Skip to Content
author's profile photo Former Member
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.

Please help.

Regards,

Harsha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 03: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

    Add a comment
    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

    Add a comment
    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 07: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.