09-17-2017 3:58 PM
Hi,
I have problem to pass posting to BAPI BAPI_ACC_DOCUMENT_POST...
I need to pass POSTING KEY as '19' . Currently the BAPI update the posting as 11 by automatically .
Special G/L Indicator for the Next Line Item = A.
I have implemented the BADI ACC_DOCUMENT, Method CHANGE
method IF_EX_ACC_DOCUMENT~CHANGE.
DATA: wa_extension TYPE bapiparex,
wa_accit TYPE accit.
LOOP AT c_extension2 INTO wa_extension.
* Extend BAPI to have Posting Keys defined by user
IF wa_extension-structure = 'POSTING_KEY'.
CLEAR wa_accit.
READ TABLE c_accit INTO wa_accit
WITH KEY posnr = wa_extension-valuepart1.
IF sy-subrc = 0.
wa_accit-bschl = wa_extension-valuepart2.
MODIFY c_accit FROM wa_accit INDEX sy-tabix TRANSPORTING bschl.
ENDIF.
ENDIF.
ENDLOOP.
endmethod.
My Program.
* Populate the Extension table
wa_bapiparex-structure = 'POSTING_KEY'.
wa_bapiparex-valuepart1 = ' 0000000001'. " Item number
wa_bapiparex-valuepart2 = '19'. " Posting Key
APPEND wa_bapiparex TO it_bapiparex.
* Valida consistencia de información
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
EXPORTING
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
TABLES
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
* accounttax = it_accounttax
currencyamount = it_currencyamount
* criteria = it_criteria
* valuefield = it_valuefield
extension1 = it_ext
return = it_return
* paymentcard = it_paymentcard
* contractitem = it_fica_it
extension2 = it_bapiparex.
* realestate = it_re.
APPEND LINES OF it_return TO it_allreturn.
The system show this message of error:
Special G/L indicator not defined or incorrect 19
Can you please help me to solve it,
Thanks,
09-18-2017 6:53 AM
Did you fill SP_GL_IND in ACCOUNTRECEIVABLE?
NB: Most of the time I use the 'Special G/L Indicator' field for AP/AR accounts and the 'Transaction Key' field for G/L accounts to automatically change the posting key.
09-18-2017 6:53 AM
Did you fill SP_GL_IND in ACCOUNTRECEIVABLE?
NB: Most of the time I use the 'Special G/L Indicator' field for AP/AR accounts and the 'Transaction Key' field for G/L accounts to automatically change the posting key.
09-19-2017 12:42 PM
When I pass an initial value to GL_ACCOUNT field in ACCOUNTRECEIVABLE work fine , but I need to pass POSTING KEY as '19' . Currently the BAPI update the posting as 11 by automatically .
I disabled the BADI in this case.
Regards
09-19-2017 1:22 PM
Read 2083799 - Composite SAP Note: Postings with Accounting BAPIs, look for '7. Special G/L transactions'. you should read 'The structures ACCOUNTRECEIVABLE and ACCOUNTPAYABLE contain the field SP_GL_IND, which you can use to post a special G/L transaction. The BAPI then derives the posting key of this open item accordingly.' So if that's not what you get, look for your Customizing or some substition/change/BAdi which could cause the problem, look also for OSS notes available for your version.
09-18-2017 10:21 PM
Hi.
I am filling SP_GL_IND with value A in table ACCOUNTRECEIVABLE
This generated error:
09-19-2017 10:51 AM
Try to pass an initial value to GL_ACCOUNT field in ACCOUNTRECEIVABLE.
09-21-2017 9:32 PM
Hi
I solved the issue passing an initial value to GL_ACCOUNT field in ACCOUNTRECEIVABLE.
However when I am using other type 'Special G/L Indicator' for example F the system is generating the following error:
Tipo: E Nro.: 613 BAPI call with wrong business transaction RFBU RFBU DOCUMENTHEADER
Regards
09-22-2017 9:30 AM
The Note already provided contains a sample for noted item (like F for vendor) so open it and look for noted_item.txt. Also read carefully the note as there should be a note/minimal SP required to use the BAPI for those kind of document.
09-19-2017 11:05 AM
BAPI will automatically assign posting key on the basis of 1) account receivable or payable and 2) amount passed to it. Just check it in SE37 with some test cases. There is no need of BADI in this case.
05-12-2021 4:03 PM
Excuse me if the time is really later, but I had a problem with BAPI_ACC_DOCUMENT_POST and I read your message to understand and create my own solution.
However, I don't use the BADI.
I found the field SP_IND_GL in the table ACCOUNTPAYABLE and I fill it with the content of my original document. Only to explain, my goal was convert all open documents in AP in some company to other. It works well.