cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Persona - Carry string value from one screen to another screen with concatenate

babowden
Explorer
0 Kudos
257

Hello,

Can someone help me? I would like to carry text string value to another text field, but before presenting it i would like to remove a certain number of characters from the beginning of the text. For example; text = "Number of Entries (without Filtering): 47:String" and i would like to remove "Number of Entries (without Filtering): " so that only the number (47 in this case) is displayed in my `dashboard` text field.

Many Thanks,

Ben

Accepted Solutions (0)

Answers (2)

Answers (2)

kmagons
Advisor
Advisor

Hi Ben,

SAP Screen Personas Scripting Engine uses JavaScript, hence, you can use the language string manipulation tools.

In your case, the number comes after the ": " so you can simply split the string in half and take the number part.

A simple example:

var sString = "Number of Entries (without Filtering): 47";

var sNumberPart = sString.split(": ")[1] // this will give you "47" of type String that you can use it further

Hope that helps!

Best regards,

Krists Magons

SAP Screen Personas Dev Team

babowden
Explorer

Hi Krists,

This has worked perfectly, thank you. All i need to do now is string a load of other transaction codes into the script to gather multiple results based on one searching criteria, I.e. work centre 🙂

Many Thanks,

Ben

Ritz
Active Contributor
0 Kudos

Benjamin Bowden,

you can easily use script to carry value from one field and make changes.

refer below link for basic info on scripts,

https://help.sap.com/viewer/20993a0c28654a26beb2b63b722d74f2/Current/en-US/8237dd539c11f76be10000000....

Thanks

RD