Calling a BAPI in R3 from CRM

I called a BAPI to retrieve information in R3. However, I encountered a problem when our R3 is in the downtime period. It raises a short dump for my program. Is there any exception that I can catch to prevent or other solutions to prevent this short dump.

Hi again,
1.  I use the exception like the below code, right?
Yes, use it like this only.
2.
Does my RFC function on R3 have these exceptions ?
No, the RFC/BAPI does not have
any such exceptions
in the definition
(u will see in SE37, that,
the EXCEPTIONS tab is empty)
3. BUT
  IT IS A FACILITY (AUTOMATIC FACILITY)
  PROVIDED BY R3
  TO DETECT SUCH COMMUNICATION PROBLEMS
(The RFC FM/BAPI does not Take care of this by itself,
bcos, if communication is not there,
then the FM is not at all called in the target system)
4.
If not, how can the system know that when the system is cracked, it will raise the exception 2?
Do not worry.
If the target server is DOWN,
then your program will not give run time error.
However, u should chec sy-subrc
to DETECT, some error has occured bcos
of communication.
5. To get a taste of it,
  just copy paste
(Change the DESTINATION as per your requriement,
  give some wrong destination,
  give some right one
  etc)
6.
REPORT abc.
DATA: msg_text(80) TYPE c.
CALL FUNCTION 'RFC_PING' DESTINATION 'PRD'
EXCEPTIONS
communication_failure = 1 MESSAGE msg_text
system_failure = 2 MESSAGE msg_text.
IF sy-subrc <> 0.
*----- MESSAGE
message 'problem' type 'I'.
ENDIF.
regards,
amit m.

Similar Messages

  • How to call a Bapi or RFC from a custom logon module

    Can you provide an example of how to call a bapi or rfc from a custom logon module? (used to authenticate in portal)

    Hello all,
    Is it possible to use SAP JRA instead?
    We have a Connector deployed on the WebAS 6.40. From an EJB (Webservice) it is possible to lookup the connector, but if i try to lookup the connector from a custom LoginModule, i get the following error:
    Path to object does not exist at java:comp, the whole lookup name is java:comp/env/eis/SAPJRA_CRMDC.#
    The whole lookup in LoginModule looks
    try
                   initialcontext    = new InitialContext();
                   connectionFactory = (ConnectionFactory) initialcontext.lookup("java:comp/env/eis/SAPJRA_CRM");
              } catch (Exception ex)
                   location.errorT(ex.getMessage());
    Regards Oliver

  • How to call the BAPI in BI from SAP

    I want to run the process from SAP and then call a BAPI in BI to retreive some data into SAP.
    What syntax should I used?
    Thanks
    Bye

    Hi,
    While calling BAPI use "Destination" and provide the RFC destination created for BI in SM59.
    Neel Thakkar.
    Edited by: neelthakkar on Mar 27, 2010 12:37 PM

  • 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

  • When to call a BAPI inputexecute method from webdynpro-java?

    Hello... I'm a little concerned about a situation I'm having. The thing is that I'm trying to use the Bapi_Qualiprof_Change bapi with some test and hard coded data for a future application. It works fine if I fill the input profile_add table in the init() method of my view and then directly call the onActionModifyQualification method (inside the same init() where i filled the parameters).
    On the contrary, if I change the code that intializes the data to the onActionModifyQualification or create an special method to initialize it wich is called later with an action button, then it doesn't work.
    After many test I noticed that i have to call the bapi execute method right in the init... is there something I can do to fix it? or is it that i must do it in order to make it work?
    I have my controller's context mapped to the bapi's model and the view context mapped to the controller's one.... is it good or do i have to build a similar structure to capture the parameters before and then copy the values into the controller's context??
    Thanks a lot!!

    Thanks for your answer, but it doesn't let me do that because wdModifyView is static. Therefore if 2 people are trying to use it, it's goning to be all mixed up, isn't it?
    Anyway, what I really want is executing the bapi when I press the button (that's when it should call the action that calls the bapi). But it only works if I call the action in the init method.

  • Call to R/3 transaction from CRM CIC0 Action Box

    Hi All,
    I configured in CRM the action box to call MySAP (transaction VA01), I used the method BOR with the object BUS2032 and the method CREATEWITHDIA, but I need to configure the action box to pass data from the transaction CIC0 into the R/3 system via data flow, for example:
    I need to send the field value CCMSEARCH_STRUCT-BP1_PARTNER (Partner - CIC0) to field KUAGV-KUNNR (Sold-to-party - VA01).
    I tried to use &BUS1006005& to send the Business Partner, but it doesn´t work.
    Any documentation is very appreciated.
    Regards
    Cássia Lima.

    Steps involved in solving “escape Sales area popup while creating cash sale order from CIC0 transaction” issue is,
    In CRM system
    Go to transaction EWFC0.
    Configuration name “ZABOXUSA”.
    Click on change button and select transaction ‘VA1_’ in transaction group R3OE.
    Click on details button and change object type to ‘ZZBUS2032’ from ‘BUS2032’.
    Assign values to transaction VA1_ in data flow.
    Save and close.
    In R/3 system,
    Go to transaction ‘SWO1’ (Business Object Builder).
    Copy object ‘BUS2032’ as ‘ZZBUS2032’ including program.
    In the object ZZRBUS2032 click on the method ‘CREATEWITHDIA’ then click on the button program on the application tool bar.
    At line number 196 added the following lines of code.
    DATA :        WA_SALESPARTNERS LIKE LINE OF SALESPARTNERS,
                      IT_KNVV TYPE KNVV.
    **MODIFIED TO ELIMINATE SALES AREA POP-UP FOR CASH CUSTOMER.
    IF SALESHEADERIN-SALES_ORG IS INITIAL.
      LOOP AT SALESPARTNERS INTO WA_SALESPARTNERS WHERE PARTN_ROLE = 'AG'.
         SELECT * FROM KNVV INTO IT_KNVV WHERE
                    KUNNR = WA_SALESPARTNERS-PARTN_NUMB.
          SALESHEADERIN-SALES_ORG = IT_KNVV-VKORG.
          SALESHEADERIN-DISTR_CHAN = IT_KNVV-VTWEG.
          SALESHEADERIN-DIVISION = IT_KNVV-SPART.
         ENDSELECT.
      ENDLOOP.
    ENDIF.
    **END MODIFICATION.
    Save and generate the program.
    Please let me know any comments on this.
    Regards,
    Srini

  • How to call a BAPI from Visual Composer

    hi,
       I am new to Visual composer. can some body give me step by step information of calling a bapi or RFC from VC.
    Thanks in advance,
    Gopi

    Hi Gopi,
    Steps involed for calling RFC/BAPI from VC
    1. Choose Model->Select Data Services.
    (Alternatively, click the Data button in the task panel toolbar.)
    2. In the Portal field at the right end of the main toolbar, enter the URL of the portal from
    which you can access the back-end system used by the iView.
    For example, you could enter: http://<yourportal>:50000/..
    3. Click the traffic light icon to the right of the Portal field. The portal Welcome screen
    appears.
    4. Log on to the portal as a user that exists in the connected back-end system, or which is
    mapped to a user of that system. Click OK.
    Once a connection to the portal is established, a list of system aliases defined in the
    portal system landscape appears in the System drop-down
    list.
    From the System drop-down list, choose the SAP system that contains the function module.
    6. Under Search SAP System, click the Search tab and in the Name field, enter the search string: <RFC/BAPI name>. Then click Search (at the bottom).
    5. A list of function modules matching the search string is displayed.
    7. Drag the function module/bapi from the Data task panel into the
    workspace: The data service is added to your model.
    8. Periodically save your work. To do so, choose File->Save Model.
    Finally test the iview in VC.
    In the workspace, drag your mouse from the Input port of the data service, <inputform> and dragn your mouse from the outut port from the data service <tabelview and etc..>
    or
    Go through the this documentation...
    http://help.sap.com/download/netweaver/nw04/visualcomposer/VC_60_UserGuide_v1_1.pdf
    Thanks,
    Suriya.

  • Calling a Web Service from CRM 620

    I prototyped from ECC 640 and created a client Proxy to call a WebService.  However,  Does anyone know if it is possible to call a WebService from CRM 620?  If so, how do you do it.  So far I have found documentation to create Server Proxies but not client proxies.
    I attempted to import the wsdl to XI as an external definition, then in CRM executed transaction: SPROXY to bring in the wsdl definition.  This did not work....
    Here is our landscape:
    -CRM 4.0 with XI-addon 2.0 & kernel patch level 1253
    -XI 3.0 SP 15
    thanks
    -steve

    Welcome to SDN.
    CRM 620 - i have no knowledge on CRM, but i guess its on WAS6.20. if yes you can consume websevice using CL_HTTP_CLIENT class.
    check out the following weblog for details.
    /people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
    Regards
    Raja

  • Calling Web Service from CRM using proxy

    Hi all,
    I'm facing a problem trying to call a web service from CRM (WAS 620) via XI 3.0. The response that XI recieves from the web service contains SOAP Envelope, and the mapping fails because of it. I built the proxy manually, because if I load WSDL the proxy generation in CRM generates error that sais that external definition coudn't be used.
    Is there any way to remove SOAP envelope from the response while mapping?
    Is it possible to call web service from WAS 620?
    Thanks!!!!
    Anya.

    Hi Manish,
    SOAP adapter does pass the message to XI (this message contains SOAP envelope although XI expects to get message without it), and during the mapping step i get "Runtime Exception in Message-Mapping transformatio~".
    I suppose it's because i created proxy manually. I did so because when i imported WSDL, and tried to generate proxy in CRM, i got an error message that said that proxy couldn't be generated because external definitions are only allowed in XI 3. But my XI version is 3.0! And when I generate the same proxy in my R/3 system that is installed on WAS 640, it works.
    What can I do?
    Cheers,
    Anya.

  • Call RFC(in R3) from CRM

    Hi,
    I am trying to call a RFC from CRM. I developed that FM in R3.
    and trying to call like ..
    CALL FUNCTION Function_Name
    EXPORTING
    IMPORTING
    But when I run from CRM, in runtime it is terminated.
    Please suggest a way to call FM (in R3) from CRM.
    Thanks,
    Gaurav

    You need to specify the destination.It is the RFC name to R/3.
    CALL FUNCTION Function_Name destination <lvdest>
    EXPORTING
    IMPORTING
    If this doesn't solve your issue , Pls provide the termination message .

  • I am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    i am trying to generate purchase order and i create a BAPI also which is active.
    But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    Hi,
    Yeah i tried my Z_BAPI in R3 and then giving some ERROR.
    This is my CODE-
    FUNCTION ZBAPIPOTV2.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(POHD) TYPE  ZPOHD OPTIONAL
    *"     VALUE(POITEM) TYPE  ZPOITEM OPTIONAL
    *"  TABLES
    *"      RETURN STRUCTURE  BAPIRET1 OPTIONAL
    data: ls_pohd type bapimepoheader,
             ls_pohdx TYPE bapimepoheaderx,
             lt_poit TYPE TABLE OF bapimepoitem,
             lt_poitx TYPE TABLE OF bapimepoitemx,
             ls_poit TYPE bapimepoitem,
             ls_poitx TYPE bapimepoitemx.
       MOVE-CORRESPONDING pohd to ls_pohd.
       MOVE-CORRESPONDING poitem to ls_poit.
       ls_pohdx-comp_code = 'x'.
       ls_pohdx-doc_type = 'x'.
       ls_pohdx-vendor = 'x'.
       ls_pohdx-purch_org = 'x'.
       ls_pohdx-pur_group = 'x'.
       ls_poit-po_item = '00010'.
       APPEND ls_poit to lt_poit.
       ls_poitx-po_item = '00010'.
       ls_poitx-po_itemx = 'x'.
       ls_poitx-material = 'x'.
       ls_poitx-plant = 'x'.
       ls_poitx-quantity = 'x'.
       APPEND ls_poitx to lt_poitx.
    CALL FUNCTION 'BAPI_PO_CREATE1'
       EXPORTING
         POHEADER                     = ls_pohd
        POHEADERX                    =  ls_pohdx
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
    *   PARK_COMPLETE                =
    *   PARK_UNCOMPLETE              =
    * IMPORTING
    *   EXPPURCHASEORDER             =
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
      TABLES
        RETURN                       = return
        POITEM                       = lt_poit
        POITEMX                      = lt_poitx
    *   POADDRDELIVERY               =
    *   POSCHEDULE                   =
    *   POSCHEDULEX                  =
    *   POACCOUNT                    =
    *   POACCOUNTPROFITSEGMENT       =
    *   POACCOUNTX                   =
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
    *   POLIMITS                     =
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
    *   POSRVACCESSVALUES            =
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
    *   POCOMPONENTS                 =
    *   POCOMPONENTSX                =
    *   POSHIPPING                   =
    *   POSHIPPINGX                  =
    *   POSHIPPINGEXP                =
    *   SERIALNUMBER                 =
    *   SERIALNUMBERX                =
    *   INVPLANHEADER                =
    *   INVPLANHEADERX               =
    *   INVPLANITEM                  =
    *   INVPLANITEMX                 =
    ENDFUNCTION.
    i am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)". 

  • Configure to call a BI query from CRM

    Hi,
    I created a BI query in the BI system and I want to get it called from CRM 2007 web UI. There is a RFC connection between CRM and BI.  Can anybody can list out all settings/configuration required to set inorder to list this query in the Web UI.
    Thanks in advance
    Nisha

    found this document on using the FPM_SEARCH_UIBB http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f07c2765-4ee8-2e10-759b-ea7429a430bb?QuickLink=index&…
    if only such a (extremely detailed) document would exits on passing on the "tag" to the BI query variable (as that is not as straight forward)

  • Call R/3 BADI from CRM without XI

    Hello Experts,
    I have to implement some BADIs in R/3 which will get executed through CRM.
    What are the various options of calling the BADI in R/3 from CRM? The BADIs are used for sales order processing, invoicing, etc....
    Thanks
    Ricky

    I could suggest u with XI
    1. Direct RFC call using RFC adapter
    2. Expose RFC as webservice and use SOAP adapter
    3. Use ABAP proxy to call RFC
    Without XI: CRM would be a better place to search for the ans
    Regards,
    Parteek

  • Call a function module from CRM 5.0 via ITS to FICA

    Hi
    I want to call a function module in FICA (FICA is using sapgui) from CRM (IC-web) via ITS (Not integrated in FICA)
    Is it possible and how should this be done???
    If someone know how, please help
    BR//JL

    generally RFCs should not have user dialogs.
    any how to handle your case, you need ITS and since FICA is a WAS 6.20 system, you need to have a ITS installed for FICA system, without which you cannot do that.
    alternatively you can mimic the functionality of the RFC by programming the same in a BSP and call this from CRM system
    Regards
    Raja

  • Call R/3 BADI from CRM

    Hello Experts,
    I have to implement some BADIs in R/3 which will get executed through CRM.
    What are the various options of calling the BADI in R/3 from CRM? The BADIs are used for sales order processing, invoicing, etc....
    Thanks
    Ricky

    Hi Ricky,
       It is might not possible to call BADI R/3 from CRM or CRM from R/3.
       This is possible in case of only RFC enabled FM.
       Could you provide information realated to your problem, so that one could guide you properly.
    Regards,
    Amit R.

Maybe you are looking for

  • I am trying to update CS5 on my Mac and I keep getting an error message

    I am trying to update CS5 on my Mac and it continues to say: "  There was an error downloading this update. Please quit and try again later." I have restarted my computer a few times and tried downloading again yet have continued to get the same resp

  • HT4972 I have the iPhone 4 how do I update new os 6

    I want to up date my phone to the os5 atleast or if possible os 6.

  • Missing class in weblogic-tags.jar for 6.1 beta

    I am using the weblogic-tags.jar and am getting an error when           pre-compiling my jsps:           [java] [jspc] parsing /ami/drugsearchtestresult.jsp:           [java] [jspc] resolved taglib uri 'weblogic-tags.tld' to           taglib-location

  • Cnt select items in column view after installing xcode 2.5 update

    hi , i just installed the xcode 2.5 update and if a file in column selected, Finder unexpectedly quits!!! i think this has some thing to do with the preview of files. PLEASE HELP IT MAKES USING THE FINDER NEARLY IMPOSSIBLE

  • Riscos no vidro

    Bom dia, infelizmente percebi que a qualidade do  vidro (tela touch) não é a mesma, nesse iPod touch 5G muitos riscos em pouco tempo. Atenciosamente Junior Lopes