cancel
Showing results for 
Search instead for 
Did you mean: 

UNIX Shell Script

Former Member
0 Kudos

Hello Experts,

I would like to seek for your assistance.

We have a requirement to use UNIX Shell Script to get the first line of the file to identify its message type and use it as its filename as it will be used for interface determination conditions to route these files to its respective receiving system.

The set-up is 3 message types will be sent to its respective receiving system from same sending system. The filename generated from the sending system is of no use as it is not related to the message type of the file so its filename should be taken inside the file.

3 message types:

OR - Purchase Orders

KC - Subcon Purchase Orders

None (Not OR && Not KC) - Sales Orders

The script will be loaded on PI Directory and it will be called by NFS channel after message is processed. I'm having hardtime on making the script. I would like to ask for your help on this.

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Jeffrey

Just my two cents, instead of the approach using Unix shell script, you can consider using Enhanced Receiver Determination instead.

Enhanced Receiver Determination in SAP XI - Process Integration - SCN Wiki

Create an Operation Mapping for your Receiver Determination that checks the first line of the incoming payload and route it to the appropriate receiving system.

You will have more visibility with this approach in terms of monitoring because you cannot use the PI monitoring tools to check what happens during the OS script execution.

Rgds

Eng Swee

Former Member
0 Kudos

Hi Eng Swee,

Thank you for your inputs.

The reason we come up to use UNIX Script is because we're not using mapping for this RICEF. We only route the files from source system (in .csv format) to its corresponding destination system.

We offered that approach which is to use mapping transformation (.csv --> xml --> .csv) however, they want us to use UNIX Script instead to save time on building this RICEF.

Best Regards,

Jeff

engswee
Active Contributor
0 Kudos

Hi Jeffrey

I understand that the client may think that using Unix script might save more time during development. But consider this, even during development stage, you as the integration consultant do not have the proper skills and is having difficulty to develop this Unix script. How would you expect the situation to be when the interface needs to be supported in the future?

Any particular approach is only worth it's TCO if there are relevant skillsets to both develop it during the implementation stage and support it during the BAU stage.

Of course at the end of the day, the approach you or your client decides on is up to you, these are just my two cents.

Rgds

Eng Swee

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Have you thought of maybe doing a 2 stage method? Where you pic up the file and take it through a mapping where you will get the file name and set it in your target directory. The second interface can determine the target system by using the file name?

You will have a bit more control this way. Because the scripting does seem a little much and it might make for a support nightmare.

Regards,

Jannus Botha

Former Member
0 Kudos

Adding to Eng Swee's points, you need to convert your input payload to xml then proceed for operational mapping.

If you convert input file to xml, you can check on basic 'receiver determination' for your requirement as well.

reg, avinash