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

Dump while SXPG_COMMAND_EXECUTE

Former Member
0 Likes
1,148

Hi Experts,

While i am calling SXPG_COMMAND_EXECUTE in my program, the system is going to dump as i have no permissions for unix. I placed a message after

if sy-subrc <> 0.

MESSAGE e000(msgclass) with 'No permissions'.

endif.

but it displays the above message and then still goes to dump .

I want to avoid the dump pls tell me how to handle this.

thanks

Dany

11 REPLIES 11
Read only

Former Member
0 Likes
1,040

Hi,

Did you give EXCEPTIONS when calling the function module..

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'

EXPORTING

commandname =

  • ADDITIONAL_PARAMETERS =

  • OPERATINGSYSTEM = SY-OPSYS

  • TARGETSYSTEM = SY-HOST

  • DESTINATION =

  • STDOUT = 'X'

  • STDERR = 'X'

  • TERMINATIONWAIT = 'X'

  • TRACE =

  • IMPORTING

  • STATUS =

  • EXITCODE =

tables

exec_protocol =

<b> 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</b>

.

Thanks,

Naren

Read only

Former Member
0 Likes
1,040

Hi,

Yes i had specified all the exceptions.

pls have a look below after if sy-subrc <> 0.

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'

EXPORTING

commandname = zip_commnd

additional_parameters = allinv

  • operatingsystem = 'UNIX'

  • TARGETSYSTEM = SY-HOST

  • DESTINATION =

  • STDOUT = 'X'

  • STDERR = 'X'

  • TERMINATIONWAIT = 'X'

  • TRACE =

  • IMPORTING

  • STATUS =

  • EXITCODE =

TABLES

exec_protocol = t_billdir

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.

MESSAGE e000(msgclass) with 'No permissions'.

ENDIF.

is that right?

thanks

Dany

Read only

0 Likes
1,040

Is there no expert to help me with this?

Dany

Read only

0 Likes
1,040

Dan,

I jst tried with your code it works fine jst check........

REPORT  ZTest.
data: t_billdir type BTCXPM occurs 0 with header line.

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = 'dir'
*additional_parameters = allinv     <i>Commented for test</i>
* operatingsystem = 'UNIX'
* TARGETSYSTEM = SY-HOST
* DESTINATION =
* STDOUT = 'X'
* STDERR = 'X'
* TERMINATIONWAIT = 'X'
* TRACE =
* IMPORTING
* STATUS =
* EXITCODE =
TABLES
exec_protocol = t_billdir
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.
MESSAGE e000(msgclass) with 'No permissions'.
ENDIF.

Can you paste your Error Description..

Regards.

Read only

Former Member
0 Likes
1,040

Hi,

Post the error analysis of the Dump..

Thanks,

Naren

Read only

0 Likes
1,040

Hi Narendran Muthukumaran

The program is issuing a message with no Message Type specified causing the program to abort.

in short text it says : Meesage type " " is unknown.

Others - thanks for your responses. How to see the object s_log_com?

Thanks

Dany

Read only

former_member194669
Active Contributor
0 Likes
1,040

Can you please check authorisation for the following object

S_LOG_COM

aRs

Read only

former_member194669
Active Contributor
0 Likes
1,040

Message Type " " can occurs due to various reasons

Please paste the short dump (atleast first 1-3 pages)

aRs

Read only

Former Member
0 Likes
1,040

Hi,

Ok..Is the dump happening while calling the function module..OR after the function module is called..

Thanks,

Naren

Read only

0 Likes
1,040

Hi,

TRhe following is the short dumps extract :

ShrtText

Message type " " is unknown.

Error analysis

Only message types A, E, I, W, S and X are allowed.

There is probably an error in the program

"<pgm name>".

please help.

thanks

Dany

Read only

0 Likes
1,040

its happening just after the call to the func module and before uf sy-subrc <> 0.