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: 

Calendar in editable ALV

NooruBohra
Active Participant
0 Kudos
3,011

Hi,

I have created an Editable ALV using OOP. My requirement is to show calendar for inputting a date on a field.

I have created event handler and register for events.

I have also appended in Fieldcat

lt_fieldcatalog-f4availabl = 'X'.

lt_fieldcatalog-ref_table = 'SYST'.

lt_fieldcatalog-ref_field  = 'DATUM'.

But still not working.

I am getting an runtime error "GETWA_NOT_ASSIGNED"

Short text : "Field symbol has not yet been assigned."

Please guide me to implement calendar on F4.

Thanks

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
1,763

Problem doesn't seem to be relative to F4, but to layout , wrong value for STYLEFNAME ?

Else, could you execute the consistency check of your grid (if able to display)

Regards,

Raymond

20 REPLIES 20

venkateswaran_k
Active Contributor
0 Kudos
1,763

Hi

You no need to put f4available = 'X'   --- remove this line

You use reference field name and reference table name in the field catalog.

Example:

  alv_fieldcat_line-tabname    = 'IT_DATAFEED'.
  alv_fieldcat_line-fieldname  = 'AENDDA'.
  alv_fieldcat_line-seltext_l = 'Approved To'.
  alv_fieldcat_line-outputlen = 15.
  lpos = lpos + 1.
  alv_fieldcat_line-edit = 'X'.
  alv_fieldcat_line-col_pos = lpos.
alv_fieldcat_line-ref_tabname = 'ZHRT_REQUESTS'.    <-- here put your table name
  alv_fieldcat_line-ref_fieldname = 'ABEGDA'.                 < - here put your field name
  APPEND alv_fieldcat_line TO alv_fieldcat.

0 Kudos
1,763

Hi Venkateswaran,

I have done the same thing but still the error is coming. I have attached the error screenshot as well please look at it once.


Thanks.

0 Kudos
1,763

I had the similar problem.  Please do it as follows:  This will solve your issue

In your field catalog defention remove the following items.

lt_fieldcatalog-f4availabl = 'X'.

lt_fieldcatalog-ref_table = 'SYST'.

lt_fieldcatalog-ref_field  = 'DATUM'.

Add the items as follows:

  lt_fieldcatalog-edit = 'X'.

  lt_fieldcatalog-ref_tabname = 'BKPF'.

  lt_fieldcatalog-ref_fieldname = 'BUDAT'

This should work.

Please udpate back

Moreover, do you have any SORT defenitions?  Please reivew that in SORT what field name you defined is there in Field catalog as well.

0 Kudos
1,763

Hi Venkateswaran,

I have tried this as well but I am still getting the same error.

    Program                                 CL_GUI_ALV_GRID====

    Include                                 CL_GUI_ALV_GRID====

    Row                                     56

    Module type                             (METHOD)

    Module Name                             IS_READY_FOR_INPUT

This is the trigger location of runtime error.

0 Kudos
1,763

do you have sort defenitions.

Pleae paste the code of SORT as well.

0 Kudos
1,763

Hi Venkateswaran,

No I am not using any kind of sorting definition.

Regards.

egenoves
Participant
0 Kudos
1,763

This code shows the calendar..

Table i_vbak is declared like VBAK dictionary table.

i_fcat holds the fieldcatalog with only the date field ERDAT

CALL METHOD alv_1->set_ready_for_input

       EXPORTING

         i_ready_for_input = 1.

     refresh i_fcat.

     wa_fcat-fieldname = 'ERDAT'.

     wa_fcat-ref_table = 'VBAK'.

     wa_fcat-ref_field = 'ERDAT'.

     wa_fcat-edit = 'X'.

     append wa_fcat to i_fcat.

     alv_1->set_table_for_first_display(

        EXPORTING

          is_layout                     = wa_layout

       CHANGING

          it_outtab                     = i_vbak

          it_fieldcatalog               = i_fcat

*        it_sort                       =

*        it_filter                     =

            ).

NooruBohra
Active Participant
0 Kudos
1,763

Hi Enrique,

I have already tried that. The error is still there. Please check the error I am getting an runtime error "GETWA_NOT_ASSIGNED"

Short text : "Field symbol has not yet been assigned."

Regards.

Former Member
0 Kudos
1,763

Hello Bohra,

Whether you have assign the Correct field name(FIELDNAME) and Column pos usually that ll also cause this kind of dump.

raymond_giuseppi
Active Contributor
0 Kudos
1,764

Problem doesn't seem to be relative to F4, but to layout , wrong value for STYLEFNAME ?

Else, could you execute the consistency check of your grid (if able to display)

Regards,

Raymond

0 Kudos
1,763

Hi Raymond,

I am using

gs_layo-stylefname = 'STYLE'


Nothing more for stylefname.

Regards.

0 Kudos
1,763

Insure STYLE is actually a field of the displayed internal table and that it is defined as an internal table of type LVC_T_STYL with a record for some specific field names. Else initialize the field STYLE_FNAME in the layout. (it is not a reference to field STYLE of the field catalog)

Regards,

Raymond

0 Kudos
1,763

Hi Raymond,

Is it really required to have that STYLE field in displayed output table?

because I don't have any field with this name in my final internal table.

Regards.

0 Kudos
1,763

Hi Raymond,

As you suggested I have also perform the consistency check. It is showing an error as

"Invalid value GT_FINAL of the field catalog parameter TABNAME"

GT_FINAL is the internal table used for display.

Please help me, what should I place in tabname? my final internal table name or the Database table name.

0 Kudos
1,763

If you actually want to manage dynamic styles, you don't have the choice, else you could have one style field per column in the internal table with value of field style of field catalog.

Don't put the internal name in the field catalog if not actually required (or default to "1"). It is only required for some hierarchy ALV not for grid, so this is not a required field, keep it initial.

Regards,

Raymond

venkateswaran_k
Active Contributor
0 Kudos
1,763

Check your lt_sort table in the

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

The lt_sort table you used , the column you defined there may not be there in the field catalog.

Make sure that the field defined in lt_sort is there in field catalog.

Or just comment the lt_sort in the function and execute it.

0 Kudos
1,763

Hi Venkateswaran,

I am not using reuse_alv_grid_display

I am using set_table_for_first_display using OOP.

I have checked the sort table, there is no problem.

Regards.

Former Member
0 Kudos
1,763

Hi,

At first - you should always check if field symbol is assigned before you try to read from it.

In other words your ASSIGN command should be followed by something like

CHECK <l_field> is assigned.

Second - you read your grid data table by a row_id (probably passed as an importing parameter)

In this row you are expecting a column with name = m_cl_variant->ms_layout-stylefname

This means you should have such column in your grid itab.

If field with this name is not in the itab, the ASSIGN command fails and <l_field> remains unassigned.

So make sure you:

a) have such field in your grid itab

b) you have correct field name value in m_cl_variant->ms_layout-stylefname

NooruBohra
Active Participant
0 Kudos
1,763

Hi everyone,

I have found the solution, Thanks everyone for your support.

Thanks & Regards.

bagholder
Newcomer
0 Kudos
1,557

what did you do ?