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: 

How to change the text of a tabstrip?

Former Member
0 Kudos

Hallo Experts,

There are 3 tabstrips in Screen Painter with the name tabstrip1, tabstrip2 and tabstrip3. The default text ist: customer_fields1, customer fields2, customer fields3.

Now I want to change the text of tabstrips in real time. E.g. text of tabstrip1 should be "Financial Data".

How can I do it?

Thanks,

Rujing

11 REPLIES 11

sitakant_tripathy2
Active Participant
0 Kudos

Hi Rujing,

Please follow these steps:

1) Create a structure as follows:

BEGIN OF GS_TABSTRIP,

TAB01 type char20

TAB02 type char20

TAB03 type char20

END OF GS_TABSTRIP.

2) Name the Tabs of the tabstrip on the screen as GS_TABSTRIP-TAB01, GS_TABSTRIP-TAB02, GS_TABSTRIP-TAB03

3) Now in the runtime you can assign any values to these variables and they will be displayed on the screen...

Regards,

Sitakant

0 Kudos

The name tabstrips is already defined in screen paiter. It should not be changed.

Former Member
0 Kudos

Hi.

Just call SE51 and edit the dynpro, double-click on tab header and check the "output" box, note the tab field name.

In your PBO or before, fill this field with your text.

Hope this helps.

0 Kudos

but where is this output box?

Former Member
0 Kudos

Hi!

Tabstrips in SAP standard programs/dynpros cannot be changed, only after registering the modifications at the SAP's homepage (using SSCR keys).

Which program/dypro would you like to change?

If you wanted to modify a Z-program dynpro's tabstrip, then you have to do the followings:

- use SE80, give program here

- choose the dynpro on the left side and double click on it to open the dynpro

- click on the Layout button

- in a popup the screen painter will appear

- double click on the tab's text

- an another popup will appear, here you can set the attributes of the field (Text, etc...)

Regards

Tamá

Former Member
0 Kudos

After reading again your tpoic, seems some misunderstanding here...

Do you want to change the text dynmically at runtime, based on some conditions?

Thanx

Tamá

0 Kudos

Yes. We have a program based on SAP.

now there are a tabstrip with several taps. Now we offer a badi to customer. Customer should be able to change the text of the tap over this badi.

but I don't know how I can change the text of the tap in runtime.

thanks.

0 Kudos

Well, I've tried out some possible solutions, but none of the worked, I could not change the text dynamically during runtime.

You have some alternate solutions: create more tabs, and show hide them during runtime. For this you can use the dynpro's PBO event, and within the LOOP AT SCREEN... ENDLOOP. statements.

And an another one (that's absolutely not an elegant soluton

- create a DDIC structure (in SE11 transaction), with a field, like ZMYSTRUCTURE-ZMYFIELD. This field should refer to a data element, like ZMYDATAELEMENT. Here you can set a default text for this data element.

- assign this ZMYSTRUCTURE-ZMYFIELD field to the name of your tabstip's tab.

- when you wanted to change the text, you have to change the text, you update the text of your data element ZMYDATAELEMENT, in the table DD04T.

This might work... I'm not sure about it, but you might give it a shot.

Regards

Tamá

0 Kudos

Hi Rujing,

I guess you did not look at my solution in detail...this is the same solution that Tamas is suggesting..

Let me know one thing ...are you trying to change the Tabstrip Text of a SAP Standard Program..If that is the case then it might not be possible till the time SAP has used a variable for naming the Tabstrip and SAP has given an exit for you to change that variable if at all provided......

Furthermore, if you are trying to build your own tabstrip and want tot change the text in runtime then simply saying you will have to create variables and assign these variable as name of the tabstrip...this is what I suggested in my previous post...

@Tamas: this is what you are also suggesting...instead of creating varaibles you want the variables to be created in the DDIC which would actually be an unnecessary development overhead...

Regards,

Sitakant...

0 Kudos

Hi Sitakant,

I have tried with your solution, but somhow I didn't get it.

I am not trying to change the tap text of a tapstrip in SAP Standard, but in a product with based on SAP. In this product exists a tabstrip with 5 taps through previous development. Now I've added another 3 taps additional to the previous 5 taps in Screen Painter.

My question is how to change the text of the 3 new taps runtime e.g. througth BAdI?

thank you for further help,

regards,

Rujing

0 Kudos

I have solved this problem - how to change the tab text in a tabstrip runtime?

e.g. There is a tabstrip with the name "G_TABSTRIPS", and in this tabstrip is "G_TAB1", "G_TAB2", "G_TAB3" as taps defined. Now the text of "G_TAB2" is to be change in runtime.

1. at first the tab should be in Screen Painter defined as "output field".

2. then define the tab "G_TAB2"as a global variable in Dynpro

data: g_tab2(40) type char.

3. write coding in PBO

g_tab2 = 'GERMANY'.

4. run program

now the wished text 'GERMANY' will be shown in the second tab.

Regards,

Rujing