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: 

ALV list display

rajesh_akarte2
Active Participant
0 Kudos
154

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

1 ACCEPTED SOLUTION

former_member491305
Active Contributor
0 Kudos
109

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

12 REPLIES 12

Former Member
0 Kudos
109

Hi,

Try using COLLECT.

Hope this helps.

Reward if helpful.

Regards,

Sipra

0 Kudos
109

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

Former Member
0 Kudos
109

hi,

Use the control break statement At New.

former_member491305
Active Contributor
0 Kudos
110

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

0 Kudos
109

hi it is working for sale order but it's not working for advance amount.

0 Kudos
109

give spos as 2 for advance amount

<b>x_sort-spos = '2'.</b>

x_sort-fieldname = 'ADAMNT'.

APPEND x_sort TO it_sort.

0 Kudos
109

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

0 Kudos
109

Hi Rajesh,

Check whether you have given correct fielname and also make sure to give it in CAPs.

0 Kudos
109

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

0 Kudos
109

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 ....

0 Kudos
109

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

0 Kudos
109

Thanks a lot to all. Finally I have done this with ur valuable support

Message was edited by:

Rajesh Akarte