Skip to Content
One of the requirement in my scenario (IDoc – File) was that after i create the output file, i should be able to run a Unix shell script that will process the file and convert it to an alternate format.  XI3.0 provides a very simple way of handling this using the “Operating System Command” in the File Adapter.  I post my output file in the following folder, /usr/sap/sapout/test/  The shell script is available in the following path, /usr/sap/bin/convert.sh  The figure below explains as to how we call the shell script using “Operating System Command”. image Some points to note,  1) When the operating system command is called, the file name currently being processed can be specified with the following placeholders: %f (file name) %F (absolute file name including path)  2) The OS Command for the file adapter only runs on the system in which the Adapter Framework is running.  3) The above feature works from SP9 onwards.  I hope the weblog is off some use to you folks, just as it was useful for me. 
To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

    1. Peter Inotai
      Hi Puru,

      Transaction code SM49/SM69 might help you, where you can execute OS level commands.
      Program RSBDCOS0 has a similar functionality.

      Best regards,
      Peter

      (0) 
  1. Bernhard Josef Neuhauser
    Hi, could you please mention that at sender side, the os-command will only be run when the file is available.

    This causes massive trouble at our side, as we wanted to mount a volume, take the file and after that umount the volume. This doesnt work!

    (0) 
  2. Bernhard Josef Neuhauser
    Hi, could you please mention that at sender side, the os-command will only run when the file is available.

    This caused massive trouble at our side, as we wanted to mount a volume, take the file and after that umount the volume. This doesnt work!

    (0) 
  3. Former Member
    Hi Sameer,

    We are on XI 7.0 SP 12 under AIX. Meanwhile there is a parameter for os command before message processing and after message processing.

    We want to copy a file for separate processing by an other fileadapter, with the following command /usr/bin/cp %F  /tmp/XI/ECHtoSAP/ELEC/MECOM/testcpbefor_mec

    My experience is, that this command only works in the parameter before message processing in combination with the message protocol nfs.

    Could you please answer the following questions:
    1. Why does’nt the command work in after message processing with nfs?
    2. Which file is expected to be copied after message processing? The original file or the xml produced by the fileadapter?
    3. Do these commands work with Ftp?
    Thanks for a soon answer?
    Regards Marlies

    (0) 

Leave a Reply