cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping

Former Member
0 Kudos

HI Experts,

I am new to SAP PI topic and here I have a mapping requirement in one of the SAP PI development interfaces. and here i am not sure which function should i use to get the desired result. if this is not possible from graphical tool, then what is the best option.

Mappings

1) - 123456789(source) -- 123-45-6789(target)

2) code ( source)----


Check, if A1 = A2 , then C1 C2 D1 D2 D3 D4 = G12, E1 E2 = H26, F1 = M12

Thanks In advance,

Best Regards,

Kiran

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kiran,

What are ABCD..are the values?

Do you need condition check and depending upon which you are populating..

If yes, its possible through graphical mapping.

Use function "If without else"

source node---->

If without else----> Target node

Condition----->

I hope you dont have any else conditon..

Regards,

Sushama

Former Member
0 Kudos

Hi Sushma,

Thanks for your reply,

Here ABCD are standard code values and yes i don't have else value to fill.

and i how is the first mapping program can be achieved.

Mapping -

123456789 ( source) -


> 123-45-6789( Target)

Thanks in advance,

Kiran

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Create a simple udf as below

Execution type : single variable

Type: Argument Name: var1 Java Type: String

public String numberFormat(String var1, Container container) throws StreamTransformationException{

String st1 = var1.substring(0,3);

String st2 = var1.substring(3,5);

String st3 = var1.substring(5,9);

String total = st1 + "-" + st2 + "-" + st3;

return total;

}

Map the source element with numberFormat UDF and connect output to targe field.

Tested the code and it works.

Answers (0)