Dynamic Icon/Text for PF Status button

light111How to set dynamic icon, text to the screen PF status button


The post describes how to dynamically set the button icon, text in the pf status of a dynpro(screen).

Create a program and create a screen.

1

It is a normal screen.

2

The PBO module is implemented to call the PF status and set in this screen.

3

Give the pf status name and double click on it to create.

4

Choose Dialog status.

5

In the application toolbar  provide the fcode  as- ZADD and double click on it to create the button. Select as static text.

6

Provide the function text and icon nae.

7

The button is having static text.

9

Activate the pf status and activate the program and execute the program. Here we can see the static button appears.

10


Let’s add another fcode to the pf status but this time choose Dynamic Text.

11

The below popup appears to select a field (with particular structure ) that is defined in the program. Do a F4 against the field name.

12

Choose Program field.

13

In the program we have not yet defined any field. So the search failed.

14

Do a F1 against the field and the help doc shows, in the program we have to define a data variable that refers to the dictionary structure SMP_DYNTXT.

15


Dictionary structure- SMP_DYNTXT which contains necessary components that helps to dynamically set the icon, text, info.

16

In program define a DATA that refers to the structure- SMP_DYNTXT.

17

Now add the fcode and select dynamic text and the field refers to the program variable that refers to dictionary structure SMP_DYNTXT

18

Here just a function code is set that refers to the properties of the program field- gv_btn_byn_txt to set the properties of the button.

19

Activate the PF Status and execute the program. Only static button appears.

20‘In the program set the field values and execute the program and the button now appears in the program application toolbar with properties set in the program via coding.

21

There could be program conditions where the button FCODE remain same but the icon id, text to be set differently. In such a case this could be helpful.


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s