Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

When clicked on button

Former Member
0 Likes
511

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.

4 REPLIES 4
Read only

Former Member
0 Likes
493

check this program "demo_dynpro_modify_simple". this shows how you can enable the text on click of command.

krishna

Read only

Former Member
0 Likes
493

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

Read only

0 Likes
493

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.

Read only

Former Member
0 Likes
493

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.