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

Changing Values on ALV Grid (using Classes)

Former Member
0 Likes
416

Hi all,

I have ALV Grid output, on which ZMENG (Target Qty) column is editable. So user will enter in value in ZMENG column and press ENTER. Then TOTAL column should be populated with ZMENG * NETWR columns. I have tried with changing/ entering values with char data type columns like MAKTX etc.. Its working fine with them. But when I entered in value in ZMENG, the actual value which I have entered is not flowing into LS_GOOD-VALUE. For char data types its been populated with user entered values.

Can anyone please tell why its not happening with Quantity or Currency fields.

method handle_data_changed.

DATA: ls_good TYPE lvc_s_modi,

l_netwr TYPE vbap-netwr,

l_total TYPE vbap-netwr,

l_zmeng TYPE vbap-zmeng.

LOOP AT er_data_changed->mt_good_cells INTO ls_good.

CASE ls_good-fieldname.

WHEN 'ZMENG'.

<<<<l_zmeng = ls_good-value.>>>>

call method er_data_changed->get_cell_value

exporting i_row_id = ls_good-row_id

i_fieldname = 'NETWR'

importing e_value = l_netwr.

l_total = l_zmeng * l_netwr.

call method er_data_changed->modify_cell

exporting i_row_id = ls_good-row_id

i_fieldname = 'TOTAL'

i_value = l_total.

ENDCASE.

ENDLOOP.

ENDMETHOD.

Fieldcatlog for Quantity field:

-


l_fcat-tabname = 'IT_VBAP'.

l_fcat-fieldname = 'ZMENG'.

l_fcat-coltext = 'Qty'.

l_fcat-outputlen = 17.

l_fcat-edit = 'X'.

APPEND l_fcat TO ct_fcat.

CLEAR l_fcat.

2 REPLIES 2
Read only

Former Member
0 Likes
385

Hi Jaker

Try calling cl_gui_alv_Grid->refresh_table_display.

refresh table display when ever the qty is changed.

It should work.

Venkat.

Read only

Former Member
0 Likes
385

HI,

Please refer the SAP standard demo program BCALV_TEST_GRID_EDITABLE.

Thanks,

Sriram Ponna.