Skip to Content

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

how to fetch similar record from the internal table,

dear firends,

would you like to give me some idea, about how to fetch, similar record from one internal table to another internal table...any code, suggestion, article will be greate help of mine,,

thankign you..

regards,

Naim

Tags:
replied

do u mean to get similar records from 2 internal tables then u need to use the read statement and get the records into another internal table of similar structure

LOOP AT ITAB1.

READ TABLE ITAB2 WITH KEY VBELN = ITAB1-VBELN.

IF SY-SUBRC = 0.

ITAB3 = ITAB1.// this get the header line into itab

APPEND ITAB3.

ENDIF.

ENDLOOP.

otherwise if u mean to say similar records from one internal table then u need to

SORT ITAB BY VBELN POSNR.
  LOOP AT ITAB.

    AT NEW VBELN.

MOVE ITAB TO ITAB2.

    ENDAT.

  ENDLOOP.

This will get all the distinct records into ITAB2

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