on 07-23-2007 9:30 AM
My requirement is to enhance Z data source to include
bonus_cat,perfinc and active from ztrm_labdlycat table.
For that reason i appended the extract structure and in CMOD included the following code in EXIT_SAPLRSAP_001 as this is transaction data source
<b>CODE:</b>
case i_datasource.
when ' Z_TRM_LMS'.
Loop at case i_datasource.
when ' Z_TRM_LMS'.
Loop at i_t_data.
Select single bonus_cat perfinc active from ztrm_labdlycat into
i_t_data-zzbonus i_t_data-zzperf i_t_data-zzactive
Where locat = i_t_data-locat and
exrsn = i_t_data-exrsn and
apobj = i_t_data-apobj.
Modify i_t_data.
Endloop.
Endcase.
<b>ERROR</b>
The field "I_T_DATA" is unknown, but there is a field with the similar name "C_T_DATA".
I am new to BW and not familiar with ABAP code...please update me on this how can i correct error
Thanks
Include the into clause within bracket.
Select single bonus_cat perfinc active from ztrm_labdlycat into
(i_t_data-zzbonus, i_t_data-zzperf, i_t_data-zzactive)
Where locat = i_t_data-locat and
exrsn = i_t_data-exrsn and
apobj = i_t_data-apobj.
But its not good practice to include Select Statement inside Loop..endloop.
You can create a separate internal table with the three fields and fill it with single select.
Then you can use read statement inside your loop..endloop.
The code will be like.
TYPES: begin of ty_data,
Locat (INCLUDE THE VARIABLE TYPE),
Exrsn (INCLUDE THE VARIABLE TYPE),
Apobj (INCLUDE THE VARIABLE TYPE),
bonus_cat (INCLUDE THE VARIABLE TYPE),
perfinc (INCLUDE THE VARIABLE TYPE),
active (INCLUDE THE VARIABLE TYPE),
End of ty_data.
Data: i_data type ty_data occurs 0 with header line.
Select locat exrsn apobj bonus_cat perfinc active from ztrm_labdlycat into corresponding fields of table i_data.
Loop at i_t_data.
Read table i_data with key
locat = i_t_data-locat
exrsn = i_t_data-exrsn
apobj = i_t_data-apobj.
If sy-subrc = 0.
I_t_data-bonus_cat = i_data-bonus_cat.
I_t_data-perfinc = i_data-perfinc.
I_t_data- active = i_data- active.
Modify i_t_data.
Endif.
Endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
case i_source
when 'z_trm_lms'.
Loop at c_t_data into I_s001biws.
I_tabix = sy_tabix.
select single * from mara where matnr =l_s001biws-matnr.
if sy-subrc = 0.
l_s001biws-zzbismt = mara-zzbismt.
modify c_t_data from l_s001biws index i_tabix.
end if.
endloop.
endcase.
Try C_T_data in the place of I_T_data because i think it s a predefined field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try this sample code
data : l_s_[structurename] like [extractstructure name],
l_tabix like sy-tabix.
case i_datasource.
when 'your datasource name'.
loop at c_t_data into l_s_[structurename]
l_tabix = sy-tabix.
fill the new field
select ... into l_zz...
where ....
l_s_[structurename]-[new field name, zz....] = l_zz...
modify c_t_data from l_s_[structurename] index l_tabix.
endloop.
may i think u not givenb data declaration...
u mentioned two times loop statements...
check this threads
hope this help
raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.