Skip to Content
author's profile photo Former Member
Former Member

Write hex string to serial port directly from ABAP

Hello everybody,

I have worked with the function module presented here: Read COMM port using ABAP w/o third party software

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 09, 2014 at 06:30 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 09, 2014 at 06:36 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2014 at 12:38 PM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.