Application Development 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: 

Changing the Text of a Box at run time

Former Member
0 Kudos
784

Hi Gurus,

I have created a Screen which is having a Box.

The requirement is that the text of the box should change with the change in transaction.

Please suggest me how to change the Text of a Box at run time.

Thanks in Advance...

4 REPLIES 4

Former Member
0 Kudos
319

Set the value in the PBO routine.

0 Kudos
319

Thanks for the reply, I have the idea that I have to Set the value in PBO.

But if could you please elaborate on this because I know how to set the fields as

1.active

2.inactive

3.visible n invisible

but I dont know how to change the text content of a element at the run time.

Thanks once again.

0 Kudos
319

Hi Amit,

As of now it is not possible to change the Lables that are used as Keywords in the Runtime. They are always displayed in a fixed position in the screen.

So you can use any of the options.

1. You can copy the screen to a new screen and then change the screen elements i.e the text box. You need to call the screen according to your program logic from the calling program.

2. In the same screen declare 2 of more text box (screen elements) and then you can make them visible or invisible based on your program logic.The template code to achive the same is already there.

Thanks,

Samantak.

Rewards points for useful answers.

Former Member
0 Kudos
319

Hi Amit,

You can follow this approach.

In the global variables you can store the conditions for which you want to display the text in the text boxes. In the ABAP code define the variables that are same as the screen elements.Then assign the text to these elements depending upon the condition that is getting satisfied. Also you can loop the screen the elements you can accomplish the same.

Option 1.

Process Before Output.

Module Set_value.

Module Set_value.

if condition = value.

variable name = 'Text'.

endif.

Endmodule.

Option 2.

Loop at screen.

if screen-<element name> =

if condition = value.

endif.

endif.

Endloop.

Thanks,

Samantak.

Rewards points for useful answers.