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

Dynamically changing the text on a screen

Former Member
0 Likes
1,274

Hello,

The requirement is to dynamically change the text of a text-element on a screen . I know that we can change the characteristics like visibility, input, output etc - of a element thro' the screen structure but do not know how to change the text displayed. I know that I need to do this in the PBO module but how is where I need help. How do you change the text displayed on the screen dynamically ?

Thanks,

Anu

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
997

Instead of using a "text elemnt" use an input field, make it output only. This will look like a "text element" but will allow you to fill it at run-time.

Regards,

Rich Heilman

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
998

Instead of using a "text elemnt" use an input field, make it output only. This will look like a "text element" but will allow you to fill it at run-time.

Regards,

Rich Heilman

Read only

0 Likes
997

Hi,

I have no idea about changing the text element dynamically.

But you can refresh the screen by the following sample coding.

You can accomplish this with a RFC enabled Function module.

1. Create a function module. The only functionality will be to wait for 10 secs.

2. Create a subroutine which will set a user-command.

3. and at user-command call the function module.

Below is the code, I found on the web. It is quite simple..

DATA: ZNUM LIKE SY-TABIX.

: GET TIME.

: WRITE: /01 'Update Number:', ZNUM, SY-UZEIT.

: CALL FUNCTION 'Z_WAIT_30_SECS'

: STARTING NEW TASK 'IF'

: PERFORMING START_REFRESH ON END OF TASK.

: AT USER-COMMAND.

: IF SY-UCOMM = 'REFR'.

: SY-LSIND = SY-LSIND - 1.

: ADD 1 TO ZNUM.

: GET TIME.

: WRITE: /01 'Update Number:', ZNUM, SY-UZEIT.

: CALL FUNCTION 'Z_WAIT_30_SECS'

: STARTING NEW TASK 'IF'

: PERFORMING START_REFRESH ON END OF TASK.

: ENDIF.

: *----


: */ Program Subroutines

: *----


: FORM START_REFRESH USING TASKNAME.

: *----


: *

: SET USER-COMMAND 'REFR'.

: ENDFORM. "

: FUNCTION Z_WAIT_30_SECS.

: *"----


: ""Local interface:

: *"----


: DATA: ZTIME LIKE SY-UZEIT.

: GET TIME.

: ZTIME = SY-UZEIT + 30.

: DO.

: GET TIME.

: IF SY-UZEIT >= ZTIME.

: EXIT.

: ENDIF.

: ENDDO.

: ENDFUNCTION.

Hope this helps.

Regards,

J.Jayanthi

Read only

0 Likes
997

Design them as labels on the same position, display only one at a time on screen (Depending on a condition).

Rgds,

Manohar

Read only

0 Likes
997

Thanks Rich. You sent me down the right direction.

I will try the other options suggested later. I logged in yesterday and saw Rich's response and went back to work on it thinking -'Duh!' Did not see the other options. Will try them now.

Anu