‎2006 Mar 06 11:37 AM
I've written a table maintenance program with an editable alv grid as per SAP example (BCALV_EDIT_04).
It works like a charm except for the NON desired message error log on a specific field/column (<b>PROD_NUM</b>) for appended rows. That is, when I click 'ENTER' (or 'check entries' button) a message error log is raised somehow, which I didn't cater for!
I am calling my grid as follows:
*...initialize alv grid
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = ps_layout
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab[].
I also cater for changed data event as follows:
SET HANDLER g_event_receiver->handle_data_changed FOR g_grid.
*---register ENTER to raise event DATA_CHANGED.
CALL METHOD g_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
As said before, I don't handle any checks for data (or existance) integrity or anything of the sort in my handle_data_changed method. This error seems to be raised almost automatically.
My field catalog is derived from the structure. In the structure, PROD_NUM is defined as Built-in type CHAR 02.
Is there a way to deactivate this error checking?
Nhlanhla Ndlovu
‎2006 Mar 06 11:47 AM
Hi,
what is the error you are getting. is it related to PROD_NUM. can you specify what is that error.
Regards
vijay
‎2006 Mar 06 12:12 PM
The message says:
'Enter a valid value'.
See, I do want it to accept initial values as well for field PROD_NUM but it flags these as erroneous input on the alv message log.
‎2006 Mar 06 12:29 PM
can you show the data declaration of internal table and fieldcatalog.
Regards
vijay
‎2006 Mar 06 11:50 AM
hi,
use following sy-subrc check after you call the display method.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope this helps..
Regards,
Shashank
‎2006 Mar 06 12:15 PM
‎2006 Mar 06 12:20 PM
Hi,
Try following code..
*...initialize alv grid
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = ps_layout
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab[].
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SET HANDLER g_event_receiver->handle_data_changed FOR g_grid.
*---register ENTER to raise event DATA_CHANGED.
CALL METHOD g_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Shashank
‎2006 Mar 06 12:38 PM
Hi Shashank,
I've tried this, Sir. Nothing happens, i.e. when I run the program, change edit values on the grid and click the 'check entries' button or 'ENTER' it just displays the alv grid message 'error log' with 'Enter a valid value' (this is for column PROD_NUM'.
sy-subrc is 0 in all cases.
Regards,
Nhlanhla Ndlovu
‎2006 Mar 06 12:51 PM
Can you show the declaration part of PROD_NUM .
if you enter invalid obviously you get error from alv.
that is the reason i was asking you to show the declaration ,you need to change the data type then only it will stop throwing the error.
Regards
vijay
‎2006 Mar 06 1:27 PM
The field catalog declaration:
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZST_ZMODEL_PARM'
CHANGING
ct_fieldcat = pt_fieldcat.
PROD_NUM in structure 'ZST_MODEL_PARM':
PROD_NUM ZLAUNCH_MTH_START NUMC 2 0 Month of Launch Start
Vijay, I think I've played around with this data type to realize that this is probably not where the problem is. Could it be something else?
‎2006 Mar 06 1:36 PM
what are you entering.
(when you got the message what value you entered).
Regards
vijay