cancel
Showing results for 
Search instead for 
Did you mean: 

Read Payload WhiteSpace

Former Member
0 Kudos

Hi.. Dear Experts.

How can I read whiteSpace in Payload.

E.g My Payload is showing <Data>ABCD 1234 1545</Data>

However between ABCD and 1234 exist 5 withspace .I verified when I made a download the Payload and check it in notepad.

I need to take the whitespace for my mapping

Can you help me?

Regards

Accepted Solutions (0)

Answers (3)

Answers (3)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Have you checked the responses from your other thread?

http://forums.sdn.sap.com/thread.jspa?threadID=2139022&tstart=0

Regards,

Mark

former_member187339
Active Contributor
0 Kudos

Hi Xinaxu,

Do you want to remove the white space in data between <Data> and </Data>? If yes then you can write a udf.

Refer this link for an idea on how to handle white space in java http://www.rgagnon.com/javadetails/java-0352.html

Regards

Suraj

Former Member
0 Kudos

Hi ,

if you want to read Whitespaces in a field value , create UDF in Message mapping.

Could you please explain about your requirement clearly.

Regards,

Jag

Former Member
0 Kudos

Could you provide the UDF.?

I test with UTF-8 but is not working.

I need to extract the payload and the Mapping by Positions.

Regards.

former_member214364
Active Contributor
0 Kudos

Hi,

i am just giving the procedure here to find whitespaces in String. you can use this procedure to find whitespaces and take required actions as per your requirement.

Convert String into Character Array. Var1 holding the string value.

char chA[] = var1.toCharArray();

Check Each character in Character Array for whitespaces.

for(int k=0; k < chA.length; k++)

{

if(Character.isWhitespace(chA[k]))

{ }

else

{}

}

if possible please explain what do you want to do after finding whitespaces in a field.

Regards,

Jag