‎2007 May 25 9:08 AM
I want to enable the textboxes to enter values.
At the beginning they are only for output purpose, however I want them to be enabled to enter values in them if the user wants.
The screen has two pushbuttons, 'BACK' and 'EDIT'. The data is displayed as read only in textboxes. If the user just wants to see the data, he/she has the option to go back. However if they want to edit, I have put another button 'EDIT' and when it is clicked the textboxes should be writable.
How can I do that? Can I change the properties(which has been assigned at design time) of the textboxes at runtime.
Thank you very much.
Deniz.
‎2007 May 25 9:13 AM
check this program "demo_dynpro_modify_simple". this shows how you can enable the text on click of command.
krishna
‎2007 May 25 9:14 AM
Hi
U need to use LOOP AT SCREEN statament in PBO:
PROCESS PBO.
MODULE LOOP_SCREEN.
PROCESS PAI.
MODULE USER_COMMAND.
MODULE USER_COMMAND.
CASE OK_CODE.
WHEN 'EDIT'. FL_EDIT = 'X'.
........................................
ENDCASE.
ENDMODULE.
MODULE LOOP_SCREEN.
CHECK FL_EDIT = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = <FIELD NAME>
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.Anyway you have to change the attribute of that field because if RED-ONLY can't be changed at run time.
Max
‎2007 May 25 9:20 AM
Thank you max.
You have understood me.
I want to ask a new question to you. How can I handle context menu?
It is there, on properties form.
I have a class having on_context_menu method and implementation also it has.
But when I will use its function code I do not know.
Thanks.
Deniz.
‎2007 May 25 9:22 AM
hi,
in pbo module
loop at screen.
if screen-name = 'txtbox1'
screen-input = 0.
modify screen.
endif.
if screen-name = 'txtbox2'
screen-input = 0.
modify screen.
endif
endloop.
in pai event.
data: ok_code like sy-ucomm.
ok_code = sy-ucomm.
at line selection.
case ok_code.
when 'back'
loop at screen.
if screen-name = 'txtbox1'.
screen-input = 1.
modify screen.
endif.
if screen-name = 'txtbox2'.
screen-input = 1.
modify screen.
endif.
endloop.
when 'EDIT'.
loop at screen.
if screen-name = 'txtbox1'.
screen-input = 1.
modify screen.
endif.
if screen-name = 'txtbox2'.
screen-input = 1.
modify screen.
endif.
endloop.
if helpful reward some points.
with regards,
suresh babu aluri.