Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Write hex string to serial port directly from ABAP

Former Member
0 Kudos

Hello everybody,

I have worked with the function module presented here:

It is working fine, I am able to write to the serial port.

The only problem is that i need to send a hexadecimal string on the serial port, and the function module uses a property of MSCOMM ActiveX Control that sends only characters.

An example:

I want to send the following hex values on the serial port: 01 24 56. I created an XSTRING in ABAP and has the value 012456, which is ok, but the serial port receives the following hex values: 30 31 32 34 35 36, which are the converted ASCII values for the components of the string sent from ABAP.

I need to send hex strings (and not ASCII characters) because the communication protocol with the device I am using requires special hex characters (with values under 20H)

Is there a way to send hex strings to the serial port directly from ABAP without involving third-party software?

Thanks in advance,

Stefan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

The problem was solved by converting the XSTRING to STRING using the CL_ABAP_CONV_IN_CE class, as someone suggested in a reply(which I can't see anymore), and then send the converted string, but this apparently works only on ECC 6.0 systems.

5 REPLIES 5

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

The problem was solved by converting the XSTRING to STRING using the CL_ABAP_CONV_IN_CE class, as someone suggested in a reply(which I can't see anymore), and then send the converted string, but this apparently works only on ECC 6.0 systems.

Former Member
0 Kudos

I wrote this reply, but the moderator deleted my post. I do not know why ....

Otherwise it is nise to hear, that you could solve your issue.

Best regards.

Alexander

0 Kudos

Thank you very much.

Regards,

Stefan

0 Kudos

You are welcome