2008 Oct 08 8:52 AM
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
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
2008 Oct 10 7:26 AM
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
2008 Oct 10 9:46 AM
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
2008 Oct 10 10:10 AM
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
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |