Skip to Content
0
Former Member
Jul 03, 2015 at 10:27 AM

Why BAPI_ACC_DOCUMENT_POST do not update BSEG-QBSHB but FB60 do

2124 Views


Dear All,

I have a Z program using BAPI_ACC_DOCUMENT_POST to mass create FI document instead of FB60. in the program I calculate and pass the withholding tax value to bapi table ACCOUNTWT. the withholding tax is populated correctly in the FI document created. the problem is when user use FBL1N or FB03 to display, the withholding tax field BSEG-QBSHB has zero value as in below screenshot, but document created by FB60 has correct value in this field as in below screenshot. user has difficulty to total by this field, user can only display the withholding tax by double click the document, then double click the vendor (AP) line item, then click the "Withholding Tax Data" button to show the withholding tax. but user wants to see the withholding tax in FBL1N or FB03 and total this column.

Our SAP system (ECC6) have the extended WT functionality, and SAP note 363309 explains the reason but the solution is not suitable for us. our case is similar with http://scn.sap.com/thread/3147820 but we need a solution.

I have also tried to use bapi table EXTENSION1 trying to pass value to BSEG-QBSHB. but in FM ZSAMPLE_INTERFACE_RWBAPI01 (Copy from standard), the table IT_ACCIT do not have such field for BSEG-QBSHB. so cannot pass the withholding tax value to populate BSEG-QBSHB.

I also searched and heard to add additional field by bapi table EXTENSION2 and badi, but I did not found guide to implement it, also not sure this way can really solve my above problem or not.

I also checked other threads such as below, but not found any solution for my case.

http://scn.sap.com/thread/81204

http://scn.sap.com/thread/254919

http://scn.sap.com/thread/653983

http://www.wikiguga.com/topic/886bcaa6cdf29e2aa09194e7a85dc5cf

http://www.wikiguga.com/topic/48f28cf4c458a8fbaf518ccb521d7819

https://www.google.com.sg/#q=BAPI_ACC_DOCUMENT_POST++bseg-qbshb

http://aap00f07.benxbrain.com/en/sap/domain/QSSKZ-TDS-amount-not-getting-updated-in-the-table-under-thread-1-1881879.htm

http://scn.sap.com/thread/3342165

Also referred to SAP Note 487722 - UsingEXTENSION1 for accounting BAPIs

below is part of my program code to populate the bapi table ACCOUNTWT, I have tried to populate ACCOUNTWT differently, but the result is the same: withholding tax is populated but appear zero in "withholding tax amnt" column (BSEG-QBSHB) when using FBL1N or FB03.

* Fill Withholding tax info
WA_ACCOUNTWT-ITEMNO_ACC = 0000000001.
TRANSLATE WA_TAB-TX_CODE TO UPPER CASE.
WA_ACCOUNTWT-WT_CODE = WA_TAB-TX_CODE.

READ TABLE IT_LFBW WITH KEY
LIFNR = WA_TAB-HKONT
BUKRS = WA_TAB-BUKRS
WT_WITHCD = WA_TAB-TX_CODE.

WA_ACCOUNTWT-WT_TYPE = IT_LFBW-WITHT.
WA_ACCOUNTWT-BAS_AMT_LC = WA_TAB-TX_BASE.
WA_ACCOUNTWT-BAS_AMT_TC = WA_TAB-TX_BASE.

READ TABLE IT_T059Z WITH KEY
LAND1 = 'IN'
WITHT = IT_LFBW-WITHT
WT_WITHCD = WA_TAB-TX_CODE.


WA_ACCOUNTWT-MAN_AMT_TC = ( WA_TAB-TX_BASE * IT_T059Z-QSATZ ) / 100.
WA_ACCOUNTWT-MAN_AMT_LC = WA_ACCOUNTWT-MAN_AMT_TC.
WA_ACCOUNTWT-BAS_AMT_IND = 'X'.
WA_ACCOUNTWT-MAN_AMT_IND = 'X'.
APPEND WA_ACCOUNTWT TO IT_ACCOUNTWT.

In Summary, my questions are:

1, Is my code to pass data to bapi table ACCOUNTWT wrong, which caused BSEG-QBSHB is not populated? what is the correct code which can populate BSEG-QBSHB for FBL1N or FB03?

2, Is bapi table EXTENSION1 and EXTENSION2 my direction to solve my problem? what is the right way to solve my problem through these 2 tables.

3, why FB60 can populate BSEG-QBSHB, but BAPI cannot in our system (ECC6)?

Many thanks for your great help! I am really stuck here!