Application Development and Automation 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: 
Read only

Error BT616 when calling function module SXPG_COMMAND_EXECUTE in background

Former Member
0 Likes
971

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

1 REPLY 1
Read only

Former Member
0 Likes
567

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