Application Development 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: 

How to pass the field XMWST to BAPI_ACC_DOCUMENT_POST

SrihariNerella
Participant
0 Kudos

Hi,

I am uploading data using BAPI_ACC_DOCUMENT_POST to FB50 . I need to pass the check box Calculate Tax for calculating tax automatically . But i did not find any field XMWST in BAPI_ACC_DOCUMENT_POST.

I searched in SDN i found one thread

In this they said use BADI is ACC_DOCUMENT .

For that i created Local Memory in program like

CONSTANTS: LC_MEMID_1 TYPE CHAR30 .

using EXPORT i exported to memory id and imported in ACC_DOCUMENT using IMPORT and i change the c_accit .

Please see the below code .

CONSTANTS: LC_MEMID_1 TYPE CHAR30 VALUE 'ZI_FI_JNL_UPLOAD_925_CN_SUB'.

DATA: W_ACCIT LIKE LINE OF c_accit.

LOOP AT C_ACCIT INTO W_ACCIT.

IMPORT W_ACCIT-XMWST TO W_ACCIT-XMWST FROM MEMORY ID LC_MEMID_1.

MODIFY C_ACCIT FROM W_ACCIT TRANSPORTING XMWST.

CLEAR W_ACCIT.

ENDLOOP.

But badi is not triggering .

I see the note 487722 also i applied the same procedure but that is also not calculating tax automatically.

Regards

Srihari Nerella

2 REPLIES 2

Former Member
0 Kudos

Hi srihari,

I had same problem, but i didn't get any solution for that with BADI and BTE.

If you look into FB03 one manual post with tax, that calculate tax amount will hold WRBTR finally.

for that

I calculated the tax in program, if the XMWST is not initial and passed as a line item to BAPI

it is working fine.

Regards,

sri

0 Kudos

How did you do this? Using FM CALCULATE_TAX_FROM_GROSSAMOUNT or CALCULATE_TAX_FROM_NETT_AMOUNT?

Problem I face with this BAPI when passing the tax data, is that although the resulting posting line items seem correct in FB03, there are multiple BSET records being generated. You can also see this when clicking on the tax data button from FB03.

I will try the BADI ACC_DOCUMENT to activate XMWST, others seem to have had success with it.

If I won't get this working, next thing I will try is to use the tax by-pass by defining 'IDOC' for OBJ_TYPE. this should skip the automatic tax recalculation that is done when the BAPI data is passed to the accounting interface.

Any other sugguestions?

Niels

Edited by: Niels van Oosterbos on Jul 29, 2010 12:28 PM