cancel
Showing results for 
Search instead for 
Did you mean: 

Help on raising error in OS command after message processing

Former Member
0 Kudos

Hi experts,

I've a receiver CChannel with OS command after message processing.

Even if OS command gives an error the message in Message Monitoring Adapter Engine show Successful.

Is possible to raise an error in Adapter Engine message status when OS command is in error?

I'm on XI 7.0 SP14.

Thanks

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Fabio,

                You cannot know from channel log on whether individual commands within a script has executed successfully or not. However you can obviously create a log file holding details of whether individual commands threw errors or not. Here is an example how you can create a log file

suppose in UNIX or Linux environment you want to see contents of a non existing file. we would use the command "cat t", where "t"  is the name of the file. Since "t" is non existent then the command throws error. We capture the error in "logfile" file as shown below. 

cat t &> logfile

now let us check contents of the "logfile"

cat logfile

output

------------

cat: t: No such file or directory

Thus for all commands in the script you can have a logfile which can be viewed later.

You can also check this wonderful blog from Michal Krawczyk

where he shows the same method for windows operating system.

Regards

Anupam

Answers (1)

Answers (1)

engswee
Active Contributor
0 Kudos

Hi Fabio

Unfortunately, it is not possible to raise error as this is a drawback/limitation of using OS command.

Refer to the following from SAP online library (although it's for 7.4 but it applies for 7.0 as well)


Message processing is independent of any errors that occur during the execution of a configured operating system command.

Defining Operating System Commands Before/After Processing - Advanced Adapter Engine - SAP Library

Rgds

Eng Swee