C Program call in ABAP

Advertisement
November 30

Hello,
Can anybody tell me the syntax to call a 'C' Program in an ABAP program. How it can be done, and where can I get some information on it?
Regards,
Kunal

Advertisement

Replay

Hi, I tested function SXPG_COMMAND_EXECUTE on a Windows server and it worked well.  Here's an example of my ABAP code.
Mark
REPORT Z_TEST3.
The function SXPG_COMMAND_EXECUTE allows you to perform an
external operating system command from within an ABAP program.
The export parameter COMMANDNAME is defined in txn SM69.
ZCMD is defined as 'cmd /c'.
start-of-selection.
  perform exe.
FORM EXE.
data: t_exec_protocol like btcxpm occurs 0 with header line.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  EXPORTING
   COMMANDNAME            = 'ZCMD'
   ADDITIONAL_PARAMETERS  = 'dir \usr\sap\interface\*.txt'
    OPERATINGSYSTEM       = SY-OPSYS
  TARGETSYSTEM                        = SY-HOST
  DESTINATION                         =
  STDOUT                              = 'X'
  STDERR                              = 'X'
  TERMINATIONWAIT                     = 'X'
  TRACE                               =
IMPORTING
  STATUS                              =
  EXITCODE                            =
  TABLES
    EXEC_PROTOCOL                       = t_exec_protocol
EXCEPTIONS
  NO_PERMISSION                       = 1
  COMMAND_NOT_FOUND                   = 2
  PARAMETERS_TOO_LONG                 = 3
  SECURITY_RISK                       = 4
  WRONG_CHECK_CALL_INTERFACE          = 5
  PROGRAM_START_ERROR                 = 6
  PROGRAM_TERMINATION_ERROR           = 7
  X_ERROR                             = 8
  PARAMETER_EXPECTED                  = 9
  TOO_MANY_PARAMETERS                 = 10
  ILLEGAL_COMMAND                     = 11
  WRONG_ASYNCHRONOUS_PARAMETERS       = 12
  CANT_ENQ_TBTCO_ENTRY                = 13
  JOBCOUNT_GENERATION_ERROR           = 14
  OTHERS                              = 15
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at t_exec_protocol.
  write: / t_exec_protocol-message.
endloop.
ENDFORM.

View 5 Replies

Tags:

  1. B8000_A422_000_085_140402_WW_WIFI
  2. Backup easyserver has stopped
  3. YouTube não carrega no lg d300f
  4. add puffin to ipad ios 5.1
  5. mass confirm vendor
  6. 305500 non oracle exception
  7. mass approval fk09
  8. vendor mass confirmation sap
  9. drovelcl
  10. spinx1l
Copyrights 2019 Fcffair BigData Resource, All rights reserved