cancel
Showing results for 
Search instead for 
Did you mean: 

Text-fields in SAP Personas

Former Member
0 Kudos

Hello,

I have a requirement where in i need to create/ display a customer using XD01/XD03  tcode. I have a few text-boxes in my personas flavor where i need to pass the madatory fields, but my requirement is that while creating/displaying a customer the initials should start with initials "ZF" and i need to default these two characters(*ZF) in my text-field where i am entering customer number so that user creates all the customers starting with *ZF.

How do i do it using Personas and its properties ?Kindly help.

Regards,

Roshan.

Accepted Solutions (0)

Answers (1)

Answers (1)

Carifaine
Active Participant
0 Kudos

Hi Roshan,

i hope i got it right: You want to force the user to create customers starting with ZF*?

There are two ways at least i guess. First possible thing to do is to manipulate the "text" property and put "ZF*" as default value.

The other way would be to add a skript button that checks the entered value via javascript. If the user didn't add "ZF" at the beginning, you can add it via script and go on in the process.

Did i get you right?

Regards,

Christoph

Former Member
0 Kudos

Hi Christoph,

Thanks Christoph.

Yes you got it right what exactly my requirement demands.

I had tried with the first way of manipulating the text property and putting a ZF* as default value,But that section in properties where we default our values was grayed-out, i.e I couldn't enter any value in that section.

-Can you help me out why am i getting grayed out section and how probably can i edit the property section in the above scenario ?

Probably the second will be a good option for me but my requirement demands that when flavor is selected the text-field should have an initial ZF* pre-populated.So 2nd solution won't be feasible in my requirement.

Regards,

Roshan.

Carifaine
Active Participant
0 Kudos

Hi Roshan,

my properties aren't greyed out. Please make sure that you focus the right control.

You could still go the second way. If you implement a script that fills in "ZF" in the customer field when it's empty and performes a check and correction when the field is filled, you can put that script button id in the "OnCreateHandler" of the user area as you can see here:

The script gets executed when transaction loads, so the customer field will be prefilled and you can still performe the check with the same script button.

A possible script could look like this, just test around which if option you need to make it prefill the customer field:

From 1 to 7 its:

IF <customer field id> is empty.

     Insert value "ZF"        <- this is what you want on load

IF <customer field id> is not empty

     Refresh display

     Copy value from <customer field id> to customer

     Calculate in javascript  <- check if ZF is at the beginning. if not, concatenate it

     Copy value "customer" to <customer field id>

Maybe this is a good option for you.

Regards,

Christoph

Former Member
0 Kudos

Hi Christoph,

Thanks a ton for your help...!

I followed with the script methodology and things are working good in my requirement.

Regards,

Roshan.

Carifaine
Active Participant
0 Kudos

Hi Roshan,

i'm happy to hear that

Regards,

Christoph