Page 1 of 1

SAP Pack - parameterize SAP connection

Posted: Mon Jan 17, 2011 10:43 am
by BI-RMA
Hello everybody,

we want to extract Data from multiple SAP-Host-Systems worldwide using an SAP-BAPI-Call.

Unfortunately it seems to be possible to parameterize Usernames, Passwords, Language and Client-Id on the SAP-BAPI-Stage, but not the DataStage Connection to SAP itself, namely the Application Server name and the System number. :(

This would mean: If we want to launch the same BAPI-Call on 6 different SAP-Hosts, we need 6 jobs to do this. Has anybody got a better idea?

Posted: Fri Feb 10, 2012 6:57 pm
by bashbal
I found this topic while I was trying to do the same thing. I know this is old, but I found a solution and thought I'd share it to help the next guy.

We have DS 8.5 Enterprise and R/3 pack 6.5.1. We use ABAP RFC, but I believe it will work for other SAP stages.
--------
The SAP stage does allow you to set the connection via parameter, but it is not obvious on how to do it. There seems to be two types of connection values, one for design time and another for run-time. Parameters can only be used for run-time.

On the General tab, set the design time connection by using the "Select" option and choose one of the connections you defined using SAP Admin. This is for ALL designer function to SAP. (Validate Stage, Build, Generate Program, Load Program etc.)

Now add connection parameter by selecting "Use Job Parameter", this will bring up a dialog box with free-form text that defaults to "Connection". This value must be an existing parameter name, or you will be prompted to create it. We use parameter sets, so I used "SAP_ABAP.pSapConn", which is defined by us. When you click 'Ok' you will find the parameter name is in typical DS format enclosed in parenthesis, just to the right of your design-time connection value. In my case, BRD is our development connection, so I get "BRD (#SAP_ABAP.pSapConn#)"

The next step is to populate SAP Logon Fields with job parameters in the standard DS format. We use the same parameter set, so I have values #SAP_ABAP.pSapUser#, #SAP_ABAP.pSapClient# etc.

Compile then run the job. Enter the connection you wish to use (as defined in SAP Admin client), and the parameter should replace the design-time value.

Posted: Sat Feb 11, 2012 6:41 am
by qt_ky
Lyle, thanks for sharing. That may come in handy for me too, in a few months...

Posted: Mon Feb 13, 2012 8:57 am
by BI-RMA
Thanks also, Lyle.

I'm not working on that same project anymore, but I'll light a candle for You should I ever have to work with SAP-Pack in DataStage again. (:-)).

I consider this resolved.