Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ACC_DOCUMENT_POST - DOCUMENTHEADER-OBJ_KEY

Former Member
0 Kudos

Hi All

I'm using BAPI_ACC_DOCUMENT_CHECK, BAPI_ACC_DOCUMENT_POST & BAPI_TRANSACTION_COMMIT to create a Vendor Invoice. This is working fine, but I have a problem with the OBJ_KEY. In FBL1N, our Object key is usually a concatenation of DocumentNo|CompanyCode|FiscalYear. The Company Code and Fiscal Year is obviously quite easy to get, but how do I get the Document Number(BELNR) prior to running the BAPI_ACC_DOCUMENT_POST to enable me to populate the OBJ_KEY in full? If I leave out the OBJ_KEY, the BAPI fails - it does not by default create this concatenated field.

Best regards, Adrian

1 ACCEPTED SOLUTION

0 Kudos

try this option & fill the rest of the structure according to your needs

i_head-obj_type = 'BKPFF'.

i_head-obj_key = '$'.

i_head-obj_sys = l_logsys.

i_head-bus_act = 'RFBU'.

4 REPLIES 4

0 Kudos

try this option & fill the rest of the structure according to your needs

i_head-obj_type = 'BKPFF'.

i_head-obj_key = '$'.

i_head-obj_sys = l_logsys.

i_head-bus_act = 'RFBU'.

Former Member
0 Kudos

* Populate header data of document
wa_docheader-obj_type = 'REACI'.
wa_docheader-obj_key = '$'.
wa_docheader-obj_sys = 'ECDCLNT090'.      "Logical System
wa_docheader-bus_act = 'RMRP'.

0 Kudos

Convinced business to accept the external reference as part of the integrated OBJ_KEY. They accepted it (as a good idea).

ndtovar
Explorer
0 Kudos

Hi Sr:

Please can you tell me what fields I put in the following fields:

OBJ_TYPE:

OBJ_KEY:

OBJ_SYS:

OBJ_KEY_R

Thanks for your help,

Regards,

Nelson D. Tovar