10-08-2008 8:46 AM
hi all,
i'm creating credit memo request thru bapi 'bapi_acc_document_post'.
i'm getting success message for creation of cmr(it is also updating the table bkpf) but
i'm not able to get the document number for created document.
can ne 1 suggest me how to get document number thru bapi in this case.
thanx in advance
Manish
10-08-2008 8:47 AM
10-08-2008 8:55 AM
are you using the exporting parameters
*" EXPORTING
*" VALUE(OBJ_TYPE) LIKE BAPIACHE09-OBJ_TYPE
*" VALUE(OBJ_KEY) LIKE BAPIACHE09-OBJ_KEY "check the object key
*" VALUE(OBJ_SYS) LIKE BAPIACHE09-OBJ_SYS
check the OBJ_KEY value.
10-08-2008 12:10 PM
Hi Vijay,
Thanks for your reply.
I am not getting what to pass in obj_key. Can you please suggest what should I pass in this parameter?
I have passed concatenatio of fiscal year and company code in it.
10-08-2008 12:32 PM
Hi Manish,
Better declare a variable of type BAPIACHE09-OBJ_KEY from the FM, then pass it in the FM for the import parameter, obj_key, after executing the FM, the first 10 characters of the variable will give you the document number.
If you are facing problems, just try posting manually in the FM and supply the values in the program as you pass in the FM manually.
This will be a easy way to test the FM. Still more issues please let me know.
10-08-2008 1:43 PM
Don't pass any values to them, if the BAPI success then it will return the Document number in l_key (it is a combination of document number and year).
data: l_type like gd_documentheader-obj_type,
l_key like gd_documentheader-obj_key,
l_sys like gd_documentheader-obj_sys.
call function 'BAPI_ACC_DOCUMENT_POST'
exporting
documentheader = wa_docheader
customercpd = wa_pcd
contractheader = wa_fica_head
importing
obj_type = l_type
obj_key = l_key
obj_sys = l_sys
tables
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
......
10-08-2008 12:11 PM
Hi Vijay,
Thanks for your reply.
I am not getting what to pass in obj_key. Can you please suggest what should I pass in this parameter?
I have passed concatenatio of fiscal year and company code in it.
10-08-2008 12:20 PM
10-08-2008 2:00 PM
Hi,
Please try with this:
Declare a variable like this:
V_OBJ_KEY type AWKEY.
Pass this to OBJ_KEY.
AWKEY (OBJ_KEY) Reference key
Source document number
The reference key is made up of:
u2022 AWREF Reference document number (10 digits)
Source document number
u2022 AWORG Reference organizational unit (10 digits)
Number range ID (if required)
When the document is being processed, the system checks whether a reference document number (first part of the reference key) has been transferred.
If an accounting document is posted via the interface in Accounting, the sending application transfers a unique reference. It consists of object key and object type. The object key consists of a reference document number and a reference organizational unit.
Example: 1000007899 00011996
Reference Reference organizational unit
document no. client and fiscal year
The object type contains a note on storing the original document.
u2022 AWTYP (OBJ_TYPE) Reference transaction
Sender ID
Regards,
Neenu Jose.
10-08-2008 2:17 PM
Hi,
Check this may be helpful.
[https://forums.sdn.sap.com/click.jspa?searchID=17223111&messageID=5909249]
[https://forums.sdn.sap.com/click.jspa?searchID=17223111&messageID=5926777]
Rhea.