cancel
Showing results for 
Search instead for 
Did you mean: 

I want to make only certain rows editable in table control.

kavmp
Participant
0 Kudos
388

I have a table control in my custom abap program where I have 7 columns. I want to achieve the below layout for input/output disabled/enabled where green is input allowed and red is input disabled. I have searched google and sap community for solutions and tried out many but nothing seems to be working.

Based on column 7, I am trying to make the row editable/disabled. If it is true, then input disabled. If it is false then input enabled. And by default, a new row will have column 7 as false. I tried to put my code inside a module within the Loop itab with table control in my PBO, but that doesn't seem to be working. 

kavmp_0-1726048394765.png

Please help with this. It is quite urgent.

Thanks in advance!!

 

Sandra_Rossi
Active Contributor

People never answer more quickly if you say it's urgent, they answer when they can.

kavmp
Participant
0 Kudos
Yes, But I was just hoping someone would. When they can. Thanks.
kavmp
Participant
0 Kudos
Hi,
View Entire Topic
raymond_giuseppi
Active Contributor
0 Kudos

 

What exactly have you coded in the PBO logic?

  • Paste your relevant code, it should be some LOOP AT SCREEN / MODIFY SCREEN within a LOOP WITH CONTROL in PROCESS BEFORE OUTPUT logic.
kavmp
Participant
0 Kudos

FIELD-SYMBOLS: <lfs_cntrl> TYPE scxtab_column.

  LOOP AT sch_chain-cols ASSIGNING <lfs_cntrl>.
    IF <lfs_cntrl>-screen-name EQ 'GW_CHAIN_JOB-JOBNAME' OR <lfs_cntrl>-screen-name EQ 'GW_CHAIN_JOB-START_TIME' OR
      gw_chain_job-scheduled EQ gc_schedule .
      <lfs_cntrl>-screen-input 1.
    ELSEIF gw_chain_job-scheduled EQ gc_scheduled.
      <lfs_cntrl>-screen-input 0.
      ENDIF.
  ENDLOOP.

sch_chain is my table control and scheduled is my column 7 flag

The above code is within my PBO loop with table control 

raymond_giuseppi
Active Contributor
0 Kudos
Try to replace LOOP AT sch_chain-cols with a direct LOOP AT SCREEN
kavmp
Participant
0 Kudos
i tried loop at screen as well. But it is changing the input/output for all the rows no matter what the flag is