Passing input data to RFC

I have Date,Name and Telephone number input fields ,once user enter these values i have to pass this input to RFC.
1) I created three context attributes Date,Name,telephonenumber (both in view and Custom controller)
2)There is a mapping between view and custom attributes(Date,Name,telephonenumber)
3)i have imported model
4) I have set the RFC attributes and input attributes
public void excuteMMDtestBapi( ){
wdContext.currentContextElement().setDate(new java.sql.Date(System.currentTimeMillis()));
     //  wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErdat( wdContext.currentContextElement().getDate());
       wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErnam(wdContext.
          currentContextElement().getName());
        wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setPhone(wdContext.
               currentContextElement().getTelephonenumber());
5) On action of send button i am excuting the method excuteMMDtestBapi();
i am getting null pointer exception
any suggestions
Murali~

Hi
in CustomControllers WDInit() method
public void wdDoInit()
    //@@begin wdDoInit()
     mmdTest = new Z_Bapi_Mmd_Create_Input();
    wdContext.nodeZ_Bapi_Mmd_Create_Input().bind(mmdTest);
    //@@end
in the following method
public void excuteMMDtestBapi( )
    //@@begin excuteMMDtestBapi()
    MessageManager msgMgr =
                    (MessageManager) wdThis
                         .wdGetAPI()
                         .getComponent()
                         .getMessageManager();
wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErdat( wdContext.currentContextElement().getDate());
       wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setErnam(wdContext.
          currentContextElement().getName());
        wdContext.nodeT_Zmmdvendg().currentT_ZmmdvendgElement().setPhone(wdContext.
               currentContextElement().getTelephonenumber());
                try {
                    this
                         .wdContext
                         .currentZ_Bapi_Mmd_Create_InputElement()
                         .modelObject()
                         .execute();
               } catch (Exception e) {
                    msgMgr.reportException("Error while executing Bapi:", true);
               wdContext.nodeOutput().invalidate();
    //@@end
I am getting null pointer exception when setting date,name and phone number
i canot set mmdTest.setPhone beacuse
I have a Bapi Z_Bapi_Mmd_Create in which parameter T_Zmmdvendg in which ERNAM,PHONE,ERDAT Ihave to set each of these values getting userinputted values from webdynpro
is there i am missing something
Regards,
Murali

Similar Messages

  • Passing input Dates in a Crystal Report

    Post Author: Preethig
    CA Forum: Older Products
    Hi all,
    I am using Crystal reports 8.5 to develop my report. I use the the Crystal report Enterprise Version 8.0 to view my reports in the IE 6.0 Web browser.I communicate to the Crystal Enterprise through my Active Server Pages.(ASP 3.0)
    From my asp page redirect to the urlI use response.redirect
    Here is an example URL:
    http://Domain/Directory/Report.rpt?&prompt0=Valuemy url request is
    Response.Redirect("report.rpt?&prompt0=" & some random value & "&prompt1=" & DateField & "&prompt2 =" & DateField  )
    and I use "sf " query string parameter for passing new selection criteria
    There are three parametes defined in the Crystal report
    Prompt0 - To accept a Number
    Prompt1 - To accept a Date
    Prompt2 - To accept a Date
    Problem: Even after passing the input date parameters as the parameter values for the parameter "Prompt1" and "Prompt2" in my Active Server Page, on launch of the Crystal report in the Crystal enterprise Viewer, the Crystal reports' Dialog still prompts the user to give input dates.
    Need Solution for: I should be able to pass the date parameter values from the ASP page and susequently, the crystal dialog should not be prompted to get the input dates.Kindly suggest a solution.
    Thanks in advance!!Preethi

    Well, can you please post the details about your stored proc?
    <quote> I've checked that when calling one stored-procedure within a crystal report, one sequence will be selected for 2 times. Thus 2 will be added to the corr. sequence No.</quote>
    Question: What do you mean by that? How many times did you run the report?
    More details please.
    -Raj Suchak
    [email protected]

  • How to pass table data to RFC?

    I have scenario below:
    Z_RFC_SalesOrderEntry_Input
    |-----> I_T_Area
                |--> PNo
                |---> Quantity
    |-----> E_T_Area
    |-----> Output
    How to set Table parameter Pno and Qiantity to I_T Area of RFC in web dynpro through coding.....

    Hi Pradeep,
    Try This.
    try
                    Z_RFC_SalesOrderEntry_Input z_RFC_SalesOrderEntry_Input = new Z_RFC_SalesOrderEntry_Input();
                             int size = wdContext.nodeText().size();
                             for (int i = 0; i < size;i++)
                        Z<Put the structure name for I_T_Area> itArea= new <Put the structure name for I_T_Area>();
                        itArea.setPNo(wdContext.nodeText().getTextElementAt(i).getPNo());
                        itArea.setQuantity(wdContext.nodeText().getTextElementAt(i).getQuantity);
                        z_RFC_SalesOrderEntry_Input.addI_TArea(itArea);
                    wdContext.nodeZ_RFC_SalesOrderEntry_Input().bind(z_RFC_SalesOrderEntry_Input);
                    wdContext.currentZ_RFC_SalesOrderEntry_InputElement().modelObject().execute();
                    wdContext.nodeOutput().invalidate();
    catch(Exception e)
    Assuming Text value node is bound to your View. Put the model class name properly.
    How to pass multiple selected values of a table to RFC
    Regards,
    Mithu

  • How can i pass input date parameter in where condition in exec_sql.parse

    EXEC_SQL.PARSE(source_connid, source_cursor,'SELECT substr(empid,3,6) ,
    attdate ,
    to_char(intime1,''HH24MI'') ,
    nvl(to_char(outtime2,''HH24MI''),nvl(to_char(intime2,''hh24mi''),nvl(to_char(outtime1,''hh24mi''),null))) ,
    ''G'' ,
    null ,
    null ,
    55
    FROM ' || source_table||'
    WHERE attdate = '||:control_main.input_dt);
    when i gave this input_dt the output is zero.
    without this where condition i am getting records.
    its urgent,please help me in this.
    Edited by: saru on Jan 12, 2009 2:06 AM
    Edited by: saru on Jan 12, 2009 2:53 AM

    I guess you have a problem with your formats...
    try this:
    [...]WHERE attdate = to_date('''||to_char(:control_main.input_dt,'dd.mm.yyyy')||''', ''dd.mm.yyyy'')[...]regards

  • Exe behaves inconsistently with input data into a cluster

    I'm on Labview 2011, SP1, so this may have been updated, but here's a quirk I discovered.
    I was reading a network shared variable on a remote machine (with 7 integers) into a labview built app (exe) and passing those integers to a cluster used for control.  Sometimes it worked, sometimes it didn't, so I figured I didn't understand shared variable enough (even though I had used them in the same situation many times).
    I switched to writing a file on that remote system, then reading that info into the same cluster.  Sometimes it worked, sometimes it didn't.  Tried all kinds of tricks, but any time there was a direct connection between that variable input data and the cluster, it was inconsistent.
    Turns out that the problem seemed to be the exe halting without error upon bundling the data into the cluster, but not every time. 
    So what finally got around the problem was writing the integers to a duplicate cluster, then using a local variable of that cluster to bundle those values into the  controlling cluster. 
    Once the path between network passed input data and controlling cluster was "double blind" to the application builder, the problem was gone.
    In case it makes some difference, the controlling cluster originated as a user control.

    Do you have a simple example that demonstrates the problem. I would like to test it on later versions.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to pass the data from a input table to RFC data service?

    Hi,
    I am doing a prototype with VC, I'm wondering how VC pass the data from a table view to a backend data service? For example, I have one RFC in the backend system with a tabel type importing parameter, now I want to pass all the data from an input table view to the RFC, I guess it's possible but I don't know how to do it.
    I try to create some events between the input table and data service, but seems there is no a system event can export the whole table to the backend data service.
    Thanks for your answer.

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • Want to pass DataBase output to RFC as an Input

    Hi All,
    Can you please let me know, How to pass the DataBase output to RFC as an Input.
    I am using JDBC Pooling to get the data from Oracle Databse.I want to pass output data(Which I got from the JDBC Pooling) to RFC as input parameters.

    Hi,
    Can you please elobrate your scenario and the meaning of JDBC Pooling as well? Are you writing some java jdbc program which will get the data from database and that data you want to send to RFC as input?
    If so then you need to use BPM
    Receive the request as output from jdbc.
    Map it to the RFC structure.
    Do the rest ....
    Thanks
    Amit
    Reward points if suggestion is helpful.

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • Problem with passing table values to RFC

    Hi all,
    I am passing values in table in RFC. There are no import/export parameters in RFC. We are passing only tables.
    There are two tables in the RFC I_Dept and I_Subdept. Initially RFC is executed for getting the Dept which works fine as for this there is no need to set in input table value. But to get sub department I need to set the dept in I_Dept and after executing RFC I should get values in table I_Subdept. The code is as below:
    wdContext.nodeOutput_I_Dept().invalidate();
    wdContext.nodeOutput_I_Subdept().invalidate();
    Z_Bapi_Dept_Values_Input d_Input = new Z_Bapi_Dept_Values_Input();
    wdContext.nodeZ_Bapi_Dept_Values_Input().bind(d_Input);
    Zdept dept = new Zdept();
    dept.setZname("Sales");
    d_Input.addI_Dept(dept);
    try
    wdContext.nodeZ_Bapi_Dept_Values_Input().currentZ_Bapi_Dept_Values_InputElement().modelObject().execute();
    wdContext.nodeZ_Bapi_Dept_Values_Input().nodeOutput().invalidate();
    catch (WDDynamicRFCExecuteException e)
    msgManager.reportException(e.toString(), true);
    Is anything wrong in this code because even after executing the RFC the size of node I_Subdept() is zero. But the RFC works fine in the backend.
    Regards,
    Jaydeep

    A typical misunderstanding when populating structured input data  
    via code is the following:                                              
    - You have bound a WD context node hierarchy to the model say
      N1         >         M1
      ->N2       >         ->M2
                                                                                    where N1, N2 are WD Context nodes (N2 is child of N1) and M1, M2 are   
    model classes bound to the context nodes. Important: M1 has a relation 
    to M2 on the model side, means there is some method M1.setMyM2(M2)   
    (assuming the target role of the relation is called "MyM2").           
    - You create context elements for N1 and N2 which are bound to a model  
    class instances of M1 and M2 respectively.                                                                               
    Assuming that M1 is the "executable" model class (*_Input) and M2       
    represents an input structure needed, the M2-input will - using the     
    above approach - not be available on execution. Why? The relation on the
    model side (MyM2) is not available if just maintaining it via the     
    context, i.e. context and model are not "in sync". As RFC execution is  
    done via the model the M2 input will not be available.                  
    You best create complex/nested input structures on the model            
    side and then bind the top-level model object to the resp context node. 
    In the above sample this would be:                                      
    M1 m1ModelObject = new M1();                                            
    M2 m2ModelObject = new M2();                                            
    m1ModelObject.setMyM2(m2ModelObject);
    Hope it helps!
    Regards,
    Sangeeta

  • Passing values to a RFC table structure

    Hi
        I am using an RFC in which there is a table called Submit Details.I want to pass three rows to this table structure in the R/3 system.
                            Can anyone help me how to do this.
    regards
    Nayeem

    Hi,
    Private<name>View.I<value node name >Node node = wdContext.node<value node name >();
    Private<name>View.I<value node name>Element ele;
    <your rfc name> input = new <your rfc name>(); // your rfc name
    wdContext.node<your rfc name>().bind(input); // bind
    <table name> inputTable;
    for (int i=0; i < node.size(); i++ ) // value node - where data is available
    inputTable= new <table name>();
    ele = node.get<value node>ElementAt(i);
    inputTable.set<Attribute>(ele.get<Attribute>());
    input.add<table name>();
    // execute rfc.

  • How to passing lowercase values to RFC/BAPI using webdynpro for JAVA

    Hi Exerts,
    When we sending values to RFC/BAPI through webdynpro (JAVA), the values are sent in capital (uppercase) letters to ECC.
    So if we fill xxxx, it is send like XXXX. Why? and how to avoid this?
    Thanks in advance,
    Joeri

    Hi,
    There could be two possibility if you are storing this value in ABAP table.
    1. You are entering value in UPPERCASE in your webdynpro application.
    2. The data stored in ABAP table, converts value in small to upper case.
    1.  Can you tell me how you are passing this value, is user entering value in some input field which is binded to some context and this value are you passing to RFC/BAPI...???
    Or else before passing value to RFC/BAPI you can use toLowerCase string function and the npass this value to RFC/BAPI
    e.g String name = wdContext().currentContextelement().getName().toLowercase();
    Now pass this name to RFC/BAPI is should go as lowercase only..
    This is from webdynpro java side..
    2. If you are storing this value in ABAP table, check the domain/type of variable in ABAP table for which you are storing the value. Ask ABAPper, so that this value are stored in small case letter.
    There is one tick in domain which you need to remove so that it stores in lower case. I dont have exact information but you can consult this with ABAPer.
    Hope this information helps guy ..!!!!
    Regards,
    Jigar

  • Not able pass the data from component to other component.

    Hello All
    I am not able pass the data from component to other component.
    I have done like this.
    1 Main Component (Parent component ) having below  two child components.Embeded as used components.
    2)     Search Component  and Details Component
    3)     In the Search Component having buttons,  Say : Button u201CXu201D on click of button I am navigating to Details component view through FPM.
    4)     When I am clicking above button u201CXu201D raising the event to call the parent   business logic method, there I am getting  Structure with values and binded this structure to the node and Mapped this node to the Details component  interface node. FYI : I kept the debugging point Structure is having data , I had set static attributes table to node instance.
    5)     In the Details component node data is not coming mean empty.
    Thanks in Advance.
    Br-
    CW
    Edited by: CarlinWilliams on Jul 4, 2011 9:21 AM

    Hi,
    When you use input Ext. check that the parent component should not be used as used component in child component.
    Only in the parent component the child components should be used as used components and the usage has to be created for the
    Child Components and the binding of the Node should be done from comp. controller of parent component to child node
    by which you will be able to see double arrow against the node.This should work
    Thanks,
    Shailaja Ainala.

  • Unable To Pass Input Page Parameter Using PageDef File.

    Dear All,
    I am currently exploring task flows as I dont have that much knowledge in it.
    Here's my use case
    1. I setup a taskflow which has a Method Call and a View Activity in it.
    2. The method call is a default activity which just calls a web service.
    3. After execution, I just wanted to display the result of the method.
    I used input page parameters to pass data between the method call and the view activity.
         (I passed the data by accessing the pagedef file directly. I know I can do it using pageflowscope..but this is
         my self exercise so that I could understand ADF fully );)
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="ManageEmployeeTaskflow">
        <view id="viewEmployee">
          <page>/viewEmployee.jsff</page>
          <input-page-parameter>
            <from-value>#{data.com_test_ManageEmpFlow_methodPageDef.empInfoIterator.currentRow.dataProvider.name}</from-value>
            <to-value>#{data.com_test_viewEmployeePageDef.name.inputValue}</to-value>
          </input-page-parameter>
        </view>
        <method-call id="EmployeeSetup">
          <method>#{bindings.EmployeeSetup.execute}</method>
          <outcome id="__12">
            <fixed-outcome>viewEmployee</fixed-outcome>
          </outcome>
        </method-call>
        <use-page-fragments/>
      </task-flow-definition>
    </adfc-config>Problem is, when I display the data. Nothing is being displayed.
    <af:inputText value="#{bindings.name.inputValue}"
                      label="#{'Name'}"/>          I debug the taskflow and the <from-value> really has a value, but I am not sure why it cant be passed to next pagedef.
    Any idea please?
    Edited by: Marky on May 15, 2011 11:25 PM

    Hi,
    I've been thinking... Is this way of passing parameters not possible?
          <input-page-parameter>
            <from-value>#{data.com_test_ManageEmpFlow_methodPageDef.empInfoIterator.currentRow.dataProvider.name}</from-value>
            <to-value>#{data.com_test_viewEmployeePageDef.name.inputValue}</to-value>
          </input-page-parameter>Thanks.

  • How to pass a date parameter from report builder query designer to oracle database

    i'm using report builder 3.0 connected to oracle database. i'm trying to pass a date parameter in the query with no success, i don't
    know the exact syntax. I've tried :
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date('01/01/2014','mm/dd/yyyy')
    it worked perfectly.
    However if i try to put a date parameter "From" instead of 01/01/2014 it will not work, a Define Query Parameter popup window appear and error occurred after i fill
    the values (usually i shouldnt get this popup i should enter the value when i run the report)
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date(:From,'mm/dd/yyyy')
    appreciate your assistance

    Hi Gorgo,
    According to your description, you have problem when in passing a parameter for running a Oracle Query. Right?
    Based on my knowledge, it use "&" as synax for parameter in Oracle, like we use "@" in SQL Server. In this scenario, maybe you can try '01/01/2014' when inputing in "From". We are not sure if there's any limitation for To_Date()
    function. For your self-testing, you can try the query in sqlplus/sql delveloper. Since your issue is related to Oracle query, we suggest you post this thread onto Oracle forum.
    Best Regards,
    Simon Hou

  • Passing table data to pl sql procedure oaf

    Hi All,
    I have a requirement where i have to pass table data to plsql procedure.
    In the first page i select the REQUISITION and click on RETURN button and it will take me to the next page.
    and in the Next page i will click on APPLY button.
    When i click on APPLY, it will call the procedure and will give input to the procedure whatever has been selected when i have selected requisition.
    Please help. Please tell me the approach how to get this task done. A sample code will work.
    Hope the requirement is clear.
    Thanks in Advance.

    Hi Chinmay,
    Refer below code for Your Requirement.
    //Code For Quering Data
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
    String Query = "SELECT organization_id FROM hr_operating_units WHERE organization_id = fnd_global.org_id";
    PreparedStatement stmt = conn.prepareStatement(Query);
    resultset=stmt.executeQuery();
    while (resultset.next())
    orgId = (String)resultset.getString("ORGANIZATION_ID").toString();
    conn.commit();
    catch(Exception e)
    e.printStackTrace();
    //Code for Pass Resulted column to Procedure Input for delete Particular Record
    Execute parameterized PL SQL procedure from OAF page
    Let us try to call PL/SQL package from OAF page. We will try to remove selected line from Database.
    Package Spec
    CREATE OR REPLACE PACKAGE APPS.genpack_pkg
    AS
    PROCEDURE roll_delete_proc (orgId IN VARCHAR2);
    END genpack_pkg;
    Package Body
    CREATE OR REPLACE PACKAGE BODY APPS.genpack_pkg
    AS
    PROCEDURE roll_delete_proc (orgId IN VARCHAR2)
    AS
    BEGIN
    DELETE FROM pklist_roll_details_temp
    WHERE roll_line_id = orgId;
    COMMIT;
    END roll_delete_proc;
    END genpack_pkg;
    //in Controller PFR
    import java.sql.CallableStatement;
    if (pageContext.getParameter("ActionsButton") != null)
    String val = pageContext.getParameter("ActionsChoice");
    if ("DELLN".equals(val))
    CallableStatement cstmt = null;
    for (OAViewRowImpl row = (OAViewRowImpl)tempvo.first(); row != null; row = (OAViewRowImpl)tempvo.next()) {
    if ((row.getAttribute("Selectflag") == null) ||
    (!row.getAttribute("Selectflag").toString().equals("Y"))) continue;
    try {
    int rollid = Integer.parseInt((String)row.getAttribute("orgId"));
    Connection conn = am.getOADBTransaction().getJdbcConnection();
    if (rollid == 1)
    temphm.put(row.getAttribute("orgId").toString(), row.getAttribute("PoNumber").orgId());
    tempvo.removeCurrentRow();
    else
    try
    StringBuilder sb = new StringBuilder();
    sb.append(rollid);
    String strI = sb.toString();
    System.out.println("Inside else in delete");
    cstmt = conn.prepareCall("{call GENPACK_PKG.tpc_roll_delete_proc(?)}");
    cstmt.setString(1, strI);
    System.out.println("Oracle Callable Statment Execution Init for Delete");
    cstmt.execute();
    catch (SQLException e) {
    throw new OAException(e.toString(), (byte)0);
    }tempvo.removeCurrentRow();
    catch (OAException e) {
    throw new OAException("No row selected", (byte)3);
    Thanks,
    Dilip

Maybe you are looking for