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: 

refernce key in bapi_acc_document_post

Former Member
0 Kudos

hi all,

can ne 1 help me to understand the reference key in bapi 'bapi_acc_document_post'.

it's concatenation of

1.document number

2.company code

3.fiscal year

please suggest me, how to get the document number.

thanx in advance

Manish

3 REPLIES 3

Former Member
0 Kudos

Hi,

The one that is concatenation of Doc No, Comp Code, and Fisc Yr is Object Key, not Reference Key.

There are 2 ways to get the document number.

1. Get it from Object Key


DATA l_belnr TYPE bkpf-belnr.
l_belnr = obj_key+0(10).

2. or get it from BAPI return table


DATA lwa_return TYPE bapiret2.
READ TABLE lit_return
INTO lwa_return
WHERE type = 'S'.
IF sy-subrc EQ 0.
l_belnr = lwa_return-message_v1.
ENDIF.

Regards,

Teddy Kurniawan

Former Member
0 Kudos

Hi Manish,

The obj_key field will contain the document number, company code and fiscal yesr. The first 10 character of the OBJ_KEY field in the bapi will fetch you the document number.

Regards,

Shobana.K

Former Member
0 Kudos

Hi ,

The first 10 character of the OBJ_KEY field is the document number.If u use the return table of the bapi ,

u can even get it from message_v2 part .

Regards,

Ramya S

Edited by: Ramya S on Oct 10, 2008 11:11 AM