XML file Upload in ADF UI page

Hi,
I have following requirement:
a) There will be an upload button on the ADF UI page.
b) The ADF UI will allow user to browse and select the XML file
c) Once XML file is selected there will be a Load button.
Note: I am fine till step c)....
d) Upon the Load, UI Screen should be populated with the XML content.
e.g. UI screen will have Book Title and Author text boxes and the data for Title and Author should be loaded from XML file.
e) Once data is loaded in ADF UI page (from XML) , it should allow user to modify Title and Author in UI screen.
f) After modifying the data, user should be allowed to save modified content either in XML file or Database.
Note: On the OTN forum I posted similar question and I found the partial solution of using the URLConnection Data control, however this data control does not allow you to modify the content on the ADF UI page.
Thanks

Hi,
Note: On the OTN forum I posted similar question and I found the partial solution of using the URLConnection Data control, however this data control does not allow you to modify the content on the ADF UI page.
Not quite true what you say. The data control shows the data as read only. However, setting the updateable property on the metadata will allow you to create an input form, which is editable. For this, in the Data Control for the URL data control, select the collection and choose "Edit Definition" from the context menu. Select Attributes and if this doesn't show the attributes, follow the link in the Attributes field. Then select each attribute and set the updateable property using the PI
The question then is how you perform the update, which is what the URL data control doesn't do for you. For this you need to expose methods in a POJO that you then expose as a POJO data control. With your knowledge about the location and name of the XML file, you can then use JAXB to upload the XML, or a database bound collection (EJB, ADF BC or JDBC) to write changes to the database. Note that JAXB could also be used read from teh XML file and show the data in the UI using the JavaBean Data Control.
To access the object to use for updating the XML file or the database, you use ((DCIteratorBinding)bindings.get("IteratorNameInPageDef")).getCurrentRow().getDataProvider()
Frank

Similar Messages

  • File Upload Problem in .jsff page

    Hi
    I tried to upload a file in my jsff fragment.(I did the POC in jspx page and its working fine )
    But when in fragment when i tried to add af:form elemenst errors are coming and as per my research we cann t add af:form element in jsff page.
    Cna any bidy tell me what shoudl be done to have file upload functionality working in page fragment?

    I am using ADF - 11.1.1.3 and even if i put af:form in my jspx page i am receiving following erro message -
    *<Jul 13, 2010 3:20:22 PM SGT> <Error> <HTTP> <BEA-101020> <[ServletContext@22880480[app:sqe module:sqe path:/abc spec-version:2.5]] Servlet failed with Exception*
    java.lang.NullPointerException
    *     at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:233)*
    *     at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)*
    *     at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)*
    *     at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)*
    *     at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)*
    *     Truncated. see log file for complete stacktrace*
    *>*
    *<Jul 13, 2010 3:20:22 PM SGT> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at Jul 13, 2010 3:20:22 PM SGT. Notification details:*
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    *WatchData: DATE = Jul 13, 2010 3:20:22 PM SGT SERVER = DefaultServer MESSAGE = [ServletContext@22880480[app:sqe module:sqe path:/abc spec-version:2.5]] Servlet failed with Exception*
    java.lang.NullPointerException
    *     at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:233)*
    *     at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)*
    *     at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)*
    *     at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)*
    *     at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)*
    *     at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)*
    *     at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)*
    *     at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1071)*
    *     at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)*
    *     at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)*
    *     at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)*
    *     at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1515)*
    *     at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:785)*
    *     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)*
    *     at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)*
    *     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)*
    *     at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)*
    *     at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)*
    *     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:710)*
    *     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)*
    *     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:205)*
    *     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)*
    *     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)*
    *     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)*
    *     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)*
    *     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)*
    *     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    *     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)*
    *     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    *     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)*
    *     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)*
    *     at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)*
    *     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)*
    *     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)*
    *     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)*
    *     at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)*
    *     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    *     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)*
    *     at java.security.AccessController.doPrivileged(Native Method)*
    *     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)*
    *     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)*
    *     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)*
    *     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)*
    *     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    *     at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)*
    *     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    *     at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)*
    *     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    *     at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)*
    *     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    *     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)*
    *     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)*
    *     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)*
    *     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)*
    *     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)*
    *     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)*
    *     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)*
    *     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)*
    *     at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)*
    *SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = CI0000000080442 TXID = CONTEXTID = 4eaa01d34767a0a4:3859a5d6:129ca386f71:-8000-0000000000000045 TIMESTAMP = 1279005622489*
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 30000
    *>*
    *<Jul 13, 2010 3:20:25 PM SGT> <Alert> <Diagnostics> <BEA-320016> <Creating diagnostic image in c:\documents and settings\shmishra\application data\jdeveloper\system11.1.1.3.37.56.60\defaultdomain\servers\defaultserver\adr\diag\ofm\defaultdomain\defaultserver\incident\incdir_166 with a lockout minute period of 1.>*
    Any idea about the reason??
    And what else can be done to solve this problem...

  • How to display XML file(as markup) in jsp page..?

    Hi All,
    * I have to display the XML file(as markup) in jsp page (Tree Format)....
    * My XML file is an java.io.file object , and how to view this XML file on my JSP page...........
    Thanks in Advance,
    JavaImran

    You mean you want to see the XML source?
    You need to replace the characters '<' and '&' with corresponding entities '&lt;' and '&amp;'. You can use replaceAll, but do the ampersands first.
    Then I suggest you probably want to put them in a <PRE> block.

  • How i verified PG xml file uploaded.

    Hi,
    I have uploaded the PG xml file with import command. But when I go to the application, it still shows the same old file. I have asked DBA to bounce the Apache. The bounce does not work either. The import has worked for me in the past. But this week it got this problem. I heard there is some table we can check if the PG xml got uploaded or not. Anyone knows the table name? If the PG xml got issue, do I expect to see error or the old page?
    The metalink used very friendly to find the table information. But the new version really sucks. I can not find where I can get the table info.
    Thanks.

    Hi,
    It is really difficult to find any information using jdr table, that is why oracle has provded some API under JDR_UTILS Package. So use following PL/SQL bloack to check your requirement:
    Begin
    Jdr_utils.printdocument('Compelete path of your xml Page');
    End;
    Hope this will help.
    Regards,
    Reetesh Sharma

  • Generating a XML file from a JSP request Page

    Hi,
    I am very new to JAVA with XML. My need is i want to capture some data in in a JSP page then after submitting ,it will generate a XML file. How can i do that??? Any help will be highly appriciated. If anybody can give me a good example....
    Thx

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Are you using our XML SQL Utility that comes with the Oracle XDK for Java? Is the correct result produced, but you are having trouble writing it to a file?<HR></BLOCKQUOTE>
    hi steven,
    yes i am using xml sql utility and have solved the problem..... as i was working from a remote system i didnot give the correct path that is the c:\.....etc of the machine i was giving http:// thats why i did not write to a file... now its working

  • Database character set = UTF-8, but mismatch error on XML file upload

    Dear experts,
    I am having problems trying to upload an XML file into an XMLType table. The Database is 9.2.0.5.0, with the character set details:
    SELECT *
    FROM SYS.PROPS$
    WHERE name like '%CHA%';
    Query results:
    NLS_NCHAR_CHARACTERSET          UTF8     NCHAR Character set
    NLS_SAVED_NCHAR_CS          UTF8
    NLS_NUMERIC_CHARACTERS          .,     Numeric characters
    NLS_CHARACTERSET          UTF8     Character set
    NLS_NCHAR_CONV_EXCP          FALSE     NLS conversion exception
    To upload the XML file into the XMLType table, I am using the command:
    insert into XMLTABLE
    values(xmltype(getClobDocument('ServiceRequest.xml','UTF8')));
    However, I get the error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    Why does it mention UCS2, as can't see that on the Database character set?
    Many thanks for your help,
    Mark

    USC2 is known as AL16UTF16(LE/BE) by Oracle...
    Try using AL32UTF8 as the character set name
    AFAIK The main difference between Oracle's UTF8 and AL32UTF8 character set is that is the UTF8 character set does not support those UTF-8 characteres that require 4 bytes..
    -Mark

  • How to break up a huge XML file and generate serialized JSP pages

    I have a huge xml file, with about 100 <item> nodes.
    I want to process this xml file with pagination and generate jsp pages.
    For example:
    Display items from 0 to 9 on page 1 page1.jsp , 10 to 19 on page2.jsp, and so on...
    Is it possible to generate JSP pages like this?
    I have heard of Velocity but dont know if it will be the right technology for this kind of a job.

    Thank you for your reply, I looked at the display tag library and it looks pretty neat with a lot of features, I could definitely use it in a different situation.
    The xml file size is about 1.35 MB, and the size is unpredictable it could shrink or grow periodically depending on the number of items available.
    I was hoping to create a documentation style (static pages) of the xml feed instead of having 1 jsp with dynamic pages
    I was looking at Anakia : http://jakarta.apache.org/velocity/docs/anakia.html , may be it has features that enable me to create static pages but not very sure.
    I think for now, I will transform the xml with an xsl file and pass the page numbers as input parameters to the xsl file
    null

  • .XML file upload

    Hi ,
         What is the purpose of uploading .xml file in SAINT/SPAM  and tell me the procedure for same
    Thanks

    The XML file contains all the information of support packages combined to form the Support Package Stack. The SPS is found at https://service.sap.com/sp-stacks and once you have selected it along with all the components there will be an option to download the XML file. You can then use SAINT to select the SPS based on the information in the file and apply it as a whole. You put the file along with all the support packages in your /usr/sap/trans/EPS/in directory.
    Nelis

  • Where do I find an index.xml file to open an existing pages file

    as above

    You have 2 versions of Pages on your Mac.
    Pages 5.2 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.2 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Older versions of Pages 5 can not open files from later versions of Pages 5.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud and opened in a newer version of Pages is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed almost 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Peter

  • Java OutOfMemoryError on File Upload in ADF

    Hi All,
    I am using JDeveloper 11.1.1.5.0.
    I am uploading a file in ADF. i should be able to upload files upto 10MB. below is the method I am calling when user puts the filename.
        public void setUploadedFile(ValueChangeEvent valueChangeEvent) {
            UploadedFile file = (UploadedFile)valueChangeEvent.getNewValue();
            if (file != null && file.getLength() > 0l) {
                filename = file.getFilename();
                filetype = file.getContentType();
                try {
                    InputStream is = file.getInputStream();
                    long length = file.getLength();
                    if (length > Integer.MAX_VALUE) {
                        // File is too large
                    byte[] bytes = new byte[(int)length];
                    int offset = 0;
                    int numRead = 0;
                    while (offset < bytes.length &&
                           (numRead = is.read(bytes, offset,
                                              bytes.length - offset)) >= 0) {
                        offset += numRead;
                    if (offset < bytes.length) {
                        try {
                            throw new IOException("Could not read complete file");
                        } catch (IOException e) {
                            e.printStackTrace();
                    is.close();
                    byte[] encoded = Base64.encode(bytes);
                    filecontents = new String(encoded);  //getting java.lang.OutOfMemoryError: Java heap space error here
                } catch (IOException e) {
                    e.printStackTrace();
            }else{
        }I am getting a java.lang.OutOfMemoryError: Java heap space error at the mentioned point. This is happening for files larger than 5MB.
    My web.xml have below entries.
    <context-param>
          <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name>
          <param-value>512000000</param-value>
       </context-param>
       <context-param>
          <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY</param-name>
          <param-value>51200000</param-value>
       </context-param>
       <context-param>
        <!-- directory to store temporary files -->
        <param-name>oracle.adf.view.faces.UPLOAD_TEMP_DIR</param-name>
        <!-- Use an ADFUploads subdirectory of /tmp -->
        <param-value>/tmp/ADFUploads/</param-value>
      </context-param>how can i resolve this issue?
    regards,
    Rajan

    byte[] bytes = new byte[(int)length];means that you try to load the whole file into memory (regardless of the parameters in web.xml). And after the file is loaded you need the same amount on memory for
    filecontents = new String(encoded); You should upload the data from the stream into a file and then process the file when you need to do it. For this you can use http://projects.apache.org/projects/commons_io.html
    Timo

  • File uploading in ADF faces

    I tried to use af:inputFile component to upload files, but i can't upload file bigger than 2K, for example i received:
    Successfully uploaded file 1.txt (4337 bytes) - file.getLength() returns
    but:
    Available to upload : 2048 - file.getInputStream().available() returns
    I try to set in web.xml params:
    <context-param>
    <!-- Maximum disk space per request (in bytes) -->
    <param-name>oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACE</param-name>
    <!-- Use 5,000K -->
    <param-value>5120000</param-value>
    </context-param>
    <context-param>
    <!-- Maximum memory per request (in bytes) -->
    <param-name>oracle.adf.view.faces.UPLOAD_MAX_MEMORY</param-name>
    <!-- Use 500K -->
    <param-value>512000</param-value>
    </context-param>
    <context-param>
    <!-- directory to store temporary files -->
    <param-name>oracle.adf.view.faces.UPLOAD_TEMP_DIR</param-name>
    <!-- Use an ADFUploads subdirectory of /tmp -->
    <param-value>D:\tmp</param-value>
    </context-param>
    but nothing changed. How can i upload file bigger than 2K ?
    JDeveloper 10.1.3
    Application Server: OC4J

    Hi,
    set the following context parameter in web.xml
    <context-param>
    <!-- Maximum memory per request (in bytes) -->
    <param-name>oracle.adf.view.faces.UPLOAD_MAX_MEMORY</param-name>
    <!-- Use 5000K -->
    <param-value>5120000</param-value>
    </context-param>
    Frank

  • Unable to clear file upload fields in web pages.

    When visiting any site which has the option to upload a file, I am unable to clear the field if I change my mind about uploading a file.
    A website has a BROWSE or UPLOAD field and button. Pressing the button brings up the open file dialog. I select a file and select open in the dialog. If I then click on the field containing the path/file, I am presented with the open file dialog. I cannot clear or edit the field on the web page.
    I originally thought it was something with the web page I visited, but then found another page did the same thing.

    For instance if you go to this page again in Safari,
    http://www.apple.com/quicktime/qtv/mwsf06/
    and then select "View Source" from the View menu, then press command-f to "find" within the page and search for ".mov"
    You will find this, which shows the url of the movie itself.
    <param name="href" value="http://stream.qtv.apple.com/events/jan/mw2006/mmw_2006_650ref.mov">
    If you copy just this part:
    http://stream.qtv.apple.com/events/jan/mw2006/mmw_2006_650ref.mov
    And open QuickTime Player, go to the File menu, select "Open URL" the movie will play.
    If you try the same technique on the page at the link provided by your client, it will allow you to bypass the html code that may be doing an outdated compatibility check and the movie may play. Or it may tell you that you are missing components (codecs, compressors etc.) in which case, post here again.

  • Excel or xml file upload for Electronic banking

    Hi all,
    Can i upload bank statement in excel or xml format. If yes, how ? Where to go and what to change? Please advice..
    I understand the BAI, Multicash format, but all are in txt format. Does SAP allow us to upload bank statement in excel or xml format ?
    Thankyou
    Sharad

    Hi,
    Good evening and greetings,
    Please go through the following link which details the entire processflow of Electronic Banking
    http://help.sap.com/saphelp_erp2005/helpdata/en/43/0bd3aa43de11d1896f0000e8322d00/frameset.htm
    Please reward points if found useful
    Thanking you
    With kindest regards
    Ramesh Padmanabhan

  • How to implement File Upload/DownLoad in OA page

    Hi All
    I have to implement the File download feature of OA Framework in my Custom OA page when i click the button.
    In developer's Guide i gone through this but i did'nt get what to set in
    File View Attribute,
    File Name Override,
    File MIME Type,
    and View Attribute
    Please Suggest
    Best regards

    The information is there in the dev guide
    File View Attribute - The view attribute that maps to the column that stores the file content.
    File Name Override - The file name to save to when you select the File Download link and choose the Save option in the File Download window to save the file. The default file name that appears in the File Name field of the Save As dialog window is derived from the value returned from the view
    attribute specified by the View Attribute property. The value of the File Name Override property overrides that default file name and is especially useful if the view attribute returns instructional text, such as "Click on this link to download the file". If the File Name Override property is not defined, then
    the file name to save to is the value returned from the view attribute.
    File MIME Type - The MIME type of the file. See the Runtime Control example below if you do not want to specify a static value for this property.
    Data Type - The data type of the File View Attribute. The BLOB datatype is now supported for File Download as of OA Framework 11.5.10D.

  • Uploading xml file in a background job .

    Hi Experts ,
    I am uploading a xml file from application server to internal table .
    While uploading from presentation server I get the value of stream as ( first few lines )
    Case 1 :
    ?<?xml version="1.0" encoding="utf-16" standalone=
    "yes"?><WPUBON01>##  <IDOC BEGIN="1">##    <EDI_DC
    40 SEGMENT="1">##      <TABNAM>EDI_DC40</TABNAM>##
    but while uploading from  application server , I get :
    Case 2 :
    <?xml version="1.0" standalone="yes"?>##<WPUBON01>##  <IDOC BEGIN="1">##    <EDI
    DC40 SEGMENT="1">##      <TABNAM>EDIDC40</TABNAM>##      <MANDT>108</MANDT>##
    Difference is of  unicode 16 as seen in file from presentation server .
    As a result File from Presentation server is getting uploaded in internal table , but not from Application Server . In this case internal table is coming blank .
    I am using :
          CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
              EXPORTING
                text   = stream
              IMPORTING
                buffer = xstring
              EXCEPTIONS
                failed = 1
                OTHERS = 2.
            IF sy-subrc  = 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    here xstring is coming blank when you use same file from application server .
    *Extract data from xsting to internal table
            CALL FUNCTION 'SMUM_XML_PARSE'
              EXPORTING
                xml_input = xstring
              TABLES
                xml_table = it_data
                return    = it_ret.
    I am getting error it it_ret as :
    line   1 col   1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment
    How to get file like case 1 . or how to convert to utf-16 ?
    I am using :
    OPEN DATASET l_filename FOR INPUT IN  BINARY MODE    .
    DO.
    READ DATASET l_filename INTO l_xml_line.
    IF sy-subrc EQ 0.
    APPEND l_xml_line TO l_xml_table.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET l_filename.
    LOOP AT l_xml_table INTO l_xml_line.
    c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
    replacement
    = space ).
    c_conv->read( IMPORTING data = l_content len = l_len ).
    CONCATENATE l_str1 l_content INTO l_str1.
    ENDLOOP.
    Help please ......
    regards ,
    SA

    Hi Alpana ,
    Thanks for the reply .
    I already am uploading data in internal table . If you see through my question ,
    My problem is modify  the error in xml file uploaded in  l_xml_table through read dataset .
    My file has been uploaded   from application server as 
    <?xml version="1.0" standalone="yes"?>
    <WPUBON01>
      <IDOC BEGIN="1">
    This file is getting changed while uploading from presentation server as 
    ?<?xml version="1.0" encoding="utf-16" standalone=
    "yes"?><WPUBON01>##  <IDOC BEGIN="1">##    <EDI_DC
    40 SEGMENT="1">##      <TABNAM>EDI_DC40</TABNAM>##
          <MANDT>108</MANDT>##      <DOCNUM>3C10000001
    notice the addition   'encoding="utf-16" '  .
    How to achieve this addition .
    If i am uploading it frompresentation server it is getting uploaded in internal table successfully , but not from application server
    so that i can parse this xml file into xstring successfulyy to get it into internal table thru function module
    CALL FUNCTION 'SMUM_XML_PARSE'
              EXPORTING
                xml_input = xstring
                xml_input = l_string_output
              TABLES
                xml_table = it_data
                return    = it_ret.
    Please help me in hanging the file stream .
    Regards ,
    SA

Maybe you are looking for