cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent Data Results in XI

Former Member
0 Kudos

My scenario picks up an XML document and sends the xml after mapping occurs to my ECC box where we use abap proxy to process the file. In my mapping there is a user defined function that pad spaces after a material number if it is not 18 char long. This then gives us the full 18 char length required. here is the code of the function.

StringBuffer sb=new StringBuffer(" ");

sb.replace(0, a.length(), a);

return sb.toString();

basically this reads the material number and if it is short of 18 char it will pad spaces needed to reach 18. When i load the payload being sent in my map to test it this works. If i use the length function after it it shows the correct char length. My test results are good also. i see the correct number of spaces padded onto the material number. The problem is when this same data runs through the whole scenario. when i check the payload being sent to ECC via sxmb_moni there is only one space padded at the end of the material number. in this case there should be two. even if it needs 5 spaces when the data goes to ECC after mapping there is only one space after my material number. I have noticed if i uses an x instead of a space it will put the proper number of x's after the material number. Why does it not treat spaces the same way?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey

That is the default behaviour of sxmb_moni,it will suppress any leading/trailing spaces.But the payload internally will have all those spaces,just check your IDOC in ECC,it will have all those spaces.

Thanks

Aamir

Former Member
0 Kudos

my code before didn't show it but there is actaully 18 spaces in it. Anyway i would almost agree with you except for the fact that in the payload it will leave one padded space in sxmb_moni. if i take the function out there are no spaces. In another instance this material number with the padded spaces is concatenated with another value at the end. Same this happens here also. The test results in XI come out fine but when the scenario runs and I check sxmb_moni in my ECC box the payload only shows one padded space then the trailing concatenated value. Also this is a proxy scenario and not IDoc so I don't really know of a good way to check the actual payload compared to what is shown in sxmb_moni.