Application Development and Automation 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: 
Read only

abap display

Former Member
0 Likes
724

Hi experts,

I have a situation like this:

I need to display an internal table through abap display as follows:

Order No:----


Item no:----


(If any under that order no.)

orderno.........

item no.....

likewise display..........

Any help?....

thanks in advance.....

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
701

You can do it like this:

LOOP AT ITAB.
  WRITE: / 'Order No:', itab-order.
  if not itab-item is initial.
  WRITE: / 'Item No:', itab-item.
  endif.
  skip 1.
endloop.

Regards,

Naimesh Patel

5 REPLIES 5
Read only

naimesh_patel
Active Contributor
0 Likes
702

You can do it like this:

LOOP AT ITAB.
  WRITE: / 'Order No:', itab-order.
  if not itab-item is initial.
  WRITE: / 'Item No:', itab-item.
  endif.
  skip 1.
endloop.

Regards,

Naimesh Patel

Read only

0 Likes
701

how can we do this using at endat.....

this 2 fields are not the first 2 fields inmy table.....

can we sort them and use at endat logic......

Read only

0 Likes
701

Yes you can use the AT ENDAT on the LINE number but the probelm will be if the other field which are ahead of the ORDER and LINE will change your AT event will fire.

So, put your fields ORDER and LINE at the first two fields and try like this:

SORT ITAB BY ORDER LINE.
LOOP AT ITAB.
  AT END OF LINE.
    WRITE:  / 'Order', ITAB-ORDER,
    WRITE: / 'Item', ITAB-ITEM.
  ENDAT.
ENDLOOP.

Regards,

Naimesh Patel

Read only

0 Likes
701

Hi Kartikey,

First You Sort your internal table upto Order no, Item no fields

Forexample:

Sort itab by field1

field2

-


Orderno

itemno.

LOOP AT ITAB.

at endat.

WRITE: / 'Order No:', itab-order.

WRITE: / 'Item No:', itab-item.

endat.

endloop.

Read only

0 Likes
701

Hi,

Try to use (Due to your sort fields are not as first fields in your internal table)


SORT ITAB BY ORDERNO.
LOOP AT ITAB.
ON CHANGE OF ITAB-ORDERNO.
WRITE: / 'Order No', ITAB-ORDERNO.
ENDON.
WRITE :/ Item No:' , ITAB-ITEMNO.
ENDLOOP.

a®