‎2009 Feb 19 1:50 PM
Hi,
In my table control there are say 5 rows...now user will select only row then automatically the other 4 which user has not selected should be Grayed out.....how to do it....
I have tried with the loop at screen syntax in PBO and also the Cols-screen syntax....
these both are not working ...plz suggest any other method ...Help me out in this...
regards,
Rohan.
‎2009 Feb 19 2:30 PM
Hi
it_zekpo is my internal table w/o header line,
wa_zekpo is work area.
Name of input/output fields on screen are:-
wa_zekpo-field1,
wa_zekpo-field2, and so on...
Add a field as flag(1) type c in the internal table and work area
And keep a name of SELCOL in the attributes of table control as wa_zekpo-flag
Take the group1 for all textboxes as 'ABC' in the table control
Try using code:-
At screen logic:
PROCESS BEFORE OUTPUT.
* MODULE status_8003.
LOOP WITH CONTROL po_tb.
MODULE read_data.
ENDLOOP.
PROCESS AFTER INPUT.
* MODULE user_command_8003.
LOOP WITH CONTROL po_tb.
MODULE modify_data.
ENDLOOP.
In PBO
*&---------------------------------------------------------------------*
*& Module READ_DATA OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
data : line_count type i.
describe it_zekpo
lines line_count.
po_tb-lines = line_count + 10.
"to increase the number of lines in table control dynamically
if wa-zekpo-flag = 'X'.
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 1. "enable
screen-active = 1.
endloop.
modify screen.
endif.
else.
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 0. "disable
screen-active = 0.
endloop.
modify screen.
endif.
endif.
ENDMODULE. " READ_DATA OUTPUT
In PAI
*&---------------------------------------------------------------------*
*& Module MODIFY_DATA INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
"this will modify the contents of existing line
ENDMODULE. " MODIFY_DATA INPUT
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
‎2009 Feb 19 2:00 PM
Hi,
In the PAI:
get the value of the selected row using sy-stepl into a variable.
Inside Loop the table control.(Either in PBO or PAI)
Use condition:
If sy-stepl ne <Selected row>.
Loop at screen.
Modify screen.
endloop.
endif.
Hope this resolves your issue.
Regards,
Gurpreet
‎2009 Feb 19 2:16 PM
Hi,
not working please guide me with a code if possible..
Regards,
Rohan.
‎2009 Feb 19 2:01 PM
‎2009 Feb 19 2:30 PM
Hi
it_zekpo is my internal table w/o header line,
wa_zekpo is work area.
Name of input/output fields on screen are:-
wa_zekpo-field1,
wa_zekpo-field2, and so on...
Add a field as flag(1) type c in the internal table and work area
And keep a name of SELCOL in the attributes of table control as wa_zekpo-flag
Take the group1 for all textboxes as 'ABC' in the table control
Try using code:-
At screen logic:
PROCESS BEFORE OUTPUT.
* MODULE status_8003.
LOOP WITH CONTROL po_tb.
MODULE read_data.
ENDLOOP.
PROCESS AFTER INPUT.
* MODULE user_command_8003.
LOOP WITH CONTROL po_tb.
MODULE modify_data.
ENDLOOP.
In PBO
*&---------------------------------------------------------------------*
*& Module READ_DATA OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
data : line_count type i.
describe it_zekpo
lines line_count.
po_tb-lines = line_count + 10.
"to increase the number of lines in table control dynamically
if wa-zekpo-flag = 'X'.
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 1. "enable
screen-active = 1.
endloop.
modify screen.
endif.
else.
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 0. "disable
screen-active = 0.
endloop.
modify screen.
endif.
endif.
ENDMODULE. " READ_DATA OUTPUT
In PAI
*&---------------------------------------------------------------------*
*& Module MODIFY_DATA INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
"this will modify the contents of existing line
ENDMODULE. " MODIFY_DATA INPUT
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
‎2009 Feb 20 11:41 AM
HI,
None of the above logics are working.
any more syntaxes...
Regards,
Rohan
‎2009 Feb 20 11:53 AM
Hi Rowan,
I am not giving the exact code.But you can try following logic.
Loop at itab with control tc.
if itab-sel ne 'X'.
loop at screen.
if ( screen-fieldname = 'ABC' or screen-fieldname = 'PQR' ) . -
> all field names in table control
screen-active = '0'.
endif.
modify screen.
endloop.
endloop.
Hope it will help you.
Regards,
Anil Salekar