Application Development and Automation 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: 
Read only

BAPI_ACC_DOCUMENT_POST - DOCUMENTHEADER-OBJ_KEY

Former Member
0 Likes
4,316

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
Read only

Former Member
0 Likes
2,397

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
Read only

Former Member
0 Likes
2,398

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'.

Read only

Former Member
0 Likes
2,397

* 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'.
Read only

0 Likes
2,397

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

Read only

ndtovar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,397

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