Former Member

# 3 itabs

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.

Regards,

Harsha

10|10000 characters needed characters exceeded

### Related questions

• Former Member
Posted on Jan 08, 2014 at 03:39 AM

hi Harsha

20130103 03 20131001 20120102 ?%

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

thanks,

Archer

10|10000 characters needed characters exceeded
• Posted on Jan 08, 2014 at 04:50 AM

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

10|10000 characters needed characters exceeded
• Posted on Jan 08, 2014 at 04:59 AM

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.

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 08, 2014 at 07:13 AM

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.