on 01-29-2008 10:29 AM
Hi all,
I have placed some conditions for WBS elements in the account assignment fields in the line item details..the condition i have place is if i select any specific IDA WBS elements i need to fill( or auto attach) tax code feild (it_item_tax_code) as 'I3' which is our specific tax code..
for this i wrote code in DOC_SAVE_BADI..it is not working pls help..code in DOC_SAVE_BADI is:
LOOP AT LT_PO_ITEM INTO WA_PO_ITEM.
READ TABLE LT_PO_ACC INTO WA_PO_ACC WITH KEY ACC_CAT = 'WBS'.
IF SY-SUBRC = 0.
READ TABLE LT_ZTWBS_R3 INTO WA_ZTWBS_R3
WITH KEY POSID = LS_ACCOUNT-WBS_ELEM_E.
IF SY-SUBRC = 0.
MOVE 'I3' TO WA_PO_ITEM-TAX_CODE.
ENDIF.
ENDIF.
ENDLOOP..
*table LT_ZTWBS_R3 contains IDA WBSE
Ravi,
You are using the wrong BADI to achieve the desired results. The DOC_SAVE_BADI is for updating custom fields and tables. You need to use the DOC_CHANGE_BADI and fill the accounting structure.
You need to choose the appropriate method to place your code in.
Regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.