Application Development 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: 

Editable ALV not able to select the value from the F4 help

0 Kudos

Hi,

I have created an editable ALV with the standard F4 help for the field matnr. I get the display of the F4 help but I am not able to select the value .

Suggestions needed.

19 REPLIES 19

satyabrata_sahoo3
Contributor
0 Kudos

Hope you have set below in ALV fieldcatalog:


FIELDCATALOG-EDIT     = 'X'.

FIELDCATALOG-INPUT     = 'X'.

-Satya

0 Kudos

Hi Satyabrata,

YES I did, but even then it is not working.

-Gayatri

0 Kudos

Hi ,

We dont have the input in LVC_S_FCAT but edit is set to X before

0 Kudos

Can you share the code that you have for making the fields editable and assigning them the F4 help.

Seeing your code we might be able to help you.

0 Kudos

Hi Gaurav,

When I observed my final table I see that these two fields are not able to populate the selected values from the standard f4 we are displaying.  These two fields are my key fields.

l_pos = l_pos + 1.

   wa_fieldcat-col_pos = l_pos.

   wa_fieldcat-fieldname     = 'MATNR'.

   wa_fieldcat-ref_field     = 'MATNR'.

   wa_fieldcat-tabname       = 'LT_FINAL'.

   wa_fieldcat-ref_table     = 'MARA'.

   wa_fieldcat-key           = abap_true.

   wa_fieldcat-f4availabl    = abap_true.

   wa_fieldcat-domname       = 'MATNR'.

   wa_fieldcat-scrtext_l = wa_fieldcat-scrtext_m = wa_fieldcat-scrtext_s     = 'Article'.

   APPEND wa_fieldcat TO lt_fieldcat.

   CLEAR wa_fieldcat.

   l_pos = l_pos + 1.

   wa_fieldcat-col_pos = l_pos.

   wa_fieldcat-fieldname = 'LGORT'.

   wa_fieldcat-ref_field = 'LGORT'.

   wa_fieldcat-tabname   = 'LT_FINAL'.

   wa_fieldcat-ref_table = 'T001L'.

   wa_fieldcat-key           = abap_true.

   wa_fieldcat-f4availabl    = abap_true.

   wa_fieldcat-scrtext_l      = wa_fieldcat-scrtext_s = wa_fieldcat-scrtext_m    = 'S Loc'."Sloc

   APPEND wa_fieldcat TO lt_fieldcat.

   CLEAR wa_fieldcat.



but the fields which are editable and not the key fields I am able to select the value and it populates the value .

I need this as when I create a new entry in editable ALV then it should allow me even to select the values for the key fields too.




0 Kudos

check the following method of the GRID class CL_GUI_ALV_GRID (if you are using this class for ALV display).

REGISTER_F4_FOR_FIELDS

ONF4 events.

Hope this helps.

0 Kudos

Hi Gaurav,

Yes what you have mentioned is correct if I am creating my own F4 help but, I am using the standard F4 help which is attached with the domain. So I have not written any custom cod for the F4 help.

0 Kudos

Do not use:

wa_fieldcat-f4availabl    = abap_true.


This option is for custom search help. But apparently you want "standard" MATNR search help?

-- Tomas --

0 Kudos

yes i commented .

thank you.

0 Kudos

try using a celltab of type lvc_s_styl in your internal table and set the editable property in the internal table itself instead of Fieldcat.

DATA: lt_dfies   TYPE ddfields , " Used for the Table structure definition.

         ls_celltab TYPE lvc_s_styl.

   FIELD-SYMBOLS: <fs_dfies> LIKE LINE OF lt_dfies,

                  <fs_final> LIKE LINE OF gt_final.

   CALL FUNCTION 'DDIF_FIELDINFO_GET'

     EXPORTING

       tabname        = '/SAPAPO/PDEMCAT'

     TABLES

       dfies_tab      = lt_dfies

     EXCEPTIONS

       not_found      = 1

       internal_error = 2

       OTHERS         = 3.

   DATA: lv_cell TYPE c.

   CLEAR : gs_final,gs_outtab.

   LOOP AT gt_final ASSIGNING <fs_final>.

     CLEAR : <fs_final>-new.

     LOOP AT lt_dfies ASSIGNING <fs_dfies>.

       IF <fs_dfies>-keyflag = gc_true.

         ls_celltab-fieldname = <fs_dfies>-fieldname.

         ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

         INSERT ls_celltab INTO TABLE <fs_final>-celltab.

         CLEAR ls_celltab.

       ENDIF.

     ENDLOOP.

   ENDLOOP.


Hope this helps.

0 Kudos

Hi Gayatri,

Hope this may help you.

Pass Table name and Field name to your fieldcatlog.

  WA_FIELDCAT-REF_TABNAME = 'XXXXXX'   " Table Name (MARA)

  WA_FIELDCAT-REF_FIELDNAME = 'XXXXX'  "Field Name  (MATNR)


Thanks,

Pavan G.

asim_isik
Active Participant
0 Kudos

hi ,

i think you are using F4IF_INT_TABLE_VALUE_REQUEST function.

You must read return_tab index 1 and shoul give to the alv colum fieldval from return_tab and modify internal table.

0 Kudos

Hi Asim,

This I guess I need to use when I create a custom F4 help and create a custom event on F4 in definition and implementation.

But I am not creating any custom .It is the standard field matnr and has a standard search help MAT1 and also it is showing the values in the f4 but only thing is I am not able to select the value.

asim_isik
Active Participant
0 Kudos

Hİ Gayatri ,

then i guess you are using a wrong search help i mean only for displaying matnr. check the search help matnr should have tick in EXP(exporting).

0 Kudos

It does have

0 Kudos

Hi,

I need a clarification in your requirement.

1. do you need the value of Matnr and Lgort changed(which are not editable) based on the value selected in the editable field?

                              (OR)

2.You need the value of Matnr and Lgort (Non editable fields) value to be changed based on the value selected from F4?

0 Kudos

Hi Sundarmoorthy,

I have a user requirement which displays ALV  based on an Input criteria. This ALV should be a Editable ALV . So if there already existing records in the ALV then those should be in display mode and the one which they want to create a new record should have all the fields in editable mode including the key fields .

So for this I have matnr and lgort as key fields and i am not able to select the value from the F4 help for these fields.

in short the whole concept of SM30 like new entries, deletion, copy ... etc should be availed in this editable ALV.

0 Kudos

Hi everybody,

I am able to solve this by putting Edit  = 'X'.

But with this I have another problem where the existing records displayed in ALV are also in editable which is wrong and they have to be in non editable mode and the new entry only has to be in editable mode for the whole row.

0 Kudos

SO your alv was not editable actually all of us comment as it was editable

like this you made all column editable delete that edit = 'X' and add a field in your internal table.

stylerow type lvc_t_styl and use below code in your new added line.


gs_layout-stylefname = 'FSTYLE'.

clear ls_stylerow.

ls_stylerow-fieldname = 'MATNR' .

ls_stylerow-style     = cl_gui_alv_grid=>mc_style_enabled.

insert ls_stylerow into table gs_data-fstyle.