cancel
Showing results for 
Search instead for 
Did you mean: 

Edit Fields

Former Member
0 Kudos
91

Hi, how can i set some fields to edit in my alv, using 'REUSE_ALV_GRID_DISPLAY'??

the structure slis_specialcol_alv is only for set the collor??

thanks

Alexandre Nogueira .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Do you mean to say,edit few cells in one column??

Former Member
0 Kudos

Yes, it's exactly what I want to do.

edit few cells in one column.

Alexandre Nogueira

Former Member
0 Kudos

Hi Alex,

My suggestion is.Display the report first & then use USER_COMMAND to go to the change mode of that field & update the report.

Former Member
0 Kudos

Hi Vijay,

I can't use OO, because I have to change a program that is already done, so I want to set SOME CELLS, not ALL THE COLUMN, to edit mode, but using 'REUSE_ALV_GRID_DISPLAY'.

thanks,

Alexandre Nogueira.

former_member188685
Active Contributor
0 Kudos

Hi Alex

I have solution for you...

You need to Do few Steps...

1. Create An additional field in your final Internal Table.

<b>HANDLE_STYLE TYPE LVC_T_STYL.</b>

2. In layout

<b> GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.</b>

<b>3.populate field catalog</b>

4.Before Calling Method do this

i will give you some explanation

here i am setting a flag based on some data, for that data i am making the cells disable to edit.

  
DATA: LS_EDIT TYPE LVC_S_STYL,
        LT_EDIT TYPE LVC_T_STYL.
LOOP AT IT_FINAL INTO LS_OUTTAB WHERE FLAG = 'X'.
    V_INDEX = SY-TABIX.
    LS_EDIT-FIELDNAME = 'MATNR'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    LS_EDIT-FIELDNAME = 'POSNR'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
    MODIFY IT_FINAL INDEX V_INDEX FROM LS_OUTTAB  TRANSPORTING
                                      HANDLE_STYLE DROP_DOWN_HANDLE.
    MODIFY IT_FINAL_TMP INDEX V_INDEX FROM LS_OUTTAB  TRANSPORTING
                                     HANDLE_STYLE DROP_DOWN_HANDLE.
  ENDLOOP

.

then call the method set table for first display...

former_member188685
Active Contributor
0 Kudos

SOrry Alex.. i thought you are In need of OO alv grid.

Former Member
0 Kudos

thanks vijay, this way I already knew, I would like to do it with 'REUSE_ALV_GRID_DISPLAY'.

Alexandre Nogueira.

Former Member
0 Kudos

Ok guys,

After read all these answers, I figured out that there is no way to implement it with the FUNCTION, only OO.

Thanks a lot.

Alexandre Nogueira

former_member188685
Active Contributor
0 Kudos

Hi ALex I am trying it for you Using ALV GRID..

Former Member
0 Kudos

Thanks Vijay,

now I'm changing the program to OO mode, I guess it's easier than find I solution to use the function.

Alexandre Nogueira

former_member188685
Active Contributor
0 Kudos

Hi ALex ,

If you Need any help in converting Please let me know..

regards

vijay

Answers (4)

Answers (4)

Former Member
0 Kudos

Yes...Just pass this parameter for the colume you want to edit.

Former Member
0 Kudos

Hi

In the field catalog set attribute EDIT = 'X'.

for e.g.

LOOP AT it_fieldcat_src INTO wa_fieldcat.

CASE wa_fieldcat-fieldname.

WHEN 'XXXXXX'.

wa_fieldcat-col_pos = '1'.

wa_fieldcat-outputlen = '11'.

wa_fieldcat-seltext_l = text-009.

wa_fieldcat-edit = 'X'.

ENDCASE.

MODIFY it_fieldcat_src FROM wa_fieldcat INDEX sy-tabix.

ENDLOOP.

Regards

Kalpana

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

This might help.

Regards,

Rich Heilman

Former Member
0 Kudos

it's goog, but it will set all my collumn to edit mode, I want it only in some cells.

I know how to do it only using the OO alv, but no with the function 'REUSE_ALV_GRID.....'

Former Member
0 Kudos

Hi,

Use the structure SLIS_LAYOUT_ALV & the fiedl name is EDIT.

Former Member
0 Kudos

Hi,

USe the structure SLIS_T_FIELDCAT_ALV & ignore my previous answer.Field name is same.

Sorry about that.

Former Member
0 Kudos

it's goog, but it will set all my collumn to edit mode, I want it only in some cells.

I know how to do it only using the OO alv, but no with the function 'REUSE_ALV_GRID.....'

Alexandre Nogueira

former_member188685
Active Contributor
0 Kudos
Hi ALex
do it in fieldcat.....
  X_FIELDCAT-SCRTEXT_M = 'MATNR'(023).
  X_FIELDCAT-FIELDNAME = 'MATNR'.
  X_FIELDCAT-TABNAME = 'IT_FINAL'.
  X_FIELDCAT-COL_POS    = L_POS.
  X_FIELDCAT-OUTPUTLEN = '10'.
  X_FIELDCAT-EDIT = 'X'.

<b>  CALL METHOD G_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
      IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
      IS_VARIANT           = LS_VARI
      I_SAVE               = 'A'
      IS_LAYOUT            = GS_LAYOUT1
    CHANGING
      IT_FIELDCATALOG      = IT_FIELDCAT1
      IT_OUTTAB            = IT_VEKP1[].
after call method you need to call this method..
** Set editable cells to ready for input initially
  CALL METHOD G_GRID1->SET_READY_FOR_INPUT
    EXPORTING
      I_READY_FOR_INPUT = 1.</b>