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

ALV grid control, Adding the push Button in the Toolbar

Former Member
0 Likes
618

Hello All,

I am facing a problem when trying to do calculation based on the button added at the toolbar of interactive ALV list.

When I click on the toolbar button Compute, the ALV should calculate the

multiplication of the Qty (manually entered by a user) & price per unit already available in the ALV & show it the Column Total value.

Presently when I try to do this using

Method handle_user_command.

modifying the inetrnal table GT_FINAL_OUTPUT

with the Total price value .

& updating the column Total price (Qty * price) in the Internal table

After doing this I am agin calling the below function

CALL METHOD g_grid->set_table_for_first_display

EXPORTING

i_structure_name = 'GT_FINAL_OUTPUT'

is_layout = gs_layout

CHANGING

it_fieldcatalog = gt_fieldcat

it_outtab = GT_FINAL_OUTPUT[].

At above function it gives short dump or sometimes it does not update the ALV screen with the new updated value of Total price .

The short dump comes states the error of unassigned field symbol.

Kindly suggest a program where we can do manipulation at the editable ALV.

Or solution to above issue .

Regards,

Anurag

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
573

You might want to take a look at the ALV code examples here:

http://www.sapdevelopment.co.uk/reporting/alv/alvscr.htm

5 REPLIES 5
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
574

You might want to take a look at the ALV code examples here:

http://www.sapdevelopment.co.uk/reporting/alv/alvscr.htm

Read only

former_member194669
Active Contributor
0 Likes
573

Hi,

Please check the fieldcatalog fields should exist in the output table, other wise system will give short dump of field symbol not been assigned.

aRs

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
573

You should only be calling the SET_TABLE_FOR_FIRST_DISPLAY one time in the PBO of your screen, otherwise you should be using the REFRESH_TABLE_DISPLAY method. IN your PBO, check that the instance of the alv_container is alive, if so, do not call the SET method, rather call the REFRESH method.

if alv_container is initial.

    create object......
    create object g_grid.....
    call method g_grid->set_table_for_first_display......

else.

 call method   g_grid->refresh_table_display( ).

endif.

Regards,

Rich HEilman

Read only

Former Member
0 Likes
573

Hello Colleagues ,

Thanks for your help .

I was using the wrong definition of the fieldcatlog .

when I change the fieldcatlog building with correct mention of table name & fieldname then it solves the problem of shortdump .

regards,

Anurag

Read only

Former Member
0 Likes
573

Issue solved .