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

SXPG_COMMAND_EXECUTE in background

Former Member
0 Likes
1,599

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,172

what is the command you are executing with the function SXPG_COMMAND_EXECUTE.

can you mention that..

7 REPLIES 7
Read only

Former Member
0 Likes
1,173

what is the command you are executing with the function SXPG_COMMAND_EXECUTE.

can you mention that..

Read only

0 Likes
1,172

It's a z_ command which activates a decryption exe file.

It's working fine at foregound.

Read only

0 Likes
1,172

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.

Read only

0 Likes
1,172

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.

Read only

Former Member
0 Likes
1,172

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

Read only

0 Likes
1,172

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

Read only

0 Likes
1,172

*--> 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