11-01-2011 4:38 PM
Hello Friends,
I am trying to post customer document by BAPI_ACC_DOCUMENT_POST instead of F-02. For the field Bus_Act I fill 'RFBU'. First line contains the customer data and the second line contains account data. I have used this BAPI many times before without any errors but now when i tried for a new program on a new system it asks for the following header table fields:
OBJ_TYPE
OBJ_KEY
OBJ_SYS
Before I did not need to fill these.
Is there smt that I have to check in customizing?
Thanks in advance,
Ali
11-01-2011 4:56 PM
Hi,
As i know you have to fill these parameters if it is a non po invoice.
Regards,
Madhu.
11-01-2011 4:56 PM
Hi,
As i know you have to fill these parameters if it is a non po invoice.
Regards,
Madhu.
11-01-2011 8:53 PM
Hi Ali,
if you never supplied OBJ_* data, maybe someone else did for you
I know it is almost impossible to do a search on SCN before posting. Otherwise one might find things like [Vendor Invoice Posting using BAPI|http://wiki.sdn.sap.com/wiki/display/Snippets/VendorInvoicePostingusingBAPI].
Happy coding!
Clemens
11-02-2011 9:48 AM
Dear Clemens,
Thanks for your comment(!) I have actually gone through SDN and searched for this topic but no article was related to my question. As the last solution I had to create a post. Please be careful about your remarks and read questions carefully.
Regards,
Ali
11-02-2011 9:01 AM
Hi all,
I used this BAPI before, without providing any values for OBJ_TYPE, OBJ_KEY, OBJ_SYS and the BAPI still works.
If you look into its source code, you can see that, if we leave those fields blank, system will automatically populate their values:
IF document_header-obj_type = 'BKPFF' OR (
document_header-obj_type IS INITIAL AND
document_header-obj_key IS INITIAL AND
document_header-obj_sys IS INITIAL ).
PERFORM reference_create_prelim
CHANGING document_header-obj_type
document_header-obj_key
document_header-obj_sys.
IF document_header-bus_act IS INITIAL. "note1264422
document_header-bus_act = 'RFBU'. "note1045412
ENDIF. "note1264422
CLEAR document_header-ac_doc_no.
ENDIF.
The routine reference_create_prelim will assign default values
OBJ_TYPE = 'BKPFF'
OBJ_KEY = '$'
call fm OWN_LOGICAL_SYSTEM_GET to get value for OBJ_SYS
This issue seems strange to me as well.
Did you test the BAPI in SE37? Is it ok?
Thanks,
11-02-2011 9:48 AM
I found the problem. The BAPI has no newer version on the current system I am working with. So the routine to fill in these three parameters do not exist.
Thx.
Ali