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

Dynamic Text for a push button

Former Member
0 Likes
1,563

Hi all,

I have a screen which has a push button with some text 'XXXXX'.

Now if I click on the push button,the text in the push button has to change to 'YYYYY'.

Kindly provide some code or a step by step procedure for this.

Thanks in advance.

Regards,

Kashyap

1 ACCEPTED SOLUTION
Read only

Former Member
952

Use this code

data:CLICK(10) type c(This si name of pushbuton.).

call screen 9000.

MODULE STATUS_9000 OUTPUT.

IF CLICK IS INITIAL.

CLICK = 'CLICK'.

endif.

ENDMODULE.

MODULE USER_COMMAND_9000 INPUT.

CLICK = 'CLICKED'.

endmodule.

7 REPLIES 7
Read only

Former Member
0 Likes
952

Hi Kashyap,

If you design the input/output fields in reference to dictionary fields, you should have the F4 help automatically.

If you need to go to screen by pressing the pushbutton:

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN <.....>. LEAVE TO SCREEN <NEW SCREEN>.

or,

When you enter the details in the input screen and press the push button,inorder to navigate to the output screen, you need to write a code for this in a PAI module of the input screen.The code for this would be.

case SY-UCOMM.

when 'DISPLAY'.

call screen 100. *** 100 is the screen number of the output screen***

endcase.

Are the input fields fetched from standard tables?

kindly reward if found helpful.

cheers,

Hema.

Read only

Former Member
0 Likes
952

Hi Hema,

Thanks for the quick reply.

But my quesion is to change the text on the push button dynamically.

For example,

If the text on the push button is 'click'.

After clicking the push button, the text on the same push button has to be changed to 'clicked'.

Regards,

Kashyap Ivaturi

Read only

0 Likes
952

Hi,

Try this code,

TABLES sscrfields.

SELECTION-SCREEN PUSHBUTTON /10(20) charly USER-COMMAND abcd.

INITIALIZATION.

MOVE 'My text' TO charly.

AT SELECTION-SCREEN.

IF sscrfields-ucomm = 'ABCD'.

MOVE 'New Text' TO charly.

ENDIF.

Regards,

Niyaz

Read only

0 Likes
952

Hi Niyaz,

Thanks for the reply.

This code is working fine for a push button in selection screen.

Actually I have created a push button in a screeen in SE51 and I am calling the screen in my report program.

So I need to change the text of the push button in that screen.

Kindly help me out in this issue.

Regards,

Kashyap

Read only

Former Member
0 Likes
952

Hi,

try this..

In pbo.

if ok-code = 'push'.

loop at screen.

screen-name = ' name of push button in capital letters(XXXX)'.

screen-name = 'YYYY'.

modify screen.

endif.

endloop.

Read only

Former Member
0 Likes
952
Read only

Former Member
953

Use this code

data:CLICK(10) type c(This si name of pushbuton.).

call screen 9000.

MODULE STATUS_9000 OUTPUT.

IF CLICK IS INITIAL.

CLICK = 'CLICK'.

endif.

ENDMODULE.

MODULE USER_COMMAND_9000 INPUT.

CLICK = 'CLICKED'.

endmodule.