‎2008 Aug 24 10:23 AM
Hi all.
Does the FM SXPG_COMMAND_EXECUTE can be activated within background mode?
When I activate the abap program that includes the above FM within a periodic job it's not being executed.
Any reason for that?
Thanks in advance,
Rebeka
‎2008 Aug 24 10:25 AM
what is the command you are executing with the function SXPG_COMMAND_EXECUTE.
can you mention that..
‎2008 Aug 24 10:25 AM
what is the command you are executing with the function SXPG_COMMAND_EXECUTE.
can you mention that..
‎2008 Aug 24 11:06 AM
It's a z_ command which activates a decryption exe file.
It's working fine at foregound.
‎2008 Aug 24 11:28 AM
is it unix command , what is your application server. if your app.system is unix/aix/linux check some normal command ex:- CAT , working in background or not.
‎2008 Aug 24 11:44 AM
I tested it , it is working in forground and background. but i used the program. i tested for unix and windows.
if it is working in foreground and not background then that means the problem with the command , Decryption may fail in Background. check wity the documentation of the command.
the below is for the windows NT, if you want to test it for Unix then change the to Unixcom = 'ls -al *'.
REPORT ZUNIX line-size 400
no standard page heading.
data : unixcom like rlgrap-filename.
data: begin of tabl occurs 500,
line(400),
end of tabl.
data: lines type i.
*----------------------------------------------------------------------
start-of-selection.
refresh tabl.
unixcom = 'dir'.
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field tabl[].
"if the files are different then you will some content in tabl
loop at tabl.
write tabl-line.
endloop.
‎2008 Sep 01 10:48 PM
Hi all.
It's still not working.
My problem is that the external command (exe file) is activated within batch mode threw windows OS without any problems by usin batch file.
I want to use the same batch file or running its command via abap code at backgrouond mode.
It may not be possible???
Thanks again,
Rebeka
‎2008 Sep 01 11:30 PM
Can you post your code? Particularly the difference between foreground and background...
Obviously, when running it in the foreground, you are Dialog type user...
When running it in the background, is this a SYSTEM type user in a job step (which type?), or just the menu option "Program => Execute in background"?
Cheers,
Julius
‎2008 Sep 02 8:00 AM
*--> Activate decryption command
CALL FUNCTION 'SXPG_COMMAND_EXECUTE' "IN BACKGROUND TASK
EXPORTING
COMMANDNAME = 'ZFI_GPG'
ADDITIONAL_PARAMETERS = LV_PARAMS
OPERATINGSYSTEM = 'Windows NT'
TARGETSYSTEM = LV_SERVER
IMPORTING
STATUS = STATUS
EXITCODE = EXITCODE
TABLES
EXEC_PROTOCOL = LT_PROT_TAB
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.
When 'ZFI_GPG' is the command from sm69 and lv_params is the additional parameters.
Thanks a lot,
Rebeka