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

MAKING ONE CELL EDITABLE IN TABLE CONTROL

Former Member
0 Likes
2,769

HI EXPERTS ,

HOW TO MAKE THE SELECTED CELL EDITABLE IN TABLE CONTROL?PLZ REPLY.

SIVAKUMAR A.

HI EXPERTS ,

HOW TO MAKE THE SELECTED CELL EDITABLE IN TABLE CONTROL?PLZ REPLY.

SIVAKUMAR A.

4 REPLIES 4
Read only

Noorie
Active Participant
0 Likes
1,224

Hi,

In P.B.O

LOOP AT IT_GI2 WITH CONTROL TC2_GI.

MODULE MODIFY_SCREEN.

ENDLOOP.

write on what condition u want to make one cell editible.

for example

MODULE MODIFY_SCREEN OUTPUT.

SELECT SINGLE * FROM MARA WHERE MATNR = IT_GI2-MATNR

AND MTART NE 'MCHF'

AND XCHPF = 'X'.

IF SY-SUBRC = 0.

LOOP AT SCREEN.

IF SCREEN-NAME = 'IT_GI2-CHARG'.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*ENDIF.

ENDMODULE.

Read only

deepak_dhamat
Active Contributor
0 Likes
1,224

HI,

IN PBO call module and write condition based on requirement .

in this case field qty having value 0 remains editable .

LOOP AT SCREEN.

IF ( screen-name = 'IT_QTY-QTY1' AND it_qty-qty1 = 0 ) OR ( screen-name = 'IT_QTY-QTY2' AND it_qty-qty2 = 0 )

OR ( screen-name = 'IT_QTY-QTY3' AND it_qty-qty3 = 0 ) OR ( screen-name = 'IT_QTY-QTY4' AND it_qty-qty4 = 0 )

OR ( screen-name = 'IT_QTY-QTY5' AND it_qty-qty5 = 0 ) OR ( screen-name = 'IT_QTY-QTY6' AND it_qty-qty6 = 0 )

OR ( screen-name = 'IT_QTY-QTY7' AND it_qty-qty7 = 0 ) OR ( screen-name = 'IT_QTY-QTY8' AND it_qty-qty8 = 0 ).

  • AND ed_flg = 'Y'.

screen-input = 1.

MODIFY SCREEN.

  • ed_flg = 'N'.

ENDIF.

ENDLOOP.

Regards

Deepak.

Read only

anand_govardhan
Active Participant
0 Likes
1,224

Hi Sivakumar,

To make certain fields as editable and some as non-editable, you can follow any one of the below two approaches:-

1. Either while designing the module pool screen keep those textbox fields as output only which need not be edited and rest textbox fields as input & output both.

2. If you want enable/disable input for textbox fields while execution, then while designing the screen, the textbox fields which need to be non-editable define the group1 as ABC for those fields. Now, In PBO of the screen, write code:-


loop at screen.
  if ( screen-group1 = 'ABC' ).
    screen-input = 0. "disable textbox for input
    screen-active = 0.
  endif.
  modify screen.
endloop.

loop at screen.
  if ( screen-group1 = 'ABC' ).
    screen-input = 1. "enable textbox for input
    screen-active = 1.
  endif.
  modify screen.
endloop.

The number of lines in table control depends on the size of table control on screen.

If number of lines in table control are same as the number of records in the internal table, then to insert a new row when user clicks INSERT button, then use code:-


case sy-ucomm.
  when 'INSERT'.
    tab_ctrl-lines = tab_ctrl-lines + 1. "to insert a new line into table control tab_ctrl
    loop at screen.
      if ( screen-group1 = 'ABC' ).
        screen-input = 1. "enable textbox for input
        screen-active = 1.
      endif.
      modify screen.
    endloop.
endcase.

It is not possible to enable only one row when you click INSERT button, rather it will enable the all fields for all lines in table control.

We can only enable/disable columns in a table control.

So, if you want not to show the existing records when you click INSERT button then use a new table control to insert new records.

Regards,

Anand

Read only

Former Member
0 Likes
1,224

Moderator message - Please do not use all caps, ask basic questions or post in the wrong forum. Thread locked Rob