2023 May 24 5:03 AM
Hi,
EDIT: Thanks all for the code correction. Actual problem was , i was modifying Screen after LOOP AT ITAB in PBO as well. Commenting it out solved the problem.
I am trying to disable a specific cell in one row only of a table control.
I've tried using table-cols and specific cell, but it disables all cells in the field.
Can someone please guide me for the same.
Tried following code:
PBO
LOOP AT IT_LINEITEM
INTO WA_LINEITEM
WITH CONTROL TCNR
CURSOR TCNR-CURRENT_LINE.
MODULE TCNR_GET_LINES.
MODULE DISABLE_DOCUMENT_QUANTITY.
ENDLOOP.
MODULE - CORRECTED CODE
MODULE DISABLE_DOCUMENT_QUANTITY OUTPUT.
* CORRECTED CODE
IF WA_LINEITEM-DCNUMBER NE ''.
LOOP AT SCREEN.
IF SCREEN-NAME = 'WA_LINEITEM-QUANTITY' .
SCREEN-INPUT = '0'.
SCREEN-INTENSIFIED = '1'.
MODIFY-SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
Please note that this is a dynamically populated table control.
Only possibility, i think of is dynamically giving a name to specific cell and then disable it.
2023 May 24 6:13 AM
in your PBO logic code, you must have a LOOP, WITH CONTROL
In this loop call some module
2023 May 24 6:13 AM
in your PBO logic code, you must have a LOOP, WITH CONTROL
In this loop call some module
2023 May 24 7:36 AM
2023 May 24 7:45 AM
Yes, the code is in PBO, module. but it disables full field , not just one cell.
I've also updated the question with PBO code.
2023 May 24 8:52 AM
dukejib5 In SCREEN-NAME, don't indicate the temporary ABAP variable, indicate the field name from your DYNPRO.
Wrong:
IF SCREEN-NAME = WA_LINEITEM-QUANTITY .
Correct:
IF SCREEN-NAME = 'XXXXXXX-XXXXXX' . " <=== must be the SCREEN FIELD NAME
2023 May 24 11:30 AM
temporary variable is working fine. however i changed it to your corrected version.
Still, unable to disable the specific cell in row.
as raymond.giuseppi suggested, i tried to add the below code, but it is raising error.
loop at itab
into wtab
with tablecontrol.
loop at screen.
moduel modify-row.
endloop.
endloop.
2023 May 24 12:01 PM
2023 May 24 7:51 AM
As stated in the answers, make sure that the 'loop at screen' syntax is called in PBO inside the 'loop ... with table control'.
If you change the screen property outside of the table control loop, it will modify all of the row of specified column / fieldname.
2023 May 24 8:23 AM
Is this what you are saying?
loop at itab
into wtab
with tablecontrol.
loop at screen.
moduel modify-row.
endloop.
endloop.
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}.L0S31 {
font-style: italic;
color: #808080;
}.L0S52 {
color: #0000FF;
}.L0S55 {
color: #800080;
}.L0S70 {
color: #8080
But this is raising error of "invalid nesting of loop"
2023 May 24 10:45 AM
Upon taking a closer look on your original code, the issue is because you wrote the syntax incorrectly hence the TRUE condition will never occur.
should be:
IF SCREEN-NAME = 'WA_LINEITEM-QUANTITY'.
logically speaking, if you use the workarea without quote, it will check the value INSIDE the variable, not the variable name itself.
And, if you only need to disable certain rows instead of all rows, do add some additional logic along with the fieldname check.
2023 May 24 6:10 PM
Thanks for the resolution feedback (in the head of your question). You may close your question now (Actions > Close).