‎2008 Feb 23 8:09 AM
Hi ,
I used the FM 'BAPI_ACC_GL_POSTING_POST'
But I couldn't give Tax Code in this Function module
Is there is any FM For G/L account with Tax Code
REGARDS
S.JANANI
‎2008 Feb 23 8:14 AM
hi
hope it will help you.
<REMOVED BY MODERATOR>
REPORT zfi_gl_fss0
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_gl OCCURS 0,
saknr(010), " GL Account
bukrs(004), " Company Code
waers(005), " Currency
xsalh(001), " BAl Local Curr Ind
mwskz(002), " Tax Category
xopvw(001), " Open Item Ind
xkres(001), " Line Item Ind
zuawa(003), " Sort Key
fstag(004), " Field Category
END OF i_gl.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X', " Flag
c_tax VALUE '0'. " Tax Category
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_gl
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Upload the Data from Internal Table
LOOP AT i_gl.
Initial Screen
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN'
'2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ACC_CRE'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_KEY-SAKNR'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
i_gl-saknr.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-BUKRS'
i_gl-bukrs.
perform bdc_dynpro using
'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=TAB02'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'
i_gl-WAERS.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XSALH'
i_gl-XSALH.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
i_gl-MWSKZ.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
i_gl-XOPVW.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'
c_x."i_gl-XKRES.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
i_gl-ZUAWA.
perform bdc_dynpro using
'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
i_gl-FSTAG.
Call The Transaction
PERFORM bdc_transaction USING 'FSS0'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
Edited by: Alvaro Tejada Galindo on Mar 5, 2008 6:14 PM
‎2008 Mar 05 2:11 PM
Hi Mahajan,
i'm using this BAPI to post document without transaction FB01.
But in some case, depending on account used, i have to insert the field mwskz (tax category), but i don't find this field into the tables of tha bapi, so how can i insert the value for this field?
thanks in advance for your help
best regards
Alessio