2013 Nov 10 7:31 PM
Hello Experts,
please help me to create this layout in alv grid display .
Purchase requisition 1000001 | |||||||
10 | 11111616 | 12 | 12/06/2013 | ||||
20 | 67678688 | 11 | 12/06/2013 | ||||
Purchase requisition 1000002 | |||||||
10 | 56464646 | 3 | 12/04/2013 | ||||
Purchase requisition 1000003 | |||||||
30 | 45521514 | 6 | 12/06/2013 | ||||
40 | 87975451 | 9 | 8/05/2013 | ||||
what code i have to use here for purchase requisition only .
Thanks
2013 Nov 11 1:28 PM
If it is ok to have the purchase requisition as the summary after all line items, then you can do it using the normal reuse_alv_grid_display FM
Just make the Purchase requisition in the field catalog no_out attribute = 'X'. And give the text for purchase requsition 'Purchase Requisition'.
lv_pos = lv_pos + 1.
CLEAR gw_alv_fieldcat.
gw_alv_fieldcat-fieldname = 'EBELN'.
gw_alv_fieldcat-tabname = 'IT_TAB'.
gw_alv_fieldcat-seltext_l = 'Purchase Requisition'.
gw_alv_fieldcat-col_pos = lv_pos.
gw_alv_fieldcat-outputlen = 7.
gw_alv_fieldcat-no_out = 'X'.
gw_alv_fieldcat-key = 'X'.
APPEND gw_alv_fieldcat TO gt_alv_fieldcat.
Include ALV sort table to sort the table by purchase requisition field.
wa_sort-spos = '01' .
wa_sort-fieldname = 'EBELN'.
wa_sort-tabname = 'IT_ITAB'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
Would this be fine? 🙂
2013 Nov 10 8:12 PM
Hi,
Unfortunately ALV Grid doesn't allow different types of lines. This layout can only be created with the old write-style REUSE_ALV_HIERSEQ_LIST_DISPLAY. Also you can use the ALV Tree but it isn't exactly the same layout.
Regards,
Alex
2013 Nov 10 10:45 PM
thank you alex ,
i am new to abap but if you look into ME5A (in alv mode) report it will show you the same output as i shown you . after debugging the whole report i haven't seen REUSE_ALV_HIERSEQ_LIST_DISPLAY or alv tree .
is there any other way or method to do this ?
2013 Nov 11 5:04 AM
2013 Nov 11 5:17 AM
Please check ME5A and try to adapt the same logic. Check in debugging how it is doing it
2013 Nov 11 12:23 PM
Hi Jess,
ME5A doesn't use any type of ALV. It's a simple write report... The REUSE_ALV_HIERSEQ_LIST_DISPLAY framework can helps you to create the same ME5A layout.
There is an example of use:
Regards,
Alex
2013 Nov 11 1:28 PM
If it is ok to have the purchase requisition as the summary after all line items, then you can do it using the normal reuse_alv_grid_display FM
Just make the Purchase requisition in the field catalog no_out attribute = 'X'. And give the text for purchase requsition 'Purchase Requisition'.
lv_pos = lv_pos + 1.
CLEAR gw_alv_fieldcat.
gw_alv_fieldcat-fieldname = 'EBELN'.
gw_alv_fieldcat-tabname = 'IT_TAB'.
gw_alv_fieldcat-seltext_l = 'Purchase Requisition'.
gw_alv_fieldcat-col_pos = lv_pos.
gw_alv_fieldcat-outputlen = 7.
gw_alv_fieldcat-no_out = 'X'.
gw_alv_fieldcat-key = 'X'.
APPEND gw_alv_fieldcat TO gt_alv_fieldcat.
Include ALV sort table to sort the table by purchase requisition field.
wa_sort-spos = '01' .
wa_sort-fieldname = 'EBELN'.
wa_sort-tabname = 'IT_ITAB'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
Would this be fine? 🙂
2013 Nov 11 2:34 PM
2013 Nov 12 7:01 AM
2013 Nov 14 6:28 PM
2013 Nov 14 7:33 PM
2013 Nov 26 7:54 AM
solution of this thread ....
(1) prepare field catalog .
wa_fcat-fieldname = 'BANFN'.
wa_fcat-tabname = 'IT_TAB'.
wa_fcat-seltext_l = 'Purchase Requisition'. " this will display text of summary .
wa_fcat-col_pos = lv_pos.
wa_fcat-outputlen = 7.
wa_fact-no_out = 'X'. " this is must if u want to display as summary after all line items.
(2) note that you have at least one numeric or quantity/currency filed to be marked as do_sum = 'X'.
wa_fcat-fieldname = 'MENGE'. " quantity field
wa_fcat-tabname = 'IT_TAB'.
wa_fcat-seltext_l = 'QUANTITY'.
wa_fcat-col_pos = lv_pos.
wa_fcat-do_sum = 'X'.
(3) prepare sort table .
sort the table by purchase requisition field.
wa_sort-spos = '01' .
wa_sort-fieldname = 'BANFN'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
(4) now add the filedcatalog and sort table in reuse_alv_grid_display .
this is also applicable in oo alv as i did in set_table_for_first_display .