Application Development and Automation 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: 
Read only

BAPI_ACC_DOCUMENT_POST - add fields from BSEC

Former Member
0 Likes
5,360

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

6 REPLIES 6
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,611

First use one of the EXTENSION parameters and either the BAdi ACC_DOCUMENT with EXTENSION2 or the BTE RWBAPI01 with EXTENSION1. If the BAdI or BTE allows to change your required data ok, else try an EXPORT TO MEMORY and IMPORT it back in a substitution rule via exit.

Regards,

Raymond

Read only

0 Likes
2,611

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

Read only

0 Likes
2,611

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

Read only

Former Member
0 Likes
2,611

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.

Read only

0 Likes
2,611

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

Read only

0 Likes
2,611

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.