cancel
Showing results for 
Search instead for 
Did you mean: 

changing the value of the field in message

Former Member
0 Kudos

hi

i have a input message to XI like this

<records>

<data_records> 1 to unbound

field1

field2

field3

the target structure is as below

<records>

<data_records> 1 to unbound

field0

field1

field2

field3

the field0 will be a constant always but it will have one value in development system one in quality and another value in production. Now how do i achieve this. is there anything in the ID configuration that i can configure ( value mapping ) etc.,

thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member91687
Active Contributor
0 Kudos

Hi,

The mapping which you would need to do would need to be like mwntioned below.

GetSenderService-->FixValues-->Field0

GetSenderService is a udf which you will have to write to get the sender service, for example code you can refer help.sap.com

In FixValues maintain all the services corresponding to the dev,QA and Prod env as the key, the values will be the constant corresponding to Field0 which you want for each of the environments.

Thanks,

Chandra

Former Member
0 Kudos

hi

Fixvalues function does not help because i do not have the values until i move to corresponding environment ( quality.prod). what abot value mapping fucntionality. do u think that will help. i mean i can update this table with the correct value correaponding the current envitonment.

thanks

former_member91687
Active Contributor
0 Kudos

You will have to use value mapping replication in that case to update the values when available. This can be easily set up, but it would amount to having another interface to update the values. So it depends on how you want to design the interface.

Thanks,

Chandra

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

you can achive this functionality by this UDF aslo taking sender service as runtime constant.

java.util.Map param = container.getTransformationParameters();

String BS = (String) param.get (StreamTransformationConstants.SENDER_SERVICE);

if(BS.equals("DEV"))

return 1;

if(BS.equals("Q"))

return 2;

if(BS.equals("P"))

return 3;

Thank You,

Madhav

Note:Points If Useful

Former Member
0 Kudos

you can use a UDF in mapping of field0

String sysID = System.getProperty("SAPSYSTEMNAME");

if (sysID.equals("Dev")) // instead of Dev, ur systemID for dev box will come
         return "1";  // specify counter you want to for Dev box
else if (sysID.equals("Quality"))
         return "2";
else if (sysID.equals("Prod"))
         return "3";
else
return null;

So even if you transport it to various environment, you dont need to make changes

Former Member
0 Kudos

hi

thanks for your reply

lets say i do not have the values for quality and prod at the time of development. i mean i will get that value once i moved to quality and once i moved to production. basically i need to pass the transport request number which will vary from dev to quality to production . so i do not know this value until i go to quality /prod. how can achieve this

thanks

Shabarish_Nair
Active Contributor
0 Kudos

>

> hi

>

> thanks for your reply

>

> lets say i do not have the values for quality and prod at the time of development. i mean i will get that value once i moved to quality and once i moved to production. basically i need to pass the transport request number which will vary from dev to quality to production . so i do not know this value until i go to quality /prod. how can achieve this

>

> thanks

Use the code that Mugdha has provided. It will help identify what is the current environment of XI.

Now in your case you want to pass a transport request number in the mapping based on the XI environment.

Well how are you getting this transport number and how do you need to pass it?

In anycase you have to know what the QA and PRD env SID is during the Dev stage itself

Former Member
0 Kudos

hi sudhakar,

you can use file lookup/ RFC lookup for this where the mapping points to the RFC table and get the value from there at runtime. all you required to do is get the Transport request number and update the table.

Thank You,

Madhav

Note:Points If Useful

Former Member
0 Kudos

hi

this will be a one time maintenance. is there any way once i go into cons/prod i will update the TR number in anywhere in the ID and get those values in UDF.

thanks

former_member732072
Active Participant
0 Kudos

Good Morning Sudhakar,

If you are mapping the input structure to the Target structure, you can always a ssign a "Constant" value in Graphical mapping to that particular element .

That should solve the problem

Best regards

Former Member
0 Kudos

hi

i know the constant mapping. but my problem is the value of the constant changes in dev/quality/prod systems. so how do i account for that

former_member732072
Active Participant
0 Kudos

Hi Sudhakar,

How about writing a UDF (User Defined Function) for that element which will change value based on the system.

Have you thought about that possibility ?

Best Regards