cancel
Showing results for 
Search instead for 
Did you mean: 

Data Source enhancement with ABAP....

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Shahid,

Thanks for the update provided.

Please refer to my doubts below

What is L_S001BIWS

where matnr =l_s001biws-matnr

l_s001biws-zzbismt = mara-zzbismt.

Thanks

Former Member
0 Kudos

while appending a field a structure will generate zazoxid.... that structure name should be given.

In this structure only you will append the z fields.

Give u r field names i gave the fields which i remember

Message was edited by:

shahid syed

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Thanks for the update provided

<b>data : l_s_[structurename] like [extractstructure name],</b>

What do you mean by STRUCTURE NAME

Please update me

Thanks