Problem in using the RFC model in webdynpro aplication

Hi,
I am trying to access FM CRIF_GET_EMPLOYEE_FOR_USER from the backend system in webdynpro application in two different ways
1.By using JCO classes in a java class
IRepository repository;
  public int getPernr(String user)
  int ret = 0;
String user = "SRESP5";
  double pool = Math.random()*100000000;
//     the repository we gonna be using
  try{
//      Add a connection pool for the specified system
     wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(""+pool);
  JCO.addClientPool(
  "DE1", //alias for this pool
  100,
//     max. number of connections
  "540", //SAP client
  "", //userid
  "", //password
  "EN", //language
  "sapde1ci.zrh.swissre.com", //host name
  "10" //system number
//      Create a new repository
  repository = JCO.createRepository(
  "MYRepository", "DE1");
  wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(
     "ExceptionwwwwwwxSS");
  catch(JCO.Exception ex) {
  wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(
  "Exceptionwwwwwwx"+ex.getMessage());
  JCO.Client client =
  null;
  try{
//      Get a function template from the repository
     wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(
     "SSS");
//     wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("ExceptWWWW");
  JCO.Function function = repository.getFunctionTemplate(
  "Z_CRIF_GET_EMPLOYEE_FOR_USER").getFunction();
  wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(
     "ddd"+function); 
     wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("ExceptioWWW");
//      Fill in input parameters
  JCO.ParameterList input = function.getImportParameterList();
  input.setValue(user,
  "USER_NAME" );
//     input.setValue(String.valueOf(new Date()), "BEGINDATE" );
//     input.setValue(String.valueOf(new Date()), "ENDDATE" );
//      Get a client from the pool
     wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("ExceptionQQ");
  client = JCO.getClient(
  "DE1");
//     wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Exception");
//      Execute function the remote system
  try{
   client.execute(function);
  }catch(Exception e){
     wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("dd"+e.getMessage());
  wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(
   "Exceptionw"); 
//      Print return message
  ret=function.getExportParameterList().getInt(
  "EMPLOYEENUMBER");
  System.out.println(
  "3");
  System.out.println(
  "RETURN MESSAGE: " + ret);
  wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(
     "SSSWSS");
  catch(Exception ex) {
  System.out.println(
  "Caught an exception333: " + ex);
  finally{
//      Always release client !!!
  //JCO.releaseClient(client);
  JCO.removeClientPool("DE1");
//     try
  return ret;
it is returning the PERNR of the username passed as an input parameter.
2.But when I am trying to use an adaptive RFC model and it is giving NO_EMPLOYEENUMBER_FOUND
here is the code
in view
public void wdDoInit()
    //@@begin wdDoInit()
     wdThis.wdGetTestAppController().executeBapi();
    //@@end
In Controller
public void wdDoInit()
    //@@begin wdDoInit()
    Z_Crif_Get_Employee_For_User_Input input = new Z_Crif_Get_Employee_For_User_Input();
     wdContext.nodeZ_cr().bind(input);
          input.setUser_Name("SRESP5");
    //@@end
public void executeBapi( )
    //@@begin executeBapi()
     try{
                    wdContext.currentZ_crElement().modelObject().execute();
                    wdContext.nodeOutput().invalidate();
                  }catch(Exception e){
               wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("User111:"+e.getMessage());
    //@@end
please help me in solving this issue.points will be awarded for sure for the helpful answer.
Bala

Hi,
Change this line of code:
wdContext.nodeZ_cr().bind(input);
to
wdContext.nodeZ_Crif_Get_Employee_For_User_Input().bind(input);
Try executing your application now.
Regards,
Murtuza

Similar Messages

  • Problem in displaying a field in webdynpro using Adaptive RFC model

    HI,
    I created a webdynpro application using adaptive RFC model and i have a problem in displaying one of the output fields.
    When i execute the function module it is giving the exact value for my output field in this case telephone number (of type STEXT which is char with length 40).But when i am trying to display that telephone number in webdynpro application it is taking only first 4 digits.
    i deleted the model and recreated it still it doesnot work.
    please let me know how to resolve it.
    points will be awarded for sure
    Bala

    Hi Bala,
    Whenever you reimport the model server restart is necessary otherwise the changes will not get reflected. You will get an error when you deploy the application.There is no go around except restarting the server as the meta data gets cached in the server as long as the server is runnig.So, Once you restart the server the cache will be cleared.
    Check once again whether you are fetching data from correct BAPI field. Still problem persist try debugging.
    Regards, Suresh KB

  • How to set the tables parameter to a BAPI using adaptive RFC model

    Hi,
    I have a BAPI ZBAPI that has a tables parameter ZPernr of type ZTable with two elements pernr and name.
    I used adaptive RFC model and created model classes for the BAPI.
    My question how do i set list of pernr and name to the tables parameter in the webdynpro for java.
    I have the following methods available
    ZBAPI input = new ZBAPI();
    1.ZTable table = new ZTable();
    table.setPernr(pernr);
    table.setname(name);
    input.addZPernr(table);
    how do i set the table parameter for multiple pernr and name
    2.
    add all the pernr and name to list and set that list to input in the following way
    input.setZPernr(list) and list of typecom.sap.aii.proxy.framework.core. AbstractList
    out of two methods mentioned which one is correct.
    Please let me know the solution
    Thanks
    Bala Duvvuri

    Hi Bala,
                In your code:
    List pernrList = new ArrayList();
    pernrList  should be declared as the  type of class HROBJECT   ( The structure name in the model  e.g. the node PERFWARN type is Zhrecmfm_002_Perfrat_Warning_Input )
    Try this:
    HROBJECT  pernrList = new HROBJECT();
    pernrList.setPernr(pernr);
    input.setPernr_List(pernrList);
    // call BAPI execute method
    If you want to pass list of pernrs, you can pass in alternate way
    IPrivate<viewname>.I<nodeame>Node prNode = wdContext.node<node>();
    IPrivate<viewname>.I<nodeame>Element prEle;
    for (int i = 0; i < table.size(); i++) {
    HROBJECT  pernrList = new HROBJECT();
    pernrList.setPernr(pernr); // Set the pernr from current record
    prEle = prNode.create<nodeame>Element(pernrList);
    prNode.addElement(prEle);     
    // call BAPI execute method
    Once I execute the BAPI how do i iterate thru second table parameter PERNR_PERFRAT to get pernr and performance rating text
    Say your node name is  PERNR_PERFRAT
    for (int i = 0; i < wdContext.nodePERNR_PERFRAT().size(); i++) {
    wdContext.nodePERNR_PERFRAT().getPERNR_PERFRATElementAt(i).getPernr();
    wdContext.nodePERNR_PERFRAT().getPERNR_PERFRATElementAt(i).getPerfrat();
    Regards,
    Siva

  • Error while using Adaptive RFC model

    I am  using adaptive RFC model to consume a function module from BI system. The function module expects a Boolean input. While executing the function module we need to give u2018Xu2019 for that input. When I consumed the function module in the webynpro java project , used it and give the input as u2018trueu2019 on runnig the application it gives the following error: u201Ccom.sap.conn.jco.ConversionException: (122) JCO_ERROR_CONVERSION: Cannot convert a value from type java.lang.Object to CHAR at field I_READ_ATTRu201D
    There is corresponding dictionary type created called u2018BOOLE_Du2019 but I could not access the dictionary type in the controller java file.
    Is there a way to rectify the same or any workaround condition?
    With regards,
    Sougato.

    Hi saurabh,
    I need to give the value from webdynpro. Hers is the sample code.
    rssem_Cha_Values_Get_Input.setI_Read_Attr();
    // It expects a boolean value but if i pass a value to the method the obove error is show.
    Where as there is a simple type "Boole_d" generated when i consumed the RFC in the webdynpro.
    but i couldn't access this simple type in the code.
    With regards,
    Sougato.

  • How to use two RFC models in one Data Source for a Interactive Form UI Elem

    Hi
    I want to use two RFC models (two Function Modules from a SAP Backend system) in one context node of a View Controller in order to pass it as the data source to a Interactive Form UI element. Can I use the data binding mechanism directly or have I to copy the data into a Value Node within the view controller.
    Thanks for helping
    René Morel
    SAP (Schweiz) AG

    Rene,
    You can create a local context node in component controller and copy the data from both the RFC's to this node, then bind it to the view controller. Then you can make this view context node as the datasource of the interactive form.
    Regards,
    Anand

  • Batch testing using the Sequencial Model

    One of our Test Engineers is uncomfortable with the Batch Model provided with TestStand 2.  Is there an easy way of using the Sequential Model as a Batch Model (testing multiple UUTs).  The way I understand it, there is much more flexibility and capability built into the Batch Model, but I'm having a hard time convincing him and our boss of that.  It seems as though by the time you get done modifying the Sequencial Model to do Batch testing, you've basically created a custom Batch Model anyway.  And if that's the case, why not use something that was already designed specifically for that purpose.  Am I looking at this correctly?

    jtc,
    you are correct in your understanding regarding the basics of the two different models. The sequential model is designed to test a single UUT at a time. The batch model expands this to test as many UUTs in parallel as you like, but the execution is synchronized on some points for the UUTs. This is done because we asume that the UUTs are connected together somehow e.g. placed on the same carrier. So each execution first handles things for all UUTs once (like retrieving/positioning of the carrier) and then starts to test each "socket" (meaning each UUT). After each socket has finished, the carrier is removed and a new one has to be placed in the fixture.
    Since i dont know TS 2.0 (i started with 3.0) i am not sure where the differences are regarding processmodels. In TS 3.x, you have a third processmodel called "ParallelModel" which does not contain logical dependencies between the sockets.
    Another thing about the BatchModel is that you can insert "synchronized sections" where you can "change the way of execution in parts of your sequence". One possible setting is e.g. "One thread only" which makes sure that the sockets synchronize at the beginning of the section and then only ONE socket executes the content of the section. After this, all sockets continue testing.
    Another "problem" which is encountered by many beginners is that both parallel and batch model copy the initial sequence for all sockets. So each socket does the same tests which is propably not wanted.
    Nevertheless, you can change the execution by including all tests for all sockets. Then create appropriate preconditions where you check for the socket you are currently working on. The needed Lookupstring would be "RunState.TestSockets.MyIndex"....
    hope this helps,
    Norbert B.
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Best practice for modelling rediects using the threat modelling tool

    I'm in the process of modelling systems using the threat modelling tool.
    There services in question do a lot of redirecting and handing off to one another on the client side, including things like ACS and identify providers.
    If Web App A redirects to Web App B what is the best way to draw this?
    1) App A (process) > HTTPs redirect > browser > request > App B (process) or 
    2) Can I just model it as HTTPS from A to B?
    Obviously 2 simplifies diagrams hugely , but does that then exclude a range of potential threats or does the tool cater for this implicitly?

    Storing documents outside the web root and using
    <cfcontent> to push their contents to the users is the most
    secure method.
    Putting the documents in a subdirectory of the web root and
    securing that directory with an Application.cfm will only protect
    .cfm and .cfc files (as that's the only time that CF is involved in
    the request). That is, unless you configure CF to handle every
    request.
    The virtual directory is no safer than putting the documents
    in a subdirectory. The links to your documents are still going to
    look like:
    http://www.mysite.com/virtualdirectory/myfile.pdf
    Users won't need to log in to access these documents.
    <cfcontent> or configuring CF to handle every request
    is the only way to ensure users have to log in before accessing
    non-CF files. Unless you want to use web-server
    authentication.

  • Is it possible to use the JS coding in webdynpro java application!!!

    Hi Experts,
    Is it possible to use the JS coding in webdynpro java application by any means?
    If yes, kindly suggest the procedure or any pointers for the same.
    Thanks in advance.
    Regards,
    Anurag

    Hi,
    I'm not an expert in this matter, but I will post here what I know:
    In NW7 releases (at least 7.01.05) it is possible to run JS, also to capture any WD Event and run your own JS code after that, using IFRAME. I have jQuery running here, it would take some time till you create a "framework" to enable some easy usage. I just want to highlight that is possible, thou I think it's a lot of effort.
    Not sure about CE7.1 it seems iFrame is deprecated. Still, being deprecated should not "block" the usage, thou it's not recommended since this functionality can be removed in next releases.
    I've read that CE7.2 has JS support, and I think you should try having a word with Armin maybe..
    Hope it helps,
    Daniel

  • I am having problem with using the Basic brush definition

    I am having problem with using the Basic brush definition. When I try to click on it will not allow me to use it and will automatically use the 5 pt. oval brush definition. The only way I can use the basic brush is after I have already drawn something and then I have to click on the stroke and then press basic. This is incredibly annoying and if anyone could help I would greatly appreciate it. (I have Adobe CS6)

    for whatever reason, the basic 'brush' you see in the brushes palette effectively means removing any brush from a path. to draw with the brush tool you need a brush defined. in your case the last one selected being the 5 pt oval one.

  • Ipad 3 charger problem im using the original charger and it say is not apropiet for device.this problem star today. :/

    ipad 3 charger problem im using the original charger and it say is not apropiet for device.this problem star today. :/

    Take it to an Apple Store for evaluation and possible replacement.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
     Cheers, Tom

  • I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4) A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4)
    A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    Sounds kind of stupid, but check to make sure that your iphone case cover is not blocking the edge of the camera lens.  I had a silicone case on my 3S and when it got older, it started tot slip and the edges of my pictures were blurred.

  • We encountered a problem during use the Configtool access JAVA engine.

    We encountered a problem during use the Configtool access JAVA engine.
    Our environment of system as below:
    HardWard: IBM i570
    OS: IBM as/400 V5E3
    DB: DB2/400
    Application system:SAP XI 3.0
    The problem we encountered as below:
    Our company used XI 3.0 SR1 for exchange data between SAP R/3 and no-sap system.For now,we wanna create a backup system(for
    offline recovery),so we backup the XI product system throught entiry system save in AS/400(we stopped the XI system before
    save process start).And following,we restored from the tape that we save from XI product system to the new backup system(they
    are whole different paratition),but the problem is coming.Describe as following item:
    1. The application seem to can be started but the java node always restart circularly(We have 4 java node now),I think
    because of different of hardware configure(between XI product and Backup system) and lack of hardware resource.(XI prduction
    have 5 CPUs and 22G Mem,Backup system have 2 CPUs and 16G MEM ).Therefore we wanna decrease the number of java nodes for
    start application in backup system(throught configtool).
    2. We wanna use configtool to decrease the java nodes for start backup system.But we encountered a problem during running the
    configtool ,the information of prompt dialog as following:
    Error occurred while working with Configuration (Scanning).
    Msg:Error while connecting to DB.
    We also see the system.log that below the directory of usr\sap\PXI\DVEBMGS00\j2ee\configtool,and found some error as
    following text:
    #1.5#C0000A0008A8000000000000017A906E000423BFFC7246E0#1165207387826#/System/Configuration/Logging##com.sap.tc.logging.APILogg
    er.LogController[addLog()]#######Thread[main,5,main]##0#0#Info##Java#TC_LOGGING_CONFIGURATION_NEW_ITEMS
    [C0000A305666000000000002018FB1F70003D67C779ECE88]##The () has been added to the !#3#Log#.
    system.log#/System#
    #1.5#C0000A0008A8000000000001017A906E000423BFFC73A670#1165207388006#/System/Server##com.sap.engine.core.configuration#######T
    hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
    Z:
    sapmnt
    PXI
    global
    security
    lib
    tools
    iaik_jce_export.jar#
    #1.5#C0000A0008A8000000000002017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
    hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
    Z:
    sapmnt
    PXI
    global
    security
    lib
    tools
    iaik_jsse.jar#
    #1.5#C0000A0008A8000000000003017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
    hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
    Z:
    sapmnt
    PXI
    global
    security
    lib
    tools
    iaik_smime.jar#
    #1.5#C0000A0008A8000000000004017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
    hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
    Z:
    sapmnt
    PXI
    global
    security
    lib
    tools
    iaik_ssl.jar#
    #1.5#C0000A0008A8000000000005017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
    hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
    Z:
    sapmnt
    PXI
    global
    security
    lib
    tools
    w3c_http.jar#
    #1.5#C0000A0008A8000000000006017A906E000423BFFC9C25A0#1165207390660#/System/Configuration/Logging##com.sap.tc.logging.APILogg
    er.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]
    ##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the
    has been changed from to )!#5#resource bundle
    name#LogController#com.sap.security.core.server.secstorefs.SecStoreFS#<null>#com.sap.security.core.server.secstorefs.SecStore
    FSResources#
    #1.5#C0000A0008A8000000000007017A906E000423BFFC9C4CB0#1165207390670#/System/Configuration/Logging##com.sap.tc.logging.APILogg
    er.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]
    ##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the
    has been changed from to )!#5#resource bundle
    name#LogController#/System/Security/SecStoreFS#<null>#com.sap.security.core.server.secstorefs.SecStoreFSResources#
    #1.5#C0000A0008A8000000000008017A906E000423BFFCAC7D38#1165207391731#/System/Server##com.sap.engine.core.configuration#######T
    hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###OpenSQLDataSource successfully created with secure
    store.#
    #1.5#C0000A0008A8000000000009017A906E000423BFFCDA3070#1165207394726#/System/Configuration/Logging##com.sap.tc.logging.APILogg
    er.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]
    ##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the
    has been changed from to )!#5#resource bundle
    name#LogController#/System/Database/sql/jdbc#<null>#com.sap.sql.log.OpenSQLResourceBundle#
    #1.5#C0000A0008A800000000000A017A906E000423BFFCDB41E0#1165207394796#/System/Database/sql/jdbc##com.sap.sql.jdbc.NativeConnect
    ionFactory#######Thread[main,5,main]
    ##0#0#Error#1#com.sap.sql.jdbc.NativeConnectionFactory#Java#com.sap.sql_0002#com.sap.sql.log.OpenSQLResourceBundle#SQL error
    occurred on connection : code={0,number,integer}, state="", message="".#5#-99999#08001#The application requester
    cannot establish the connection. (XIPRD)#jdbc:as400://XIPRD/SAPPXIDB;transaction isolation=read uncommitted;data
    truncation=true;date format=jis;time format=jis;sort=hex;hold input locators=true;hold statements=true;cursor
    hold=false#<null>#
    The "SQL error occurred on connection"  happened during start run configtool.
    We don't know how to solve this problem.
    Thanks

    I am unable to start my configtool.bat to administer JVM memory settings for my J2EE.
    Wait......
    Thanks

  • Using the RFC adapter (sender), how do I know which RFC is being sent?

    Hello everyone!
    Has anyone used the RFC adapter (sender) in XI to pick up RFC messages? How would I know which RFC is triggered for example when a user creates a PO (purchase order)?
    Warm Regards,
    Glenn

    Glenn,
    When u are writinfg RFC program, u will have destination right?  There u know u have to give RFC Destination(SM59) while creating RFC destination we will be giving Program ID .
    Similarly in XI while creating Sender RFC u have to give the program id. So with these program id these programs are linked together and triggered from R/3 to the exact Sender adapter.
    Please see Michal weblog for more details
    /people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step
    I hope it clears your doubt!!!
    Best regards,
    raj.

  • Retaining row selection in a new  table which uses the same model.

    hi can anybody help me
    actually i have a table which allows multiple selections.like it allows to select row1 & row 4 if
    there are 5 rows.Now on click of a button i show a dialog with another table but with the same model
    applied to it.
    now my problem is that iam not able to make the selction of 1 & 4 rows in the new table.
    if i use a selectSingleRow in a for loop only 4rth row is getting selected.
    if i use a selection interval method it selects all the 4 rows from 1 to 4.
    is there any way i could select only the 1st and the 4rth row ?

    import javax.swing.*;
    import java.awt.*;
    import javax.swing.table.*;
    class Testing
      public void buildGUI()
        JTable table = new JTable(10,3);
        JScrollPane sp = new JScrollPane(table);
        sp.setPreferredSize(new Dimension(300,200));
        JFrame f = new JFrame();
        f.getContentPane().add(sp);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        table.changeSelection(1,0,true,false);
        table.changeSelection(4,0,true,false);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • Reg using the GP APIs with webdynpro applications

    Hi Experts,
    I have been implementing webdynpro appln using GP APIs as a callable object in my application. In my webdynpro application i have been using RFCs to access data from the R/3 system.
    Are there any setting I need to do in Guided Procedures (portal) to run the application in portal.
    Can any one of you explain me regarding what are all the setting i need to do from the Guided Procedures perspective while using callable object that interact with an R/3 system?
    Also, I would be grateful for any other valuable suggestions from you regarding implementing webdynpro appln using GP APIs as a callable object.
    Thank You.
    Regards,
    Murthy J N.

    Please follow the below links for Webdynpro Development with Guided Procedures :
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/50d74ada-0c01-0010-07a8-8c118d408e59
    https://www.sdn.sap.com/irj/sdn/xapps?rid=/library/uuid/73cc8084-0b01-0010-1788-b2304424605a
    Hope it helps.
    Regards,
    Shikhil

Maybe you are looking for