Skip to Content
author's profile photo Former Member
Former Member

Calling a RFC from PHP

Hello techies..

I want to call one RFC in PHP, RFC being defined in SAP system.

Can anyone just guide me.. or sample code will help

Regards

Sriram

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2004 at 11:29 AM

    Well,

    I'm using this approach to call RFC from an ASP (or J/VBScript). You should check SAP DCOM Connector (if it's a Windows platform at all). After creating a DCOM object with your RFC FM as its method, you could call it in a way DCOM objects are called via any script language - including php.

    HTH

    Ivaylo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2004 at 11:49 AM

    thnx

    But itwould be of great help if u explain bit more

    Regards

    Sriram

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ok,

      I'll try to explain it further:

      1. Creation of DCOM object - it's quite well explained in SAPHelp 'DCOM Connector Logon Component'. You should also install DCOM Connector component from your SAPGui. After installing the component and following the docu and the link 'SAP Frontend->Development Tools->DCOM Connector' you should have an HTML page opened with quite a lot of info related to DCOM. Creation of a new DCOM object is possible following the links in this 'page' > 'Components -> Object Builder'. You should log-in to your destination SAP system where your RFC module/s is/are. (note - if my memory doesn't betrades me, there was some clue with a user > it should be RFC-enabled, or something like that - check possibilities for user creation).

      2. After successfull login via 'DCOM Connector Object Builder' select RFC Functions instead of BAPIs, put your wildcard to get list of your RFC-FModule/s.

      3. Follow the docu related to creation of the DCOM object further. As a result you will have few C resource files with defined methods and class/es of your DCOM object/s, which need to be compiled to dll-s. This all is related to creation of the DCOM object - and to the support tools supplied by SAP with your SAPGui to do that.

      4. How to check if your DCOM works? You need first to have this DCOM working in your COM environment (check Microsoft Component Services -> and components under 'My Computer' - there should be a COM+ Application with you DCOM object just defined). Next, you should call the point (well, method) from your DCOM object with respect of SAP logon information from your PHP (whatever) code and to pass/retrieve needed information.

      Just to be clear - I do not supply any sample code, because:

      1. It's ASP, and highly modularizated - in a several different files.

      2. My DCOM environment is broken from some time (well, that'a another issue, related to MS 😔 ), and I don't want to supply you a piece of code, which would possibly be with misleading mistake.

      Finaly, it's closely depending on your environment - something I have in my envy may not work in the same way in yours. You should check related docu and examples (there are a few).

      HTH

      Ivaylo

      P.S. One specific: In order to compile dll-s you should have VisualStudio 6, it would generate a make-files for your dll-s.

      Message was edited by: Ivaylo Mutafchiev

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2004 at 01:00 PM

    Hey thanx a lot Mr.Ivaylo Mutafchiev

    Calling Bapi is different from calling an RFC? i think its same right.. i'm just a beginner in this field.. so pls bare with me

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.