Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

basic question on internal table

akash_01
Explorer
0 Kudos

Iam having multiple po in my internal table

i want my po to be displayed only once in the output.

i need to display the po once only but all the material details to that po should be displayed

po-4500004822, matnr-100-01 ,desc- printer, qty- 10

100-02 fly wheel 50

as you can see po number is not coming in second line item

need to get this using control break statement is their a possibility..



1 ACCEPTED SOLUTION

mateuszadamus
Active Contributor
0 Kudos

Hello akash_01

SORT lt_table BY po_number.
LOOP AT lt_table REFERENCE INTO DATA(ld_table).
  AT NEW po_number.
    WRITE ld_table->po_number.
  ENDAT.

  WRITE ld_table->material.
ENDLOOP.
Kind regards,
Mateusz
2 REPLIES 2

mateuszadamus
Active Contributor
0 Kudos

Hello akash_01

SORT lt_table BY po_number.
LOOP AT lt_table REFERENCE INTO DATA(ld_table).
  AT NEW po_number.
    WRITE ld_table->po_number.
  ENDAT.

  WRITE ld_table->material.
ENDLOOP.
Kind regards,
Mateusz

But this code works all the time ONLY if PO_NUMBER is the first component of LT_TABLE.