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: 

The first row should be editable in a table control

Former Member
0 Kudos

Hi Everyone,

I have a requirement for a screen, where we have a table control and we allow only a column to be in editable mode.

Now we dont require the entire coulmn to be on editable or input mode, we require only the first entry(latest entry) to be in ediatble mode. Rest should be in display mode.

Can we accomplish this.

Regards,

Raj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can try this way. In the module inside the LOOP...ENDLOOP of the table control in the PBO, firstly initialize the table control lines like this



if gt_itab[] is INITIAL.
 tabcontrol-lines = 1.  "So here, you have just one editable line in the table control. The rest are geryed out
endif.

What you can do later is have a button that acts on the table control say an ADD button. On click of this ADD button, the next row(or in your case only the first column) will become editable. Write this in the PAI of the module outside the LOOP...ENDLOOP



if OK_CODE eq 'F_ADD'.
tabcontrol-lines = tabcontrol-lines + 1.
endif.

3 REPLIES 3

Former Member
0 Kudos

Hi,

try this way..



PROCESS BEFORE OUTPUT.
* Module screen GUI-Screen&Status and Screen Logic
  MODULE status_1020.

* Table control for OUTPUT
  LOOP AT t_zcxref_classes INTO wa_zcxref_classes
       WITH CONTROL tc_batch .
    MODULE charac_classname_out.
  ENDLOOP.


MODULE charac_classname_out OUTPUT.

* Table control reading values from input screen & displaying on screen
  READ TABLE t_zcxref_classes INTO wa_zcxref_classes
                            INDEX tc_batch-current_line.

* Logic for screen Display when Required Flag = 'D'
  IF tc_batch-current_line = 1.   
    LOOP AT SCREEN.
      IF screen-name = 'WA_ZCXREF_CLASSES-ATWRT'.  "Pass the field name in the table control to make disply
        screen-input = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

ENDMODULE.                 " CHARAC_CLASSNAME_OUT  OUTPUT


Prabhuda

Former Member
0 Kudos

Hi,

You can try this way. In the module inside the LOOP...ENDLOOP of the table control in the PBO, firstly initialize the table control lines like this



if gt_itab[] is INITIAL.
 tabcontrol-lines = 1.  "So here, you have just one editable line in the table control. The rest are geryed out
endif.

What you can do later is have a button that acts on the table control say an ADD button. On click of this ADD button, the next row(or in your case only the first column) will become editable. Write this in the PAI of the module outside the LOOP...ENDLOOP



if OK_CODE eq 'F_ADD'.
tabcontrol-lines = tabcontrol-lines + 1.
endif.

0 Kudos

This message was moderated.