Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

data selection into same itab

Former Member
0 Kudos

hi,

itab having txz01 and bukrs field , bukrs having data.

can i do like this to fetch data for txz01 for all bukrs having in same itab.

is this correct to fetch data?

select txz01 from ekpo into corresponding fields of table gt_item for all entries in gt_item where bukrs = gt_item-bukrs.

3 REPLIES 3

Former Member
0 Kudos

itab having txz01 and bukrs field , bukrs having data.

can i do like this to fetch data for txz01 for all bukrs having in same itab.

is this correct to fetch data?

Data itab1 like itab occurs 0 .

itab1 = itab .

append itab1 .

select txz01 from ekpo into corresponding fields of table itab1 for all entries in gt_item where bukrs = gt_item-bukrs.

loop at itab .

read table itab1 where bukrs = itab-bukrs.

itab-txz01 = itab1-txz01 .

Modify itab .

endloop.

Reward points if it is usefull ...

Girish

Former Member
0 Kudos

Hi.

you can. Just check it out the following code.

tables : mara.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

MAKTX LIKE MAKT-MAKTX,

END OF ITAB.

select-options : matnr for mara-matnr.

select * from mara into corresponding fields of table itab where matnr in matnr.

select * from makt into corresponding fields of table itab

for all entries in itab where matnr = itab-matnr.

Reward if the above is useful.

Regards,

Sankar.

former_member202957
Contributor
0 Kudos

Hi Santoshini,

Your question is that for the data bukrs exits in internal table you want to fetch txz01 into same internal table??

first fetch the data into another internal table and then modify the first internal table in this way you can do it.

<b>reward if useful</b>

Regards,

sunil kairam.