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

reference Key fields 1 and 2 to be uploaded using BAPI_ACC_DOCUMENT_POST.

Former Member
8,807

Hi All,

I want to post account document using BAPI_ACC_DOCUMENT_POST.

However, there is no way I see to upload reference Key fields XREF1_HD and XREF2_HD using this BAPI.

Is there any way this can be achieved?

Thanks in advance.

3 REPLIES 3
Read only

ThomasZloch
Active Contributor
0 Likes
3,814

Documentation says that these fields can only be filled internally, so you need to setup an FI substitution or use the EXTENSION1 structure of the BAPI along with the corresponding BADI implementation, please look for available information.

Thomas

Read only

eduardo_hinojosa
Active Contributor
0 Likes
3,814

Hi

See SAP Note 487722 - Using EXTENSION1 for accounting BAPIs

Regards

Eduardo

Read only

Former Member
0 Likes
3,814

Hi,

I too had the same problem and found a solution. Hope it will be useful to someone.

1. Pass field names 'XREF1_HD' & 'XREF2_HD' in valuepart1 of structure 'EXTENSION2' and their corresponding values in valuepart2.

2. Create an implementation for BADI 'ACC_DOCUMENT'.

3. The extension values will be available in 'C_EXTENSION2' parameter of Method 'Change'.

4. The fields XREF1_HD & XREF2_HD are available in ACCIT but not in ACCHD. Modify these fields in ACCIT.

5. Once doc is posted, you should be able to see values in the header.

Regards,

Laxman