Entering content frameProcedure documentation Defining Dynamic Function Texts Locate the document in its SAP Library structure

If you want a menu entry or a function to have a variable text at runtime, you can define dynamic texts. To do this, you must define a field in your ABAP program that will contain the required text at runtime.

When you define the text, use the structure SMP_DYNTEXT.

For example:

DATA: TEXT_1 LIKE SMP_DYNTXT,

TEXT_2 LIKE SMP_DYNTXT.

 

Procedure

  1. Place the cursor on an empty function line.
  2. Choose Edit ® Insert ® Func.with dyn. text.
  3. The Insert Function with Dynamic Text dialog appears.

  4. Enter a function code
  5. Choose Continue.
  6. The Enter function text dialog box appears.

  7. Enter a program or ABAP Dictionary field name.
  8. Choose Continue.

The system display the field in <> (brackets) as follows:

This graphic is explained in the accompanying text

 

Note

For information about how to create a dynamic text for a menu, see Defining dynamic menu texts

Changing Function Texts

You can change static function texts to dynamic ones, and vice versa. To change a static text into a dynamic text:

  1. Double-click the function that you want to change.
  2. The Function Attributes dialog box appears.

  3. Choose Change text type.
  4. Enter the name of the program or ABAP Dictionary field in the Field name field.
  5. Choose Continue.

The system display the dynamic text in brackets <>.

Note

Since the field name you specify to store the function name can be up to 132 bytes long (as on the screen), the system can not always display the field in its full length. You can change the field name by double-clicking the function or menu name.

 

 

 

Leaving content frame