Skip to Content
0
Former Member
Aug 10, 2016 at 10:15 AM

GETWA_NOT_ASSIGNED Dump for OO ALV F4 Calendar

2358 Views

Hi everyone! Please help.

My requirement is to modify a program in such a way that one of its field, will have an F4 value of a calendar or F4_Date. I am using set_table_first_display. The field is already editable.

However, I am encountering this dump GETWA_NOT_ASSIGNED.

Here are the steps that I've done.

1. Declared the following:

ts_g_f4 TYPE lvc_t_f4 WITH HEADER LINE.


2. Field catalog

move: 'X' TO e_g_fieldcat-f4availabl,

'SYST' TO e_g_fieldcat-ref_table,

'DATUM' TO e_g_fieldcat-ref_field.


3. After the call method ob_g_alvgrid->set_table_for_first_display and CALL METHOD ob_g_alvgrid->register_edit_event.


ts_g_f4-fieldname = 'NDAT01'.

ts_g_f4-register = 'X' .

ts_g_f4-getbefore = 'X' .

APPEND ts_g_f4.

CALL METHOD ob_g_alvgrid->register_f4_for_fields

EXPORTING

it_f4 = ts_g_f4[].

SET HANDLER gr_event_handler->on_f4 FOR ob_g_alvgrid.


4. Class definitions


CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

METHODS:

on_f4

FOR EVENT onf4 OF cl_gui_alv_grid

IMPORTING e_fieldname

es_row_no

er_event_data

et_bad_cells

e_display.

ENDCLASS.

CLASS lcl_event_handler IMPLEMENTATION.

METHOD on_f4.

PERFORM on_f4_help USING e_fieldname

es_row_no-row_id

er_event_data

et_bad_cells

e_display.

er_event_data->m_event_handled = 'X'.

ENDMETHOD.


5. on_f4 definition


FORM on_f4_help USING p_e_fieldname row_id p_er_event_data TYPE REF TO cl_alv_event_data p_et_bad_cells p_e_display.

DATA:

l_select_date LIKE workflds-gkday,

l_select_week LIKE scal-week.

* pop up calendar.

CALL FUNCTION 'F4_DATE'

EXPORTING

date_for_first_month = sy-datum

IMPORTING

select_date = l_select_date

select_week = l_select_week

EXCEPTIONS

calendar_buffer_not_loadable = 1

date_after_range = 2

date_before_range = 3

date_invalid = 4

factory_calendar_not_found = 5

holiday_calendar_not_found = 6

parameter_conflict = 7

OTHERS = 8.

IF sy-subrc <> 0.

EXIT.

ENDIF.

ENDFORM.


----------------------------------


Question:

1. Why does this result to a dump? I have checked into ST22 and the code that results to an error is sap standard.


>>>> read table <l_field> into ls_style

57 with table key fieldname = is_col_id-fieldname.

This code is from Class CL_GUI_ALV_GRID method IS_READY_FOR_INPUT.

Assumptions:

1. The field NDAT01 is defined in the field catalog.

2. Here is my alv style

MOVE: 'FIELD_STYLE' TO e_g_layout-stylefname,

'X' TO e_g_layout-zebra.

Can you please help on how to resolve this? thanks!