cancel
Showing results for 
Search instead for 
Did you mean: 

XI Mapping

rahul_kharya
Participant
0 Kudos

Hi All,

I have two fields in BW(Material and Currency). Earlier I had both the fields coming from Source System. Now only material is coming from the source system. So in message mapping,I was trying to apply conditions to the material, but I couldn’t.

What I need to do is,

If the length of the material is 5, then currency must be assigned a constant value as pieces. If the length is 7, then currency must be assigned a constant value as boxes.

please help me out.

How do i achieve this?

Regards

rahul

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

you can do it with standard mapping functions:

length - to check the legth of your material

if - to check if it has 5 or 7

if 5 then PCE if 7 then BOX

or you can just use length function (on the material element) and connect it with a simple function like this:

if (a.equals("5")

return "PCE";

else if (a.equals("7")

return "box";

else

return "ERR";

which will give you your values

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Message was edited by: Michal Krawczyk

rahul_kharya
Participant
0 Kudos

Hi Michal,

How do i associate this function with length function?

Regards

rahul

MichalKrawczyk
Active Contributor
0 Kudos

hi,

create a simple user defined function with the code

then in your message mapping connect:

material - length - simple function - your destination unit of measure

you can find length in text functions

Regards,

michal

Shabarish_Nair
Active Contributor
0 Kudos

As mike said use the length function ....

a.length() wud return its length then from there on apply the logic to assign the string as you require.

REF:http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#length()

Former Member
0 Kudos

Hi

get the material as input to ur userdefined function which will defined as parameter 'a' in ur fuction

then use java code

if(a.length=5)

{

then

{


perform the function

}

}

Answers (0)