‎2011 Mar 03 4:04 AM
hii expert,
as i have created material for halb by using bapi and rfc
material_get_initnumber
material_save_data
the thing is i am not ablle to update classification view in material creation as i am taking data from reference material and some fileds we are taking from input parameters
and next one is in sales org 1 we have tax data column in that for in we need to get vales like 11 r some thing becuse we r taking from reference material as that column also not getting updated
please help me in this ...
thank you,
ragrds
prabhanjan
‎2011 Mar 03 9:39 AM
This for tax classigication. Following is the code to retrieve all tax codes which are going to appear for a material:
DATA:
BEGIN OF I_TAX OCCURS 0,
WERKS LIKE TVKWZ-WERKS, " Plant
VKORG LIKE TVKWZ-VKORG, " Sales Organisation
VTWEG LIKE TVKWZ-VTWEG, " distrib.channel
SPART LIKE T001W-SPART, " Division
LAND1 LIKE T001W-LAND1, " Country
LFDNR LIKE TSTL-LFDNR, " Sequence of possible taxes for country
TATYP LIKE TSTL-TATYP, " Tax category
TAXKD(5) TYPE C, " Tax Classif. Code
END OF I_TAX,
BEGIN OF I_TAX_F OCCURS 0,
VKORG LIKE TVKWZ-VKORG, " Sales Organisation
VTWEG LIKE TVKWZ-VTWEG, " distrib.channel
LAND1 LIKE T001W-LAND1, " Country
LFDNR LIKE TSTL-LFDNR, " Sequence of possible taxes for country
TATYP LIKE TSTL-TATYP, " Tax category
TAXKD(5) TYPE C, " Tax Classif. Code
END OF I_TAX_F,
BEGIN OF I_KEYS OCCURS 0,
WERKS LIKE TVKWZ-WERKS, " Plant
VKORG LIKE TVKWZ-VKORG, " Sales Organisation
VTWEG LIKE TVKWZ-VTWEG, " distrib.channel
SPART LIKE T001W-SPART, " Division
LAND1 LIKE T001W-LAND1, " Country
END OF I_KEYS,
I_TSTL type standard table of TSTL WITH HEADER LINE.
SELECT a~WERKS a~VKORG a~VTWEG b~SPART b~LAND1
INTO CORRESPONDING FIELDS OF TABLE I_KEYS
FROM TVKWZ as a inner join T001W as b on a~werks = b~werks.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE I_TSTL
from TSTL.
SORT I_TSTL by talnd lfdnr ASCENDING.
LOOP AT I_KEYS.
LOOP AT I_TSTL WHERE talnd = I_KEYS-LAND1.
I_TAX-WERKS = I_KEYS-WERKS.
I_TAX-VKORG = I_KEYS-VKORG.
I_TAX-VTWEG = I_KEYS-VTWEG.
I_TAX-SPART = I_KEYS-SPART.
I_TAX-LAND1 = I_TSTL-talnd.
I_TAX-LFDNR = I_TSTL-LFDNR.
I_TAX-TATYP = I_TSTL-TATYP.
APPEND I_TAX.
ENDLOOP.
ENDLOOP.
LOOP AT I_TAX.
MOVE-CORRESPONDING I_TAX to I_TAX_F.
APPEND I_TAX_F.
ENDLOOP.
sort i_tax_f by vkorg vtweg land1 lfdnr.
delete adjacent duplicates from i_tax_f.
delete i_tax_f where vkorg ne Material VKORG.
delete i_tax_f where vtweg ne Material-vtweg.
After the above code internal table I_TAX_F will tax code lines exactly in same sequence which are going to appear in screen. After that we need not to pass tax dode in BDC. We just need to pass values for each tax code.
‎2011 Jun 06 1:41 PM