cancel
Showing results for 
Search instead for 
Did you mean: 

Service Call via RFC

Former Member
0 Kudos

Hi all.

I am currently starting with WDA and facing some problems in calling BAPI via RFC.

We have a "plain" WAS without SD or other modules. Our data is distributed over multiple R/3 systems.

When I try to implement a Service Call to the BAPI BAPI_CUSTOMER_GETLIST via RFC I got the error message that this FM is not available in the current system (WAS).

Does anyone has experience in how to get this working?

What is the best practice here?

- Building wrapper on WAS which calls the FM via RFC on the other system?

- Installing missing modules on WAS ?

Any comment would be appreciated.

Cheers,

Sascha

Accepted Solutions (1)

Accepted Solutions (1)

Chandresh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sascha,

Prerequisities for using service call wizard is that the function module or in your case BAPI has to exit in the system.

Check SAP Help Docu for Serivce call.

https://www.sdn.sap.com/irj/sdn/collaboration

I hope that will help you to figure out your problem.

Chandresh

Answers (4)

Answers (4)

former_member185845
Active Participant
0 Kudos

Dear Sascha,

As of now i dont think we can use RFC/BAPI on remote system.

As of 2004s ,When you are creating Service call. the text clearly shows, that the RFC/BAPI shold exist only in exisitng system. it canont make a call located on different system.

Regards

chandra

Former Member
0 Kudos

Hi again.

To shorten development time we considered the following solution:

We are generating web service proxy classes on the WAS for the BAPIs of the R/3 system we want to use. Afterwards we are generating wrapper function modules which will use these proxies. So we do not have to import all missing structrues cause these are generated automatically during proxy generation.

I tested this already with BAPI_CUSTOMER_GETDETAIL2. Calling the wrapping fm which calls the service proxy works fine from se80. I do get a result via the service.

Then i generated a service call for my WEBDynpro component using the wizard in WDA.

Silly is that the generated code is not compilable cause of missing ,. Anyway after correcting I tried to run my webdynpro application and when the fm gets called via the generated service method I receive the following message:

CODE SOAP:111

ERRORTEXT Unallowed RFC-XML Tag (SOAP_EINVALDOC)

Any ideas?

Why is it working when i call the fm directly but not when calling it from my webdynpro app?

Thanks in advance

Sascha

Message was edited by: Sascha Dingeldey

Message was edited by: Sascha Dingeldey

Former Member
0 Kudos

Hello.

Finally i resolved this issue. I had to define a http destination for my logical port of the service in transaction LPCONFIG and a RFC-connection of type G in SM59.

Now I receive my data in the WDA application. The only strange thing still is that the wizard do not work propper with my function module which wrapps the service proxy call.

Anyway thanks for all the usefull input.

Cheers,

Sascha

Former Member
0 Kudos

Hello Sascha

Could you explain the way how to config the following action?

We have same problem. We want to call the RFC in R/3 from SRM.

Thank you,

Best Regards,

SH.

Former Member
0 Kudos

Hi.

If your requirement is just to call a RFC from you WD4A app you can do it as usal.

You just can not use the qizard to create the call.

call function '1234'

destination 'RFC'

Or what do you need to do?

Cheers,

Sascha

Former Member
0 Kudos

Good evening Sascha,

I want to call BAPI_DOCUMENT_CREATE2 from my WD4A application for which i need to specify a RFC Destination.

From the thread it seems i need to create

1.RFC Destination of Type 'G'.

2. Enter Target host

3. Enter Path prefix

4. Enter Service number.

but from where do i get these details 2,3 and 4. Please help me with this issue.

Attached snippet:

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'

DESTINATION <b>'A2C_logon_user'</b>

EXPORTING

documentdata = ls_doc

"pf_http_dest = 'SAPHTTPA'

IMPORTING

documenttype = lf_doctype

documentnumber = lf_docnumber

documentpart = lf_docpart

documentversion = lf_docversion

return =

Former Member
0 Kudos

Hi Abhishek.

If you want to call the BAPI via RFC a normal RFC Abap Copnnection of type 3

will do the job.

Cheers,

Sascha

Chandresh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sascha,

First -

Sorry for sending wrong link, here is again correct link for service call

http://help.sap.com/saphelp_nw2004s/helpdata/en/d7/951b42f828df2ce10000000a1550b0/frameset.htm

Second -

Answer to your Questions -

If WAS doesn't have structure or BAPI, i am thinking best practices would be to check support package, if there is support package availble, which has all component you need, i would take this way.

second would be transport to WAS, but not creating Object in WAS, because than you would be have difficulties to track on this.

Let me know if you have more questions.

Chandresh

Former Member
0 Kudos

Hi Sascha,

<b>Problem:</b>

You do not have RFC in the WAS in which you have WebDynPro ABAP. But you need to call a RFC which resides in the different WAS. Right?

<b>

Solution</b>

You can call a RFC using the keyword "Destination". All you have to do is to create a RFC Destination where your RFC exists using TCode sm59. Then when you are calling the

RFC just follow the below example...



CALL FUNCTION func DESTINATION dest 
                     parameter_list.

Hope it helps.

Regards,

Maheswaran.B

Former Member
0 Kudos

Hi all and thanks for the answers.

But my main question was what are the best practices to handle RFCs to an R/3 system when all the BAPIs and structures/tabels which are needed to call the BAPI are only available on the R/3.

- Install missing packages on WAS?

- Transport structures to WAS?

- Define structures on WAS?

Sorry if my first question was not so clear.

Cheers,

Sascha

Former Member
0 Kudos

Hello again.

I forgot to remark that I tried generating the call with the WIZARD. I guess when I would have tried to implement the service call by hand, that this would work, but anyway the main question is how this is handled the best way. For example how to handle missing structures or how to handle upcomming updates on the backends so that eventually structures or FM parameters are changing.

Cheers,

Sascha

former_member183804
Active Contributor
0 Kudos

Hello Sascha,

I assume you refer to the Service Call Wizard in the WD Explorer of SE80. This wizard generates the pure invocation as you will do in your coding too. The only difference is that you get a (a little bit bulky) context definition granted for free.

Maybe your rfc Destination or some other argument is not valid. Have you already tried to check the invocation within WD in the debugger and later use exact the same arguments in test mode within se37?

Regards,

Klaus

the WD Service