cancel
Showing results for 
Search instead for 
Did you mean: 

Global constants used in all components?

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I'm facing the following problem: I'm mapping a constant value in a lot of different mapings (and different SWC too). Now the requirement is to replace this constant value for another and there is no way to find where is this constant value used to replace all the constants.

Can you help me to solve this?

There is a way to define a global variable visible through all the ESR SWC to prevent me to face this problem again?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think that, in order to prevent this problem, you must save these constants in an Z abap table and pickup its value thought an abap mapping or a RFC lookup

Regards,

Carme.

Marçal_Oliveras
Active Contributor
0 Kudos

Thank you Carme, I've thought this solution already and I think it must be a better solution.

I'm thinking in create a "Value mapping for constants"... In the mapping I introduce the name of the value mapping constant to get the value then... But I'm not sure if this is a good solution

Former Member
0 Kudos

Hi,

How many constant values are you using in message mapping-- R u planning to replace only one constant value in mapping???

U can use option of graphical variable have a look at this blog...

/people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable

Again it all depends upon how many constant values u r using??

Options available are:-

1. RFC lookup.

2. Value mapping group.

3. Fixed value mapping.

there are options available but based on above inputs design will change...

chirag

Edited by: Chirag Gohil on Feb 15, 2011 4:56 PM

Former Member
0 Kudos

That is okay, but then we need to transport table entries across the systems too right.. Good if we had a way to globally define some header file as we could do in C, old VB6 etc.. early days.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

In PI 7.1 another way is to create a function library in a separate SWCV. In this function library you can put the strings as constants and you can even create more than one function library depending on the constants that you want. Then you need to define a dependency in the SLD between this new SWCV and all the others where you want to use the constants.

In this way, you will always use the function library (and implicitly the constants) from a single place.

Regards,

Horia

Marçal_Oliveras
Active Contributor
0 Kudos

Ok, thank you very much to all of you.

There isn't a perfect option but now I will decide which is better for me with all the options that you shared.

stefan_grube
Active Contributor
0 Kudos

> I'm facing the following problem: I'm mapping a constant value in a lot of different mapings (and different SWC too). Now the requirement is to replace this constant value for another and there is no way to find where is this constant value used to replace all the constants.

You are right. There is no way to find the use of a constant with a specific value.

> There is a way to define a global variable visible through all the ESR SWC to prevent me to face this problem again?

In PI 7.1 you can use global funtions. For a constant define a function with no parameters. There is just one line: return "constant";