Blogs

Ryan Quackenboss

BI Process Chains with Dynamic System Command
Ryan Quackenboss
Business Card
Company: Kindred Healthcare
Posted on May. 13, 2008 09:24 AM in ABAP, Business Intelligence (BI)

Subscribe.Subscribe
Print. Print
Permalink Permalink

For those of you who have had to manage the system commands in process chains, hopefully you'll appreciate this little tip.  Here is the scenario...

You need a remote file to process/execute (.cmd/.exe) inside a process chain.  This remote file resides on a file server, not the application server.  The issue is when you create the command, you only have a free text field input box to define your command. Like the one below.

So you resolve yourself to put in the UNC path to the \\server\path\filename.xxx. to get it to work.  Here's the kicker, if your environment is like most, you have different file servers for each tier of your landscape....so when you transport this process chain through the landscape, you have to go in and manually update the path to the file in the Q/A and Production tiers.  This is problematic on many different levels...so here is my solution.

Create a System Parameter with a value to the server name and use that parameter in the command string.  Pretty simple, how do you do it?

Locate the profile file on the application server and add an entry. You can find the file here:

\\<Server Name>\sapmnt\<SID>\SYS\profile. 

Here is an example from my file where we added the parameter INTERFACESERVER = whatever your serverName is.  Before this parameter is available, the system has to be bounced.  If you don't have access to this file, have your Basis folks help you out.  Do this in each system in your landscape.

Now that the parameter is available, we can create/edit existing commands to utilize this parameter.  Now when you transport this command through the landscape, the servername will resolve to whatever is set in this file. Pretty cool.

Lets create the command: Run  TCode SM69, and click the create ICON:

Fill in the Command name and in the opperating system command field, use the parameter you created in the profile.  Wrap the parameter in $/ / like this below:

You can see the list of available commands and your new one sorted alphebetically in SM69: 

 

Notice the difference between the commands above and below and my new one...the server path is "hard codded" in the string in the other two.  Now I can go edit my older commands and update them to the new parameter. 

Now you're ready to add this new command to a process chain. Pull up the process chain you want to add the command to, either via RSA1 or RSPC transaction codes.

Drad the command object into the process chain designer:

You'll see this prompt, click the create ICON:

Create you're variant:

Now choose the command you created ealier:

Finally, your process chain can be connected to include this new command:

 

Congratulations, you've just created a new parameter and used it in a command, and put that command into a process chain.  How cool was that!!!

Ryan Quackenboss is a software engineer who prides himself on coming up with the most robust, efficient and innovative business solutions


Add to: del.icio.us | Digg | Reddit


Comment on this articleThis solution works for us, if you know of an easier or more efficient way, please feel free to share.
Comment on this weblog
Showing messages 1 through 7 of 7.

Titles Only Main Topics Oldest First

  • COMMAND IN PROCESS CHAIN
    2008-05-14 23:14:23 Muchumarri Amarnath Reddy Business Card [Reply]

    Hi Ryan,


    Could you please elaborate the scenario please and mention in what scenario this will be more useful to use to reduce the manual intervention.


    Thanks in advance...
    Amarnath

    • Scenario Elaboration.
      2008-05-15 05:20:14 Ryan Quackenboss Business Card [Reply]

      I can try...
      Imagine you are building this process chain in the Development environment for transport through the landscape (I know it's tough), and this process chain needs to execute a command file that is located on a development file server. If you hard code the path to the file in system command, once you transport the process chain to your Q/A and Production system you will be forced to change the system command in the subsequent systems to point to their prospective file server.
      Example:
      Development file server MDSAP00
      Q/A file server MQSAP00
      Prod file server MPSAP00


      If the parameter in system command contains the path to the dev file server...
      \\mdsap00\folder1\folder2\filename.xxx and you transport this system command in the process chain, and you run that process chain in Q/A and Production without updating the path, the systems will run the file on the DEVELOPMENT server.
      To get the file on the Q/A box to run, you will have to manually update the command parameter to point to the Q/A file server \\mqsap00\ect...


      If your organization is like mine and periodically does a "Refresh" of the Q/A system (replace with a copy of production setup and data) then the Q/A box now has system commands that point to the Production file server. NOW you have to touch each and EVERY command to point it back to the Q/A file server.


      Talk about pain in the arse.


      Fix: replace the sever name with a variable that resolves to the server applicable to each environment.


      Hope that clears up the scenario.
      Quack

  • Changing the machine in the process chain
    2008-05-14 13:38:22 Gil Borges Neto Business Card [Reply]

    Ryan,


    I have the following scenario:


    I have a process chain where I need the
    Specific step run in Central instance, my question is: I can use the command system for this?


    Thanks,
    Gil Borges

    • Changing the machine in the process chain
      2008-05-15 05:06:13 Ryan Quackenboss Business Card [Reply]

      Hi Gil,


      If I understand your question correctly, and you are referring to the application server, there is and SAP delivered parameter SAPDBHOST that will resolve to the name of the app server. Just remember to wrap the parameter in $/ / like this:
      $/SAPDBHOST/


      Hope that helps.
      Quack

  • Nice
    2008-05-13 10:10:02 Dennis Horvath Business Card [Reply]

    You are good, but your hair looks a little long in your picture

Showing messages 1 through 7 of 7.