Application Development and Automation 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: 
Read only

Please answer the following

Former Member
0 Likes
566

There are two fields in one table and 2 fields from another.

For e.g 2 fields from EKKO and 2 fields from EKPO.

U need retrieve them as 4 fields in another table.(meaning the should display in the same row)

EKKO -FIELD1 EKKO-FIELD2 EKPO-FIELD3 EKPO-FIELD4

CONDITION : Should not use JOIN.How can we acheive it

I used internal table.

But it is printing like follows

EKKO -FIELD1 EKKO-FIELD2

EKPO-FIELD3 EKPO-FIELD4

How to achieve this in the same line using IT?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
545

Hi

Try this.Use all entries and retrieve the values.

Thanks

Vasudha

Hi

Try this.Use all entries and retrieve the values.

Thanks

Vasudha

4 REPLIES 4
Read only

former_member386202
Active Contributor
0 Likes
545

Hi,

Select data from EKKO then using for all entries select data from EKPO.

Loop on EKKO pass data to final internal table, read EKPO using read statement

if sy-sub rc eq 0 then pass data from EKPO to final internal table.

Regards,

Prashant

Read only

0 Likes
545

A small correction for prashant reply

Get data from EKKO into IT_EKKO
Get data from EKPO into IT_EKPO using for all entries of IT_EKKO
loop at IT_EKPO. " Its IT_EKPO instead of IT_EKKO
read table IT_EKKO with key EBELN = IT_EKPO-EBELN.
if sy-subrc = 0.
move required fields to IT_FINAL.
endif.
Required data is available in IT_FINAL.

Regards

Gopi

Read only

Former Member
0 Likes
546

Hi

Try this.Use all entries and retrieve the values.

Thanks

Vasudha

Read only

Former Member
0 Likes
545

Hi,

Try this,

Read data into itab_ekko and itab_ekpo tables.

Loop at itab_ekko.

Read table itab_ekpo with key field1 = itab_ekpo-field1.

If sy-subrc = 0.

Move itab_ekko-field1 = itab_final-field1.

Move itab_ekko-field2 = itab_final-field2.

Move itab_ekpo-field3 = itab_final-field3.

Move itab_ekpo-field4 = itab_final-field4.

Append itab_final.

Endloop.

Regards,

Ruthra