cancel
Showing results for 
Search instead for 
Did you mean: 

Message mapping problem

Former Member
0 Kudos

Hello Experts,

I have an issue in the message mapping step. In my source record, there are some values as per each field but my problem is that I want to pass only those field values which are getting change.

for ex:

I have one record as:

EMP Id:100

Name: XXX

City:YYY

Sal:20000

first time when I mapped these values in the message mapping then all the values will be passed in the target structure but in the next time If i change the sal from 20000 to 30000 then my record will be as:

EMP Id:100

Name: XXX

City:YYY

Sal:30000

But this time, I want to pass the change values only (sal:30000) along with one unique field (say for ex EMP ID this time) in the target structure.

Now this time, the target structure should be:

EMP Id:100

Sal:30000

and the unchanged value should be ignored.

Is it possible by UDF or any other solution in message mapping?

Any solution will be highly appreciated?

TNR,

Saurabh...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Saurabh Kumar Sahu,

I think you try this with Value mapping.where can assign the value for the unquie field .so that it will lookup........

If you follow the below mentioned link which is very well explained about the Value mapping with screenshots....

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf...

Thanks

Sai

PS: kindly reward points if helpful

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Saurabh

i think Its difficult (not feasible as it effects performance) to store data in XI to check the repetition of data. either u can check it on sender side or at receiver.

you can store data in XI also but its of no use to maintain another record at middleware just to check repetition. and it will effect performance.

Rather you check at sender / receiver side.

Regards

Raj

Former Member
0 Kudos

Hi Saurabh,

1) Yes it is possible by UDF only.

2) U have to use Global database in message mapping --> Edit java section.

3) Define parameters here Write one UDF to check whether data is changed or not. According to it u can display or block the data.

Regards,

Rohit.

Reward points if helpful.

Former Member
0 Kudos

Hi Saurabh,

you have to use the GlobalContainerElement and use it in UDF.

Here are code samples:

1) Initialize

String globalParameterObject = new String("");
container.getGlobalContainer ().setParameter ("myObject",globalParameterObject);

2) Concatenate String to GlobalContainerElement; Importparameter of UDF is the field myfield

String global = (String) container.getGlobalContainer().getParameter ("myObject");
if(myfield.length()!=0)
global = global + myfield.substring(0, 1) ;
	container.getGlobalContainer ().setParameter ("myObject",global);
return feld;

--> This is what you can use. Cast the String to Integer an add the values

3) How to return the GCO

return (String) container.getGlobalContainer().getParameter ("myObject");

Regards Mario

Former Member
0 Kudos

Hello Mario,

Thanks for your prompt reply.

Could you please explain a bit more on your reply?

How to use this Global Container?

TNR,

Saurabh...

Former Member