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

Similar Messages

  • 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.

  • Calling RFC Function module from JAVA

    Hi All,
       We have created a RFC Function Module for Billing Plan tab in Sales order (BDC). The function Module contains BDC. When we are running the same function module in SAP it is working fine. But when the FM is called in Java , it is allowing only maximum of 5 entries , when we trying to insert at 6th position in billing plan tab, we are getting an error.
    Can any one help on this.
    Points will be rewarded for helpful answers.
    Thanks & Regards,
    Kiran I

    I think the problem is because of the number of lines displayed on the screen in the BDC session in the Billing Plan.
    You might have to add the page down logic to your BDC program.

  • Problem while calling RFC function module in java

    Hi all
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connect_PM  GWHOST=<system.ab.ydydy.yyyd.com>, GWSERV=sapgw00, ASHOST=<system.ab.ydydy.yyyd.com>, SYSNR=00
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname '<system.ab.ydydy.yyyd.com>' unknown
    TIME        Mon Jun 06 14:50:25 2005
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        332
    DETAIL      NiPGetHostByName2: hostname '<system.ab.ydydy.yyyd.com>' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
         at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
         at MyProject.Bapi2.<init>(Bapi2.java:43)
         at MyProject.Bapi2.main(Bapi2.java:231)
    Pl help me
    pradeep

    Hi
    This is my code....
    Created on Jun 2, 2005
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package MyProject;
    @author pradeep
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    import com.sap.mw.jco.*;
    public class Bapi2 extends Object {
       JCO.Client mConnection;
       JCO.Repository mRepository;
       public Bapi2() {
           try {
              // Change the logon information to your own system/user
              mConnection =
                JCO.createClient("122", // SAP client
                   "<pradeep>", // userid
                   "*****", // password
                   "EN", // language
                   "<abc11.aa.abc23.company.com>", // application server host name
                   "<00>");//system no
              mConnection.connect();
              mRepository = new JCO.Repository("HLL", mConnection);
          catch (Exception ex) {
            ex.printStackTrace();
            System.exit(1);
          JCO.Function function = null;
          JCO.Table codes = null;
            try {
               function = this.createFunction("BAPI_COMPANYCODE_GETLIST");
               if (function == null) {
                 System.out.println("BAPI_COMPANYCODE_GETLIST" +
                                         " not found in SAP.");
                 System.exit(1);
               mConnection.execute(function);
               JCO.Structure returnStructure =
                 function.getExportParameterList().getStructure("RETURN");
               if (! (returnStructure.getString("TYPE").equals("") ||
                        returnStructure.getString("TYPE").equals("S")) ) {
                 System.out.println(returnStructure.getString("MESSAGE"));
                 System.exit(1);
               codes =
                 function.getTableParameterList().getTable("COMPANYCODE_LIST");
               codes.setRow(2);
    codes.deleteRow();
    codes.deleteRow(5);
    codes.appendRow();
    codes.setValue("XXXX", "COMP_CODE");
    codes.setValue("Does not exist", "COMP_NAME");
    codes.appendRows(2);
    codes.setValue("YYYY", "COMP_CODE");
    codes.setValue("Does not exist either", "COMP_NAME");
    codes.nextRow();
    codes.setValue("ZZZZ", "COMP_CODE");
    codes.setValue("Nor does this", "COMP_NAME");
    for (int i = 0; i < codes.getNumRows(); i++) {
    codes.setRow(i);
                 System.out.println(codes.getString("COMP_CODE") + '\t' +
                                         codes.getString("COMP_NAME"));
            catch (Exception ex) {
               ex.printStackTrace();
               System.exit(1);
            try {
               codes.firstRow();
               for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
                 function = this.createFunction("BAPI_COMPANYCODE_GETDETAIL");
                 if (function == null) {
                    System.out.println("BAPI_COMPANYCODE_GETDETAIL" +
                                            " not found in SAP.");
                    System.exit(1);
                 function.getImportParameterList().
                    setValue(codes.getString("COMP_CODE"), "COMPANYCODEID");
                 mConnection.execute(function);
                 JCO.Structure returnStructure =
                    function.getExportParameterList().getStructure("RETURN");
                 if (! (returnStructure.getString("TYPE").equals("") ||
                          returnStructure.getString("TYPE").equals("S") ||
                          returnStructure.getString("TYPE").equals("W")) ) {
                    System.out.println(returnStructure.getString("MESSAGE"));
                 JCO.Structure detail =
                    function.getExportParameterList().
                    getStructure("COMPANYCODE_DETAIL");
                 System.out.println(detail.getString("COMP_CODE") + '\t' +
                                         detail.getString("COUNTRY") + '\t' +
                                         detail.getString("CITY"));
           catch (Exception ex) {
              ex.printStackTrace();
              System.exit(1);
           mConnection.disconnect();
         public JCO.Function createFunction(String name) throws Exception {
           try {
              IFunctionTemplate ft =
                mRepository.getFunctionTemplate(name.toUpperCase());
              if (ft == null)
                return null;
              return ft.getFunction();
          catch (Exception ex) {
            throw new Exception("Problem retrieving JCO.Function object.");
       public static void main (String args[]) {
          Bapi2 app = new Bapi2();
    This is the error i'm getting...
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connect_PM  GWHOST=<abc11.aa.abc23.company.com>, GWSERV=sapgw00, ASHOST=<abc11.aa.abc23.company.com>, SYSNR=00
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname '<abc11.aa.abc23.company.com>' unknown
    TIME        Mon Jun 06 17:15:12 2005
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        332
    DETAIL      NiPGetHostByName2: hostname
                '<abc11.aa.abc23.company.com>' not
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
         at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
         at MyProject.Bapi2.<init>(Bapi2.java:45)
         at MyProject.Bapi2.main(Bapi2.java:233)
    Thx
    PRadeep

  • How to call a function module from debugger?

    Hi all,
           i just wanted to know whether we can call a function module from a debugger ,
           if yes how ?

    Hi Laxmikanth,
    How ur going to call a function module which is not present in program???
    In debugging mode u can change the values of variables,put break points and watch points,but i thnk its not possible to call a function module(not present in program) while debugging .
    Please share with us if u have any solution...
    Regards,
    lakshman.

  • 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 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 APO Macro

    Hi,
    Can I call a function module from a macro directly without going through the user exit? If so, how should I pass the parameters to the function module? I don't have to get the results back to macro.
    Regards

    Hi Asokan - you can call a function module directly from a macro providing it is designed to be called from a macro. For example if you are in the Macrobuilder and use the menu path Edit -> Edit User Function then you will get a list of existing function modules that you can call directly by inserting a Operator/function into your macro. If you want to call a function module not listed in the User Function drop down list then you will either need the user exit or create a custom function module as a wrapper and register the wrapper function module in the Edit User Function menu path. Calling a function module will always return a value - but you can choose to ignore that value depending on how you build your macro.
    Regards
    Andy

  • Calling a Web Service from Java Webdynpro

    Hi,
    Can any one give me step by setp details on how to call a Web Service from Java Webdynpro ?
    I tried creating a model using Import Web Service Model but when I completed creating the model, I got some errors as shown below.
    Error               The method setRouteGeometryLineArray(double[][]) in the type Trip is not applicable for the arguments (double[])     ComplexType_Trip.java     WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1     line 249
    thanks
    SBK

    Hi SBK,
    I assume you may already have read the [help guide|http://help.sap.com/saphelp_nw70/helpdata/EN/81/12703e5da3e946e10000000a114084/content.htm] This gives a pretty good idea of how to do it (step by step).
    Is there a typo in the error you pasted?
    Error The method setRouteGeometryLineArray(double][) in the type Trip is not applicable for the arguments (double[]) ComplexType_Trip.java WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1 line 249
    The square brackets [] after double in the method call appear to be reversed. Is that also in the code? or just a mistake here?
    Hope this points you in the right direction.
    BRgds,
    Simon

  • 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

  • Problem calling two perl modules from java in seperate threads(JVM CRASHES)

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

  • 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

Maybe you are looking for

  • HELPP!

    okay the lcd screen keeps blinking on and off what should i do? what happened to it? i just unplugged it from the usb but yea i forgot to eject first.. and now its just dead HELPP

  • Photoshop CS4 sudden lag after installing tablet driver

    Hi.. So my PS CS4 had never lagged before, it was all running perfectly, all functions are going quickly. I was using the newest driver for wacom intuos 3, but with using a new driver, I had a weird pressure problem. It would only work with an older

  • Win2008 Cluster ASCS + CI + DI + STMS error

    Hi all, I've installed an SAP ECC in cluster environment in Win2008, as followed by guides, I installed Clustered ASCS (cluster host is CISAPCL) Clustered DB instance (host DBSAPCL) then local CI at node1 and local DI at node2. now transport system d

  • Airplay to more than one apple tv?

    Is it possible to airplay from my ios 7 ipad 4 to two apple tvs at the same time??

  • LOGICAL_READS_PER_CALL (profile)

    I am trying to limit a user from heavy database usage. The user will just be querying a single table for 1 row at a time. What is a good value to set LOGICAL_READS_PER_CALL to? my DB is 8K block size. I am also thinking of setting this too: CPU_PER_C