cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Special characters in file sender in sap Pi

former_member601528
Participant
0 Kudos

Dear All,

I have a requirement: File to Idoc Scenario. File is fixed length file.

In the source file, we are getting first character and the last character is the special character such as &.

We need to validate and generate the Target Idoc.

If both first and last characters are same, then we need to generate the Idoc, else we need to fail the message in PI itself.

Any needful suggestions on this.

Regards,

Arvind

Accepted Solutions (0)

Answers (1)

Answers (1)

gagandeep_batra
Active Contributor
0 Kudos

Hi Aravind,

Put first character with first field and last character with last field and use "equals" , Substring & createIf function to determine and then create a target root idoc field.

Regards

Gagan

former_member601528
Participant
0 Kudos

Dear Gangadeep,

But it's working fine for only one recordset.If i'm getting multiple recordsets, how to handle.

Can you elaborate your suggestion.

Regards,

Arvind

gagandeep_batra
Active Contributor
0 Kudos

How you creating the idoc, ?

are you creating the multiple idoc based on multiple records then have to take care of context.

you can also paste screen shot for batter clearance

Regards

Gagan

former_member601528
Participant
0 Kudos

Dear Gagandeep,

Small change in the reqirement.

We are getting a special character at the end of the fixed length file.

We need to treat it as a key, if

& is present at the end of the file, we need to generate the IDOC. else fail it in PI itself.. How to do it... any suggestions...

Regards,

Arvind

former_member184720
Active Contributor
0 Kudos

Hi Arvind,

Instead of doing it in the mapping, may be you can handle it in the receiver determination step.

something like below..

(If i check for equals then i dont think it'll check across the nodes)

mt/Records[not(firstfield != "&")] EX

mt/Records[not(lastfield != "&")] EX

or

mt/Records[firstfield = "&"] EX

mt/Records[lastfield = "&"] EX

former_member184720
Active Contributor
0 Kudos

if you dont need to check across recordsets..

then simply read that into a field and in the xpath check for the field..

mt/Records/lastfield = & then Receiver

if you need to check across all the recordssets then

mt/Records[not(lastfield != "&")] EX then Receiver