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: 

Allow users to enter a value to alv and get that value to internal table.

former_member797394
Participant
0 Kudos

Hello everyone,

the task is to allow users to enter numeric values and by pressing Enter or clicking some button, to calculate that value in another column.

TYPES: BEGIN OF ls_invent_alv,<br>         werks  TYPE iseg-werks,<br>         name1  TYPE t001w-name1,<br>         wekgr  TYPE maw1-wekgr,<br>         eknam  TYPE t024-eknam,<br>         matkl  TYPE mara-matkl,<br>         wgbez  TYPE t023t-wgbez,<br>         matnr  TYPE iseg-matnr,<br>         maktx  TYPE makt-maktx,<br>         netwr  TYPE vbrp-netwr,<br>         budat  TYPE iseg-budat,<br>         dmbtr1 TYPE mseg-dmbtr,<br>         dmbtr2 TYPE mseg-dmbtr,<br>         dmbtr3 TYPE mseg-dmbtr,<br>         dmbtr4 TYPE mseg-dmbtr,<br>         sumdmb TYPE mseg-dmbtr,<br>         decres TYPE p DECIMALS 2,<br>       END OF ls_invent_alv.<br>DATA: gt_invent TYPE STANDARD TABLE OF ls_invent_alv,<br>      wa_invent LIKE LINE OF gt_invent.

This is my table, which is filled with some data.

This is how it should look like:

on the left columns, data, which is gathered from tables, on the left side (after first green column) are the columns, which should be allow for users to enter value and in green columns, they should be calculated.

Any ideas of how to do this? I have read somethig about REUSE_ALV_GRID_DISPLAY_LVC FM, but have no idea of how to implement this to my program.

6 REPLIES 6

matt
Active Contributor

Don't use the FM. Use CL_GUI_ALV_GRID.

Try searching with keywords CL_GUI_ALV_GRID and editable. Also look at demo program BCALV_EDIT_02

Sandra_Rossi
Active Contributor
0 Kudos

All REUSE_ALV* function modules have the edit capability, but better use CL_GUI_ALV_GRID.

former_member797394
Participant
0 Kudos

sandra.rossi matthew.billingham

Could you please, send me a simple example code for CL_GUI_ALV_GRID?

Sandra_Rossi
Active Contributor

Sure. Is demo program BCALV_EDIT_02 fine?

matt
Active Contributor
0 Kudos

BCALV_EDIT_02

former_member797394
Participant
0 Kudos

Never mind, I have done this. Thanks for effort! sandra.rossi