SXPG_COMMAND_EXECUTE

Hi Experts,
Can you explain me the fuctionality below code...
DATA: l_target_syst     LIKE rfcdisplay-rfchost.
  DATA: i_error LIKE btcxpm  OCCURS 0 WITH HEADER LINE.
  CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'SAPDBHOST'
                     ID 'VALUE' FIELD l_target_syst.
  CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
    EXPORTING
      commandname                         = commandname
      additional_parameters               = filename
      operatingsystem                     = sy-opsys
      targetsystem                        = l_target_syst
   DESTINATION                         =
      stdout                              = stdout
      stderr                              = stderr
      terminationwait                     = terminationwait
   TRACE                               =
    IMPORTING
      status                              = status
      exitcode                            = exitcode
    tables
      exec_protocol                       = i_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                              = 99.
  CASE sy-subrc.
    WHEN 1.
      RAISE no_permission.
    WHEN 2.
      RAISE command_not_found.
    WHEN 3.
      RAISE parameters_too_long.
    WHEN 4.
      RAISE security_risk.
    WHEN 5.
      RAISE wrong_check_call_interface.
    WHEN 6.
      RAISE program_start_error.
    WHEN 7.
      RAISE program_termination_error.
    WHEN 8.
      RAISE x_error.
    WHEN 9.
      RAISE parameter_expected.
    WHEN 10.
      RAISE too_many_parameters.
    WHEN 11.
      RAISE illegal_command.
    WHEN 12.
      RAISE wrong_asynchronous_parameters.
    WHEN 13.
      RAISE cant_enq_tbtco_entry.
    WHEN 14.
      RAISE jobcount_generation_error.
    WHEN 99.
      RAISE x_error.
  ENDCASE.
Regards
Kali Pramod

In this FM.. main three parameters are:
<b>commandname
additional_parameters
exec_protocol</b>
Commandname is the command created thru SM49 they are called external operating system command,,,
In this command first parameter is always an operating system command like..
<b>ls for listing all files and directories</b>
<b>put</b>  etc
in additional_parameters you can pass the parameters for that command like for the command you can see the contents of some particular directory so u have to pass  that directory path in additional_parameters field 
i.e. additional_parameters = '/usr/sap/tmp'
and exec_protocol is the table which returns u the contents which are retrieved using that command...
e.g using ls command all files an dir names appended to this table...
You can use another FM is ur additional parametes field is very long..
<b> SXPG_COMMAND_EXECUTE_LONG</b>
<i>Two more parameters:  STATUS and EXITCODE are very important... your command is run successfully only when <b>STATUS = 'O' " Capital O
and
EXITCODE = '0' " Zero</b>
</i>
Reward if useful
Regards
Prax

Similar Messages

  • Difference between SXPG_COMMAND_EXECUTE and Open data set mechanism

    Can you please help me to know the difference between moving a file using FM "SXPG_COMMAND_EXECUTE" and moving file using "open data set - transfer file- close data set" mechanism?

    Through 'SXPG_COMMAND_EXECUTE' u can execute a External command  (ie.. UNIX /Windows/OS/400) In ABAP programming..
    for Conversion Of Aplication server File/Move the file from one directory to Other...
    The Command must be present in SM69.
    Using this function module'SXPG_COMMAND_EXECUTE' , you can check the authorization of a user to execute a particular external command and run the command:
    With the arguments specified in ADDITIONAL_PARAMETERS
    On the target host system defined by OPERATINGSYSTEM and TARGETSYSTEM
    If an SAP profile parameter is inserted in the portion of the command stored in the database, then the value of this parameter is substituted into the command. If an SAP application server is active on the target system (TARGETSYSTEM), then the profile parameter values are read from the profile that is active on that system. No parameter substitution is made in ADDITIONAL_PARAMETERS.
    After substitution, the command is checked for the presence of "dangerous" characters such as the semicolon ( ; ) on UNIX systems.
    If an additional "security function module" is specified in the command definition, this function module is also called in the course of processingebenfalls. This function module can prevent execution of the command.
    If the authorization checks complete successfully, the command is run on the target host system.
    Through Open Data Set u can read and write the file in the same directory...
    Thnaks,
    SD
    Moderator message: copy/paste without credit, points removed, please do not repeat!
    http://www.google.de/search?hl=de&q=%22youcanchecktheauthorizationofauserto+execute%22&meta=&aq=f&aqi=&aql=&oq=&gs_rfai=
    http://www.google.de/search?hl=de&q=%22Aftersubstitution%2Cthecommandischeckedforthepresence%22&meta=&aq=f&aqi=&aql=&oq=&gs_rfai=
    Edited by: Thomas Zloch on Aug 17, 2010 12:47 PM

  • Problem with FM SXPG_COMMAND_EXECUTE in deleting a file on server.

    Hi All,
    My Task is to delete a file with version number 6 and rename all other files, so that my new file will be version 0.
    Am using the FM SXPG_COMMAND_EXECUTE to delete/rename a file on server.
    Though, this is working fine in debugging mode I can see the file getting deleted in regular run, which is followed by renaming some files, it is NOT working in regular run.
    Somehow the deletion and renaming are not happening correctly in regular run, but does happen successfully while in debugging.
    Am I missing anything or any refresh or delay needed?
    Here is my code for DELETE :
    CONCATENATE P_PATH '\' P_TABNAME '_6.dat' INTO LF_FILE.
      CONDENSE LF_FILE NO-GAPS.
    *// Check if this file exists
      OPEN DATASET LF_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC EQ 0.
    *// Delete this file
        DELETE = LF_FILE.
        CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
          EXPORTING
            ADDITIONAL_PARAMETERS      = DELETE
            COMMANDNAME                = 'ZDELETE'
            OPERATINGSYSTEM            = OPSYS
            STDERR                     = 'X'
            STDOUT                     = 'X'
            TARGETSYSTEM               = EHOST
            TERMINATIONWAIT            = TERMWAIT
            TRACE                      = ' '
          IMPORTING
            STATUS                     = RETCODE
          TABLES
            EXEC_PROTOCOL              = PROT
          EXCEPTIONS
            COMMAND_NOT_FOUND          = 01
            NO_PERMISSION              = 02
            PARAMETERS_TOO_LONG        = 03
            PARAMETER_EXPECTED         = 04
            PROGRAM_START_ERROR        = 05
            PROGRAM_TERMINATION_ERROR  = 06
            SECURITY_RISK              = 07
            TOO_MANY_PARAMETERS        = 08
            WRONG_CHECK_CALL_INTERFACE = 09
            X_ERROR                    = 10
            OTHERS                     = 11.
    ENDIF.
    Regards
    Raj
    Edited by: Rajasekhar Dinavahi on Apr 14, 2010 11:45 AM

    Hi All,
    Problem resolved.
    We need ensure all files which are opened [by OPEN DATASET], are CLOSED before trying any operation like DELETE or RENAME on the files.
    Regards
    Raj

  • Sxpg_command_execute exit code

    Hi,
    I used function SXPG_COMMAND_EXECUTE in an abap program.
    During runtime, the function is returning an exit code of 1, although sy-subrc = 0.
    exec_protocol is showing the error "> Function: BtcXpgPanicCan't exec external program (No such file or directory)                                                External program terminated with exit code 1".
    There are no authorization errors.
    I have authorization to execute the command in sm49 and sm69 and the command can be executed
    successfully through these transactions.
    Any reason why ?
    Thanks. Will award points promptly.

    hi ,
    goto the tcode st22 for the error analysis ...from there u may get some information for it...
    regards,
    venkat.

  • PROBLEM IN SXPG_COMMAND_EXECUTE

    Hi,
    Can anyone solve my problem I m using function module to zip three excel sheet which were present in the application file and shell script is written accordingly.
    But my query is this is working fine in Production and in development but it is failing in Quality with SU 53 screen shot showing auth. object S_RZL_ADM Object class BC_A with acticvity 01 is highlighted in red.
    Does these are in correspondence with each other?
    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
        EXPORTING
          commandname                   = c_zcompressall
          additional_parameters         = w_missingtargz
          stdout                                = c_x
          stderr                                 = c_x
          terminationwait                   = c_x
        TABLES
          exec_protocol                 = w_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.
    Here after executing the w_protocol is giving me two values
    1.Can't exec external program (No such file or directory) 
    2.External program terminated with exit code 1
    Would please suggest me why it is happening?
    regards
    M jacks

    Hi All,
    There is a Quality refresh happened which means the Production data overwrites the Quality In such case the path that is defined in SM69 of the external command Zcompressall got overwrite with the production path which is the reason for failing of the external command.
    Cheers
    Jacks M.

  • Error BT616 when calling function module SXPG_COMMAND_EXECUTE in background

    Hi All,
    We use function module SXPG_COMMAND_EXECUTE with a custom command we defined in SM69 to move files in unix (mv command).
    The function module call has worked fine for almost a year and recently we have been seeing an error (BT616) in our job lob (SM37) when the program is run in background. We have not been able to reproduce the error in foreground mode and it seems to be occuring only periodically in the background. (The appropriate SAP authorization objects where assigned to the batch job ID and the steps on the batch job.) We are in the process of setting up the trace flag and performing analysis on the trace log via ST11 to help identify the issue.
    After perform analysis on SXPG_COMMAND_EXECUTE, the error is occurring when calling function module SAPXPG_END_XPG for exception 2, system failure, yet function module SAPXPG_END_XPG does not exist. I assume this is a program at the operating system level and is just a signature of the parameters to be passed to the operating system program.
    Below is part of the SAP function module SXPG_COMMAND_EXECUTE that is failing.
    * Now we have to wait for the termination of the external
    * command if the caller wants us to.
        IF TERMINATIONWAIT = 'X'.
          CALL FUNCTION 'SAPXPG_END_XPG'
            DESTINATION DESTINATION
            IMPORTING   EXITSTAT = STATUS
                        EXITCODE = EXITCODE
            TABLES      LOG      = LOG
            EXCEPTIONS  COMMUNICATION_FAILURE = 1 MESSAGE MSG
                        SYSTEM_FAILURE        = 2 MESSAGE MSG.
    I performed a where used on function module SXPG_COMMAND_EXECUTE, and most of SAP programs call the function module with the parameter TERMINATIONWAIT = 'X', so I assume we should pass ‘X’ as well.
    Any ideas on what could be causing this issue?
    Mike Vondran

    I also remember I have this kind of issue, as I have some UNIX script at OS( UNIX) level . The problem was with the ID , as it don’t have proper authorization at OS level ( UNIX ) . Please check this ID authorization. This could be the one of reasons if you’re sure from SAP standpoint.
    Hope this’ll give you some guide line..
    Thanks
    Bye

  • Maintain Blanks in SXPG_COMMAND_EXECUTE additional parameters

    Hello guys,
    we are trying to execute some commands in a Z function calling the function SXPG_COMMAND_EXECUTE.
    We have a command Z and in the additional parameters and we fill the command with CMD('COPY T:
    Documents
    PXXX2
    IEXXX.DOC \"E:
    WORK
    600613 MATERIAL     100333 (12345)\" ').
    We want to maintain the blanks, but during the execution of function SXPG_COMMAND_EXECUTE a CONDENSE of the field additional parameters is done.
    There is any way to maintain the blanks calling this function? There is another function that also executes commands and maintain the blanks?
    Many thanks in advance.
    Regards,
    Xavi.

    Hi,
    thanks for the answer. But thats doesn't match my problem. What I want is to start a shell-script with parameter whereas some parameters might include one or more blanks. Like for examples a script with only one parameter:
    shell-script 'this is a parameter'
    What I found out while testing with SM49 is, when I put the parameter into apostrophe than the parameter is passed as a single parameter to the script. But SM49 elsewell SXPG_COMMAND_EXECUTE condense more than blank to only one blank. And the apostrophe remain in the parameter.
    SM49:
    shell-script 'This   is a parameter'
    The shell-script gets the parameter 'This is a parameter' , whereas the apostrophe ' and the start and at the end is part of the parameter.
    Using the function modules SXPG_RFCDEST_OPEN_INT, SAPXPG_START_XPG and SAPXPG_END_XPG instead of SXPG_COMMAND_EXECUTE solves the problem of condensing the blanks to one blank. But the apostrophe is still part of the parameter. And I have to consider that the apostrophe might be originally part of the parameter.
    And I have to solve this problem.
    Regards
    Karl-Wilhelm

  • SXPG_COMMAND_EXECUTE failed for BRTOOLS -Reason: no_permission: Authorizati

    HI Experts.
    My BI consultants are not able to pull the data while execute the Tcode: LISTCUBE.
    I could not see any logs any short dumps but in RZ20 i found below error message.ora-00600
    SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: no_permission: Authorization object S_LOG_COM miss.
    Even we checked with our security team even after they assigned full authorization they are getting the same problem.
    Could some one provide the solution for this.
    Regards
    JAN

    Seems to be confusing..
    Any error while executing LISTCUBE tcode ?
    If suspect authorization issue, did BI team run SU53 just after LISTCUBE ?
    For S_LOG_COM, did you see this note once ?
    Note 150315 - BW-Authorizations for Remote-User in BW and OLTP
    However, following error seems to be confusing containing the term BRTOOLS, not sure what BRTOOLS doing here
    SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: no_permission: Authorization object S_LOG_COM miss
    SXPG error comes for external commands, once check the Notes using this search term. For eg
    Note 854060 - Authorizations for external commands
    Note 1336776 - External commands: Security for calling side

  • SXPG_COMMAND_EXECUTE failed for BRTOOLS

    Hi experts,
    I have my SAP ECC in a distributed system (CI and DB nodes are different) on Oracle 11G/ Solaris.
    When I try to execute any action in db13, appear the following error:
    SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: program_start_error: For More Information, See SYS
    I follow the SAP Note:  1974030 - How to configure DB13 to work with a standalone Oracle database in Unix/Linux
    but I continue with the error
    The RFC SAPXPG_DBDEST_HOSTDB works fine but I check in the trace of the proccess is:
    LOCATION    SAP-Gateway on host adonis.blumaq.local / sapgw00
    ERROR       timeout during allocate
    TIME        Tue Sep  9 12:47:24 2014
    RELEASE     721
    COMPONENT   SAP-Gateway
    VERSION     2
    RC          242
    MODULE      gwr3cpic.c
    LINE        2164
    DETAIL      no connect of TP sapxpg from host adonisdb after 20 sec
    COUNTER     6595
    Any idea?
    Thanks in advance,
    Regards,

    Hello Victor,
    and how the parameter gw/remsh is set, could you please check also this section in the note "10403 - Starting external programs":
    " c) If the remote shell in your computer is not called remsh
          (if you
    use a Unix 5.4 system, for example),
          you must set the gateway parameter
    gw/remsh to the correct name
          (which is normally "rsh" in such
    cases).  You may have to use the
          complete path name.  To check whether
    the remote shell is found,
          use the Unix command "which remsh" or "which
    rsh" under the
          gateway identifier."
    Regards,
    Alwina

  • SXPG_COMMAND_EXECUTE  return wrong parameter value

    Dear all.
    We have an Abap program that pulls an encrypted FTP file and saves it to our network.
    After that we activate an external command via transaction SM69 by calling FM SXPG_COMMAND_EXECUTE.
    This command is an execution of a batch file that executes a decryption method via PGP decryption software.
    The problem is that we get an output parameter of this FM (STATUS) as u201CEu201D (error) although the decryption is being executed successfully.
    We have the same process being activated same way successfully with another folders (rest is exactly the same).
    Why does SXPG_COMMAND_EXECUTE return wrong status value ?
    Regards,
    Rebeka

    SXPG_COMMAND_EXECUTE runs under certain operating system user account. Looks like that account does not have enough privileges to do what you want it to do. Look at the operating system for privileges (read,write,execute) of the user account SAPServiceuser or equivalent.
    /Simo

  • SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: program_start_error:

    Hi,
    Our Production server is in High Availability on Unix ( DB node active & CI Node active).
    When I am executing the initialize tape or triggering the backup from DB13 in our production we are getting the below error.
    SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: program_start_error:
    Even in DB12 when I click on the detailed log of any backup log, it is giving the same error.
    In System log we got the below error.
    Error 1003 when executing external command brtools on
    (in=R,out=M,err=M,trc=0,trm=C. strtstat=,xpgid=0,convid=. msg:)
    Error 1003 when executing external command brtools on
    (in=R,out=M,err=M,trc=0,trm=C. strtstat=,xpgid=0,convid=. msg:)
    RFC SAPXPG_DBDEST_<HOSTNAME>  connection test giving the below error
    Logon Connection Error
    Error Details Error when opening an RFC connection
    Error Details ERROR: timeout during allocate
    Error Details LOCATION: SAP-Gateway on host ProdApp / sapgw00
    Error Details DETAIL: no connect of TP sapxpg from host PROD-DB-SRV
    after 20 sec
    Error Details COMPONENT: SAP-Gateway
    Error Details COUNTER: 869
    Error Details MODULE: gwr3cpic.c
    Error Details LINE: 2007
    Error Details RETURN CODE: 242
    Error Details SUBRC: 0
    Error Details RELEASE: 700
    Error Details TIME: Tue Mar 30 09:07:51 2010
    Error Details VERSION: 2
    I have created .rhosts and .rshosts files in both DB & CI nodes under path /home/trpadm as below
    CI Node
    ProdApp:trpadm 27> cat .rhosts
    PROD-DB-SRV
    PROD-APP-SRV
    ProdApp:trpadm 28> cat .rshosts
    PROD-DB-SRV trpadm
    PROD-APP-SRV trpadm
    trpadm
    DB Node
    ProdDB:trpadm 2> cat .rhosts
    PROD-DB-SRV
    PROD-APP-SRV
    ProdDB:trpadm 3> cat .rshosts
    PROD-DB-SRV trpadm
    PROD-APP-SRV trpadm
    trpadm
    But below command is giving error
    ProdApp:trpadm 24> rsh PROD-DB-SRV -l trpadm sapxpg
    rshd: 0826-813 Permission is denied.
    rsh is happening in both the nodes.
    In CI node when iam doing rsh to DB node it is connecting. Pleas find the below logs
    ProdApp:trpadm 17> rsh PROD-DB-SRV
    trpadm's Password:
    Welcome to AIX Version
    6.1! *
    Please see the README file in /usr/lpp/bos for information pertinent
    to *
    this release of the AIX Operating
    System. *
    Last login: Wed Mar 31 11:36:53 IST 2010 on /dev/pts/1 from
    Prod_App_boot_1
    ProdDB:trpadm 1>
    In DB node when iam doing rsh to CI node it is connecting. Pleas find the below logs
    ProdDB:trpadm 1> rsh PROD-APP-SRV
    trpadm's Password:
    Welcome to AIX Version
    6.1! *
    Please see the README file in /usr/lpp/bos for information pertinent
    to *
    this release of the AIX Operating
    System. *
    Last unsuccessful login: Tue Mar 23 16:05:26 IST 2010 on ftp
    from ::ffff:10.0.1.39
    Last login: Wed Mar 31 11:36:30 IST 2010 on /dev/pts/1 from
    Prod_DB_boot_1
    ProdApp:trpadm 1>
    the below entries are already maintained in /etc/services file on both the nodes.
    sapgw30 3330/tcp
    sapdp30 3230/tcp       
    Please look into this and suggest us.

    Hi,
    I have cross checked every thing, it is ok.
    Praveen,
    As per your suggest, i have changed the background server in DB13. It didnot help us.
    Problem is RFC are giving errors.
    Logon     Connection Error
    Error Details     Error when opening an RFC connection
    Error Details     ERROR: timeout during allocate
    Error Details     LOCATION: SAP-Gateway on host <host> / sapgw00
    Error Details     DETAIL: no connect of TP sapxpg from host <host> after 20 sec
    Error Details     COMPONENT: SAP-Gateway
    Error Details     COUNTER: 4853
    Error Details     MODULE: gwr3cpic.c
    Error Details     LINE: 2007
    Error Details     RETURN CODE: 242
    Error Details     SUBRC: 0
    Error Details     RELEASE: 700
    Error Details     TIME: Mon Apr  5 09:18:49 2010
    Error Details     VERSION: 2
    When i am doing rsh from one node to another node it is asking for password, but it should not ask.
    and also the below error for sapxpg
    rsh <hostname> -l <sid>adm sapxpg
    rshd: 0826-813 Permission is denied.
    i have created .rhosts in both the nodes and maintained the values for hostname with <sid>adm user correctly.
    Please look into this and suggest.
    Regards,
    Raj

  • SXPG_COMMAND_EXECUTE / Parameters

    Hi
    I've setup af system commando called ZMYSQL using SM69.
    When I try run the function
    SXPG_COMMAND_EXECUTE using
    ADDITIONAL_PARAMETERS = '-h xxx.xxx.xxx.xxx  --user=<uid> --password=<pwd> < c:\file.sql'
    it for some reasson removes the '<' sign from my parameters, which make it fail.
    Any knows how its possible to avoid this ? or is there a workaround ?
    I can execute the system comand from the application server using.
    mysql -h xxx.xxx.xxx.xxx  --user=<uid> --password=<pwd> < c:\file.sql
    Edited by: Henrik Mortensen on Jan 15, 2010 1:17 PM

    Look at OSS [Note 1152084 - Parameter for external commands|https://service.sap.com/sap/support/notes/1152084] and [Note 1280022 - Special characters in parameter string of ext. commands (2)|https://service.sap.com/sap/support/notes/1280022]
    Regards,
    Raymond

  • SXPG_COMMAND_EXECUTE - FTP problem

    Hi Guys,
    I am transferring file from FTP server to SAP server using the F.M  SXPG_COMMAND_EXECUTE but the same same program executes in QAS server but not in DEV server.
    I have checked in External command in SM69 and SM49 in both the systems both are same and I debugged and found that CALL FUNCTION 'SAPXPG_END_XPG' in side the
    SXPG_COMMAND_EXECUTE gives the error in DEV server.
    I am using a .BAT file and additional parametes I am using the FTP command with primary- proxy
    Pls find the log
    ftp> Invalid command.#
    ftp> *****************
    Invalid command.#
    ftp> *************
    Not connected.#
    ftp> cd *********
    Not connected.#
    ftp> ls
    quit
    > ftp: connect :Connection refused
    where as in QAS server the BAT file executes and gives me the list of files which is in the respective FTP server.
    Please let me know the error and I hope some thing to do with server profile setup.
    regards,
    Prabhu

    Hi,
    I am using the same FTP server logon id and password and after the the FM SXPG_COMMAND_EXECUTE if there is no permission it should return me sy-subrc = 1 but here in my case the Sy-subrc = 0 but I get the log as not connected.
    Regards
    Prabhu
    Edited by: prabhu jayaraman on Mar 11, 2009 8:57 AM

  • SXPG_COMMAND_EXECUTE - Recv failed:Connection reset by peer

    We are calling external commands in a batch job using the SAP supplied function module SXPG_COMMAND_EXECUTE.  However, if the external command takes longer than 2 minutes (120 seconds) to execute the call to the external command is terminated (from the SAP perspective) with the message Recv failed:Connection reset by peer.  The termination is precisely at 120 seconds.  The external command, however, continues to run as an u201Corphanu201D task and finishes normally.  However, due to the connection termination, SAP is no longer aware of it.
    Do you have any ideas where the termination is occurring and/or where the wait limit of 120 seconds is set?

    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
        EXPORTING
          commandname                   = 'ZTEST_BATCH'
          additional_parameters         = param1
          operatingsystem               = castserveropsys
          targetsystem                  = target
          stdout                        = 'X'
          stderr                        = 'X'
          terminationwait               = 'X'
        IMPORTING
          status                        = funcstatus
        TABLES
          exec_protocol                 = iserveroutput[]
        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.

  • SXPG_COMMAND_EXECUTE: ADDITIONAL_PARAMETERS contains Blanks

    Hi to all,
    I want to start a shell-script with SXPG_COMMAND_EXECUTE on Linux. Therefor I have maintained a command with SM69.
    I have to fill ADDITIONAL_PARAMETERS with a list of parameters which are passed to the shell-script. Unfortunately some parameters contains blanks, such as a material description.
    How do I have to call SXPG_COMMAND_EXECUTE so that a parameter "AA BB" or "CC   DD" conserves as one parameter when it is passed to the shell-script and the shell-script can recognize these as one parameter and not as two or more.
    Maybe someone has a suggestion for another solution to handle this problem.
    Thanks in advance
    Karl-Wilhelm

    Hi,
    thanks for the answer. But thats doesn't match my problem. What I want is to start a shell-script with parameter whereas some parameters might include one or more blanks. Like for examples a script with only one parameter:
    shell-script 'this is a parameter'
    What I found out while testing with SM49 is, when I put the parameter into apostrophe than the parameter is passed as a single parameter to the script. But SM49 elsewell SXPG_COMMAND_EXECUTE condense more than blank to only one blank. And the apostrophe remain in the parameter.
    SM49:
    shell-script 'This   is a parameter'
    The shell-script gets the parameter 'This is a parameter' , whereas the apostrophe ' and the start and at the end is part of the parameter.
    Using the function modules SXPG_RFCDEST_OPEN_INT, SAPXPG_START_XPG and SAPXPG_END_XPG instead of SXPG_COMMAND_EXECUTE solves the problem of condensing the blanks to one blank. But the apostrophe is still part of the parameter. And I have to consider that the apostrophe might be originally part of the parameter.
    And I have to solve this problem.
    Regards
    Karl-Wilhelm

Maybe you are looking for

  • How to merge partitions in Windows 7 ?

    Hi, i have partitions C and D. My problem in that C is smoler than D. How can i move some space to C from D or to merge this partitions? Thanks in advance,

  • Is this a Dreamweaver or Apache problem?

    Or maybe it's a problem with me?? I created a new site and everything proofs fine on my Apache server EXCEPT: The .css file path for my left nav include file is: /Pyramid/css/pyramid1include.css      <link href="/Pyramid/css/pyramid1include.css" rel=

  • Adding date field in cv01n very urgent

    hye all,               can plz anybody send any document or any screen shot or link for adding date field in cv01n(dms). mail id      [email protected] thanks.

  • Time to export/save one D2X NEF to JPG Aperture vs. Bridge/ACR

    15" PB, 1.5 Ghz, 1.5 GB RAM, running Firefox, Entourage, while each app is running test. Single D2X NEF in an Aperture project: -No sharpening applied, export to JPG 11 seconds -Any sharpening applied, export to JPG 29 seconds Single D2X in a folder

  • Satellite C660 - How to downgrade the BIOS?

    I have the same problem. Latest BIOS version for my notebook is 1.3 but on my is 1.4 installed?! Notebook is 10 days and I cant work with it. We have few C660 (PSC0LE) we bought tham on same day and they all have 1.3 and are working perfect. Only my