07-10-2007 7:44 AM
Hi friends,
I have implemented an ALV grid list using 'REUSE_ALV_GRID_DISPLAY' function module.It displays like this-
SO No Item PO date Advance Amt
31410 10 2006/05/01 500.00
31410 20 2006/05/02 500.00
31410 30 2006/05/05 500.00
31411 10 2006/05/01 100.00
31411 10 2006/05/06 100.00
I want to display advance amount once for each sale order ,bcoz it is at sale order level.I want to display it in a vertical column only and don't want to show it horizontally like sub total row....
Can some body help me out for achieving this functionality...
Thankin You
Regards,
Rajesh
07-10-2007 8:46 AM
Hi,
One opton is pass the sort internal table with the values of sale order no field name and amount field name.But here both sale order no and amount will be displayed as per ur requirement.
*------EBELN & ADAMNT -->fieldname of sale order no and adavnce amount
REFRESH it_sort.
x_sort-spos = '1'.
x_sort-fieldname = 'EBELN'.
APPEND x_sort TO it_sort.
x_sort-spos = '1'.
x_sort-fieldname = 'ADAMNT'.
APPEND x_sort TO it_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF_STAT'
i_callback_user_command = 'USER_CMD'
is_layout = layout
<b> it_sort = it_sort</b>
it_fieldcat = fieldcat
is_sel_hide = v_sel_mode
i_screen_start_column = '1'
i_screen_start_line = '8'
i_screen_end_column = '45'
i_screen_end_line = '30'
TABLES
t_outtab = itab.
Message was edited by:
Vigneswaran S
07-10-2007 8:23 AM
Hi,
Try using COLLECT.
Hope this helps.
Reward if helpful.
Regards,
Sipra
07-10-2007 8:27 AM
I think collect will make the sum of all the amount.but i don't want to do that.i want to show the same value but once for each sale order
07-10-2007 8:39 AM
07-10-2007 8:46 AM
Hi,
One opton is pass the sort internal table with the values of sale order no field name and amount field name.But here both sale order no and amount will be displayed as per ur requirement.
*------EBELN & ADAMNT -->fieldname of sale order no and adavnce amount
REFRESH it_sort.
x_sort-spos = '1'.
x_sort-fieldname = 'EBELN'.
APPEND x_sort TO it_sort.
x_sort-spos = '1'.
x_sort-fieldname = 'ADAMNT'.
APPEND x_sort TO it_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF_STAT'
i_callback_user_command = 'USER_CMD'
is_layout = layout
<b> it_sort = it_sort</b>
it_fieldcat = fieldcat
is_sel_hide = v_sel_mode
i_screen_start_column = '1'
i_screen_start_line = '8'
i_screen_end_column = '45'
i_screen_end_line = '30'
TABLES
t_outtab = itab.
Message was edited by:
Vigneswaran S
07-10-2007 9:47 AM
hi it is working for sale order but it's not working for advance amount.
07-10-2007 9:51 AM
give spos as 2 for advance amount
<b>x_sort-spos = '2'.</b>
x_sort-fieldname = 'ADAMNT'.
APPEND x_sort TO it_sort.
07-10-2007 10:01 AM
hi I have set the spos =2 but still it is not working.
what is spos in x_sort-spos.
Advance amount field is 15th column in my list.
Message was edited by:
Rajesh Akarte
07-10-2007 10:10 AM
Hi Rajesh,
Check whether you have given correct fielname and also make sure to give it in CAPs.
07-10-2007 10:11 AM
spos defines the sort order to do the subtotals , sorts the fields according to the position specified in spos
spos = 1 , sorts this field first
spos = 2 , sorts second,
i guess in this context there is no need to use the advance amount in the sort field, using first field will do , but not sure what do u mean by Vertically
07-10-2007 10:31 AM
HI,
I have given the correct field name and in CAPs also.It is showing red mark of sorting on Advance amount field and as well as on sale order,that means field name is correct.but values of amount are repeating ....
07-10-2007 10:41 AM
Hi rajesh,
If you are using a currency data type....change it like this while displaying...
This will work..Only character type data can be displayed as Unique entriess and then followd by empy values... while sorting...so change data type of advance amount field in display as character as mentioned below..
this has to be done in fieldcatalog internal table.
CLEAR x_fieldcat.
cnt = cnt + 1.
x_fieldcat-col_pos = cnt.
x_fieldcat-fieldname = 'ADAMNT'.
x_fieldcat-tabname = 'ITAB'.
<b> x_fieldcat-datatype = 'CHAR'.</b>
x_fieldcat-seltext_l = 'Advance amount'.
APPEND x_fieldcat TO fieldcat.
Message was edited by:
Vigneswaran S
07-10-2007 10:58 AM
Thanks a lot to all. Finally I have done this with ur valuable support
Message was edited by:
Rajesh Akarte