Skip to Content

How to run TELNET Command from ABAP


We have a requirement to take the data from from an external "Radiation Detection System" to SAP.

Scenario: There is a PC(say RADPC1) on which a third party software is running which captures the radiation values of vehicles passing by. We have to get these values in SAP.

On any windows PC (say LCLPC1) if we want to get the radiation value from RADPC1 then we do TELNET on LCLPC1:

TELNET <PC Name> <Port No.>


then we give the Command say PC777

This gives the data string on telnet which has the radiation values.

Our requirement is to write ABAP Code so that we send the telnet command directly from our ABAP program and get back the data string having the radiation values?

Any help on how to achieve this from ABAP?



telnet.jpg (37.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Sep 25, 2017 at 12:47 PM

    Please check this Blog : link

    "Creation of External Commands with the help of UNIX Coding in SAP"

    Check the possibilities using Trx."SM69" and FM "SXPG_COMMAND_EXECUTE" ...

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 26, 2017 at 06:57 AM

    Hi Nic,

    I tried using SM69 but not getting the result. In SM69 I created a command "Z_RADIATION_POLL" and in its definition, under 'Operating System Command' I provided the command "TELNET RADPC1 9898" I get the error

    "Process died with exitcode -1"

    The output as highlighted should give the list of records as shown in my earlier screen shot of command prompt.



    Add comment
    10|10000 characters needed characters exceeded

  • Sep 26, 2017 at 09:24 AM

    Check if :

    • Your User has the necessary Privileges / Authorizations to perform the Operation (see SAP-KBA 859104) ;
    • The Meaning of the Returncode : SAP-KBA 1128667;

    Further, SAP-KBA 677435 provides a General Overview on the use of External Commands in SAP and FAQ SAP-KBA 188772 can help you out on Troubleshooting ...

    If you get any further on this, you might want to use some Dynamic Parameter ("PC<1234>") and would want to check out SAP-KBA 1152084.

    Talk to your BASIS Team on Telnet-Connection and Authorizations (and related Security issues). If you still have issues, contact SAP Support ...

    Add comment
    10|10000 characters needed characters exceeded