on 2024 Sep 11 10:58 AM
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.
Please help with this. It is quite urgent.
Thanks in advance!!
Hi, Thanks for the replies. I have found a solution for this. What worked it looping at the screen for each condition separately and modifying screen. So essentially, instead of using a single 'loop at screen' and modifying all my required columns in that, I used three different 'loop at screen' blocks and gave an if inside each of those for each of my columns.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Basics to make the Table Control cells with input enabled or disabled varying according to each line. Adapt to your needs.
Flow logic:
PROCESS BEFORE OUTPUT.
LOOP AT itab INTO line WITH CONTROL yourcontrol.
MODULE pbo_one_line.
ENDLOOP.
ABAP code:
MODULE pbo_one_line OUTPUT.
LOOP AT SCREEN INTO DATA(screen_field).
CASE screen_field-name.
WHEN 'COL3'.
IF line-col7 = 'TRUE'.
screen_field-input = '0'. "input disabled.
ELSE.
screen_field-input = '1'. "input enabled.
ENDIF.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE.
Paste your whole PBO and the whole code of the module with "loop at screen".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What exactly have you coded in the PBO logic?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.