01-07-2014 4:26 PM
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
01-08-2014 3:39 AM
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
01-08-2014 4: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
01-08-2014 4: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.
01-08-2014 7:13 AM
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.
01-08-2014 7:53 AM
Hi,
itab1,itab2 and itab3 have only 2 fields only there is an other field like primary key common to all the 3 itabs.
01-08-2014 1:23 PM
HI Krishna,
Nope there is only one field which is common i.e day or day name.