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: 

3 itabs

Former Member
0 Kudos

Guys,

I have 3 itab which contains the following data

itab1

date             day

20130101     01

20130102     02

20130103     03

20130104     04

20131003     05

20131004     06

itab2

20131001     03

20131002     04

20131003     05

20131004     06

itab3

20120101    02

20120102    03

20120103    04

20120104    05

I need to match the second column in all itab and display horizontally in the below format -

20130101 01

20130102 02

20130103 03     20131001  20120102   xxxxx

20130104 04     20131002  20120103   xxxxxx

Need to calculate % for all common fields and ifs    not common, need to display without any calculation.

Please help.

Regards,

Harsha

6 REPLIES 6

Former Member
0 Kudos

hi Harsha

please give more information about calculate % for all common fields

20130103 03     20131001  20120102   ?%

20130104 04     20131002  20120103   ?%     what the result should be based on your three itab.

thanks,

Archer

sivaprasad_paruchuri
Active Participant
0 Kudos

hi harsha,

declare itab4 with all four fields..

refresh itab4.

loopa at itab1.

itab4-field1 = itab1-field1

itab4-field2 = itab1-field2

read table itab2 with key field2 = itab1-field2.

if sy-subrc is initial.

itab4-field3 = itab2-field1.

endif.

read table itab3 with key field2 = itab1-field2.

if sy-subrc is initial.

itab4-field3 = itab3-field1.

endif.

append itab4

endloop.

regards,

siva

former_member424229
Participant
0 Kudos

Hi,

1) first declare new internal table with required fields as like output.

2)Put the loop for first itab1 and populate the fields in new internal table

3) similarly read and populate the itab2 and itab3  with key condition .

4) Before endloop put the append statement.

Former Member
0 Kudos

Thanks for the reply.

I have used the read statement in the loop. But, result is in the attached file.

The day is not unique to entire column, its duplicated after 7 days.

There should be other ways to do it.

I tried flagging also, itab is not getting updated.

0 Kudos

Hi,

   itab1,itab2 and itab3 have only 2 fields only there is an other field like primary key common to all the 3 itabs.

0 Kudos

HI Krishna,

Nope there is only one field which is common i.e day or day name.