Skip to Content
0

Posting Key issue in BAPI_ACC_DOCUMENT_POST

Sep 17, 2017 at 02:58 PM

462

avatar image

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,

bapi.jpg (17.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Raymond Giuseppi
Sep 18, 2017 at 05:53 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0

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.

0
avatar image
Former Member Sep 19, 2017 at 10:05 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
wilman santiago Sep 18, 2017 at 09:21 PM
0

Hi.

I am filling SP_GL_IND with value A in table ACCOUNTRECEIVABLE

This generated error:


error1.jpg (200.5 kB)
error2.jpg (57.2 kB)
Show 3 Share
10 |10000 characters needed characters left characters exceeded

Try to pass an initial value to GL_ACCOUNT field in ACCOUNTRECEIVABLE.

0

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

0

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.

0