cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a special character in graphical mapping?

Former Member
0 Kudos

Hi!

I need to concatenate some element and special character "Line feed" (the same as \n in Java).

Is it possible to put this symbol as an entering value to Concat function using "Constant" in graphical mapping?

I mean entering symbols somehow using their ordinal numbers, 10 (or 0A) in this particular case.

I use SAP PI 7.4 single stack.

Best regards,

Andrey Petin

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor
0 Kudos

Hi Andrey!

Did you try to do it with java code in UDF?

Regards, Evgeniy.

Former Member
0 Kudos

Hello Evgeniy.

Yes, finally I wrote a simple UDF for converting character number to character itself (i.e. 65 -> 'A' etc).

But it would be interesting to know whether it is possible to use constant with character number.

Answers (2)

Answers (2)

former_member187587
Contributor
0 Kudos

First ask yourself or tell us why do you need to do it?

Some times the right place to add it is in the receiver adapter as a module parameter.

What exactly is your scenario and what is your requirement?

Former Member
0 Kudos

Hello Nimrod.

It is an IDoc to Message Type mapping.

We have to concatenate some lines from different IDoc segments and use separator depending on some value.

I mean, we have to use space delimiter if a value "*" comes and a line feed (break) delimiter if a value "/" comes.

So I use Fixed Values function for this case, and "*" is mapped to space, and "/" has to be mapped to character number 10.

mdejesus
Participant
0 Kudos

Hi Andrey,

Have you tried creating different segments for different delimiter?
You will generated custom segment 1 if value is "*" and generate custom segment 2 if value is "/" so you can control the delimiter in FCC side.

Regards,

Marc

Former Member
0 Kudos

Hi Marc.

IDoc definition and filling is developed by other team, I can not change anything there.

As for now, I wrote an UDF which converts char number to the char itself (Fix Values function converts "*" to 32, "/" to 10, and my UDF returns char with the corresponding number).

I just want to know whether I may use something like, maybe, &10 or &32 in Fix Values of Constant elements to define character with this number.

former_member187587
Contributor
0 Kudos

Is it an IDoc to EDI scenario?

IDoc to flat file csv?

Idoc to flat file XML ?

Former Member
0 Kudos

It is IDoc to JDBC.

former_member187587
Contributor
0 Kudos

Thanks Andrey.

Why do you need \nl charecter in the database?

Former Member
0 Kudos

It is the description of a shop item. It is displayed in some software working with that database.

The requirement is to transfer line breaks there in the right places.

Former Member
0 Kudos

It is now like this.

IDoc gives me segments with data:

      <E1BPE1MLTXRT SEGMENT="1">

          ...

         <TEXT_LINE>Text1</TEXT_LINE>

          ...

      </E1BPE1MLTXRT>

      <E1BPE1MLTXRT SEGMENT="1">

          ...

         <FORMAT_COL>/</FORMAT_COL>

         <TEXT_LINE>Text2</TEXT_LINE>

          ...

      </E1BPE1MLTXRT>

      <E1BPE1MLTXRT SEGMENT="1">

          ...

         <FORMAT_COL>*</FORMAT_COL>

         <TEXT_LINE>Text3</TEXT_LINE>

          ...

      </E1BPE1MLTXRT>

The final string has to be:

Text1<break>Text2<space>Text3

I use this mapping:

FixValues here transforms "*" to 32 and "/" to 10.

After that my UDF "getCharByNumber" transforms char code to char itself.

After all (not shown here) all strings are concatenated into one final string by another UDF.

I think I could omit the getCharByNumber step if it was possible to put the symbol itself in FixValues (<10> or &10 or :10 or whatever).

former_member186851
Active Contributor
0 Kudos

Hello Andrey,

What exactly is the special code to be appended?

Former Member
0 Kudos

Hello!

It is line feed - code 10.