Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question