SAP Pack - parameterize SAP connection

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

SAP Pack - parameterize SAP connection

Post 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?
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
bashbal
Premium Member
Premium Member
Posts: 23
Joined: Mon Mar 01, 2004 12:26 pm
Location: Milwaukee, WI
Contact:

Post 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.
Last edited by bashbal on Mon Feb 13, 2012 10:48 am, edited 1 time in total.
Lyle
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Lyle, thanks for sharing. That may come in handy for me too, in a few months...
Choose a job you love, and you will never have to work a day in your life. - Confucius
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post 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.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
Post Reply