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

Change Screen Lables dynamically

former_member181966
Active Contributor
0 Likes
1,680

HI

I want to change screen labels dynamically based on my sales area/Plant ... how can I achieve this task, what are steps I have to take to change the screen labels dynamically?

Please give your input/suggestion.

Thanks

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,429

On a selection screen, or a dynpro?

Regards,

Rich Heilman

10 REPLIES 10
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,430

On a selection screen, or a dynpro?

Regards,

Rich Heilman

Read only

0 Likes
1,429

On dynpro......

Thanks

Read only

0 Likes
1,429

When creating a label, enter a name for it. Lets say for example, call it LABEL1. Now create a variable in your program called LABEL1.

Data: label1(20) type c.

Of course you must set this value somewhere in your program. Most likely you will set it in the PBO of the screen.

I believe that you must make the field "Output Only" in the screen painter.

Regards,

Rich Heilman

Read only

0 Likes
1,429

Labels are already there.. Like when I’ll create in screen VA01 (Sales order) after giving all required fields the sales order screen will come up . It already have labels like "Document Date" "P.O reference" "Plant" say I want to change those labels to my own labels .. How I can do this?

Thanks in advanced...

Read only

0 Likes
1,429

Ok, I'm testing it, i was wrong. You will need to create an input, mark it as "Output Only". Again you need a variable in your program, LABEL1, move the value to the field in PBO.




report  zrich_0001.

data: label1(20) type c.


start-of-selection.

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

label1 = 'This is the label'.


endmodule.                 " STATUS_0100  OUTPUT


REgards,

Rich Heilman

Read only

0 Likes
1,429

Oh, ok. Then you will need to "hack" the standard SAP screen. You will need to register the object to get an access key. Then you will be able to change the values of the labels as you need to. This will be a static change though. To do this dynamically, you would have to do simular to the above post, but since this is a standard SAP transaction, there will be some work involved. Not sure that its worth it.

REgards,

Rich Heilman

Read only

0 Likes
1,429

May be I explain it a little wrong, I want to change "Filed TEXT" Dynamically based upon my plant and Sale organization...

Read only

0 Likes
1,429

Yep, you want to change the label beside a field, right? These are defined statically in the screen at design time. In order to make it dynamic you will have to replace the labels with "Output Only" input fields and in the PBO of the screen fill the values accordingly. Again, since we are talking about a standard SAP screen, this is not so easy to do. Some of the subscreens in VA01 are built dynaically though. I don't think yours is. To check, find out the screen number and go to SE51 to look at the screen. If you can see the field labels there, then they are statically defined.

Regards,

Rich Heilman

Read only

0 Likes
1,429

Thanks and I’ll try and definitely award you point ..

Thanks again ...

Read only

0 Likes
1,429

I wonder if you could use some of the SD user exits in Sales Order processing.

MV45AOZZ is for custom PBO routines.

MV45AIZZ is for custom PAI routines.

They are meant for the screen user exits (Additional Data tabs at the header and item level). They might get called for each screen. Because they are the "older style" of user exits, you still need a access key. However, SAP considers changes to these programs as enhancements, not modifications.

Same applies for USEREXIT_FIELD_MODIFICATION in MV45AFZZ. This is called for every screen in SD order processing. With a CASE statement against SCREEN-NAME and a check for the dynpro number, you might be able to manipulate the label values. If I had access to a system, I would check... but I don't right now.

Many of the labels reference the labels for the data elements in the data dictionary, so these userexits may not be able to over ride the values.