cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice for pulling SAP table contents with PI?

Former Member
0 Kudos

Hello,

Sometimes we have simple requirements to send some table contents (e.g. master data) from SAP to a 3rd party system. We get this done today using RFC sender adapter, but maybe there is a better way.

I know we can do RFC look-ups in PI to query a table (passing table name as parameter), but this at mapping level when a message is already in progress.

How can we set an interval for an adapter in PI to query a table in SAP, and send its contents to a 3rd party system without developing an ABAP function and the associated T type RFC Sender RFC ports / unique Program ID for each individual message type?

I'm looking for absolute minimal setup work on the ERP backend (e.g. don't want to take precious time of Basis and ABAP team resources each time we want a different table or view extracted).

Many thanks for your ideas!

Aaron

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

maybe you can build one RFC which will always pull the data from table (tablename as input)

and put result it in one field (everything_combined) with a separator like "|" or ","

and then in PI you will just create a new scenario for each table and in PI mapping you can split the fields into different columns each time in a different way

This would be pretty generic and could work for all master data tables right ?

Regards,

Michal Krawczyk

former_member184681
Active Contributor
0 Kudos

There is an RFC-enable function module RFC_READ_TABLE that does exactly what Michal has described. This should help you put the automation to even higher levels. The FM takes the import parameters: QUERY_TABLE for the database table name and DELIMITER for the delimiter to be inserted between field values in each line.

Hope this helps,
Greg

P.S. Besides, since you are asking about best practices: it isn't really a best practice to send out data flashes from SAP DB directly

Former Member
0 Kudos

Thanks for the direction Michal and Greg!

Along these lines, with RFC sender I believe the schedule / interval / trigger is still always on the ABAP side. For example, file or JDBC sender channels have a Polling Interval on the Processing tab but I haven't seen this for RFC Sender

Does anyone know a way to initiate an RFC Read Table based on a polling interval in PI?

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>Does anyone know a way to initiate an RFC Read Table based on a polling interval in PI?

no need to do the pull - you can also push it on intervals from SAP

1. create a report in ABAP which you can schedule - SM36 and it will do the

a) call RFC_READ_TABLE as Grzegorz mentioned to get table data

b) send the data to PI (via RFC) - can be the same RFC structure as RFC_READ_TABLE

but call it in background mode with a comit

this way you don't need to pull

and there is no way to make RFC sender adapter into the pull mode

Regards,

Michal Krawczyk

Former Member
0 Kudos

Thanks a lot for confirming that Michal. We do already push these from SAP with our current RFC Sender messages and scheduled background tasks / commit (probably based off one of your nice blog posts!)

I was looking for a pull solution totally within PI so we could control this in one place (PI Config), and not bother another team (ABAP)...and also not hide the schedule somewhere outside of PI.

I wonder if I could trick PI using another adapter type, like file. The trigger file could have empty content and doesn't get destroyed. Set the File Sender adapter to what polling interval I want, and in the mapping just do my RFC Read Table with fixed parameters. I might try that if there is no better way to keep it all contained within PI.

former_member184681
Active Contributor
0 Kudos

The approach you described should be possible in theory, assuming that some file is what you need to deliver to the target system, and your system version is high enough. In such case, you should be able to use RequestResponseBean for that purpose. Read some more for instance here:
http://wiki.sdn.sap.com/wiki/display/HOME/Using+Request+Response+Bean+Module+in+FILE+Adapter

Hope this helps,
Greg

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Pulling within PI is possible. One catch here is whether the purpose, better design and efficiency are achieved.  To trigger file you can go automated time planning scheduler to poll the file at desired time interval or another feasible way is externally controlling the adapter through which you can set the file in start mode for some time intervals.  You might do RFC lookup in the mapping to achieve this. Also you can use even http adapter to achieve this.You can post data to http adapter externally and this way you can trigger too.

You can use wget command in the script to run http links.

Example: William's link you can tweak for later pi versions too.

http://scn.sap.com/people/william.li/blog/2007/05/04/control-communication-channels-externally-witho...

Former Member
0 Kudos

Baskar, that is really cool information from William Li about the external channel controls!

I think PI could really use some improvements for setting specific, time based schedules for certain integration scenarios. Maybe a home grown schedule using these external channel controls would be an approach.

In my case I think I'll be trying my file trigger idea and will share the results here.

Regards,

Aaron

baskar_gopalakrishnan2
Active Contributor
0 Kudos

PI has builtin Availability time Planning scheduler. Hope you know about it.  You can see this link

Answers (0)