Showing results for 
Search instead for 
Did you mean: 

Access R/3 4.6C data from BSP

Former Member
0 Kudos


I have SAP Web AS on one server together with BW, and on other servers SAP R/3 4.6C.

On documentation (WAS help, forums, SAP PRESS books, etc.) I can not find some usefull information/code example how to do data retrieval from R/3 in BSP, when this is on different servers and databases. Both databases (R/3 and WAS) are on MS SQL SERVER.

In BSP documentation and tutorials are very simple data retrievals of type:

select * from bsbook into table books.

How can I connect to different databases? Without this possibility is BSP/WAS useless.

I want to use BSP/WAS as platform for overall company reporting - so I will need to access to other MS SQL SERVER databases.

Thanks a lot,

Alexander Talac

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi gurus!


so I do it.

Thanks a lot.


Former Member
0 Kudos

Please remember to mark your message solved and reward those that helped! Marking it solved helps others find it sooner and rewarding the points helps those that helped feel good

Former Member
0 Kudos

Hi there, the guys are right you'll need a few things to get the data you want.

1) RFC Destination (SM59) to your target system

We'll call it "TEST46" for now.

2) In your BSP you'll use the command

CALL FUNCTION '<i>function name here</i>' DESTINATION 'TEST46'

3) A function module to call.

Let's say for example you want to get a list of the servers for your system, first I go into sm59 and create a RFC Destination (Type 3) to my R/3 system and I call it "TEST46".

Then I create a new HTML page with Flow logic in a BSP. On the page layout I simply put the following code.

<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>

<htmlb:content design="design2003">
  <htmlb:page title = " ">

      witab TYPE MSXXLIST,
      content TYPE STRING,
      off TYPE i.

        LIST   = itab
        others = 7.

LOOP AT itab INTO witab.
    FIND '_' IN witab-NAME MATCH OFFSET off.
    INTO content SEPARATED BY '<br>'.

      <htmlb:textView     text          = "<%= content %>"
                          design        = "EMPHASIZED" />


You'll just need to find the function modules you need to access the data you need. Or you need to create your own function module transport it to the system you want data from and then call it from your BSP.

Former Member
0 Kudos

Hi Alexander

You can call RFC from the BSP to access data from 4.6server.



Active Contributor
0 Kudos

You need indeed RFC to connect to your R/3 system.

Just type

call function 'name of your FM' destination 'RFC id'


instead of where you normally put

call function 'name of your FM'

The RFC ids can be found via trx SM59. Contact your system guys to setup an RFC if nothing is set yet.