SAP Reports / Programs

J_1HDTAX SAP ABAP Report - Transfer deferred tax for Thailand







J_1HDTAX is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for In Thailand, tax on sales/purchases (VAT) is reported when TAX INVOICE issued/recieved...see full standard documentation available for this report. Also check out the submitted Comments related to this SAP report and the details below to see which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC.

If you would like to execute this report or see the full code listing simply enter J_1HDTAX into the relevant SAP transactions such as SE38 or SE80


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT J_1HDTAX. "Basic submit
SUBMIT J_1HDTAX AND RETURN. "Return to original report after report execution complete
SUBMIT J_1HDTAX VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: S_UMSKS = D .
Selection Text: S_MWSKZ = Deferred Tax Code
Selection Text: S_LIFNR = D .
Selection Text: S_KUNNR = D .
Selection Text: S_HKONT = Deferred Tax Account
Selection Text: S_BUPLA = D .
Selection Text: P_ZERONO = Generate tax invoice number
Selection Text: P_ZERO = Include deferred tax 0%
Selection Text: P_SGTXT = D .
Selection Text: P_BWMOD = D .
Selection Text: P_BLART = D .
Selection Text: LV_HKONT = Retention Account
Selection Text: FLAG_RET = Retention Exists
Title: Transfer deferred tax for Thailand
Text Symbol: TRN = Carry Out Batch Input
Text Symbol: 001 = Company :
Text Symbol: 002 = Business place :
Text Symbol: 003 = Vendor :
Text Symbol: 004 = Customer:
Text Symbol: 010 = Tax item no.
Text Symbol: SGT = Transfer Postings for Deferred Taxes
Text Symbol: RET = Retention Details
Text Symbol: 011 = has been transf.by
Text Symbol: BAR = Transfer Business Area
Text Symbol: DIS = Display Batch Input Session
Text Symbol: E04 = Select one tax code only
Text Symbol: E93 = Different tax code selected
Text Symbol: E95 = Please select all invoices paid in same payment document
Text Symbol: LIF = Enter Tax Invoices from Vendors
Text Symbol: KUN = Create Tax Invoices for Customers
Text Symbol: ERR = Enter Retention G/L account
Text Symbol: FB4 = Zero Tax
Text Symbol: FB3 = Posting Parameters
Text Symbol: FB2 = Further Selections
Text Symbol: FB1 = Vendors and Customers


INCLUDES used within this REPORT J_1HDTAX

No INCLUDES are used within this REPORT code!


TABLES used within REPORT and the associated SELECT statement:





No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

GET_CURRENT_YEAR CALL FUNCTION 'GET_CURRENT_YEAR' EXPORTING BUKRS = t_bseg-bukrs DATE = t_bseg-augdt IMPORTING CURRY = gt_payment-gjahr.

BDC_CLOSE_GROUP call function 'BDC_CLOSE_GROUP'.

REUSE_ALV_HIERSEQ_LIST_DISPLAY call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' exporting * I_INTERFACE_CHECK = ' ' i_callback_program = g_repid i_callback_pf_status_set = 'STATUS' i_callback_user_command = 'USER_COMMAND' is_layout = gs_layout it_fieldcat = gt_fieldcat[] * IT_EXCLUDING = it_special_groups = gt_sp_group[] it_sort = gt_sort * IT_FILTER = * IS_SEL_HIDE = * I_SCREEN_START_COLUMN = 0 * I_SCREEN_START_LINE = 0 * I_SCREEN_END_COLUMN = 0 * I_SCREEN_END_LINE = 0 * I_DEFAULT = 'X' i_save = g_save is_variant = g_variant it_events = gt_events[] * IT_EVENT_EXIT = i_tabname_header = g_tabname_header i_tabname_item = g_tabname_item * I_STRUCTURE_NAME_HEADER = * I_STRUCTURE_NAME_ITEM = is_keyinfo = gs_keyinfo * IS_PRINT = * IS_REPREP_ID = * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = tables t_outtab_header = gt_bset t_outtab_item = gt_payment.

REUSE_ALV_EVENTS_GET call function 'REUSE_ALV_EVENTS_GET' exporting i_list_type = 1 "Hirachy-list "608928 importing et_events = e03_lt_events exceptions list_type_wrong = 1 others = 2.

J_1BREAD_BRANCH_DATA call function 'J_1BREAD_BRANCH_DATA' exporting branch = bkpf-brnch bukrs = bkpf-bukrs importing address = sadr exceptions branch_not_found = 1 address_not_found = 2 company_not_found = 3 others = 4.

BDC_OPEN_GROUP call function 'BDC_OPEN_GROUP' EXPORTING group = bdc_group user = sy-uname.

BDC_INSERT call function 'BDC_INSERT' EXPORTING tcode = 'FB05' TABLES dynprotab = bdcdata.

BDC_OPEN_GROUP call function 'BDC_OPEN_GROUP' exporting group = bdc_group user = sy-uname.

BDC_INSERT call function 'BDC_INSERT' exporting tcode = 'FB05' tables dynprotab = bdcdata.

FI_STANDARD_ACCOUNT_DETERMINE call function 'FI_STANDARD_ACCOUNT_DETERMINE' exporting i_bukrs = gt_bset-bukrs i_ktosl = gt_bset-ktosl i_mwskz = gt_bset-zmwsk x_taxit = gt_bset-mwart importing e_bschh = d_bschh e_bschs = d_bschs e_konth = d_konth e_konts = d_konts exceptions invalid_input = 1 missing_account = 2 missing_posting_keys = 3 missing_rule = 4 missing_tax_account = 5 others = 6.

FI_STANDARD_ACCOUNT_DETERMINE call function 'FI_STANDARD_ACCOUNT_DETERMINE' exporting i_bukrs = gt_bset-bukrs i_bwmod = p_bwmod i_komok = d_komok i_ktosl = c_ktosl importing e_bschh = d_bschh e_bschs = d_bschs e_konth = d_konth e_konts = d_konts exceptions invalid_input = 1 missing_account = 2 missing_posting_keys = 3 missing_rule = 4 missing_tax_account = 5 others = 6.

FI_STANDARD_ACCOUNT_DETERMINE call function 'FI_STANDARD_ACCOUNT_DETERMINE' exporting i_bukrs = gt_bset-bukrs i_ktosl = gt_bset-ktosl i_mwskz = gt_bset-zmwsk x_taxit = gt_bset-mwart importing e_bschh = d_bschh e_bschs = d_bschs e_konth = d_konth e_konts = d_konts exceptions invalid_input = 1 missing_account = 2 missing_posting_keys = 3 missing_rule = 4 missing_tax_account = 5 others = 6.

SKB1_SINGLE_READ CALL FUNCTION 'SKB1_SINGLE_READ' EXPORTING I_BUKRS = gt_bset-bukrs I_SAKNR = h_skb1-saknr IMPORTING O_SKB1 = h_skb1 EXCEPTIONS NOT_FOUND = 1 OTHERS = 2.

BDC_OPEN_GROUP call function 'BDC_OPEN_GROUP' exporting group = bdc_group user = sy-uname.

BDC_INSERT call function 'BDC_INSERT' exporting tcode = 'FB01' tables dynprotab = bdcdata.

FI_STANDARD_ACCOUNT_DETERMINE call function 'FI_STANDARD_ACCOUNT_DETERMINE' exporting i_bukrs = gt_bset-bukrs i_bwmod = p_bwmod i_ktosl = k_ktosl_zdi importing e_bschh = d_bschh e_bschs = d_bschs e_konth = d_konth e_konts = d_konts exceptions invalid_input = 1 missing_account = 2 missing_posting_keys = 3 missing_rule = 4 missing_tax_account = 5 others = 6.

FI_STANDARD_ACCOUNT_DETERMINE call function 'FI_STANDARD_ACCOUNT_DETERMINE' exporting i_bukrs = gt_bset-bukrs i_ktosl = gt_bset-ktosl i_mwskz = t_mwskz-zmwsk x_taxit = 'X' importing e_bschh = d_bschh e_bschs = d_bschs e_konth = d_konth e_konts = d_konts exceptions invalid_input = 1 missing_account = 2 missing_posting_keys = 3 missing_rule = 4 missing_tax_account = 5 others = 6.

CONVERT_TO_LOCAL_CURRENCY call function 'CONVERT_TO_LOCAL_CURRENCY' exporting date = bkpf-wwert foreign_amount = t_sel_items-xxbas "577014 foreign_currency = bseg-pswsl local_currency = t001-waers importing local_amount = h_amount.

CONVERT_TO_LOCAL_CURRENCY





call function 'CONVERT_TO_LOCAL_CURRENCY' exporting date = bkpf-wwert foreign_amount = t_sel_items-xxbas "577014 foreign_currency = bseg-pswsl local_currency = t001-waers importing local_amount = h_amount.

CONVERT_TO_FOREIGN_CURRENCY call function 'CONVERT_TO_FOREIGN_CURRENCY' exporting date = i_budat foreign_currency = i_frn_curr local_amount = h_amount local_currency = t001-waers importing foreign_amount = h_amount.

J_1H_VAT_NUMBERING CALL FUNCTION 'J_1H_VAT_NUMBERING' TABLES T_BKPF = tt_bkpf T_BSEG = tt_bseg T_BSET = CHANGE_BSET "752185 EXCEPTIONS NO_BRANCH = 1 NOT_RELEVANT = 2 TARGET_NOT_OK = 3 TAX_CODE_NOT_UNIQUE = 4 NUM_GROUP_NOT_FOUND = 5 NUMBERING_ERROR = 6 OTHERS = 7.

CHANGE_DOCUMENT CALL FUNCTION 'CHANGE_DOCUMENT' TABLES T_BKDF = CHANGE_BKDF T_BKPF = CHANGE_BKPF T_BSEC = CHANGE_BSEC T_BSED = CHANGE_BSED T_BSEG = CHANGE_BSEG T_BSET = CHANGE_BSET EXCEPTIONS OTHERS = 1.

CONVERT_TO_LOCAL_CURRENCY call function 'CONVERT_TO_LOCAL_CURRENCY' exporting date = bkpf-wwert foreign_amount = bseg-txbfw foreign_currency = bkpf-waers local_currency = t001-waers importing local_amount = bseg-hwbas.

CALCULATE_TAX_FROM_NET_AMOUNT CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT' EXPORTING I_BUKRS = T001-BUKRS I_MWSKZ = t_mwskz-zmwsk I_WAERS = T001-WAERS I_WRBTR = 0 TABLES T_MWDAT = T_MWDAT.

FI_STANDARD_ACCOUNT_DETERMINE call function 'FI_STANDARD_ACCOUNT_DETERMINE' EXPORTING i_bukrs = gt_bset-bukrs i_bwmod = p_bwmod i_komok = d_komok i_ktosl = c_ktosl IMPORTING e_bschh = d_bschh e_bschs = d_bschs e_konth = d_konth e_konts = d_konts EXCEPTIONS invalid_input = 1 missing_account = 2 missing_posting_keys = 3 missing_rule = 4 missing_tax_account = 5 others = 6.



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.

The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name J_1HDTAX or its description.