Append Data from Java Web Dynpro to an Internal Table in ECC

Hi,
Currently I am using AdaptiveRFCModels to creating/updating records from Java Web Dynbpro to FM in R/3. Users can add few records before they save the changes. The current design is Java Web Dynpro call RFC FM when user add/edit one record. The record will store in an global internal table in the Function Group. For example, I have added 3 records before I save the changes. It means that global internal table should have 3 records that I added before I save it. But in fact, the global internal table only store one record while I adding the third record. The global internal table not able to keep the previous records. The code below is how I code to execute the FM from Java Webdynpro. Is the code can work as I expected? Anything missing in the codes? Please advice. Thanks.
wdContext.nodeZhr_abc_Input().bind((Zhr_abc_Input) model.createModelObject(Zhr_abc_Input.class));
Zhr_abc_Input objReq = new Zhr_abc_Input();
Zhr_Pad31 insUpdVer = new Zhr_Pad31();
insUpdVer.setQ_Id(wdContext.currentContextElement().getQ_Id());
insUpdVer.setZ_ce(wdContext.currentZhr_Detail_OutputElement().getZ_ce());
objReq.addLt_Pad88(insUpdVer);
wdContext.nodeZhr_abc_Input().bind(objReq);
wdContext.currentZhr_abc_InputElement().modelObject().execute();

According to your code you are setting only one record.
You have to create 3 elements for each record and add all the three to the nodeZhr_abc_Input node.
If I understand correctly, node currentZhr_Detail_Output is the one which is containing all the three records. Loop through this node, pick each record and set to the input node.
wdContext.nodeZhr_abc_Input().bind((Zhr_abc_Input) model.createModelObject(Zhr_abc_Input.class));
for(int i=0;i<wdContext.nodeZhr_Detail_Output().size();i++)
Zhr_abc_Input objReq = new Zhr_abc_Input();
Zhr_Pad31 insUpdVer = new Zhr_Pad31();
insUpdVer.setQ_Id(wdContext.currentContextElement().getQ_Id());
insUpdVer.setZ_ce(wdContext.nodeZhr_Detail_Output().getElementAt(i).getZ_ce());
objReq.addLt_Pad88(insUpdVer);
wdContext.nodeZhr_abc_Input().addElement(objReq); // Changed from bind to addElement
}//for end
wdContext.currentZhr_abc_InputElement().modelObject().execute();
Note: I just typed the code. Syntax might be wrong here and there. Please correct it while coding.
Regards,
Jaya.

Similar Messages

  • Nwdi-managed access of pcd-objects from java web dynpro

    Hi,
    im am trying to access portal pcd-objects from a java web dynpro component (namely getting and setting personalized iview properties). for locally managed web dynpro components this works fine with the code below.
    when i try the same with a nwdi managed web dynpro component i run into problems regarding references to used dcs. for instance, i need to reference used dc SAP_JTECHS/tc/epbc/pcm/adminapi/java because the build needs tcepbcpcmadminapijava.jar which is inside the mentioned dc. but access permissions of this dc don't allow the dependency. when i try to "add used dc ..." in nwds i get the error message: illegal dependency: access list does not allow use of ...
    has someone any solution for this problem? are there other ways of accessing pcd-objects from java web dynpro (nwdi managed!)?
    thanks
    heiko
    private static void savePersonalizationData(String value) {
         try {
              IAttributeSet attributeSet = (IAttributeSet) getIview(IVIEW);
              attributeSet.putAttribute(ATTRIBUTE, value);
              attributeSet.save();
         } catch (Exception e) {
    private static Object getIview(String pcdPath) throws Exception {
         Hashtable env = new Hashtable();
         env.put(
              com.sap.portal.directory.Constants.REQUESTED_ASPECT,
              com.sap.portal.pcm.admin.PcmConstants.ASPECT_SEMANTICS);
         env.put(
              Context.SECURITY_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         env.put(
              IPcdContext.PCD_PERSONALIZATION_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         InitialContext iCtx = new InitialContext(env);
         return iCtx.lookup(pcdPath);

    Hi Kust,
    To access the PCD objects the code you used looks ok for me but your main issues is related to the dc access permissions. This thread discussed about the similar issue. Please review this below thread.
    /message/979328#979328 [original link is broken]
    Regards
    Krishna Reddy

  • How to select the data from a Maintainance View into an internal table

    Hi All,
    Can anybody tell me how to select the data from a Maintainance View into an internal table.
    Thanks,
    srinivas.

    HI,
    You can not retrieve data from A mentenance view.
    For detail check this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    Regards,
    Anirban

  • How to Extract Data from the PDF file to an internal table.

    HI friends,
    How can i Extract data from a PDF file to an internal table....
    Thanks in Advance
    Shankar

    Shankar,
    Have a look at these threads:-
    extracting the data from pdf  file to internal table in abap
    Adobe Form (data extraction error)
    Chintan

  • How to Transfer Data from editable ALV grid control to internal table?

    Hi,
    Can anyone give me a simple example by which I can transfer data from editable alv grid control back to the internal table. The ALV has been created by OO approach.
    I would appreciate if the solution is provided without handling any events.
    Regards,
    Auro

    Hello Auro
    You simply need to call method <b>go_grid->check_changed_data</b> at PAI of the dynpro displaying the ALV grid. If data have been changed on the editable ALV grid then this method will raise event DATA_CHANGED. If you do not want or need to handle this event (e.g. for validating the edited values) then you do not define any event handler method.
    Regards
      Uwe

  • How to fetch data from XML and store it in internal table

    Hi All,
    Can anyone help me out, in fetching data from xml and store it in an internal table. Is there any standard function module is there?
    Regards,
    Karthick

    to do this you can either develop a XSLT program and use it with CALL TRNSFORMATION key word to tranform the XML into itab .
    (search the ABAP General forum, i have posted few samples)
    or simply use the following FM which converts your XML into a itab of name value pair (name would holw the element name and value would hold the value of the element) which you can then loop and read it to your itb.
    data:             xmldata type xstring .
    data: result_xml type standard table of smum_xmltb .
    data: return type standard table of bapiret2 .
    CALL FUNCTION 'SMUM_XML_PARSE'
      EXPORTING
        xml_input       = xmldata
      TABLES
        xml_table       = result_xml
        return          = return .
    Regards
    Raja

  • Unable to access PCD's role properties from Java Web Dynpro  (Access Denied

    Using the IPcdContext to access the portal roles does not produce the required list of roles due to the following error
    Access denied (Object) .....
    This occurs once I try to use the lookup() method
    I have tried security zones, adding sharingReferences and permission, but no luck.
    I have searched the SDN but again whatever I found still gave the same result. I now think that it's a configuration settings rather than code.
    Sample code
    Hashtable env = new Hashtable();
    env.put(Context.SECURITY_PRINCIPAL, strCurrentUser);
      env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
      //DirContext ictx = new javax.naming.directory.InitialDirContext(env);
    // InitialDirContext     ictx = new InitialDirContext(env);
      InitialContext ictx = new InitialContext(env);
      lookupObject = "portal_content";
      IPcdContext myPcdContext =      (IPcdContext) ictx.lookup(lookupObject);
    Any suggestion will be appreciated

    Rob,
    The only thing I see different as per this [document |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401]  is following line of codes. Check if adding it resolves the issue:
    env.put(com.sap.portal.directory.Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
    lookupObject = "pcd:portal_content/"
    ... note the /
    Chintan

  • The data from my web page insert in SQL table as question marks

    I use Farsi language in my web page for inserting customer data. The data that is inserted in webpage and submitted, showed as ???? in SQL table. A lot of developers say that I should use N' before the Unicode character, but I don't know how I can use it
    in my code. I attached the code. Can someone say me where I should insert the N in my code?
    protected void cmdInsert_Click(object sender, EventArgs e)
    //Checking the validation of required fields
    if (cboCustomerType.Text == "" || cboTitle.Text == "" || SearchableName.Text == "" ||
    FinalName.Text == "" || NationalID.Text == "" || BusinessID.Text == "" || MobilePhone.Text == "")
    lblStatus.Text = "لطفا فیلدهای اجباری را حتما پر کنید";
    return;
    //define ADO.NET objects.
    string insertSQL;
    insertSQL = "INSERT INTO Customers(";
    insertSQL += "CustomerType,CustomerTitle,CustomerFirstName,CustomerLastName,CompanyType,";
    insertSQL += "CompanyName,SearchableName,FinalName,NationalCode,BusinessID,City,Address,PostalCode,";
    insertSQL += "Zone,MobileNumber,WorkPhone1,WorkPhone2,HomePhone,FaxNumber,Email,Website,Note)";
    insertSQL += "VALUES('";
    insertSQL += cboCustomerType.Text + "','";
    insertSQL += cboTitle.Text + "','";
    insertSQL += CustomerFirstName.Text + "','";
    insertSQL += CustomerLastName.Text + "','";
    insertSQL += cboCompanyType.Text + "','";
    insertSQL += CompanyName.Text + "','";
    insertSQL += SearchableName.Text + "','";
    insertSQL += FinalName.Text + "','";
    insertSQL += NationalID.Text + "','";
    insertSQL += BusinessID.Text + "','";
    insertSQL += City.Text + "','";
    insertSQL += Address.Text + "','";
    insertSQL += PostalCode.Text + "','";
    insertSQL += Zone.Text + "','";
    insertSQL += MobilePhone.Text + "','";
    insertSQL += Phone1.Text + "','";
    insertSQL += Phone2.Text + "','";
    insertSQL += HomePhone.Text + "','";
    insertSQL += FaxNumber.Text + "','";
    insertSQL += Email.Text + "','";
    insertSQL += Website.Text + "','";
    insertSQL += Note.Text + "')";
    SqlConnection con = new SqlConnection(connectionString);
    SqlCommand cmd = new SqlCommand(insertSQL, con);
    //try to open the database and execute the insert
    int added = 0;
    try
    con.Open();
    added = cmd.ExecuteNonQuery();
    lblStatus.Text = added.ToString() + "اضافه شد";
    catch (Exception err)
    lblStatus.Text = "Error inserting record.";
    lblStatus.Text += err.Message;
    finally
    con.Close();
    //If the insert succeed, refresh the customer list.
    if (added > 0)
    FillCustomerList();
    Regards,

    Because you're composing the SQL statement with string concatenation, you would put the "N" before the single quote,
    VALUES(N'";
                insertSQL += cboCustomerType.Text + "',N'";
                insertSQL += cboTitle.Text + "',N'"; // ...etc
    However, composing SQL statements with string concatenation is not a suggested practice because it's open to SQL injection (see:
    https://technet.microsoft.com/en-us/library/ms161953(v=sql.105).aspx). A safer way to do this is to use command parameters to represent the values (see SqlCommand.Parameters
    property). If you use parameters, you can specify parameter data type as SqlDbType.NVarchar, which will ensure your text values are passed in as Unicode. Also ensure that the columns in question are defined in the database table definition as Unicode (NVARCHAR
    rather than VARCHAR).
    Hope this helps, Bob

  • Connecting to R/3 System through Java Web Dynpro forms.

    Hi,
    I have a requirement in which I have to send data to R/3
    from Java Web Dynpro screens.
    I will design the Java Web Dynpro screens and write a RFC Model.
    I will write a RFC in se37 which will connect to the RFC Model.
    Before creating the RFC in se37, I will create ztables in se11.
    I will write a ABAP Report to see that all data enters the ztables.
    I need some guidance with regard to this.
    Do, the RFC Model have the access of the ECC(R/3) System.
    What are tasks to be told the Basis guy so, that RFC being called from through Java Web Dynpro?
    Please provide me some documents with regards to this scenario.
    Regards
    Neha Singh

    Hi Neha,
    The steps you provided is clear enough to connect to a R/3 system through the WD forms.
    On creating the model you need to give two inputs such as
    logical system name for model instance
    logical system name for RFC metadata
    there will be 2 default values, also you can create your own JCOs in the <servername>:<port>/devinf of the server or u can ask your basis team also.
    Before creating the JCO , the SLD (System Landscape Directory) needs to be configures, that your basis team will know.
    other than that once you create the functional module in se37 make it RFC enabled , and once you import the RFC model , you can give your ECC system user name and password and search for RFC you have created from the list of RFC.
    Regards,
    Sam Charles J.

  • Call smartforms via java web dynpro

    Hi,
    We was created payslip in R3 smartforms in PDF format. How can I call the PDF file from java web dynpro?
    Regards,
    Eric

    Hi,
       Check [this|http://****************/Tutorials/Smartforms/SFinEPasPDF/Page1.htm] link.
    Regards,
    Satyajit.

  • How to use EVS with different data in each row, in a Java Web Dynpro table?

    Hi all,
    I am using EVS in a column of java web dynpro table.
    Let's say the name, and context attribute, of this column is column1.
    It's filled dynamically using an RFC, that uses as input parameter the value of another column, and related context attribute, from the same table (Let's call it column2).  Obviously, from the same row. So, in other words: the values of the EVS in column1 of row1, are dependent of the value of column2 of row1. And the values of the EVS in column1 of row2, are dependent of the value of column2 of row2. And so on... Hope i could explain myself ok.
    The code I'm using works great for filling the EVS dynamically:
    IWDAttributeInfo attrInfo = wdContext.nodeDetail().getNodeInfo().getAttribute(nodeElement.COLUMN1);
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    value.clear();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for (int i = 0; i < wdContext.nodeRFCresult().size(); i++){
              value.put(wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgort()
                 , wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgobe());
    In this code, nodeElement is the context row of the table that is passed dynamically to the method when the value of colum2 is changed.
    HOWEVER, the problem I'm having is that after executing this code, EACH NEW ROW that is added to the table has by default the same values as the first row, in the column1 EVS. And, for example, if I refresh the values of the column1 EVS in row 2, all EVS values in the other rows are also refreshed with the same values as the ones of EVS in row 2.
    How can I make sure each row EVS has its own set of independent values, so they don't mess with each other?
    Hope you guys can help me. And please, let me know if I didn't explain myself correctly!
    Thanks!

    I just did as you said (I think), but it's still having the same behaviour as before (same data for all EVS in the table).
    Here´s what I did:
    I
    In node "Detail" (cardinality 0...n, singleton set to true), which is binded to the table, I created a child node named "Column1Values" wth cardinality 1...1 and singleton set to false.
    "Column1Values" node has an attribute called "column1", of type String.
    I did the binding between attribute "column1" and the column1 inputfield celleditor in the table.
    I created an event called Column2Changed and binded it to the column2 celleditor of the table. I added a parameter called nodeElement of type IPrivateCompView.IDetailElement to this event, and mapped it to the column2 editor in the table so that I can dynamically get the nodeElement that is being affected.
    I added the following code to the onActionColumn2Changed(wdEvent, nodeElement) method that gets created in the view:
    IWDAttributeInfo attrInfo = nodeElement.nodeColumn1Values().getNodeInfo().getAttribute("column1");
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for(int i =0; i < wdContext.nodeRFCresults().size(); i++){
              value.put(wdContext.nodeRFCresults().getRFCresultsElementAt(i).getId(),
                                  wdContext.nodeRFCresults().getRFCresultsElementAt(i).getDesc());
    And with this, I still get the original problem... When the EVS of one row is updated, ALL other EVS of the table get also updated with the same values.
    What am I missing? Sorry Govardan, I bet I'm not seeing something really obvious... hopefully you can point me in the right direction.
    Thanks!

  • Sending java web dynpro interactive form as pdf attachment from Business WF

    Hi,
    I have a java web dynpro application with interactive form(online), on send button click i need to send the filled form as an PDF attchment to internet mail id. I am using SO_NEW_DOCUMENT_ATT_SEND_API1 inside workflow to send attachment. My custom RFC which is interacting with WD app is getting the pdf source context attribute(simply i set the import parameter with that attribute and no juggling is done) as import parameter which  is of type XTSRING. Once i execute the application i am getting mail with attachment as pdf but i am not able to open the pdf. It is of just 1 KB size. It seems my pdf source context attribute is not sending data. Can some one suggest how can i solve this.DO i need to convert the data to pdf format before sending or any otgher thing i need to do.
    Regards
    Ravindra

    I did that before posting the question itself (enables = false), it doesn't work. It just disable the extra features like digital signature and stuff.  Interesting thing is all our HCM forms developed for HR actions works fine with out any issues. Why the interactive form developed with WDJ is not working and it requires credentials??. The same form works fine if I deploy the application directly into server but it throws the error if I check in through NWDI ..
    If you look at the server location it has the file but it throws the error:
    Caused by: com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: IOException occured while creating template stream from the TemplateSource : .\temp\webdynpro\public\sap.com\ess~ben\webdynpro\Components\com.sap.xss.hr.ben.reviewtable.VcBenefitsReviewTable\ReviewTableView_InteractiveForm_Review.xdp (The system cannot find the file specified)
    Please advise.
    Thank You,
    Hari.

  • Unable to download file from FileDownload UI Element - Java Web Dynpro

    Hello Experts,
    I am facing a strange issue.Scenario is:
    I created an java web Dynpro application (Please note that it is just a standalone WD app, not integrated in portal) with just one FileUpload UI Element ,one FileDownload UI element and one button (for triggering an action).
    I browse a file (e.g. text,pdf,doc etc.) and click on button. It uploads the file and when I click on download, there are two cases:
         1) Simply click on download does not downloads the file and shows error: "Unable to download <file name> from <server name>.  Unable to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later." Though it is opening the file,showing the content.
         2) I opened that portal URL in a new tab in same session and logged in with a portal user. Now if I click on download link of same WD app opened in different tab of same session, it downloads the file without any error.
    I am using portal 7.0
    Can somebody point what's going wrong with case 1?
    Helpful pointers will be appreciated.
    Thanks,
    Kirtiman

    Hi Sid,
    I did not gave any authentication of WD app as it is anonymous app. There is no parameter set in application properties.
    As I run the app, it is showing the initial screen with UI elemtns and till upload works fine,.It has to be an anonymous app, so cannot ask for credential from user.
    Thanks
    Kirtiman

  • Possible to read data from a web browser into java?

    Is it possible to read data from a web browser such as IE or Mozilla into a java applet for use and manipulation? If it is, could someone please post some documentation I could look at or a snip-it of code I could use? Thanks.

    This will read the content from a site:
    import java.net.*;
    import java.io.*;
    class Test {
         public static void main(String[] argv) throws Exception {
              URL u = new URL("http://www.google.com");
              URLConnection uc = u.openConnection();
              BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
              String text;
              while( (text = br.readLine()) != null ) {
                   System.out.println(text);
    }

  • Consuming an outbound iDoc from a Java Web Dynpro application on EP front

    Hi,
    I am trying to consume an outbound iDoc from a SAP system into a Java Web Dynpro application. The result would be displayed on the Enterprise Portal. Could anyone help me with the process to be followed for the same.
    Regards,
    Chandrima.

    Hi,
    I am trying to consume an outbound iDoc from a SAP system into a Java Web Dynpro application. The result would be displayed on the Enterprise Portal. Could anyone help me with the process to be followed for the same.
    Regards,
    Chandrima.

Maybe you are looking for

  • SetDiagnosticDirectory(Diagnostics.java:54) [32-bit java on 64-bit machine]

    On 64-bit LucidLynx Linux, If I run Oracle SQL Developer using 64 bit java, all is fine. If I use 32-bit java, it doesn't start up and I get this fatal error: java.lang.IllegalArgumentException: Cannot create <pwd>/?/.sqldeveloper/system1.5.5.59.69/o

  • Advance payment in SO

    Hello Experts, My client gets the 70% advance payment once he sends the proforma invoice.My query is that once he gets the payment he will do the manual advance payment entry.But my client wants the payment shoud reflect the SO.I understand it has li

  • Cant find movie from videora

    i just transfered my movie into a mp.4 using videora but i cant find the new file to add to my itunes library. on the one site that shows step by step instructions for videora it says the new file will be located in the " output video to: " folder, c

  • Background job to create/update vendors.

    Hello, We need to create/update vendor records for travel expenses reimbursement. So far we try to create it as background scheduled job for transaction PRAA, but in fact PRAA transaction only creates batch input session and donu2019t process it. In

  • Not able to start EM on Windows2003

    Install went through fine for DB server, however, DBConsole is failing to come up, any one seen this before? E:\oracle\product\10.1.0\bin>emca -r STARTED EMCA at Fri Aug 19 17:20:18 IST 2005 Enter the following information about the database to be co