cancel
Showing results for 
Search instead for 
Did you mean: 

File to idoc scenario

Former Member
0 Kudos

Hello PI experts,

I am sought of new to PI mapping, I got a requirment to map a file to idoc.

From the payload , I have to take a particular  field from the input file , if the field is starting with AB* , then the coressponding SNDPRN in the receiver idoc should be AB123 , and if the field is starting with say XY* , then the coressponding SNDPRN in the receiver idoc should be XY123.

I am planning to use , value mapping for this , but can we use wild characters such as (*) in value mapping or is there any better way for implementing this?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes Udo correct that is very simple by using "subString"

refer below logic mightbe helpful:

for ex:

u can add multiple key and value pairs based on ur requirement.

and subString is :

Answers (4)

Answers (4)

Former Member
0 Kudos

Sorry guys , I should have been more clear - My input field XY* or AB*  - here astreik(*) means that it can be any value , for example XYD544,XY78TI, ABJH99 , ABHHHJk43 etc...so based on the first two characters I have to decide my SNDPRN field in the output idoc .

Former Member
0 Kudos

ya , have to take first 2 characters by using Standard function"subString" then pass the key and value pairs in fixmapping for SNDPRN

input field -> substring(0,2) -> fixvalue -> oupput field (SNDPRN) and u have to refer  above my previous post also ..

otherwise u can call if else condition after subString insted of fixvalues ....

Former Member
0 Kudos

Hi Sankar ,

The characters that follow  AB(....) or XY(....) are not fixed these are dynamic values , only thing that remain constant are the first two characters of the field , thus I have to map based on first two characters of the incoming field.

If I am not wrong , Fixed mapping table would work if we already know the input values beforehand.

Former Member
0 Kudos

Thanks guys for your inputs , I have used Substring function + If then else to acheive the functionality.

gagandeep_batra
Active Contributor
0 Kudos

Hi Shashank,

You can achieve this using start with function also see below:

Regards

Gagan

Former Member
0 Kudos

Hi,

I think standard function replaceString allows you to replace any pattern at the incoming string with a new string... have you considered that function?

cheers,

Edu

udo_martens
Active Contributor
0 Kudos

Hi Shashank,

You can use Message Mapping standard function "substring" for that.

Regards,

Udo