cancel
Showing results for 
Search instead for 
Did you mean: 

Field Length check in SAP PI

Former Member
0 Kudos

A small requirement. If the field length is greater than the target field lenth, i need to map only the first "X" chars to the target.

e.g if the target field is 50 chars and the source is greater than 50, I need to map first 50 to the target field.

Need help to close this asap..

your help is appreciated.

S

Accepted Solutions (1)

Accepted Solutions (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Shyam,

If you are using FCC in receiver channel use fixedLengthTooShortHandling.

You could have got this by searching SCN or SAP Help.

Converting XML in the Receiver File/FTP Adapter to Text Format - Advanced Adapter Engine - SAP Libra...

Former Member
0 Kudos

Raghu,

I am sorry but i should made it clear.

The scenario is SOAP to HTTP.

RaghuVamseedhar
Active Contributor
0 Kudos

Shyam,

If target is text file use fieldLengthExceeded of StrictXml2PlainBean.

Adding StrictXml2PlainBean (XML to Text) in the Module Processor

If you want to cut length in message mapping create below UDF.


    public String udf_trim(String in, int len, Container container) throws StreamTransformationException {

        if (in.length() > len) {

            return in.substring(0, len);

        }

        return in;

    }

Former Member
0 Kudos

Let me try this UDF and get back..

Former Member
0 Kudos

This is correct and has been implemented.. Many thanks.

Answers (0)