Calling Remote enabled Function module in java using RFC Destination

Hi
We are on Portal 7.3 ehp1 sp9.
Steps followed are :
RFC Destination called “SAP_RFC” has been created as below :
Configuration -> Destinations -> RFC Destinations
Connection and Transport:
Load balancing :Yes
Provided : SystemID / MS Server / MS Server Service / Logon Group / Gateway Host / Gateway Service
SNC : Inactive
Logon Data:
Authentication : Current User (Assertion Ticket)
Language : EN
Client : XXX
Repository Connection:
Destination Name : This Destination
Specific Data:
pooled Connection Mode : Yes
Max : 5
Size : 10
Max. wait time : 10,000
Ping Destination results : Successfully connected to System XXX as per user XXXXXXX.
JAVA Code as Follows:
JCoDestination destination = JCoDestinationManager.getDestination("SAP_RFC");
//destination.ping();
JCoRepository repository = destination.getRepository();
JCoFunction function = repository.getFunction("FM_NAME");
function.execute(destination);
Lines highlighted in RED color throwing an error as below :
{"ERROR":"Initialization of destination JCO_RFC failed: Incomplete logon data. on <SID> mshost <MS_HOST>/ com.sap.conn.jco.JCoException: (103) JCO_ERROR_LOGON_FAILURE: Incomplete logon data. on SID mshost MS_HOST"}
And found that no COOKIE with the name “SAP_SESSIONID_<system>_<client>” was not found, I am afraid that “Assertion Ticket” was not created in above scenario.
To confirm SSO configuration working, i have followed below steps:
1) Created System Object pointing to R/3 and tests were successful for authentication type "SSOLOGONTICKET / ASSERTIONTICKET"
It's J2EE application, no references or any other additional configuration been made part from above.
Any help ?
Thanks

Here is log ..Assertion ticket could not be retrieved. Error was null
Log Record Details
Message:
Assertion ticket could not be retrieved. Error was null
Severity:
Error
Date:
2014-04-23
Time:
20:28:26:056
Category:
/System/Security/destinations
Location:
com.sap.security.core.server.destinations.service.AssertionTicketRetriever
Application:
Thread:
System [2]
Data Source:
j2ee/cluster/server0/log/system/security_00.log
Arguments:
Passport User Activity ID:
3a7af5ddca8b11e384bd8adb6f484d33
Message ID:
Session:
Transaction:
User:
Time Zone:
+0800
Customer Message Component:
BC-JAS-SEC
Runtime Component:
tc~sec~destinations~service
Correlation ID:
3643650000002747
Passport Session:
3A7AF5DDCA8B11E384BD8ADB6F484D33
Passport Connection:
3a7af5ddca8b11e384bd8adb6f484d33
Passport Connection Counter:
0
Log ID:
C0000AD01D7B002200000EA5009800B2
Host:
host
System:
XXX
Instance:
J00
Node:
server0

Similar Messages

  • 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

  • How should tables be defined in remote-enabled function modules used in PI

    Hi,
    I know the outside-in development approach is best practice (although there is some conflicting viewpoints on the best approach for new developments, some favouring RFC).
    If I was to create a new remote-enabled function module in a backend system then import this into the Integration Repository what is the recommended parameter group for defining tables against the RFC?
    I've tested using import, export, changing and tables and they all work but SAP recommends not using the tables option anymore but when using import/export/changing option I receive a warning that using these parameters with deep/nested data types can lead to performance problems.
    Can someone offer any advice?
    Thanks,
    Alan

    > I've tested using import, export, changing and tables and they all work but SAP recommends not using the tables option anymore but when using import/export/changing option I receive a warning that using these parameters with deep/nested data types can lead to performance problems.
    You use import and export parameters, and avoid deep and nested structures.

  • Calling a remote enabled function module which does not exist in caller sys

    Hi,
    I have a a system ABC from which I am trying call a rfc enabled fm(Test) present in system XYZ.
    The fm(Test) does not exist in the system ABC so I am getting generation errors and dumps.
    Is there a way for me to call these remote enabled function modules which does not exist in the caller system without the obvious errors etc.
    Is there any special way.
    Thanks

    Hi,
    please check this sample:
    REPORT  zcallfm                                 .
    DATA: xv_return TYPE sysubrc.
    CALL FUNCTION 'DOESNOTEXIST'
    DESTINATION   'NOWHERE'
    EXPORTING     caller                = sy-sysid
    IMPORTING     return                = xv_return
    EXCEPTIONS    system_failure        = 1
                  communication_failure = 2
                  OTHERS                = 4.
    It shouldn't throw any generation errors in your system!
    Regards,
    Klaus

  • How to develop an Remote Enabled Function Module

    Hi All,
    I'm totally new to ABAP. I have a requirement to create a Remote Enabled Function Module, which I can use to call from an external program like Java using JCo.
    The functionality of the Remote Function is to write some data into certain fields of the tables AFPO and JEST.
    Can someone please guide me, how to do the above described task. Is there any code snippets available, that would be really gr8.
    Thanks & Best Regards,
    Chandrasekhar.

    you shuld have import parameters like this
    i_aufnr tpye afpo-aufnr.
    i_posnr tpye afpo-posnr.
    i_matnr tpye afpo-matnr.
    i_wemng tpye afpo-wemng.
    i_ltrmi tpye afpo-ltrmi.
    i_meins tpye afpo-meins.
    i_dwerk tpye afpo-dwerk.
    i_objnp tpye afpo-objnp.
    i_stat type jest-stat.
    in exceptions
    enter_key_data.
    assume all the fields are mandatory.
    types: begin of t_ekpo,
          aufnr like ekpo-aufnr,
          posnr like ekpo-posnr,
          matnr like ekpo-matnr,
          wemng like ekpo-wemng,
          ltrmi like ekpo-ltrmi,
          meins like ekpo-meins,
          dwerk like ekpo-dwerk,
          objnp like ekpo-objnp, "for Status update
          end of t_ekpo.
    types: begin of t_jest,
           objnr like jest-objnr,
           stat  like jest-stat,
           end of t_jest
    data: x_ekpo type t_ekpo,
          x_jest type t_jest.
    **need to validate before sending it to EKPO.
    if not i_aufnr is initial
         and not i_posnr is initial
         and not i_objnp is initial
         and not i_stat is initial.
    X_ekpo-aufnr = i_aufnr.
    X_ekpo-posnr = i_posnr.
    X_ekpo-matnr = i_matnr.
    X_ekpo-wemng = i_wemng.
    X_ekpo-ltrmi = i_ltrmi.
    X_ekpo-meins = i_meins.
    X_ekpo-dwerk = i_dwerk.
    x_ekpo-objnp = i_objnp.
    modify EKPO from X_ekpo .
    if sy-subrc = 0.
    commit work.
    endif.
    x_jest-objnr = i_objnp.
    x_jest-stat = i_stat.
    modify JEst from X_jest .
    if sy-subrc = 0.
    commit work.
    endif.
    else.
    raise exception enter_key_data.
    endif.
    please let me know if you need any validation on those.
    regards
    vijay
    Message was edited by: Vijay Babu Dudla

  • Message handling in remote enabled function module .

    Hello experts ,
    I am creating a remote enabled function module which must return a warning message based on certain condition . Inorder to meet the requirement  I have added this line in the Fm's source code :
    " Message Wxx(message class) with a ."
    But when I am trying to use it , the above given message is dispalyed as an error message . Could you please let me know where am I going wrong . TIA.
    Regards,
    Prakrita Kapoor.

    Hi Prakrita,
    Try building below code within the RFC after you have added return structure in your RFC parameters.
      IF sy-subrc NE 0.
        CLEAR message.
        message-msgty = 'E'.
        message-msgid = 'ZMI'.
        message-msgno = '001'.
        message-msgv1 =  ID.
      PERFORM return_message USING message
                                   CHANGING return.
      Endif.
      form return_message USING    VALUE(P_MESSAGE)   LIKE MESSAGE
                                   CHANGING P_RETURN  LIKE BAPIRETURN.
      CHECK NOT MESSAGE IS INITIAL.
      CALL FUNCTION 'BALW_BAPIRETURN_GET'
           EXPORTING
                TYPE       = P_MESSAGE-MSGTY
                CL         = P_MESSAGE-MSGID
                NUMBER     = P_MESSAGE-MSGNO
                PAR1       = P_MESSAGE-MSGV1
                PAR2       = P_MESSAGE-MSGV2
                PAR3       = P_MESSAGE-MSGV3
                PAR4       = P_MESSAGE-MSGV4
           IMPORTING
                BAPIRETURN = P_RETURN
           EXCEPTIONS
                OTHERS     = 1.
    endform.

  • Standard Remote-Enabled Function Module to display data.

    Good afternoon,
    Is there any Standard Remote-Enabled Function Module which can be used to display a list of material, supplier or stocks data?
    First time, I was trying to use FM link to BW Extractor as MDEX_MATERIAL_MD for Material Attributes, but these kind of FM are not Remote-Enabled and not released.
    My second solution is to find a Standard Remote-Enabled Function Module which can be used to display a list of material, supplier or stocks data, but I haven't it yet.
    May someone help me in this?
    Thanks in advance for your answers.
    Best regards,
    Paul d'ORIGNY

    Hi,
    Suppose you want to read data from the vbrk table in ECC through a function module, then you can define the function module as "remote-enabled"(attribute tab in se37-processing type). You can try the following code out:
    FUNCTION Z_EM_INVOICE.
    *""Local Interface:*
    *"  IMPORTING
    *"     VALUE(I_FKDAT) TYPE  FKDAT OPTIONAL
    *"  TABLES
    *"      E_VBRK STRUCTURE  VBRK
    *select * from vbrk into table*
    e_vbrk where fkdat = i_fkdat.
    ENDFUNCTION.
    From BI you can call the function odule as follows:Supposing that you are calling the function module in the start routine of a dso:
    data : v_dest_system TYPE char255.
    data: l_vbrk type table of vbrk.
    v_dest_system = 'DRDCLNT010'
    CALL FUNCTION 'Z_EM_INVOICE''
    destination v_dest_system
    EXPORTING
    i_fkdat = <passing variable>
    e_vbrk = l_vbrk.
    Regards,
    Anjana.

  • How to Create a Remotely Enabled Function Module

    Hi All,
    How to Create a Remotely Enabled Function Module.
    I Want to Create a FM Using Sample Data , This for Practice
    What Fields can i give in the Import and Export Parameters.
    Please Give me one Example
    Can Any one Give me the Steps to do this.
    Regards
    Vamsi

    Hi Vamsi,
    Lets do simple example where you will first create a RFC in one server (say A) and create normal program in othere server (say B). Finally you will call the RFC in A from B.
    Do the following steps for creating RFC in server A.
    1. log on to server A
    2. go to se37
    3. Edit -> function groups-> create function group and give the function group name (say ZGRP).
    4. create a FM ( say Z_TEST_RFC) in se37 providing the function group which is created just now.
    5. go to attribute tab -> choose remote-enabled module from processing type.
    so that your FM will become RFC.
    6. provide the import parameter in import tab.
    we will provide only two import parameters.
    - parameter name : P_NUM1, typing: TYPE, associated type : I & <b>check the pass value</b> (all the parameters of RFC must pass by value).
    - parameter name : P_NUM2, typing: TYPE, associated type : I & <b>check the pass value</b>
    7. provide the export parameter in export tab.
    parameter name : P_SUM, typing: TYPE, associated type : I & <b>check the pass value</b>
    8. write the given simple code in source code tab.
    FUNCTION Z_TEST_RFC.
    P_TOT = P_NUM1 + P_NUM2.
    ENDFUNCTION.
    Do the following steps for creating ABAP program which will call the RFC in server B.
    1. se38 - > creat a program.
    2. write the given simple code.
    data tot type i.
    call function 'Z_TEST_RFC' destination '<b>XXXXXX</b>'
      exporting
        p_num1 = 10
        p_num2 = 15
      importing
        p_tot = tot.
    write tot.
    please note that <b>XXXXXX</b> is RFC connection which is avialable in <b>sm59</b> transaction in server A.
    -go to sm59 - > abap connection (list of RFC connection configurations are avialable). choose server B connection and replace it of <b>XXXXXX</b> in the code.
    finally you can execute the normal abap program that will call the RFC and display the result.
    Regards,
    Sukhee

  • Remote enabled Function module for a simple report program

    Hi Experts ,
    I have to convert a Simple list report program to a remote enabled function module, so that it can be used from the online applications.
    One option that comes to my mind is to create some import parameters for all the selection screen fields and then the result will be fetched in the export tables in function module. and call that report program using call transaction or submit program.
    I Dont know whether this is a best solution or not, can you please help me with your suggestions?
    Regards,
    Ashish Shah

    Hi,
    You can use the SUBMIT statment in the Function module , then in the report program you need to EXPORT the Result to the list then use the IMPORT option in the function moduel then pass the data to the TABLE parameters so that the data will be avilable in the table parameters
    Regards
    Sudheer

  • Difference between BAPI and remote enabled function module

    Hi!
    what is the difference between remote enabled function module and
    BAPI.
    How do we use remote enabled function module .
    thanks
    Amit

    Please search the forum before asking basic questions.

  • Remote enabled function modules IN R/3

    hi,
    i posted this question before but i didnt get a convincing answer to move forward
    when data is sent to bw from r/3 there should be some remote enabled function modules which are  getting fired.
    so people told me to find fm for each data source in 'ROOSOURCE'  table.
    and to debug to get the function module IN RSA3.
    i got those function module but these r 'NORMAL FUNCTION MODULE'  but not
    'REMOTE ENABLED FUNCTION MODULES'
    IF REMOTE ENABLED FM'S ARE NOT GETTING TRIGGERED THEN HOW IS DATA GOING TO BW
    PLEASE SUGGEST ME I AM WAITING FOR LONG TIME FOR A GOOD ANSWER.

    OK,
    this is a big project.... You want to simulate a BW system.... I think don't think it is not possible but R/3 is a pair exchanging a lot of information and a lot of settings have to be done.... this seems to me very complex....
    This will depend on what kind of datasource you want to extract....
    - Master data: I would directly go the you SAP database and extract the info form the tables directly (we are actually doing that)
    - LO datasources would be a bit more complex since you'll have to initialize your datasource from a BW system.... Or figure out how this is working, meaning reverse engineering of the whole stuff! You could even think about using the exits for the business events, e.g. when an article doc is created, write the data in a flat file and/or write it directly to the DB of your DW....
    Also I would setup a BW system anyway; it is so easy then to manage all this data... You could then stick to load the data to the PSA and extract it very easily to your external DW. Even BW provide much more extraction capabilities once the data is stored there....
    They're a lot of solutions like always... the challenge is to choose the best one.
    hope this helps...
    Olivier.

  • Remote enabled function module to copy a variant

    Hi
    Kindly let me know whether there is any remote enable function module to copy a variant  and save a  variant.
    Thanks and Regards
    neeta

    HI,
    Use the Function moduels
    <b>RS_VARIANT_CLIENTCOPY 
    RS_VARIANT_COPY   </b>    
    Regards
    Sudheer

  • Error in executing remote enabled function module

    Hi All,
    I have created a remote enabled function module.
    The function module works fine without entering the RFC dest sys.
    When i enter the RFC dest sys and execute it, i get the error
    Exception                  SYSTEM_FAILURE
    Message ID               00
    Message number      341
    Message                   Runtime error CALL_FUNCTION_NOT_FOUND has occured
    The RFC connection actually works fine to connect to the system when i test it from SM59.
    But what could be the reason for the above error?
    Actual intent is that I want to execute FM created in sys1 to be executed on sys2 from sys1 itself.
    Regards,
    Rahul

    Hi,
    I guess there is no other way. For an RFC enabled function module it should exist in SYS2 .Then only you will be able to call from SYS1.
    Your RFC connection will work fine if you provide all the technical parameters correctly.A RFC function module has nothing to do with this connection
    Regards,
    Lakshman.
    Edited by: Lakshman N on May 14, 2010 11:25 AM

  • Remote-enabled function module could not be imported

    Hello all,
    I have a problem. In so called Enterprise Services Builder I want to import a remote-enabled function module. But I got the following error:
    Could someone tell me how to fix the problem? thx.
    Best regards,
    Fanglin Ye

    Hi,
    I hope I already answered.
    "You can transfer his changelist to your name for activation"
    Goto--> changelist tab --> right click on your colleague's changelist --> transfer
    then activate under your name

  • Remote-Enabled Function Modul G/L Accounts

    Hi!
    I am looking for remote-enabled function moduls (or BAPIs) to create and change G/L Accounts. There are two function moduls which seems perfect (GL_ACCOUNT_INSERT and GL_ACCOUNT_UPDATE) but these two are not remote-enabled.
    Does anyone know some alternatives that i missed?
    Thanks in advance,
    Frank!

    Hi.
    Look at this function module
    BAPI_ACC_GL_POSTING_POST

Maybe you are looking for