Hi All,
I am using BAPI_ACC_DOCUMENT_POST for posting. I have two GL Codes one for AGL internal tableount and one for Bank charges.
When im trying to fill the GL Data internal Table as below
*----------Deposit amt 1
CLEAR wa_gldata.
REFRESH : ist_gldata,ist_currency,ist_ardata.
wa_gldata-itemno_acc = 1.
wa_gldata-gl_account = '0000301001'.
CONCATENATE 'Debit Entry for' g_financialtransaction INTO wa_gldata-item_text
SEPARATED BY space.
wa_gldata-comp_code = '1000'.
wa_gldata-profit_ctr = ls_generalcontractdata-portfolio.
IF wa_gldata-profit_ctr IS INITIAL.
wa_gldata-profit_ctr = im_master-ibrch.
ENDIF.
wa_gldata-pstng_date = sy-datum.
wa_gldata-value_date = sy-datum.
MOVE im_master-insno TO wa_gldata-alloc_nmbr.
APPEND wa_gldata TO ist_gldata.
wa_gldata-itemno_acc = 2.
wa_gldata-gl_account = '0000736021'.
CONCATENATE 'Debit Entry for' g_financialtransaction INTO wa_gldata-item_text
SEPARATED BY space.
wa_gldata-comp_code = '1000'.
wa_gldata-profit_ctr = ls_generalcontractdata-portfolio.
IF wa_gldata-profit_ctr IS INITIAL.
wa_gldata-profit_ctr = im_master-ibrch.
ENDIF.
wa_gldata-costcenter = im_master-spoint.
wa_gldata-pstng_date = sy-datum.
wa_gldata-value_date = sy-datum.
MOVE im_master-insno TO wa_gldata-alloc_nmbr.
APPEND wa_gldata TO ist_gldata.
* wa_ardata-itemno_acc = 3.
wa_ardata-customer = l_cust.
wa_ardata-item_text = 'Test'.
wa_ardata-comp_code = '1000'.
wa_ardata-profit_ctr = ls_generalcontractdata-portfolio.
IF wa_ardata-profit_ctr IS INITIAL.
wa_ardata-profit_ctr = im_master-ibrch.
ENDIF.
APPEND wa_ardata TO ist_ardata.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'.
when i check IST_GLDATA the line item number is not changing .
It remains as 00000001 for all the 3 line items.and the document does not get posted.
Please provide inputs on this.
regards,