10-17-2008 2:28 PM
Hi All,
I have a requirement wherein i need to display 2 screen navigation.
The first screen contain selection parameters and based on that selection parameters data get displayed in second screen. The second screen contain table control wherein i have displayed fields from custom table.
The requirement is that if internal table is not initial then data should be displayed on table contol in display mode. The table control contain one selection field. When user select one of line on table control then table control must be changed from display mode to change mode and allow user to change existing data .
Now problem is i am unable to change table control from display mode to change mode.
plz help me out.
Thanks & regards,
Parag
10-17-2008 9:21 PM
Hi Parag, you can change the atribute of a table control using Loop at screen, also you can add words to the fiels to control the behavior or filter by the fields names.
LOOP AT SCREEN.
IF screen-group1 = 'CRE'
OR screen-group2 = 'CHG'.
screen-input = 1.
IF screen-group3 = 'REQ'.
screen-required = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Very important here, this have to be include in the PBO into the table control loop.
PBO
LOOP AT t_itab
WITH CONTROL tc_XXXX
CURSOR tc_XXXX-current_line.
MODULE tc_status. " here you include the code above
ENDLOOP.
Regards
Alexis
10-17-2008 2:43 PM
Hi Parag,
Put one FCT code for the table line and use the following code may help you..
In PBO
CASE SY-UCOMM.
WHEN 'CODE'. "FCT code
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZORMA-YIAMN'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZORMA-YIAMQ'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZORMA-YIAME'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDCASE.
In PAI
CASE SY-UCOMM.
WHEN 'CODE'. "FCT code
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZORMA-YIAMN'. "field which has to
SCREEN-INPUT = 1.
SCREEN-ACTIVE = 1.
SCREEN-OUTPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZORMA-YIAMQ'. "field which has to
SCREEN-INPUT = 1.
SCREEN-ACTIVE = 1.
SCREEN-OUTPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZORMA-YIAME'. "field which has to
SCREEN-INPUT = 1.
SCREEN-ACTIVE = 1.
SCREEN-OUTPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endcase.
Try this logic else revert me back i will try to help you coding with some other.
Cheers!!
10-17-2008 9:21 PM
Hi Parag, you can change the atribute of a table control using Loop at screen, also you can add words to the fiels to control the behavior or filter by the fields names.
LOOP AT SCREEN.
IF screen-group1 = 'CRE'
OR screen-group2 = 'CHG'.
screen-input = 1.
IF screen-group3 = 'REQ'.
screen-required = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Very important here, this have to be include in the PBO into the table control loop.
PBO
LOOP AT t_itab
WITH CONTROL tc_XXXX
CURSOR tc_XXXX-current_line.
MODULE tc_status. " here you include the code above
ENDLOOP.
Regards
Alexis
10-21-2008 5:53 AM
hi,
Create a group which contains all your fields in table control
which you want to enable. For creating group, go to screen layout, double click on any field and mention the group name in first box, let say 'G1'. similarly mention the same group name 'G1' for every field in table control.
Now in PBO create a module , let say 'Activate' and put this code inside it.
module activate.
IF < YOUR CONDITION >
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'G1'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.