on 2006 Jan 14 11:32 AM
Hi Frnds,
I have enhanced a Master data attribute with a field ANSVH
,
Could anyone help me showing a sample code to be written in the INCLUDE ZXRSAU02 under EXIT_SAPLRSAP_002 that will populate the data for the field from the Table PA0001
Thanks for any help
raky
Hi Rakesh,
Can you tell me the scenario exactly what you want then i can give a sample code..
Please find the sample code
WHEN '0COORDER_ATTR'.
LOOP AT I_T_DATA INTO TBIW_COOR.
SELECT SINGLE AUFEX INTO TBIW_COOR-ZZAUFEX
FROM COAS WHERE AUFNR = TBIW_COOR-AUFNR.
IF SY-SUBRC = 0.
MODIFY I_T_DATA FROM TBIW_COOR.
CLEAR TBIW_COOR.
ENDIF.
ENDLOOP.
Regards,
PRK
Message was edited by: PRK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rakesh,
Data T_HRMS_BIW_IO_OCCUPANCY like HRMS_BIW_IO_OCCUPANCY
case I_DATASOURCE.
When '0EMPLOYEE_ATTR'
LOOP AT I_T_DATA INTO HRMS_BIW_IO_OCCUPANCY.
SELECT single ANVSH " work contact number
INTO (T_HRMS_BIW_IO_OCCUPANCY - Fild technical name which you had appended at structure)
FROM PA0001
WHERE Primary Key field of table(PA0001) = T_HRMS_BIW_IO_OCCUPANCY - Filed name.
Here HRMS_BIW_IO_OCCUPANCY = Structre name
Hope it's help you lot ....
Regards,
PRK
Message was edited by: PRK
Hi Rakesh,
Here is some sample code, you can refer this......
tables: makt.
data : f1(50) type c.
data: l_s_icctrcst like s001biws,
l_counter,
l_s_icctract like icctract,
l_s_icctrsta like icctrsta,
l_tabix like sy-tabix.
data: l_s_zoxid30047 like zoxid30047,
jah like knb4-jah01,
mon like knb4-mon01,
ags like knb4-ags01,
vzs like knb4-vzs01,
agn like knb4-agn01,
vzn like knb4-vzn01,
anz like knb4-anz01.
data: begin of temp_data occurs 0,
bukrs like l_s_zoxid30047-bukrs,
kunnr like l_s_zoxid30047-kunnr,
fiscper like l_s_zoxid30047-fiscper,
agsxx like l_s_zoxid30047-agsxx,
vzsxx like l_s_zoxid30047-vzsxx,
agnxx like l_s_zoxid30047-agnxx,
vznxx like l_s_zoxid30047-vznxx,
anzxx like l_s_zoxid30047-anzxx,
end of temp_data.
case i_datasource.
when '0MATERIAL_ATTR'.
data: l_sbw220 like biw_mara_s. "BW220: s870biws should exist!!!
*+ find corresponding master data record in MARA
loop at i_t_data into l_sbw220.
l_tabix = sy-tabix.
select single * from makt where matnr = l_sbw220-matnr.
*+ fill additional fields with master data
f1 = makt-maktx.
translate f1 to lower case.
translate f1+0(1) to upper case.
if sy-subrc = 0.
l_sbw220-zz_descr = f1.
l_sbw220-zz_desc1 = f1.
l_sbw220-zz_desc2 = f1.
modify i_t_data from l_sbw220 index l_tabix.
endif.
endloop.
when others.
exit.
endcase.
Hope it helps you!!!!
Regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rakesh,
data: l_s_icctrcst like icctrcst,
l_s_icctract like icctract,
l_s_icctrsta like icctrsta,
l_tabix like sy-tabix.
case i_isource.
when '0CO_OM_CCA_1'.
loop at c_t_data into l_s_icctrcst.
l_tabix = sy-tabix.
select single * from z0001 where kokrs = l_s_icctrcst-kokrs
and kostl = l_s_icctrcst-kostl.
if sy-subrc = 0.
l_s_icctrcst-zfield1 = z0001-zfield1.
l_s_icctrcst-zfield2 = z0001-zfield2.
modify c_t_data from l_s_icctrcst index l_tabix.
endif.
endloop.
when '0CO_OM_CCA_2'.
...
when '0CO_OM_CCA_3'.
...
when others.
exit.
endcase.
This is sample coder for transactional data enhancement. But same for master data aswell.
Hope this helps.
Srini.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.