Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ASCII to EBCDIC packed decimal

Hi everyone,

I need to convert some numerical string into a Package field in EBCDIC in order to write a file and send it to some mainframe system. I have using an ABAP proxy like sender and a File adapter like the reciver.

I have made some java function that takes every two characters and merge them into a single byte (like the mainframe can read it). I tested the function and evreything goes well in my PC, but when I create a simple user-defined function and try to make the conversion it writes the characters incorrectly.

But this only happen when the character are < 10.

I mean If I send a 999999 I have in my file ™™™œ This is correct becuase the hexadecimal representation is 99 99 99 9C.

But when I send 123456 I have in my mapping this string ##El but this is incorret because the hexadecimal code is <b>23</b> 23 45 6C and this should be #El hex: <b>01</b> 23 45 6C and I have this correct result when I run it in my PC.

does anybody have any idea why happens this???

or does anybody has another way to solve the problem of the packed fields???

I guess there is an internal conversion in the mapping, and cannot read the characters like 0000 0001.

I really appreciate your help

Thanks

Former Member
replied

Hi Omar Hernandez,

1.Yes you can use file content conversion to remove XML tags before converting it to EBCDIC format and that would be the better approach.

2.I am not sure, but I hope the reverse process should solve the Mainframe to ABAP Proxy scenario.

MainFrame[plain file] -> XI - FileAdapter content conversion ->
  XI - Mapping -> ABAP Proxy

Regards,

Ananth

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question