Call XI From R3 using RFC

Hi
We are running R/3 4.6C and XI 3.0.
We have a requirement to call a web service from XI at regular intervals (eg 10 mins). From what I have read it is not possible to set the SOAP adapter to poll a web service in this way (as you can with the file adapter). We have therefore decided that we will have to schedule a job in our SAP R3 system to run an ABAP that does nothing but call an RFC that causes XI to call the web service.
I have been following the blogs by Shabarish Vijayakumar and Michal Krawczyk on this subject but am having problems. Based on the blogs, I believe I need to create and RFC and then create a TCP/IP destination (SM59). I have done this using the hostname of our R/3 system and the R/3 gateway. I have created a Program ID and entered that too.  However, if I hit the test connection button I get the following error:
"program zawprogid not registered / CPI-C error CM_ALLOCATE_FAILURE_RETRY."
How do I register the program ID? I believe I have configured the RFC Sender adapter in XI correctly (although I have not created any mappings yet) but don't acvtually understand how the RFC and/or Destination I have created will 'know' to connect to XI?
Any help/advice/pointers would be greatly appreciated!
Thanks
Andy

Hi,
I suggest u to
Define an integeration process and Schedule it to Run ten minutes either by scheduling an fileadapter to pool every 2 hours and send an dummy file ti IP or write an proxy in R/3 system and schedule it(in SM36) to run every ten minutes so that the Integeration Process gets triggered every ten minutes.
In the IP call the Webservice using soad adapter.
Go thru this blog to schedule the BPM <a href="/people/siva.maranani/blog/2005/05/22/schedule-your-bpm Your BPM</a> by Siva Maranani
Go thru this document for scheduling file adapter
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4f61fddf-0601-0010-7ab5-fb749538f6ab">Scheduling File Adapter</a>
Remember to set the thread to solved when you have received a solution
[url=Use a Good Subject Line, One Question Per Posting - Award Points;  Use a Good Subject Line, One Question Per Posting - Award Points[/url]

Similar Messages

  • Calling BRM from UDF using JNDI lookup with @EJB annotation

    Hi Experts
    I am trying to implement a UDF to invoke my BRM Rules set via JNDI Lookup instead of a SOAP Channel lookup.
    I have had a look at the following links/docs:
    Calling BRM from UDF using Public API
    http://www.gleanster.com/system/resources/W1siZiIsIjIwMTIvMDgvMDcvMjAvNDcvNTAvNDMvVGhpbmdzX1lvdV9TaG91bGRfS25vd19hYm91dF9TQVBfTmV0V2VhdmVyX0JSTS5wZGYiXV0/Things%20You%20Should%20Know%20about%20SAP%20NetWeaver%20BRM.pdf
    For item 1 above, the example looks really good, but it doesnt explain how I get access to the following required imports from my UDF:
    import com.sap.brms.qrules.ejb.*;
    import com.sap.brms.qrules.engine.AbstractProject;
    import com.sap.brms.qrules.engine.RuleEngine;
    import com.sap.brms.qrules.engine.RulesetContext;
    import javax.ejb.EJB;
    The second document is really good as well, but I could not figure out how to get it to work from my UDF.
    So, can anyone help me to understand specifically what is required to get this to work?
    Is is possible to invoke the rule set from my UDF?
    How do I give my UDF access to all the required jars/imports?
    I have manage to create a new DC (Development Component) with a public part and this enables me to get my code to compile on my local PC but I am not able to activate it due to the server not having access to the same java packages as my local copy.
    Any help would be greatly appreciated.

    You resolve the dependency by importing the required jars with using the dependency tab for the mapping program.
    As stipulated before, I have managed to resolve the dependency issue but I have now getting the same error as in the forum: Calling BRM from UDF using Public API
    The specific error is:
    com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:238)
    Has anyome manage to get invoke a BRM Ruleset using JNDI?

  • Calling r/3 function module from crm using rfc

    Dear SDN Members,
    I'm given a task to write a method on CRM side which sets the equipment status to "lost" in ABAON transaction on R/3 side.  There is a function module on r/3 side which is RFC enabled and it will set the stuatus to LOST when we call that from CRM.  This RFC fm is not available on CRM side, so I cannot used Pattern.  I'm very new to abap and when i've gone through abap help I got the syntax which i've write with destination parameter.  But I'm really not understanding how to pass Lost status to that fm.
    Here-with I put the coding so far i've done on crm side and also the rfc fm coding aswell on r/3 side.
    Should any one need for more info please do let me know to my yahoo ID:
    [email protected].  I would be pleased to provide you the same.
    The coding on crm side to call the r/3 fm through rfc follows here..
    method IF_EX_EXEC_METHODCALL_PPF~EXECUTE.
    21st November 2006
    Created by Venkata Sunder
    Method for
    Loss Disposal - ERP Equipment Status Update
    Damage Notifications
    Called by actions
    DATA: lv_guid_ref                      TYPE crmt_object_guid,
          lv_kind_ref                      TYPE crmt_object_kind.         "#EC NEEDED
    DATA: lv_preview                       TYPE char1.                    "#EC NEEDED
    DATA:
          lt_header_guid                   TYPE crmt_object_guid_tab,
          lt_orderadm_i_buffer             TYPE crmt_orderadm_i_wrkt,
          gs_orderadm_i_buffer             TYPE crmt_orderadm_i_wrk,
          lt_orderadm_i_db                 TYPE crmt_orderadm_i_wrkt,
          gs_orderadm_i_db                 TYPE crmt_orderadm_i_wrk,
          lt_customer_i_buffer             TYPE crmt_customer_i_wrkt,
          gs_customer_i_buffer             TYPE crmt_customer_i_wrk,
          lt_log_handle                    TYPE balloghndl,
          return                           TYPE bapiret2_t,
          gs_return                        TYPE bapiret2,
          ev_rfcdest                       TYPE rfcdest.
    get guid for referenced object
      CALL METHOD cl_hf_helper=>action_helper->get_ref_object
        EXPORTING
          io_appl_object = io_appl_object
          ip_action      = ip_action
          ii_container   = ii_container
        IMPORTING
          ev_guid_ref    = lv_guid_ref
          ev_kind_ref    = lv_kind_ref
          ev_preview     = lv_preview.
    current crm transaction is identified
      IF lv_guid_ref IS INITIAL.
        RAISE EXCEPTION TYPE cx_socm_condition_violated.
      ENDIF.
    Header GUID
      APPEND lv_guid_ref TO lt_header_guid.
    Read order details from buffer
      CALL FUNCTION 'CRM_ORDER_READ'
        EXPORTING
          it_header_guid       = lt_header_guid
        IMPORTING
          et_orderadm_i        = lt_orderadm_i_buffer
          et_customer_i        = lt_customer_i_buffer
        CHANGING
          cv_log_handle        = lt_log_handle
        EXCEPTIONS
          document_not_found   = 1
          error_occurred       = 2
          document_locked      = 3
          no_change_authority  = 4
          no_display_authority = 5
          no_change_allowed    = 6
          OTHERS               = 7.
      IF sy-subrc <> 0.
      ENDIF.
    call function  destination 'DERCLNT200'.
    (I'm not understanding how and wt to pass to this fm.)
    The fm 'Z_SET_EQUIPMENT_STATUS_RFC'  on r/3 side has the following coding..
    DATA:
        lv_objnr  LIKE equi-objnr,
        lv_estat  LIKE tj30-estat,
        wa_return LIKE bapiret2.
      LOOP AT equipment_status.
        SELECT SINGLE objnr
          FROM equi
          INTO lv_objnr
         WHERE equnr EQ equipment_status-equnr.
        SELECT estat
          FROM tj30t
          INTO lv_estat
         WHERE stsma = equipment_status-stat_profile
           AND txt04 = equipment_status-status
           AND spras = sy-langu.
        ENDSELECT.
        CALL FUNCTION 'STATUS_CHANGE_EXTERN'
          EXPORTING
          CHECK_ONLY                = ' '
            client                    = sy-mandt
            objnr                     = lv_objnr
            user_status               = lv_estat
          SET_INACT                 = ' '
          SET_CHGKZ                 =
          NO_CHECK                  = ' '
        IMPORTING
          STONR                     =
         EXCEPTIONS
           object_not_found          = 1
           status_inconsistent       = 2
           status_not_allowed        = 3
           OTHERS                    = 4.
        IF sy-subrc NE 0.
          MOVE:
            equipment_status-equnr       TO wa_return-message_v1,
             'E'                         TO wa_return-type,
             ' Equipment Update failed'  TO wa_return-message.
          APPEND wa_return TO return.
        ELSE.
          COMMIT WORK.
        ENDIF.
        CLEAR wa_return.
      ENDLOOP.
    ENDFUNCTION.
    Thanks in advance.
    Best Regards!
    Sam.

    Hi,
    You can write similar to the below.
    CALL FUNCTION 'CRM_ORDER_READ'
    <b>DESTINATION  'DERCLNT200'</b>
    EXPORTING
    it_header_guid = lt_header_guid
    IMPORTING
    et_orderadm_i = lt_orderadm_i_buffer
    et_customer_i = lt_customer_i_buffer
    CHANGING
    cv_log_handle = lt_log_handle
    EXCEPTIONS
    document_not_found = 1
    error_occurred = 2
    document_locked = 3
    no_change_authority = 4
    no_display_authority = 5
    no_change_allowed = 6
    OTHERS = 7.
    Thanks
    Ramakrishna

  • JCO RFC Provider: "Bean not found" when calling EJB from ABAP via RFC

    Hello,
    I'm having trouble calling an EJB in a CE 7.1 system from ABAP via RFC. I'm trying to use the JCO RFC Provider service, which mean that I want to expose an EJB so that it can be called via Remote Function Call.
    I have documented everything, including the code and the deployment descriptors I wrote, in this thread in the CE forum: Jco RFC Provider: Bean not found
    If there's any chance you can help, please do me a favour and look into the problem.
    Thanks a lot!
    Thorsten

    Hi Vladimir,
    Thank you very much, your help was immensely valuable.
    I just had to add the function declaration to the Home Component interface, everything else was correct, and now it works.
    Cheers,
    Thorsten

  • Calling BDC from Java using JCO

    Hello Everyone,
    Is it possible to call a BDC from Java program using JCO ?

    Are you serious with that question? Did you try to build the web service client before? Because this is exactly the same. Try to find "building web service clients" instead "Calling BPEL from java". By default (probably) every BPEL process has both WSIF and SOAP end points, just use correct WSDL address.

  • Calling package from java using JNDI properties

    Hi there,
    I have created an interface to transfer data from oracle to JMS XML Queue. It is inside a package and have generated a scenario.
    The scenario works well when executed from the ODI designer. When I execute it from java it throws an error. The error is
    java.sql.SQLException: Cannot load connection class because of underlying exception: 'javax.jms.JMSException: Cannot create the initial JNDI context
    Is there any ways to set the JNDI properties, (any set methods for ODIConnection object)
    Cheers

    Are you serious with that question? Did you try to build the web service client before? Because this is exactly the same. Try to find "building web service clients" instead "Calling BPEL from java". By default (probably) every BPEL process has both WSIF and SOAP end points, just use correct WSDL address.

  • Not able to call Java from flex using RemoteObject

    hi,
    I am badly stuck in compiling my flex app to connect to Java code on the server side using LCDS remoteObject component.
    My swf file wouldn't trigger a method on the Java class, below is the snippet of all relevant codes, i just don't know what to do.
    Please help on what am i missing or what i am doing wrong in this.
    ------> 1. here is the ant target that uses mxmlc compiler option
    <target name="flex-compile" depends="copy-all">
        <mxmlc
          file="${uisrc}/OnlineServicesPortal.mxml"
          output="${prjdeploydir}/OnlineServicesPortal.swf"
          actionscript-file-encoding="UTF-8"
          keep-generated-actionscript="true"
          incremental="true"
          as3="true">
    <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
    <source-path path-element="${FLEX_HOME}/frameworks"/>
    <library-path dir="${FLEX_HOME}/frameworks" append="true">
         <include name="libs" />
    </library-path>
    <compiler.source-path path-element="${FLEX_HOME}/frameworks"/>  
    <compiler.include-libraries dir="${FLEX_HOME}/frameworks" append="true">   
         <include name="libs/datavisualization.swc" />   
         <include name="libs/fds.swc" />  
         <include name="libs/player/10/playerfds.swc" />   
         <include name="locale/en_US/datavisualization_rb.swc" />
         <include name="locale/en_US/fds_rb.swc" />
    </compiler.include-libraries>
    <!--compiler.services filename="${src}/flex/services-config.xml"/-->
    <!--context-root context-path="portal"/-->
    <default-size width="500" height="600" />
        </mxmlc>
      </target> 
    ---------2. services-config.xml file
    <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        <properties>
    <polling-enabled>false</polling-enabled>
        </properties>
    </channel-definition>
    <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
    </channel-definition>
    ----------3. remoting-config.xml file
    <service id="remoting-service"
        class="flex.messaging.services.RemotingService">
        <adapters>
            <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
        </adapters>
        <default-channels>
            <channel ref="my-amf"/>
            <channel ref="my-http"/>
        </default-channels>
        <destination id="portal">
            <properties>
                <source>com.mssb.portal.impl.PortalService</source>       <!---this class file is valid & exists-->
            </properties>
        </destination>
    </service>
    -----------4. mxml file
    <mx:RemoteObject  id="myRO"  destination="portal"  result="createFieldsResultHandler();"  fault="createFieldsFaultHandler();">
    </mx:RemoteObject>
    myRO.persistServiceDefinition(serviceDef)                           //called from action script function invoked upon a click of a button.

    actually , I have laready given print stataement for the data in the context property file that you can see in the output. Today I am also able to call the bpel process using the same java program from my DOS command promt(cmd). Don't understand why the problem is occuring in unix.
    please help.

  • Calling LabVIEW from C# Using ActiveX?

    Hi,
    I try to call LabVIEW VI's from C# using ActiveX/COM, but I am not
    successful. I was able to do this from C++ and there are nice articles on
    the NI site dealing with the C++ integration.
    I tried to follow the instructions of the C# help, using a wrapper for the
    LabVIEW application call. I included the TypeLib that I created with the
    tlbimp-tool in my project. Basically my code looks like this:
    LabView50TypeLib._Application myLV = new
    LabView50TypeLib.ApplicationClass() ;
    LabView50TypeLib.VirtualInstrument myVI = new
    LabView50TypeLib.VirtualInstrument();
    myVI = myLV.GetVIReference(,?,?);
    myVI.SetControlValue();
    myValue= myVI.GetControlValue();
    myLV.Quit();
    I even don't know if the fi
    rst line is correct. I know that the second line
    is not OK, because there is no class "VirtualInstrument" - but from what
    class should I derive my instance for the VirtualInstrument? And different
    from my C++ implementation, the GetVIReference now needs 3 parameters
    instead of 1 (the path).
    What am I doing wrong? Does anybody have a working example on this?
    Thanks a lot & best regards,
    Martin Schellenberger

    Hello
    After adding a reference to the LabVIEW type lib to the project (I just to o to Project >> Add Reference and I browse for the typelib myself), and including the labview namespace at the top,here is what I tried
    using LabVIEW;
    //form code here
    //Event for button code
    LabVIEW.Application lv = new LabVIEW.ApplicationClass();
    LabVIEW.VirtualInstrument vi= lv.GetVIReference(@"c:\a.vi","",false);
    vi.FPWinOpen=true;
    vi.Run(true);
    So all it does is it opens the VI and runs it, seems to work fine. Hope this helps
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • Getting information from SOAP call in R/3 using RFC adapter

    I have following scenario:
    R/3 (RFC)> XI (SOAP)> WebService
    I want to know within the R/3 if the call to the webservice fails (Server not available, etc), that there is a problem.
    Is there any exception code or way to fill the exception with a return code? I have tried to map a exception, but it will only be created, if the WS-Application creates the exception not if an error occurs in XI or the AF.
    Best regards
    Helmut

    You can capture exception from R/3 and send it to external WebService. You need to add a Module  to your SOAP Communication Channel:
    Module Key: SOAP
    Parameter Name: XI.SendMode , value = http
    Module Key: SOAP
    Parameter Name: XI.TargetURL , value = http://XXX(your url to the XI engine)
    Module Key: SOAP
    Parameter Name: XI.User , value = <username>
    Module Key: SOAP
    Parameter Name: XI.Password , value = <password>
    Once you do this you can get R/3 Exceptions passed to your w/s.
    Thanks
    Ashish

  • How do I read a R/3 table from VB6 using RFC?

    I am using a DLL created in VB6 to connect to an R/3 system.  I then call several ABAP functions I have written and exchange data.  This all works nicely.
    I now have a R/3 function into which I pass a parameter, and it gathers some data into a table which has 3 string fields.  I want to pass that data back to my VB6 DLL, and read all the records from the table.
    Unfortunately I have absolutely no idea where to start.  If someone could post an example of reading data directly from a table I would appreciate it.
    Here is the function so far.  It passes the parameter "scenario" to the ABAP Function, and then needs to read the table directly.
        Dim oR3Func As Object
        Dim oFuncLoadDocument As Object
        bResult = Logon(oR3Func, "SAP.BAPI.1")
        If bResult Then
            Set oFuncLoadDocument = oR3Func.Add("ZMT_SET_SCENARIO")
            oFuncLoadDocument.exports("SCENARIO") = sScenario
            bResult = oFuncLoadDocument.Call
            ' Retrieve and read table here???
        End If
    Kind Regards
    Jack

    There are two "generic" function modules to read table data from SAP. The one above and RFC_GET_TABLE_ENTRIES. However, most of the time you want to filter/process the data before it leaves SAP as large data handling is slow in VB. If you have ABAP skills it is often better to develop your own RFC enabled function module.
    As of the VB access, there is several OCX you can use, documentation link:
    http://help.sap.com/saphelp_46c/helpdata/en/39/7e11e0ac6011d189c60000e829fbbd/frameset.htm
    Help title: SAP Automation RFC and BAPI Interfaces (BC-FES-AIT
    It's all fairly straightforward once you get into it.
    PS I almost always use the functions OCX...

  • Call report from forms6i, use report server from 10gAS

    Hi there,
    I have been searching for any info I can get that will help me to do the following:
    I want to call an Oracle 6i report from Forms6i but I want to specify a Report Server running on an Oracle10gAS box. Can this be done in a client/server fashion, meaning the forms/reports are on a Citrix box, accessed by many users.
    Everything is working fine, using "RUN_PRODUCT" and the "Report Background Engine" to generate the report on the Citrix box. However, I want to use the report server from 10gAS runinng on another box, to generate these reports.
    Please reply with any help you give.
    Regards
    shak

    Hello,
    You can use the compatible element in the reports server configuration file :
    Description
    The compatible element is available for backward compatibility with Oracle Reports 6i clients (RWCLI60.EXE, RWCGI60.EXE, RWQMU60.EXE, RWRQM60.EXE, RWRQV60.EXE, 6i Forms). When compatible is set to 6i, Reports Server will make use of an executable file named rwproxy that listens for requests from a 6i client and forwards them to a 10g server.
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_conf.htm#i1005999
    Regards

  • HOW TO HIDE USERID PARAMETER, WHEN CALL REPORT FROM MENU USING FORM 10G

    good morning colegas
    i'm from panama
    when i call a report from a oracle forms menu, its send a user, pass and bd in the url, i need to hide this parameter userid,
    cuando llamo un reporte desde forms, se envia el usuario, pass y bd en el url nesesito ocultar estos parametros del url, le agradeceria si alguno tiene algun eejmplo q me de, de como ocultar estos parametros
    i'm using oracle forms y report 10g
    this is my msn [email protected]
    slds desde panama

    this document show us, only when i call a report from a forms, but not from a menu!
    but to hide these parameters, i need to create a bean in a block a way and the menus do not allow me to create these objects
    you done this before?
    you have a example?
    slds desde panama

  • SAP Module sapnwrfc: Retrieving data from SAP using RFC

    I'm sorry, if I'm asking about something that's obvious in SAP. I need to develop a perl application in a remote server that will receive a requisition from an abap application.
    I'm using the SAP Module sapnwrfc. I connect to SAP Gateway with no errors and execute the function sapnwrfc::installFunction (no errors returned) but I can't find the transaction in SAP. Anybody has some document about configurations that I need to do in sap ? Or anybody could see the code above and tell me what is wrong?
    [code]
    #!/usr/bin/perl
    use sapnwrfc;
    use Data::Dumper;
    use utf8;
      SAPNW::Rfc->load_config;
      my $conn = SAPNW::Rfc->rfc_connect;
      # print "Testing SAPNW::Rfc-$SAPNW::Rfc::VERSION\n";
      my $func = new SAPNW::RFC::FunctionDescriptor("ZRFCDAZEL") ;
      my $pipedata = new SAPNW::RFC::Type(name => 'DATA',
                                          type => RFCTYPE_TABLE,
                                          fields => [{name => 'OBJTY',
                                                      type => RFCTYPE_CHAR,
                                                      len => 4},
                                                     {name => 'OBJKY',
                                                      type => RFCTYPE_CHAR,
                                                      len => 10},
                                                     {name => 'ATTRIBUTES',
                                                      type => RFCTYPE_CHAR,
                                                      len => 255},
      $func->addParameter(new SAPNW::RFC::Export(name => "COMMAND",
                                                 len => 255,
                                                 type => $pipedata));
      $func->addParameter(new SAPNW::RFC::Import(name => "COMMAND1",
                                                 len => 255,
                                                 type => $pipedata));
    $funcao->callback(\&do_remote_pipe);
    $conn->disconnect();
    exit;
    sub do_remote_pipe {
        my $param = shift;
        print "\nPARM : " . $param->{'ZDUS'} . "\n";
        $param->COMMAND1([{'LOG'=>'Execute ZDUS PARAMETER '}]);
        $param->COMMAND1([{'STATUS'=>'S'}]);
        return 1;
    sub do_global_callback {
        warn "Running global callback ...\n";
        return 1;

    Timo,
    I included the code in the VO and in my bean, I was able to generate this code snippet:
    public String GetParamterSetup() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("applyParamVOCriteria");
            operationBinding.getParamsMap().put("vcodetype", codeType);
            Object result = operationBinding.execute();
            System.out.println(result);
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
    I was able to get the result from the System.out.println. It returns null when there is no match. However, I  want  to return the entire row or have access to that attribute.  For instance if I have 'GB011' what the system will display for me is 'viewrow [oracle.jbo.Key[GB011 ]]'
    Pls, how can I have access to individual attributes like ParamSetup.codeType, ParamSetuo.MainCode etc...

  • Calling Transaction from ALV using OO Method

    Hi,
    My requirement is as follows....
    I have an ALV grid with columns such as month wise Total of a GL account  say JAN, feb etc...
    When I double click on any of these cells it should take me to the respective Transaction (say FBL3n for the GL account and the company code) . I am able to track the GL account for which the total is displayed and company code is one of my selection criteria. In the main screen of the FBL3N we have to enter the posting date and i also want the Radio button against "all items', presently default is against 'Open Items'. So how can i proceed.
    Thanks and Regards,
    Namit

    DATA gr_event_handler TYPE REF TO lcl_event_handler . .. ..
    *--Creating an instance for the event handler
    CREATE OBJECT gr_event_handler .
    *--Registering handler methods to handle ALV Grid events
    SET HANDLER gr_event_handler->handle_double_click FOR gr_alvgrid .
    CLASS lcl_event_handler IMPLEMENTATION .
    *Handle Double Click
    METHOD handle_double_click .
    PERFORM handle_double_click USING e_row e_column es_row_no .
    ENDMETHOD .
    CLASS lcl_event_handler DEFINITION
    *Double-click control
    Methods:
    handle_double_click
          FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING e_row e_column
               i_fieldrows      TYPE lvc_t_row.
               w_fieldrows LIKE LINE OF i_fieldrows,
      CALL METHOD o_alvgrid->get_selected_rows
                 IMPORTING
                 et_index_rows = i_fieldrows.
      LOOP AT i_fieldrows INTO w_fieldrows.
        READ TABLE i_batch INTO w_block INDEX w_fieldrows-index.
    if sy-subrc = 0.
    *       CLASS LCL_EVENT_RECEIVER DEFINITION
    CLASS LCL_EVENT_RECEIVER DEFINITION.
    * Event receiver definitions for ALV actions
      PUBLIC SECTION.
        CLASS-METHODS:
    * Row Double click for dirll down.
           HANDLE_DOUBLE_CLICK
             FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                IMPORTING E_ROW
                          E_COLUMN
                          ES_ROW_NO.
    ENDCLASS.
    * Implementation
    * Every event handler that is specified below should also be set after
    * the object has been created.  This is done in the PBO processing.
    * with the following command
    * SET HANDLER oEventreceiver->handle_toolbar FOR o_Alvgrid.
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
    *&      Method handle_double_click
    * This method is called when the user double clicks on a line to drill
    * down.
    * The following are exported from the ALV
    * LVC_S_ROW
    * LVC_S_COL
    * LVC_S_ROID
      METHOD HANDLE_DOUBLE_CLICK.
    * The double click drill down processing should be
    * coded in the form below.
       PERFORM F9007_HANDLE_DOUBLE_CLICK USING E_ROW
                                               E_COLUMN
                                               ES_ROW_NO.
      ENDMETHOD.
    ENDCLASS.
    *&      Form  F9007_HANDLE_DOUBLE_CLICK
    * This form is called when the user double clicks on a line to drill
    * down.
    *      -->P_E_ROW_ID    - Row ID  text
    *      -->P_E_COLUMN_ID - Column ID
    *      -->P_ES_ROW_NO   - Row number
    FORM f9007_handle_double_click USING p_row
                                         p_column
                                         p_row_no.
      DATA: lw_output LIKE LINE OF i_output.
    * RG:16/11/2004 - Start of Changes
    * Need to check that a subtotal or grand total line has not been
    * double-clicked, otherwise the report will produce a short dump!
      check p_row+0(1) is initial.
    * RG:16/11/2004 - End of Changes
      READ TABLE i_output INDEX p_row INTO lw_output.
      CASE p_column.
        WHEN 'KNUMA'.
          IF NOT lw_output-knuma IS INITIAL.
            SET PARAMETER ID 'VBO' FIELD lw_output-knuma.
            CALL TRANSACTION 'VBO3' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'VBAK_VBELN'.
         IF NOT lw_output-vbak_vbeln IS INITIAL.
          SET PARAMETER ID 'AUN' FIELD lw_output-vbak_vbeln.
            CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'VBRK_VBELN'.
          IF NOT lw_output-vbrk_vbeln IS INITIAL.
            SET PARAMETER ID 'VF' FIELD lw_output-vbrk_vbeln.
            CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    ENDFORM.                    " F9007_HANDLE_DOUBLE_CLICK

  • Calling Java from C++  using JNI

    I have been looking into JNI, and I ran sample where the Java calls Native c/c++ methods. Now to do it the other way, having C/C++ to call Java method by passing argument and getting the results back, I think I need to follow the example in Chapter 5 sun, which is creating JVM in the native code, accessing the Java class and method, and then finally calling the Java method.
    First I like to know if I'm right above, and second if I need to pass a C++ class as the argument to the Java method and then the result from the method is Java class, what would be the best way to do? I know I need some to convert the class type some how.
    Thanks,
    Eli

    Are you also wanting to launch Java from C++? Unzip JAVA_HOME/src.zip and look at the source code for java.exe
    If you have native called by a Java object then you can call any non native method in the Java object from the C/C++ side. Example Java method, reportCurrentStagePosition :
        public void reportCurrentStagePosition (int fault, double x, double y, double z, double &#966;)
            if (fault == 0)
                reportCurrentStagePosition (x, y, z, &#966;);
            else
                faultMessage = "Stage Positioning Fault: X="+eFormat(x)+", Y="+eFormat(y)+", Z="+eFormat(z)+", phi="+eFormat(&#966;);
                System.out.println ("***Aero Fault Message: "+faultMessage);
        public native long moveLinearXYZPhiAxes() throws PositionException;Then from the native side of moveLinearXYZPhiAxes the obj is the calling object and has the reportCurrentStagePosition method
    JNIEXPORT jlong JNICALL Java_com_hypernex_goniometer_AerotechWrapperN_moveLinearXYZPhiAxes (JNIEnv *env, jobject obj)
         jmethodID jReportPositions = env->GetMethodID(env->GetObjectClass(obj), "reportCurrentStagePosition", "(IDDDD)V");
         if (jReportPositions == NULL)
              printf ("***ERROR*** about to call jReportPositions but it is NULL ***\n");
         else
             env->CallVoidMethod (obj, jReportPositions, 0, xFeedBack, yFeedBack, zFeedBack, phiFeedBack);
    }Since reportCurrentStagePosition returns a void you use the CallVoidMethod of env. The "(IDDDD)V" is the signature of the method. If it is there GetMethodID returns a non null.

Maybe you are looking for