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 button text in dynpro

Former Member
0 Likes
1,400

i have a dynpro containing a tabstrip control

i would make the tab title sequence dynamic

as the tab title are pushbutton i have thought to make the pushbutton text dynamic

how can i do it?

i'm sure it's possible to do it in selection screen

thanks!!

bye

Davide

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
912

Hi Davide,

I think you should declare every tab of the tabstrip with text "_________", and then, at the PBO, write "tabs1 = 'Title1'", and so on (tabs1, tabs2... are the names of the tabs in your tabstrip control).

At least I made it in the selection screen of a report.

I hope it helps. BR,

Alvaro

6 REPLIES 6
Read only

Former Member
0 Likes
913

Hi Davide,

I think you should declare every tab of the tabstrip with text "_________", and then, at the PBO, write "tabs1 = 'Title1'", and so on (tabs1, tabs2... are the names of the tabs in your tabstrip control).

At least I made it in the selection screen of a report.

I hope it helps. BR,

Alvaro

Read only

0 Likes
912

unfortunatly it's impossible to set the text template for a dynpro elemnt as "___" (space)

and anyway i cannot call the dynpro element in a module unless i declare it in some way in the top include

at the moment i'm looking for a usefull declaration

thanks anyway for help

bye

Davide

Read only

0 Likes
912

I am assuming you are using Module programming. If so, when you are doing :


LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'XYZ'.
SCREEN-NAME = 'ABC'.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.

there is a particular characteristic called Name. Modify the name in PBO in the above loop.

Never had the need to do it, but seems like this will work. Let us know.

Regards,

Subramanian v.

Read only

0 Likes
912

unfortunatly screen-name is the name of the dynpro element

i have already hecked all the structure screen but there isn't a field that contains the dynpro element text

thanks anyway for the help

bye

Davide

Read only

0 Likes
912

In screen painter, make sure that you check the box for "output only" for the tabstrip text fields. In your program, define them as character 30 and fill the variables. It will work, did for me.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

Message was edited by: Rich Heilman

Read only

0 Likes
912

Ok..here is my example. Most of the code was generated by screen painter via the tabstrip control wizard. Create screen 100, use the tabstrip control wizard to create your tabstrip, name it TABSTRIP. Double click on the tab text elements, rename them TABSTRIP_TEXT1 and TABSTRIP_TEXT2 for the tab text elements, make sure that the output only check box is checked.



REPORT ZRICH_0003 .

data: TABSTRIP_TEXT1(30) type c,
      TABSTRIP_TEXT2(30) type c.

start-of-selection.

call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module STATUS_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

* Fill the tabstrip text elements here!
TABSTRIP_TEXT1 = 'Text 1'.
TABSTRIP_TEXT2 = 'Text 2'.

endmodule.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.

endmodule.                 " USER_COMMAND_0100  INPUT

* FUNCTION CODES FOR TABSTRIP 'TABSTRIP'
CONSTANTS: BEGIN OF C_TABSTRIP,
             TAB1 LIKE SY-UCOMM VALUE 'TABSTRIP_FC1',
             TAB2 LIKE SY-UCOMM VALUE 'TABSTRIP_FC2',
           END OF C_TABSTRIP.
* DATA FOR TABSTRIP 'TABSTRIP'
CONTROLS:  TABSTRIP TYPE TABSTRIP.
DATA:      BEGIN OF G_TABSTRIP,
             SUBSCREEN   LIKE SY-DYNNR,
             PROG        LIKE SY-REPID VALUE 'ZRICH_0003',
             PRESSED_TAB LIKE SY-UCOMM VALUE C_TABSTRIP-TAB1,
           END OF G_TABSTRIP.
DATA:      OK_CODE LIKE SY-UCOMM.

* OUTPUT MODULE FOR TABSTRIP 'TABSTRIP': SETS ACTIVE TAB
MODULE TABSTRIP_ACTIVE_TAB_SET OUTPUT.
  TABSTRIP-ACTIVETAB = G_TABSTRIP-PRESSED_TAB.
  CASE G_TABSTRIP-PRESSED_TAB.
    WHEN C_TABSTRIP-TAB1.
      G_TABSTRIP-SUBSCREEN = '0101'.
    WHEN C_TABSTRIP-TAB2.
      G_TABSTRIP-SUBSCREEN = '0102'.
    WHEN OTHERS.
*      DO NOTHING
  ENDCASE.
ENDMODULE.

* INPUT MODULE FOR TABSTRIP 'TABSTRIP': GETS ACTIVE TAB
MODULE TABSTRIP_ACTIVE_TAB_GET INPUT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN C_TABSTRIP-TAB1.
      G_TABSTRIP-PRESSED_TAB = C_TABSTRIP-TAB1.
    WHEN C_TABSTRIP-TAB2.
      G_TABSTRIP-PRESSED_TAB = C_TABSTRIP-TAB2.
    WHEN OTHERS.
*      DO NOTHING
  ENDCASE.
ENDMODULE.

Screen Flow is ....



PROCESS BEFORE OUTPUT.
* PBO FLOW LOGIC FOR TABSTRIP 'TABSTRIP'
  MODULE TABSTRIP_ACTIVE_TAB_SET.
  CALL SUBSCREEN TABSTRIP_SCA
    INCLUDING G_TABSTRIP-PROG G_TABSTRIP-SUBSCREEN.
 MODULE STATUS_0100.

PROCESS AFTER INPUT.
* PAI FLOW LOGIC FOR TABSTRIP 'TABSTRIP'
  CALL SUBSCREEN TABSTRIP_SCA.
  MODULE TABSTRIP_ACTIVE_TAB_GET.
 MODULE USER_COMMAND_0100.

Regards,

Rich Heilman