Skip to Content
avatar image
Former Member

itab issue

Experts,

I have internal table ITAB1 like this.

SEQNR	NAME               
1	GA001DA01
2	GA001DA02
*3	GA001DA03*
4	GA001DA04
*5	GA001DA05*
6	GA001DA06

Other internal table ITAB2 like this

NAME                         STATUS
GA001DA03
GA001DA05

How can i make ITAB2 like this compare to ITAB1?

NAME                STATUS
                              X
                              X
GA001DA03         M
                              X
GA001DA05         M
                              X

In ITAB2 i need same sequence like ITAB1. In blank lines i need status as X others M.

Could you please advise.

Edited by: Priya on Apr 8, 2010 7:52 PM

Edited by: Priya on Apr 8, 2010 7:53 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Apr 08, 2010 at 11:55 PM

    loop at itab1.

    tabix = sy-tabix.

    read table itab2 with key name = itab1-name.

    if sy-subrc eq 0.

    itab2-status = 'M'.

    modify itab2 index tabix.

    else.

    wa_tab2-status = 'X'.

    insert wa_tab2 into itab2 index tabix.

    endif.

    endloop.

    Edited by: subas Bose on Apr 9, 2010 2:00 AM

    Edited by: subas Bose on Apr 9, 2010 2:02 AM

    Edited by: subas Bose on Apr 9, 2010 2:05 AM

    Add comment
    10|10000 characters needed characters exceeded