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: 
Read only

Editable Alv

Former Member
0 Likes
896

Hi all,

I am having a problem that in editable alv that when i save the data in the newly added row and if the data entered in the new row in not right then the fields of the new row become uneditable so what should i do to makes these fields editable again.

regards,

arpit.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
850

Hi Arpit,

In your fieldcatlog insert this line,

wa_fieldcat-TABNAME = 'TAB_NAME'.

APPEND wa_fieldcat to TO it_fieldcat.

Try this.....Hope it helps you,

Regards,

Abhijit G. Borkar

8 REPLIES 8
Read only

Former Member
0 Likes
850

Is it a editable ALV or table control? because in editable ALV this problem genrally does not occurs.

But if it is a table control then this can be sorted out using CHAIN..ENDCHAIN.

Read only

Former Member
0 Likes
851

Hi Arpit,

In your fieldcatlog insert this line,

wa_fieldcat-TABNAME = 'TAB_NAME'.

APPEND wa_fieldcat to TO it_fieldcat.

Try this.....Hope it helps you,

Regards,

Abhijit G. Borkar

Read only

0 Likes
850

I inserted this in my wa_fieldcat-TABNAME = 'TAB_NAME' fieldcatalog but it didnt help .

Read only

0 Likes
850

Hi Arpit,

Are you changing the property of the cell from editable -


> Non-Editable somewhere in the program.

if yes then put a break-point there and check the property of the cell.

Let me know the result.

Regards,

Abhijit G. Borkar

Read only

0 Likes
850

Hi Arpit,

I suppose you are following the same as i had asked you in the previous discussion,

now when and error is encountered just change your cell property again to Editable .

Use the following logic to achieve the result,

if error eq 'X' .

l_mode = cl_gui_alv_grid=>mc_style_enabled. "l_mode changed

else. "p_mode eq 'RO'

l_mode = cl_gui_alv_grid=>mc_style_disabled.

endif.

and then pass L_MODE to the CELLTAB as follows,

ls_celltab-fieldname = 'MATNR'.

ls_celltab-style = l_mode. "l_mode passed

INSERT ls_celltab into table p_lt_celltab.

Hope it helps you,

Regards,

Abhijit G. Borkar

Read only

0 Likes
850

thanks abhijit it worked..

Read only

jyotheswar_p2
Active Participant
0 Likes
850

Hi

I dont think its possible for one particular row but it is possibel for a particualr coloumn.

If you are using the OO ABAP to dispaly these then in the PAI event based on the condition You have change the make the fieldcat field EDIT = ' ' and modify the fieldcat. So whenever the user ENTER incorrect value in that the entire coloumn will be remain uneditable.

Get back to me if you face any problems.

Thanks & Regards

Jyo

Read only

Former Member
0 Likes
850

Dear Arpit

please find the below code which may useful for u

REPORT  ZSURI_ALV_EDITALV.
TABLES: VBAK, VBAP.
TYPE-POOLS: SLIS, ICON.
DATA: BEGIN OF ITAB OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      ERDAT LIKE VBAK-ERDAT,
      END OF ITAB.
DATA: BEGIN OF JTAB OCCURS 0,
      VBELN LIKE VBAP-VBELN,
      MATNR LIKE VBAP-MATNR,
      KWMENG LIKE VBAP-KWMENG,
      END OF JTAB.
DATA: TB_FCAT TYPE SLIS_T_FIELDCAT_ALV,
      WA_FCAT LIKE LINE OF TB_FCAT,
      WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
      TB_EVENT TYPE SLIS_T_EVENT,
      WA_EVENT LIKE LINE OF TB_EVENT,
      TB_HEADER TYPE SLIS_T_LISTHEADER,
      WA_HEADER LIKE LINE OF TB_HEADER,
      WA_KEYINFO TYPE SLIS_KEYINFO_ALV.

CLEAR WA_FCAT.
WA_FCAT-ROW_POS = '1'.
WA_FCAT-COL_POS = '1'.
WA_FCAT-REF_TABNAME = 'VBAK'.
WA_FCAT-FIELDNAME = 'VBELN'.
WA_FCAT-EDIT = 'X'.
WA_FCAT-SELTEXT_M = 'DOCUMENT'.
APPEND WA_FCAT TO TB_FCAT.

CLEAR WA_FCAT.
WA_FCAT-ROW_POS = '1'.
WA_FCAT-COL_POS = '2'.
WA_FCAT-REF_TABNAME = 'VBAK'.
WA_FCAT-FIELDNAME = 'ERDAT'.
WA_FCAT-SELTEXT_M = 'DATE'.
APPEND WA_FCAT TO TB_FCAT.
CASE SY-UCOMM.
  WHEN 'VBELN'.
    WA_FCAT-SELTEXT_M = 'SURENDRA'.
    MODIFY TB_FCAT FROM WA_FCAT.
ENDCASE.
SELECT VBELN ERDAT FROM VBAK INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 15 ROWS.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
   I_CALLBACK_PROGRAM                = SY-REPID
   IS_LAYOUT                         = WA_LAYOUT
   IT_FIELDCAT                       = TB_FCAT
 TABLES
    T_OUTTAB                          = ITAB.

Thanks

Surendra P