Dear All The ABAP Gurus,
I have made a Z Program for posting multiple F-47 Documents having multiple Special G/L . It is working fine . For this I have used BAPI_ACC_DOCUMENT|_POST and in that I have also used EXTENSION1 for updating the PO History also. All this is working fine when I have to post the documents without withholding Tax.
The issue is that how to post the documents for which withholding tax is to be deducted. In the BAPI there is EXTENSION2 table which is calling BADI. Should I also use BADI to resolve it. I don't know how to achieve this. Also I have used ACCOUNTWT table of the BAPI but I could not achieve success.
How to resolve this issue?
Thanks In Advance,
Bharti Jain
Hi,
To add the withholding tax, you can use the ACCOUNTWT table itself.
Pass teh following fields to the table and it should work fine.
wa_accountwt-ITEMNO_ACC = d_item.
wa_accountwt-WT_TYPE = Withholding tax type.
wa_accountwt-WT_CODE = With holding Tax Code.
Suzie
Thanks For The Reply,
I have passed following entries
WA_ACCOUNTWT-ITEMNO_ACC = 1. "Line Item
WA_ACCOUNTWT-WT_TYPE = 'PC'.
WA_ACCOUNTWT-WT_CODE = 'PY'.
WA_ACCOUNTWT-BAS_AMT_LC = W_ITAB-QSSHB.
WA_ACCOUNTWT-BAS_AMT_TC = W_ITAB-WRBTR.
WA_ACCOUNTWT-BAS_AMT_IND = 'X'.
APPEND WA_ACCOUNTWT TO ACCOUNTWT.
CLEAR: WA_ACCOUNTWT.
But It is not working.
Thanks In Advance,
Bharti Jain
Thanks For Prompt Replies.
I have used the following tables and following code
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = DOCHEADER
IMPORTING
OBJ_TYPE = OBJ_TYPE
OBJ_KEY = OBJ_KEY
OBJ_SYS = OBJ_SYS
TABLES
ACCOUNTGL = ACCOUNTGL
ACCOUNTPAYABLE = ACCOUNTPAY
ACCOUNTTAX = ACCOUNTTAX
CURRENCYAMOUNT = CURRAMOUNT
ACCOUNTWT = ACCOUNTWT " For Withholding Tax
EXTENSION1 = EXTENSION1 " Contains entry to update PO History
RETURN = RETURN1.
I have already used EXTENSION1 Table to update PO History which is working fine. I have the only option left ie to use EXTENSION2 table or to fill the entries in ACCOUNTWT (which I had already done but no success) .
How to modify my code?
Thanks In Advance,
Regards,
Bharti Jain
Thanks For Replying Me.
I have already used the following code to fill the EXTENSION1 Table to update PO History
MOVE W_ITAB-EBELN TO WA_EXTENSION1-FIELD1.
MOVE W_ITAB-EBELP TO WA_EXTENSION1-FIELD2.
MOVE W_ITAB-PROJK TO WA_EXTENSION1-FIELD3.
MOVE COUNT TO WA_EXTENSION1-FIELD4. " Here COUNT indicates the line item because I am posting multiple docs
APPEND WA_EXTENSION1 TO EXTENSION1.
CLEAR: WA_EXTENSION1.
What else should I write.Should I now also append The Tax Entries.
Thanks In Advance,
Regards,
Bharti Jain
Thanks For Replying,
But I have used COUNT as an important field because we are posting multiple documents and generating one voucher so it is necessary that which PO Number is attached with which document number. On the basis of COUNT ie Line Item I am able to put correct PO Number in the respective document.
I am displaying an ALV grid with Checkbox so that user can select multiple Documents and that is why the COUNT field is required.
Thanks & Regards,
Bharti Jain
Hi All The ABAP GURUS,
I have appended the EXTENSION1 Table in the following manner.
Field1 ---WITH_ITEM-WITHT
Field2 ---WITH_ITEM-WT_WITHCD
Field3 ---WITH_ITEM-WT_QSSHB
Field4 ---Line Item
Then in Interface I have appended all the fileds to the table ACCIT_WT from the EXTENSION1 Table . Is this correct . What are the filed related to Withholding Tax that I should update in another structure ACCIT & ACCIT_WT. Now also I have not got success.
Thanks In Advance
Regards,
Bharti Jain
Edited by: Bharti Jain on Mar 4, 2011 4:45 AM
Add a comment