cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping logic

Former Member
0 Kudos

Hi,

I want to implement a scenario like File1-XI-webservices-XI-File2 scenario.

(asynchornous-synchornous-asynchornous scenario).

File1 will have only field 'Material Name'. webservices on the target side take the 'Material Name' as input and return 'Vendor Name'.

I want to implement a logic at XI as follows.

1)Whenever the 'Vendor name' returned from webservice is 'XYZ paints',I have to populate the

fields of File2 with some pre-determined Rate,Paint grade,Paint quantity to be ordered.

2)whenever the 'Vendor name' returned from webservice is 'ABC paints,I have to populate the

fields of FIle2 with some other Pre-determinced Rate,Paint Grade and Paint quantity to be

ordered.

Questions:

How to achieve the above logic at XI.Is it possible to use some standard functions available at mapping.Do I need to implement the Logic at BPM?Can it be done at mapping

level?

Regards,

Alex.M.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am not sure the "IF else" construct will help you if you have long list of values or if the vlaues are to be dynamic in nature. If at run time you are to get some vlaues against the fixed values coming in from your file then why can't you use "Value Mapping" functionality. Maintain a Table in XI with all the values and then call and read it at run time.

A simple Situation : You provide Employee Number (coming from WebService) and for this EMpNo from the Value Mapping Table you can derive information like dt of Joining or divitons etc (derived at run time) and pass it to Target.

Hope I got ur requirement corrrect and this solution helps

Former Member
0 Kudos

Hi,

Try to use Fixed value mapping concept or Value mapping table concept. Which will avoid writing java code.

Former Member
0 Kudos

Hi Ranchana,

I will try FixValue and Value Table mapping .

Please give some example/blog on Valuetable ?

Regards,

Alex.M

Former Member
0 Kudos

Hi,

Please check The below Blog.

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5479. [original link is broken] [original link is broken] [original link is broken]

Answers (3)

Answers (3)

prateek
Active Contributor
0 Kudos

Three options

1. Use BPM. Async Sync Bridge

Receive - Send sync - Send Async

2. Without BPM

This should be the ideal choice

3. File to File using Webservice lookup

/people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function

But in ur case, mutiple lookup calls would be required wich may make it inefficient.

In all the cases the logic will reside in mapping only

In mapping, use if condition. And then map the fields to constants based on if condition.

Regards,

Prateek

Former Member
0 Kudos

Hi Alex,

you can achieve this without BPM also,

you just need to decide one thing, how are you going to bring the pre decided values in XI??

If you are going to hard code those values in File 2 then, just use a simple 'if -- then -- else' construct in the response of the webservice and hard code the values.

Let me know if you need more help.

Thanks,

Varun

Former Member
0 Kudos

Hi Varun,

I am passing the pre-defined values as constants based upon the response received.For Example,if Reponse is 'XYZ Paints",then I will pass the pre-defined values 100,A,10 to file2.I may use If without else.

If you have some idea,please let me know.

Regards,

Alex.M

Former Member
0 Kudos

Hello,

i think it's necessary to use the bpm for that scenario.

The mapping could be done with message mapping.

Is your vendor name always one of your two possibilites (in that case you could use if-then-else) or could it have another (third) value.

Regards

Patrick

Former Member
0 Kudos

Hello,

maybe the easiest way for your mapping is to use the function 'FixValues' in message mapping. You map 'vendor name' to all of your target fields and put a 'FixValues' between them.

Regards

Patrick

Former Member
0 Kudos

Only two possibilities available.

Regards,

Alex.M

Former Member
0 Kudos

Hi ,

Please explain more on this 'FixValues' functionality and also the solution you have provided.

Regards,

Alex.M

Former Member
0 Kudos

Hello,

if i got your scenario right you have one source field and more than one target fields.

Your target fields should get a value in dependency of your (one) source value.

If it's like that you can map your source value to all of your target values.

For example:

source -> FixValues -> target1

source -> FixValues -> target2

...

Double click on FixValues opens a table. In this table you can write your values.

For example:

XYZ paints | 100 (this will be your target value)

ABC paints | 200 (this will be your target value)

Regards

Patrick

Former Member
0 Kudos

Hi,

Thanks .Could you please give some example which explains fix value functioanlity in detail?

Regards,

Alex.M.

Former Member
0 Kudos

Hello,

here it is all explained:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb...

(Fix value mapping is on page 76)

Regards

Patrick