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

REPORT DISPLAY

Former Member
0 Likes
527

hI all,,,

i have a requirement in my program to display as follows"

Delivery Delivery item Mat No Cust No.

1 10 BX123 201022

20 BX232 201022

2 10 BX333 201111

20 BX555 201111

30 BX323 201111

How to perform this operation???? llike whenever we encounter new delivery, its subitems should be dispalyed in the above format.

pls help...

thankz in adv

null

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
497

Hi,

You can use Control Break statements for the same.

Here is sample code.

SORT ITAB BY DELIVERY DELIVERYITM.

LOOP AT ITAB.

L_tABIX = SY-TABIX.

AT NEW DELIVERY.

CLEAR FLAG.

READ TABLE ITAB INDEX L_tABIX.

WRITE DELIVERY

SET FLAG.

ENDAT.

IF FLAG IS SET

WRITE: DELIVERY ITEM, MATERIAL NO, CUST NO

ELSE

WRITE: / DELIVERY ITEM, MATERIAL NO, CUST NO

ENDIF.

ENDLOOP.

Hope this helps.

ashish

5 REPLIES 5
Read only

Former Member
0 Likes
498

Hi,

You can use Control Break statements for the same.

Here is sample code.

SORT ITAB BY DELIVERY DELIVERYITM.

LOOP AT ITAB.

L_tABIX = SY-TABIX.

AT NEW DELIVERY.

CLEAR FLAG.

READ TABLE ITAB INDEX L_tABIX.

WRITE DELIVERY

SET FLAG.

ENDAT.

IF FLAG IS SET

WRITE: DELIVERY ITEM, MATERIAL NO, CUST NO

ELSE

WRITE: / DELIVERY ITEM, MATERIAL NO, CUST NO

ENDIF.

ENDLOOP.

Hope this helps.

ashish

Read only

Former Member
0 Likes
497

Hi,

Try this..

DATA: V_FOUND.

SORT ITAB BY DELIVERY.

LOOP AT ITAB INTO WA.

AT NEW DELIVERY.

WRITE: /1 WA-DELIVERY.

V_FOUND = 'X'.

ENDAT.

IF V_FOUND IS INITIAL. " Means same delivery.

SKIP.

ENDIF.

WRITE: 11 WA-DELIVERY_ITEM,

20 WA-MATERIAL,

40 WA-CUST_NO.

CLEAR: V_FOUND.

ENDLOOP.

Thanks

Naren

Read only

Former Member
0 Likes
497

Hi,

ALV or Classical report ?.

Regards,

Niyaz

Read only

Former Member
0 Likes
497

HI,

you have the results in the itab

if you want to display in the alv grid then

use the sort function then it will do the necessary hellp for you

eg:

data: gwa_sort TYPE slis_sortinfo_alv,

git_sort TYPE slis_t_sortinfo_alv.

gwa_sort-spos = 1.

gwa_sort-fieldname = 'DELIVERY' .

gwa_sort-tabname = 'ITAB'.

gwa_sort-up = 'X'.

APPEND gwa_sort TO git_sort.

CLEAR gwa_sort.

GIve this git_sort in the fm of grid display

or if it is a report ( classical )

data: delivery like itab-delivery.

clear: delivery.

loop at itab

at new delivery.

delivery = itab-delivery.

endat.

if delivery eq itab-delivery.

write: itab-delivery.

endif.

write:/ all fields except itab-deliveryitem.

now chek

endloop.

regards,

Venkatesh

Read only

Former Member
0 Likes
497

Hi,

Use AT NEW.

exp..

loop at itab.

at new itab-vbeln.

write:/ itab-vbeln, itab-posnr , itab-netwr.

on change of itab-posnr.

write 😕 itab-posnr , itab-netwr.

endon.

endat.

endloop.

regards,

Message was edited by:

SAPLOVER