2007 Jan 15 11:36 AM
Hi ,
In table control , Few cells have to be displayed Change mode and few cells in display mode ( Just like Conditions tab table control in Sales order ).
How can code for this senario . Could you please provide me the Solution for this ?
Thanks
Srinivas
2007 Jan 15 11:54 AM
hi this depends on PBO event where u set your records to editable or uneditable format, check the solution here
https://forums.sdn.sap.com/click.jspa?searchID=736686&messageID=1794330
just add another field say FIELD1(6) to your internal table, set this to ON or OFF according to ur requirement
PROCESS PBO.
LOOP AT ....
MODULE LOOP_SCREEN.
ENDLOOP.
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF SCREEN-NAME = 'FIELD1'.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDLOOP.
In this sample the field of colunm FIELD1 will be avaible for input if the value of ITAB-FIELD1 is ON.
If you delete the control of field name (so the cell) the attribute'll be valide for whole row:
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
In this way the row with field FIELD1 is OFF aren't available for input.
award points if found helpful, this solves the problem
Hi ,
In table control , Few cells have to be displayed Change mode and few cells in display mode ( Just like Conditions tab table control in Sales order ).
How can code for this senario . Could you please provide me the Solution for this ?
Thanks
Srinivas
2007 Jan 15 11:54 AM
hi this depends on PBO event where u set your records to editable or uneditable format, check the solution here
https://forums.sdn.sap.com/click.jspa?searchID=736686&messageID=1794330
just add another field say FIELD1(6) to your internal table, set this to ON or OFF according to ur requirement
PROCESS PBO.
LOOP AT ....
MODULE LOOP_SCREEN.
ENDLOOP.
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF SCREEN-NAME = 'FIELD1'.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDLOOP.
In this sample the field of colunm FIELD1 will be avaible for input if the value of ITAB-FIELD1 is ON.
If you delete the control of field name (so the cell) the attribute'll be valide for whole row:
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
In this way the row with field FIELD1 is OFF aren't available for input.
award points if found helpful, this solves the problem
2007 Jan 15 12:12 PM
Yeah this is possible and this we can do when we the same table control has to behave differently for some conditions .
For this based on the input set the condition like GV_flag = 'X'. This will be done in the pai of that module .
Now once the flag is set the in PBO make the table control behave with the Screen groups which u can define for the elements in the field attributes
You need to make use of the<b> screen groups</b> very well in this regard.
so based on condition we can make the table control display or change for the same .
Just a pseudo code for demo .
IF GV_FLAG = 'X'.
IF SCREEN-NAME = 'ITAB-XXX1' AND ITAB-XXX2 = 'CN2'.
SCREEN-INPUT = 1.
ELSE.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.ENDIF.
(or)
IF <b>SCREEN-group1</b> = '0001' or SCREEN-group1 = '0002'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
Screen-input / screen-active /screen-visible } make use of this .
regards,
vijay
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |