‎2013 Jan 07 5:11 PM
Hi all,
I'm using BAPI_ACC_DOCUMENT_POST to post FI documents, and I need to update customer fields, like name and address, from BSEC table, that are not available in table structure ACCOUNTRECEIVABLE.
How can I do this?
I already check BTE RWBAPI01 to do this, but it seems I can only update fields that are available in structure ACCIT.
Any idea?
Thanks in advance.
Best regards,
Sónia Gonçalves
‎2013 Jan 07 6:18 PM
‎2013 Jan 08 10:50 AM
Hi,
I thought substitution rules won't work with BAPI_ACC_DOCUMENT_POST.
Isn't there any other way? Because if I do this by batch-input, these fields are editable, so I don't understand why I can't do this by BAPI.
I'll appreciate some help on this, because I really need to update these fields.
Thanks.
Regards,
Sónia Gonçalves
‎2013 Jan 09 6:59 AM
I thought substitution rules won't work with BAPI_ACC_DOCUMENT_POST.
No, rules substitutions are carried out correctly, at least call-up points 1 and 2 (header, items), as you can read in 1797611 - Field updated in FI document with different value than submitted to BAPI.
But which fields are not available in parameter CUSTOMERCPD of the BAPI ?
Regards,
Raymond
‎2013 Jan 08 11:02 AM
Hi,
Use the EXTENSION parameters in BAPI and there you can specify the field name you want to update. And then Use the User-Exit ACBAPI01 (Accounting: Customer Enhancement to BAPI Interfaces). Here you have to update/modify the Strucutre T_ACCIT with the required data which you want which the BAPI is not passing to BSEG table after the Doc is posted.
You have to Implement the User-Exit and write you code in IF condition.
Example: In BAPI EXTENSION param you have specified the Field1 = 'CUSTOMER' then in the User exit you should read the EXTENSION table with Field1 = CUSTOMER and then put you code with IF condition or esle the BAPI - User-exit will be will be triggered for all BAPI calls for this BAPI_ACC_DOCUMENT_POST.
Regards,
Shakeel.
‎2013 Jan 08 12:05 PM
Hi,
This User-Exit is called in bapi BAPI_ACC_GL_POSTING_POST, not in BAPI_ACC_DOCUMENT_POST, so this will not solve my problem.
In BAPI_ACC_DOCUMENT_POST we have import parameter CUSTOMERCPD, where I can update these fields, but it will update all customer items with this information.
If I have different customer items, how could I update each item, with different information?
Thanks.
Regards,
Sónia Gonçalves
‎2013 Jan 09 5:36 AM
Hi,
Try using the EXTENSION2 and implement the BADI ACC_DOCUMENT's Method : FILL_ACCIT where you get the C_ACCIT data and you can change/modify the relavent record you want and then pass it back.
Reggards, Shakeel.