Dear All The ABAP Gurus,
I have created a program for posting multiple f-47 documents and for this I ahve used a BAPI BAPI_ACC_DOCUMENT_POST. In this BAPI I have passed EXTENSION1 table which contains the entries to update PO history and I have used BTE for the same.
Now I want that withholding tax should also be calculated and displayed in the line items when I see the posted document through FB03. For this I have already populated the ACCOUNTWT table and passed it in the BAPI. The code snippet for the same is attached.
But then also I have not achieved success. When I post a f-47 document through F-48 and see the same posted document in FB03 then I can see the line items of Tax amont deducted. I want the same thing to be done in my program.
In BAPI I have seen that EXTENSION2 Table is also there.Should I pass my entries in that. But that EXTENSION2 Table is used in Line 66 (PERFORM CALL_BADI TABLES EXTENSION2.) in BAPI.
What step should I follow ?
SELECT *
FROM LFBW
INTO CORRESPONDING FIELDS OF TABLE T_LFBW
FOR ALL ENTRIES IN T_ITAB
WHERE LIFNR = T_ITAB-LIFNR.
IF SY-SUBRC EQ 0.
LOOP AT T_LFBW INTO W_LFBW .
READ TABLE T_ITAB INDEX SY-INDEX INTO W_ITAB.
WA_ACCOUNTWT-ITEMNO_ACC = COUNT.
WA_ACCOUNTWT-WT_TYPE = W_LFBW-WITHT.
WA_ACCOUNTWT-WT_CODE = W_LFBW-WT_WITHCD.
WA_ACCOUNTWT-BAS_AMT_TC = W_ITAB-WRBTR.
WA_ACCOUNTWT-BAS_AMT_TC = W_ITAB-WRBTR.
SELECT SINGLE *
FROM T059Z
INTO W_T059Z
WHERE LAND1 = 'IN'
AND WITHT = WA_ACCOUNTWT-WT_TYPE
AND WT_WITHCD = WA_ACCOUNTWT-WT_CODE.
WA_ACCOUNTWT-MAN_AMT_TC = ( W_ITAB-WRBTR * W_T059Z-QSATZ ) / 100.
IF WA_ACCOUNTWT-MAN_AMT_TC < 0.
WA_ACCOUNTWT-MAN_AMT_TC = WA_ACCOUNTWT-MAN_AMT_TC * -1.
ENDIF.
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 ACCOUNTWT.
CLEAR: WA_ACCOUNTWT.
ENDLOOP.
ENDIF.
Thanks In Advance,
Regards,
Bharti Jain