Call of a function module from a method / catch of exceptions

Hello,
how do you catch the error of a function module that is called within the start routine of a data transfer process? The process terminates in case of an exceptions
E.G.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
   client                  = sy-mandt
   date                    = SOURCE_FIELDS-xxx
   foreign_amount          = SOURCE_FIELDS-xxx
   foreign_currency        = SOURCE_FIELDS-xxx
   local_currency          = SOURCE_FIELDS-xxx
IMPORTING
   local_amount            = RESULT
EXCEPTIONS
  NO_RATE_FOUND           = 1
  OVERFLOW                = 2
  NO_FACTORS_FOUND        = 3
  NO_SPREAD_FOUND         = 4
  DERIVED_2_TIMES         = 5
  OTHERS                  = 6.

uncomment the exceptions section of your call. ie
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
Afterwards check sy-subrc value to see if exception has occured. If it is zero, call was successful otherwise it will have a value corresponding to the exception occured (as specified in the code above)

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

  • Call ABAP function module from script?

    Hi,
    I have an ABAP function module, which works fine when I call it in a transformation.
    Since I don't need to execute this function for each record but rather for each file I process, I would like to move the call from the DataFlow to a script in the WorkFlow. When I click on the 'functions' button the ABAP FM is available in my SAP Datastore, so I drag and drop it into my script. I also make sure to populate all required variables.
    There are no error messages or warning when I check my job definition.
    When I execute it, I get the following RFC error:
    Function call <xxx  ( abcd ) > failed, due to error <150413>: <RFC CallReceive exception <FUNCTION_NOT_FOUND>.>.
    Is it just not possible to call an RFC enabled function module in SAP from a script or am I doing something wrong here?
    Thanks,
    Jan.

    Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
    Thanks,
    Shashi.

  • How to call a function module from a transformation

    Hi,
    Could somebody please let me know how I can call an abap function module from a transformation (abap xslt program). I know how to call the class methods from transformation, but how do i call a function module..?
    Thanks,
    Shashi.
    Edited by: Shashi Kanth Kasam on Apr 8, 2010 12:45 PM

    Ya. I can do that. But I don't want to use a class and a method to call that function module. Want to directly call function module from transformation. Is that possible..?
    Thanks,
    Shashi

  • Call an Function Module from BSP page to import an CSV file to internal tab

    Hi Experts,
    I am working on creating a web application in BSP which will call the function module  ALSM_EXCEL_TO_INTERNAL_TABLE.
    This function module imports an excel file into an internal table.
    Since this is the first time I am working on BSP I am not sure how to call this FM from event handler tab in BSP page.
    What I could gather from previous posts is that we need to create an attribute which should take the value of the export parameter of the function module.But I am kind of messed up on this.
    Could u guys please help ,I would be extremely grateful.Points will be assigned for sure
    Thanking in anticipation
    Ankit

    Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
    Thanks,
    Shashi.

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Calling Z function module from BSP page

    hi,
      i am calling a z function module from BSP application ROS_SELF_REG ,The z function module is inside a z function group,It does not give any sytnax error..but while running BSP application ,it is going into dump saying that Z function module is not found..Any idea why this is happening???

    Hi,
    Check whether the Z function module is spelled correctly. Also try activating the whole function group and function module in se80 transaction.
    Check whether the BSP application is calling the Z FM from the correct server/client where it is available.
    Regards,
    Harish

  • Debuggin a Call to Remote Function Module

    Hi
    I have a scenario where i have a Remote Function Module in r3 which is being called synchronously by an external java application. The FM has a lot of input and output parameters and many tables.  The output returned by the FM is not as expected.
    Can anyone tell me how debug a Remote Function Module when a call has been made from an external application.
    I am not able to get the test data sent by the external application . So when the external application gives a call to this Remote FM and if it is possibele to debug it would be great.
    regards
    Nilesh Taunk.

    Hi Nilesh,
    1) Login to SAP with the same ID with which you will calling the RFC function module from the outside system.
    2) Goto transaction - se37/se38
    3) Goto Utilities => Settings.
    4) Select the ABAP Editor Tab.
    5) Click on the Debugging tab.
    6) Tick the Actv. button and give the user name with which you will be debugging the code. In this case the logged in user id.
    7) Press Enter.
    8) Now put an external break point inside the Function Module.
    9) Load your external application (from where you want to debug the FM) once again.
    The execution will stop in the FM.
    Hope it helps..
    Lokesh
    PS: This was a simple question, but I guess the reason no one has answered your question is due to the fact that you havent rewarded points to members helping you. Also remember to close your post once it has been answered.

  • Calling New Function Module from JAVA ISA b2b

    I need to call a new function module which accepts some parameters as input and
    returns some result parameters back as output.
    These returned value needs to be displayed on the JSP pages of ISA B2B applications.
    Can someone please guide me and provide code snippet on how to do this?
    Thanks in advance.
    Points will be awarded for all relevant and helpful answers.

    Stride,
    I did this on CRM ISA 4.0...  I used the dev and extension guide as a basis - I think the ISA 5.0 guide has the examples and tutorials in a separate document that can also be downloaded from service.sap.com.
    Here’s some info on how to do it although I can't guarantee this is the full solution or that it will work the same for ISA 5.0, and I will probably forget a lot of stuff as its been a few years since I did it!  I also can’t guarantee it is the correct way to do it – but it worked!  Basically, we built a link into the order overview page to display url’s to order tracking websites using an RFC on the backend CRM system.  Hope it helps anyway.
    1. Create RFC enabled function module in backend.
    2. Edit file backendobject-config.xml in folder project_root\b2b_z\WEB-INF\xcm\customer\modification:-
    [code] <backendobject
         xmlns:isa="com.sapmarkets.isa.core.config"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xml="http://www.w3.org/XML/1998/namespace">
         <configs>
              <!-- customer changes in backendobject-config should be done here by extending/overwriting the base configuration-->
              <xi:include
                   href="$
    Template for backend object in customer projects
    Concrete implementation of a backend object
    This implemenation demonstrates how a backend object
    is used to communicate with the CRM system
    @see com.ao.isa.backend.boi.Z_AOFuncBackend#getOrderDeliveryTrackingData(java.lang.String)
    Interface used to communicate with a backend object
    The purpose of this interface is to hide backend implementation details
    from the business objects
    Returns a vector of Z_OrderDeliverTracking objects containing data to link
    to external delivery tracking websites
    @param orderNo The sales order document number
    @return A vector of order tracking objects
    @return
    @return
    @return
    @return
    @return
    @param string
    @param string
    @param string
    @param string
    @param string
    /modification/backendobject-config.xml#xpointer(backendobject/configs/*)"/>
              <!-- This is an example customer extension. A new Backend Object is registered in the framework using XCM extension mechanism. -->
              <!-- If you write customer extensions you should register your backend objects in the same way. -->
              <!-- Please make sure that you use the correct base configuration (e.g. crmdefault for CRM or r3default, r3pidefault for R/3) -->
              <config
                   isa:extends="../config[@id='crmdefault']">
                   <businessObject
                        type="Z_AO_Custom"
                        name="Z_AO_Custom"
                        className="com.ao.isa.backend.crm.Z_AOFuncCRM"
                        connectionFactoryName="JCO"
                        defaultConnectionName="ISAStateless"/>
              </config>
         </configs>
    </backendobject>
    [/code]
    File com.ao.isa.backend.crm.Z_AOFuncCRM.java looks like this :-
    [code] package com.ao.isa.backend.crm;
    //jco imports
    import java.util.Vector;
    import com.ao.isa.backend.boi.Z_AOFuncBackend;
    import com.ao.isa.businessobject.order.Z_OrderDeliveryTrackingItem;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.JCO.ParameterList;
    import com.sapmarkets.isa.core.eai.BackendException;
    import com.sapmarkets.isa.core.eai.sp.jco.BackendBusinessObjectBaseSAP;
    import com.sapmarkets.isa.core.logging.IsaLocation;
    public class Z_AOFuncCRM
         extends BackendBusinessObjectBaseSAP
         implements Z_AOFuncBackend
         // initialize logging
         private static IsaLocation log =
              IsaLocation.getInstance(Z_AOFuncCRM.class.getName());
         /* (non-Javadoc)
         public Vector getOrderDeliveryTrackingData(String orderNo)
              Vector urlData = new Vector();
              try
                   // get Java representation of function module
                   JCO.Function func =
                        getDefaultJCoConnection().getJCoFunction(
                             "Z_BAPI_CRM_ORDER_TRACKING_URLS");
                   // provide export parameters
                   ParameterList params = func.getImportParameterList();
                   params.setValue(orderNo, "ORDER_NO");
                   func.setExportParameterList(params);
                   // execute function
                   getDefaultJCoConnection().execute(func);
                   // get result table
                   JCO.Table table =
                        func.getTableParameterList().getTable("TRACKING_DATA");
                   int numRows = table.getNumRows();
                   for (int i = 0; i < numRows; i++)
                        // get row
                        table.setRow(i);
                        // create a new Z_orderdeliverytracking object
                        Z_OrderDeliveryTrackingItem trackItem =
                             new Z_OrderDeliveryTrackingItem(
                                  table.getString(0),
                                  table.getString(1),
                                  table.getString(2),
                                  table.getString(3),
                                  table.getString(4));
                        urlData.addElement(trackItem);
                        trackItem = new Z_OrderDeliveryTrackingItem();
                   return urlData;
              catch (BackendException bex)
                   // The following key has to be added to WEB-INF/classes/ISAResources.properties
                   // in order to see the exception correctly
                   log.config("ao.b2b.order.error.getOrderTrackingURLs", bex);
              return null;
    [/code]
    And file com.ao.isa.backend.boi.Z_AOFuncBackend.java looks like this:-
    [code] package com.ao.isa.backend.boi;
    //package java.ao.com.ao.isa.backend.boi;
    import java.util.Vector;
    import com.sapmarkets.isa.core.eai.sp.jco.JCoConnectionEventListener;
    public interface Z_AOFuncBackend
         public Vector getOrderDeliveryTrackingData(String orderNo);
    [/code]
    Whilst file com.ao.isa.businessobject.order.Z_OrderDeliveryTrackingItem.java looks like this:-
    [code]
    package com.ao.isa.businessobject.order;
    // Referenced classes of package com.sapmarkets.isa.businessobject.order:
    //            PaymentType
    public class Z_OrderDeliveryTrackingItem // extends SalesDocument implements OrderData
         private String deliveryDocNo;
         private String goodsIssuedDate;
         private String consignmentNo;
         private String status;
         private String url;
         public Z_OrderDeliveryTrackingItem()
         public Z_OrderDeliveryTrackingItem(
              String delDocNo,
              String GIDate,
              String consNo,
              String status,
              String url)
              this.setDeliveryDocNo(delDocNo);
              this.setGoodsIssuedDate(GIDate);
              this.setConsignmentNo(consNo);
              this.setStatus(status);
              this.setUrl(url);
         public String getConsignmentNo()
              return consignmentNo;
         public String getDeliveryDocNo()
              return deliveryDocNo;
         public String getGoodsIssuedDate()
              return goodsIssuedDate;
         public String getStatus()
              return status;
         public String getUrl()
              return url;
         public void setConsignmentNo(String string)
              consignmentNo = string;
         public void setDeliveryDocNo(String string)
              deliveryDocNo = string;
         public void setGoodsIssuedDate(String string)
              goodsIssuedDate = string;
         public void setStatus(String string)
              status = string;
         public void setUrl(String string)
              url = string;
    [/code]
    3. Edit file bom-config.xml in folder project_root\b2b_z\WEB-INF\xcm\customer\modification :-
    [code] <BusinessObjectManagers
         xmlns:isa="com.sapmarkets.isa.core.config"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xml="http://www.w3.org/XML/1998/namespace">
         <!-- customer changes in bom-config should be done here by extending/overwriting the base configuration-->
         <xi:include
              href="$/modification/bom-config.xml#xpointer(BusinessObjectManagers/*)"/>
         <!-- This is an example Business Object Manager. It can act as template for customer written Business Object Managers -->
         <BusinessObjectManager
              name="Z_AO-BOM"
              className="com.ao.isa.businessobject.Z_AOBusinessObjectManager"
              />
    </BusinessObjectManagers>
    [/code]
    File com.ao.isa.businessobject.Z_AOBusinessObjectManager.java looks like this:-
    [code] package com.ao.isa.businessobject;
    // Internet Sales imports
    import com.sapmarkets.isa.core.businessobject.management.BOManager;
    import com.sapmarkets.isa.core.businessobject.management.DefaultBusinessObjectManager;
    import com.sapmarkets.isa.core.businessobject.BackendAware;
    Template for a custom BusinessObjectManager in customer projects
    public class Z_AOBusinessObjectManager
         extends DefaultBusinessObjectManager
         implements BOManager, BackendAware {
         // key used for the backend object in customer version of backendobject-config.xml
         public static final String CUSTOM_BOM = "Z_AO-BOM";
         // reference to backend object
         private Z_AOFunc mCustomBasket;
    constructor
         public Z_AOBusinessObjectManager() {
    Method is called by the framework before the session is invalidated.
    The implemenation of this method should free any allocated resources
         public void release() {
    Returns custom business object
         public Z_AOFunc getCustomBasket() {
              if (mCustomBasket == null) {
                   mCustomBasket = new Z_AOFunc();
                   assignBackendObjectManager(mCustomBasket);
              return mCustomBasket;
    [/code]
    And uses file com.ao.isa.businessobject.Z_AOFunc.java which looks like this:-
    [code]
    package com.ao.isa.businessobject;
    // Internet Sales imports
    import com.sapmarkets.isa.core.businessobject.BOBase;
    import com.sapmarkets.isa.core.businessobject.BackendAware;
    import com.sapmarkets.isa.core.eai.BackendObjectManager;
    import com.sapmarkets.isa.core.eai.BackendException;
    import com.sapmarkets.isa.core.logging.IsaLocation;
    // custom imports
    import com.ao.isa.backend.boi.Z_AOFuncBackend;
    import java.util.Vector;
    Template for business object in customer projects
    public class Z_AOFunc extends BOBase implements BackendAware
         // initialize logging
         private static IsaLocation log =
              IsaLocation.getInstance(Z_AOFunc.class.getName());
         private BackendObjectManager bem;
         private Z_AOFuncBackend backendAOBasket;
    Returns a reference to the backend object. The backend object
    is instantiated by the framework.
    @return a reference to the backend object
         private Z_AOFuncBackend getCustomBasketBackend()
              if (backendAOBasket == null)
                   //create new backend object
                   try
                        backendAOBasket =
                             (Z_AOFuncBackend) bem.createBackendBusinessObject(
                                  "Z_AO_Custom");
                        // the backend object is registered in customer version
                        // of backendobject-config.xml using the 'Z_AO_Custom' type
                   catch (BackendException bex)
                        // The following key has to be added to WEB-INF/classes/ISAResources.properties
                        // in order to see the exception correctly
                        log.config("ao.b2b.order.error.getOrderTrackingURLs", bex);
              return backendAOBasket;
    This method is needed when a business object has a corresponding
    backend object.
         public void setBackendObjectManager(BackendObjectManager bem)
              this.bem = bem;
    Returns a vector of url links for tracking
    @return vector of urls
         public Vector getOrderDeliveryTrackingData(String orderNo)
              // the call is delegated to the CRM aware backend object
              return getCustomBasketBackend().getOrderDeliveryTrackingData(orderNo);
    [/code]
    4. Edit file config.xml in folder project_root\b2b_z\WEB-INF to add custom actions (the section below is just the custom stuff added at the end of the file – the Z_orderTracking is the relevant one) :-
    [code] <!-- Begin of custom AO action definitions -->
         <action path="/b2b/Z_orderTracking" type="com.ao.isa.order.actions.Z_OrderTrackingAction">
              <forward name="success" path="/b2b/order/Z_orderTracking.jsp"/>
         </action>
         <action path="/catalog/Z_displaySVGPage" type="com.ao.isa.catalog.actions.Z_SVGPageAction">
              <forward name="success" path="/catalog/Z_SVG_fs.jsp"/>
         </action> [/code]
    Which points at Java file com.ao.isa.order.actions.Z_OrderTrackingAction.java which looks like this :-
    [code] package com.ao.isa.order.actions;
    // internet sales imports
    import com.sapmarkets.isa.core.BaseAction;
    import com.sapmarkets.isa.core.UserSessionData;
    // struts imports
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionForm;
    // servlet imports
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    // Internet Sales imports
    import com.ao.isa.businessobject.Z_AOBusinessObjectManager;
    import java.util.Vector;
    This action acts as a template for customer extensions
    public class Z_OrderTrackingAction extends BaseAction
    This method is called by the ISA Framework when the
    action is executed
         public ActionForward doPerform(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws ServletException
              // get user session data object
              UserSessionData userSessionData =
                   UserSessionData.getUserSessionData(request.getSession());
              // gettting custom BOM
              Z_AOBusinessObjectManager myBOM =
                   (Z_AOBusinessObjectManager) userSessionData.getBOM(
                        Z_AOBusinessObjectManager.CUSTOM_BOM);
              // get the order number being processed
              String orderDocNumber = request.getParameter("orderNo");
              // pass the order number back to the page
              request.setAttribute("orderNo", orderDocNumber);
              if (orderDocNumber != null)
                   // Get a vector of delivery tracking objects from lower layers (Business Object layer =>
                   // Business Logic Service Layer)
                   Vector trackingTable =
                        myBOM.getCustomBasket().getOrderDeliveryTrackingData(
                             orderDocNumber);
                   String error = "";
                   if (trackingTable != null)
                        if (trackingTable.size() == 0)
                             error = "true";
                        else
                             error = "false";
                   else
                        error = "true";
                   request.setAttribute("errorMessage", error);
                   request.setAttribute("trackingTable", trackingTable);
              return mapping.findForward("success");
    [/code]
    5. I added the call to the function module for page orderstatusdetail.jsp in folder project_root\b2b_z\b2b\order to display a custom page Z_orderTracking.jsp in the same folder.  To do this I added a link into the HTML to call a JavaScript function that passed the current order number to the /b2b/Z_orderTracking.do actionhandler mapped in the config.xml file.
    So, in summary!  Create an RFC; define business managers for it in the XML files; create a new Strut action and supporting Java class; create all the Java class’ for the managers.
    I hope this makes some sense!
    Gareth.

  • Call an ABAP program or a function module from command prompt/python script

    Dear All,
    I want to call a function module/ABAP program from command prompt or a python script.
    Let me explain with an example.
    There is a function module "z_add" that takes  two integers as input parameters and generates their sum.
    the sum is the output parameter.
    Now i want to call this function module from command prompt / python script and pass parameters to this function module.
    In return i must get the sum(i.e. the output of function module).
    I tried using STARTRFC ,was able to call the FM but could not get the return value(output) from FM.
    Can you please provide me the code of such a function module and the method to call it thereby passing parameters and getting the sum.
    Thanks and regards,
    Gaurav
    Edited by: gauravkec2005 on Mar 4, 2010 7:41 AM

    thank you both!  helpful answers! :o)
    anyway! 
    i have written the program which is called from the SAPScript:
        /:       PERFORM GET_VATNUMBER IN PROGRAM ZFI_F140_OPERATIONS
        /:       USING &BKPF-BUKRS&
        /:       CHANGING &VATNUMBER&
        CE       VAT Registration No : &VATNUMBER&
        REPORT zfi_f140_operations.
        FORM get_vatnumber TABLES in_par  STRUCTURE itcsy
                                  out_par STRUCTURE itcsy.
          DATA: lv_co_code TYPE bukrs,
                lv_vat_no  TYPE stceg.
          READ TABLE in_par WITH KEY name = 'BKPF-BUKRS'.
          MOVE in_par-value TO lv_co_code.
          SELECT SINGLE stceg FROM t001
            INTO lv_vat_no WHERE bukrs = lv_co_code.
          out_par-name = 'VATNUMBER'.
          WRITE lv_vat_no TO out_par-value.
          CONDENSE out_par-value.
          MODIFY out_par INDEX 1.
        ENDFORM.              
    it is not working and i cannot work out why... 
    i have not been ABAPing for very long but have had a go.... 
    any thoughts as to what i have done wrong?
    or point me where i should be looking?  thank you!

  • How to call a function module from a workflow ? ?

    hi all,
    i have to call a function module from an workflow, i got a hint from someone that i have to enhance an object and then write and methode, in this methode i can call that function module. I dont know even how to go for it.
    Can anyone suggest that how to go for it ?
    thanks.
    raman khurana.

    Hi Raman Khurana,
    Please  go through the links it might be helpful , notsure
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4af8b453d11d189430000e829fbbd/content.htm
    http://www.abapcode.info/2007/07/standard-function-module-text.html
    http://it.toolbox.com/wiki/index.php/SAP_Workflow
    Regards,
    Sreekar.Kadiri.

  • Calling a function module from a Web Template

    Hi,
    I need to call a function module from a web template. Any pointers on how i can do this ? Is this even possible ?
    Thanks
    Shailesh

    Hi Rael,
    We were finally able to call a FM module from the Web. The trick as Heike suggested was to create an ABAP class which inherits from CL_RSR_WWW_HELP_WINDOW. Then you should modify the process_cmd method of this new class in order to call the FM. Now use this class to create a help service. In case you need to pass any parameters to the FM, you will need to pass them as additional parameters while calling the help service.
    An example is below.
    CMD=PROCESS_HELP_WINDOW&HELP_SERVICE=ZBOOKMARKING&TEXT=mytext&URL=myurl
    Where mytext and myurl were the parameters i pass to my FM and ZBOOKMARKING is my help service.
    Thanks a Lot to Heike for his help on this !!
    Shailesh

  • How to call a function module from the Web Template?

    Hi all,
    how can I call a function module from a BI 7.x web template and then show the result of the FM on the web template?
    Many thanks for your hints.
    Regards, Nils

    Hi!
    I am too working on a similar issue.
    Probably this helps:
    Re: Calling a function module from a Web Template
    Regards,
    Sri

  • Can you call a function module from within a smartform?

    I was told that yu can not call a function module from a smartform - that does not make sense to me because you can do tons of ABAP within a smartform.
    Well - can you?
    Thanks.
    Scott

    Yes, you can call function modules.

  • How to call function module from IP

    Hi
    I need to trigger the process chain from the input ready queries in Bex analyzer. I figured out that I need to call RSPC_API_CHAIN_START.
    How do we go about in calling the above function module in IP.
    Thanks in advance
    I

    Hi Matt
    Thanks for your response, it was very productive at the right time as we saw our process chain running indefinetly. With selecting all chars to be changed, it ran just once with no errors.
    what is TA ? I know rsplan- transaction code for the planning modeler.
    Can you tell me how can we call function module in custom exit planning function.
    Where should I embed the code
    CALL FUNCTION 'RSPC_API_CHAIN_START'
                   EXPORTING
                     I_CHAIN             = 'ZPC_CCATOPCA'.
                   I_T_VARIABLES       =
                   I_SYNCHRONOUS       =
                   I_SIMULATE          =
                   I_NOPLAN            =
                 IMPORTING
                   E_LOGID             =
                 EXCEPTIONS
                   FAILED              = 1
                   OTHERS              = 2
    thanks in advance

Maybe you are looking for