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 : problem with an editable field (quantity)

Former Member
0 Likes
1,513

Hi there , I got this problem , in a ALV I got a quantity field that in the field catalog is referred to a unit field, the problem is that when i change the value , after click or enter pressing, the value change in Sap standard value , for example the value 30 (pieces) began 0,030, I tried to intercept the data_changed event but seems that I can read the new value but I can't write on it.

this is how I declared the fieldcatalog

ls_fieldcatalog-col_pos = 8.

ls_fieldcatalog-fieldname = 'MENGE_C'.

ls_fieldcatalog-reptext = ls_fieldcatalog-scrtext_l =

ls_fieldcatalog-scrtext_m = ls_fieldcatalog-scrtext_s = 'Q.ta Cons Forn.'.

ls_fieldcatalog-outputlen = '000015'.

ls_fieldcatalog-qfieldname = 'MEINS'.

ls_fieldcatalog-just = 'R'.

ls_fieldcatalog-emphasize = 'C3'.

APPEND ls_fieldcatalog TO pt_fieldcat. "clear pt_fieldcat.

(i change the editability dinamically depending on the value of another field)

Hi there , I got this problem , in a ALV I got a quantity field that in the field catalog is referred to a unit field, the problem is that when i change the value , after click or enter pressing, the value change in Sap standard value , for example the value 30 (pieces) began 0,030, I tried to intercept the data_changed event but seems that I can read the new value but I can't write on it.

this is how I declared the fieldcatalog

ls_fieldcatalog-col_pos = 8.

ls_fieldcatalog-fieldname = 'MENGE_C'.

ls_fieldcatalog-reptext = ls_fieldcatalog-scrtext_l =

ls_fieldcatalog-scrtext_m = ls_fieldcatalog-scrtext_s = 'Q.ta Cons Forn.'.

ls_fieldcatalog-outputlen = '000015'.

ls_fieldcatalog-qfieldname = 'MEINS'.

ls_fieldcatalog-just = 'R'.

ls_fieldcatalog-emphasize = 'C3'.

APPEND ls_fieldcatalog TO pt_fieldcat. "clear pt_fieldcat.

(i change the editability dinamically depending on the value of another field)

5 REPLIES 5
Read only

Former Member
0 Likes
1,087

Hi,

Check the following link:

http://sapdev.co.uk/reporting/alv/alvgrid_editable.htm

Regards,

Bhaskar

Read only

0 Likes
1,087

Thanks for your answer but my ALV is an object ALV and does not work in the same way of the function one does..

Read only

Former Member
0 Likes
1,087

Hi ,

In the catalog please check if you are using the REF Table field and in the example you gave for thet row what is the value of MEINS.

Regards

Arun

Read only

0 Likes
1,087

The quantity is referred to an order, so the meins is the one of the order line,( usually pieces ), that is stored in the same internal table .

..I noted that in the handle_data_changed event there is a sort of "object of the object"

er_data_changed->mp_mod_rows

that has the same structure of my internal table , and where the new data are stored , I tried to access the field in the debugging mode and I changed the value of interest by hand , but seems that is not possible in the abap code ( i tried in forms like er_data_changed->mp_mod_rows-menge_c ) , someone got an idea ??

Read only

0 Likes
1,087

...resolved by myself this way :

in method METHOD handle_data_changed.

FIELD-SYMBOLS: <fs> TYPE table.

*

LOOP AT er_data_changed->mt_mod_cells INTO wa_mod_cell.

*

ASSIGN er_data_changed->mp_mod_rows->* TO <fs>.

*

READ TABLE <fs> INTO rc_doc INDEX wa_mod_cell-tabix.

*

  • I DO MY COMPUTATION

*

MODIFY <fs> FROM rc_doc INDEX wa_mod_cell-tabix.

*

GET REFERENCE OF <fs> INTO er_data_changed->mp_mod_rows.

*

ENDLOOP.