Replace the header line in the o/p file

My scenarion is to generate a xml file,the xml file contains a header line <?xml version="1.0" encoding="utf-8"?>
and this lineis  to be relaced with <XYZ>.
it is multi message mapping -- splitting of messages 1:n, i cannot add any extra fields to the target structure to pass the header
I wrote a abap mapping program and included that in the second step of my interface mapping.
the code for abap mapping is as below.
method IF_MAPPING~EXECUTE.
   data: lv_new_str  type string,
         lv_old_str type string,
         lv_string type string.
***Convert the XSTRING to STRING
CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
  EXPORTING
    im_xstring        = source
*   IM_ENCODING       = 'UTF-8'
IMPORTING
   EX_STRING         = lv_string .
**Pass the Values
lv_old_str = '<?xml version="1.0" encoding="utf-8"?>'.
lv_new_str = '<!XYZ>.
REPLACE ALL OCCURRENCES OF lv_old_str in lv_string with lv_new_str.
***Convert the STRING to XSTRING.
CALL FUNCTION 'ECATT_CONV_STRING_TO_XSTRING'
  EXPORTING
    im_string         = lv_string
*   IM_ENCODING       = 'UTF-8'
IMPORTING
   EX_XSTRING        = result
*   EX_LEN            = .
endmethod.
But iam not able to get the desired output.
Please suggest me how to make this work?
Thanks
Srinivas

Hi Srinivas,
Can you please see the java mapping as given by suraj in this thread:
How do I remove xml encoding?
Regards,
---Satish

Similar Messages

  • How to print header lines at the top of every page with Alv list display?

    Dear all,
    I need a requirement with printing issue. A program list should be printed with the function reuse_alv_list_display.
    The list has several pages and then can be printed but the header lines appear only first page when they printed. The other pages don't have header lines, they continue with the next record of the list remaining from previous page. I use the alv parameters as below:
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_pf_status_set = 'ALV_PF_STATUS'
          is_layout                = ls_layo
          it_fieldcat              = lt_fcat
          i_default                = 'X'
          i_save                   = 'A'
          is_variant               = ls_variant
          it_events                = lt_events
        TABLES
          t_outtab                 = lt_data
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    and lt_events as below:
      ls_event-name = 'END_OF_LIST'.
      ls_event-form = 'ALV_END_OF_LIST'.
      APPEND ls_event TO lt_events.
      ls_event-name = 'END_OF_PAGE'.
      ls_event-form = 'ALV_END_OF_PAGE'.
      APPEND ls_event TO lt_events.
      ls_event-name = 'TOP_OF_LIST'.
      ls_event-form = 'ALV_TOP_OF_LIST'.
      APPEND ls_event TO lt_events.
      ls_event-name = 'TOP_OF_PAGE'.
      ls_event-form = 'ALV_TOP_OF_PAGE'.
      APPEND ls_event TO lt_events.
    So, how can I print header lines for every page?
    Best Regards,

    Hello Saba,
    Your point might be very close to solution.
    Because in the selection screen of the program there are two radio buttons, one of them visits 'REUSE_ALV_COMMENTARY_WRITE' function and the other doesn't. The one which visits has a problem with header liens in every page when printing. But I couldn't find out the solution yet.
    reuse_alv_list_display uses 4 event and of course I call subroutine. There are end_of_list, end_of_page, top_of_list and top_of_page. I use in the subroutine for top_of_page:
      CALL FUNCTION 'LVC_TRANSFER_TO_SLIS'
        EXPORTING
          it_fieldcat_lvc         = gt_fcat
        IMPORTING
          et_fieldcat_alv         = lt_fcat
        EXCEPTIONS
          it_data_missing         = 1
          it_fieldcat_lvc_missing = 2
          OTHERS                  = 3.
      CALL FUNCTION 'REUSE_ALV_LIST_WIDTH_GET'
        EXPORTING
          it_fieldcat = lt_fcat
        IMPORTING
          e_width     = l_width.
    WRITE l_reptx TO l_reptx CENTERED.
      NEW-LINE.
      WRITE: AT (l_width) l_reptx CENTERED.
      SUBTRACT 10 FROM l_width.
      WRITE: AT l_width sy-pagno RIGHT-JUSTIFIED.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            it_list_commentary       = lt_header
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    Do you have other suggestions ?

  • How to delete value in the header line of itab

    dear all,
    i have create an internal table.
    i would like to delete value of the header line after have used read table to read the contents.
    how can i do it ?

    If your internal table is something like this:
    data: begin of i_mara occurs 0.
    include structure mara.
    data: end of i_mara.
    That clears the matnr field of the header line...
    CLEAR i_mara-matnr.

  • How to customize the File Adapter to put the header line in a variable?

    I have a file in which the first line contains the number of records contained by the file itself.
    Like this:
    4
    record1
    record2
    record3
    record4
    where each record is a delimited list of values
    I need to validate that the records are actually 4.
    in the documentation of the File Adapter I see that you can declare the first line as "header", but I have the impression that in this case it would be simply ignored, and not stored in a variable for later use......
    Is this correct?
    Any trick or workaround?
    thank you soooo much!

    it worked like a charm,
    here is the XSD I have used:
    http://www.javamonamour.org/2010/12/soa-sutie-file-adapter-parsing-complex.html
    ( I don't seem to be able to display correctly XML in this post :o( )

  • After adding one column in a table can't get the header line

    hi all,
    i have make a SMART FORM which was working perfectly.Now the requirement of user is to add one column in my table at smart form which i did and after modification i execute it it give me data as well but issue which i'm facing is that the TABLE at smart forms in which i have add one field is not displaying the HEADER LINE which i have define with SELECT PATTREN option.
    Thanks & Regards,
    sappk25

    Hi,
    Have you created the Header Text? If yes, then might be the case that your smartforms
    table which was already created is with Multiple Line. Check weather you have added
    customer field in Header Line or Not?
    Regards,
    SUjeet

  • Add header line to the text file in receiver file adapter

    Hello Experts,
    I have to add a new line to the text file generated at the receiver end.
    My structure is
    Record
       Item......0-unbounded
             field1
             field2
             field3
    I have defined below parameters in receiver FCC.
    RecordSet Structure : Record,Item
    Item.fieldSeparator : ;
    Record.fieldSeparator : nl
    Record.endSeparator : '0x0D''0x0A' ( this is to get a carriage return at the end of the file)
    Item.addHeaderLine : 1
    With the above configuration, i am getting the desired output with NO header line.
    Please help.
    Thanks,
    Swetha.

    Hi, it looks like that the headerline "specification is only permitted if exactly one structure is defined." Please check [SAP help under Define Parameters for Recordset Structures|http://help.sap.com/saphelp_nw73/helpdata/en/44/686e687f2a6d12e10000000a1553f6/frameset.htm].
    One solution would be to generate the header fields in the message payload. Generate an additional first line containing the header names, e.g.
    <Item>
    <field1>Header1
    <field2>Header2
    <field3>Header3

  • How to count the total lines of the file (including the file header)

    Hi all,
    I am working with Idoc to file scenario(FCC).
    I need to map one of the field with a recound count ie.., count of the total lines of the file (including the file header).
    Eg:Record Count-- mapping area:Total number of records in the file including file header     The total line of the file (including the file header).
    Can i get a help on this.
    Thanks and Regards,
    Manoj

    Hi !
    If there is a tag of your IDOC that occurs the same quantity of times as file lines you have to create in your target file, you could make a Java user defined function in graphical mapping that "caches the entire queue" (use the corresponding option button), that receives as input that field of the IDOC, and returns the "lenght" (.length property value) of that input parameter (it is an array) as output..that should be the file line quantity..you may also add 1 to that count, for the header.
    Hope it helps.
    Regards,
    Matias.

  • Need to add a TAB in the header line of PO

    Hi,
    Can someone suggest me where to add a screen tab in the header line of PO.
    Please help me with the exit name.
    Thanx.
    Kamlesh

    Hi,
    You can use the enhancement MM06E005 for this..
    GO to CMOD..create a project and give the enhancement..
    Activate the project..
    GO to SE51..give the program SAPLXM06 and screen 0101 for header level data.
    Press create..
    GIve the screen type as SUBSCREEN..
    In the layout give the field.
    Activate the screen..Now you can see the field in ME21N
    Thanks
    Naren

  • I put a Favicon on my website, which can be seen in the adress line and the tab header. However, when I add this site to the bookmarks, it doesn't show it's favicon.

    I put a Favicon on my website, which can be seen in the adress line and the tab header. However, when I add this site to the bookmarks, it doesn't show it's favicon. I have tried deleting and creating a bookmark and also refreshing the webpage or clicking on the bookmark. I don't know what else to do. I use Firefox 4.0.1

    I'm getting favicons for most of my bookmarks, so there might be some issue with the coding or the image format.
    Do you use a tag like this in your page?
    <link rel="shortcut icon" href="/path/to/favicon.ico"/>

  • Interpret the header line in /etc/release file

    Can you pelase interpret the header lines in /etc/release file on solaris 9 OS.

    sreedeepa wrote:
    Can you pelase interpret the header lines in /etc/release file on solaris 9 OS.
    x31$ cat /etc/release
    Solaris 9 9/05 s9s_u8wos_05 SPARC
    Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 04 August 2005
    x31$ Base OS level (Solaris 9), Release Date (9/05), shorthand for easy parsing (s9s == Solaris 9 sparc, u8 == update 9, wos_05 (don't know what the represents)), Processor Architecture
    I'll assume you don't need the other lines parsed :-)
    Best,
    Edited by: John.Kotches on Feb 22, 2008 9:18 AM
    Edited by: John.Kotches on Feb 22, 2008 9:18 AM
    Trying to get Code tag to work.

  • I will starting afresh website in my iWeb, it shows only the head or the command line and the command new website is inactive - what do I need to start over

    Help........
    I will starting afresh website in my iWeb, when I start the program it only shows the head or the command line and the command new website is inactive - what do I need to start over - what have I done wrong

    Don't quite understand what you mean, but it says at the bottom that you are still using iWeb 08 so depending on what OSX you are running, you might consider upgrading to iWeb 09.  This works with Lion, Mountain Lion and Mavericks.
    Apple no longer sells iWeb so if you decide to upgrade, then you'll need to purchase iWeb by going to Amazon and buying the iLife 09 or 11 boxed sets, both of which contain iWeb 09.
    Install this on your Mac and it might solve your problems, or just ditch iWeb and start again with one of the newer programmes out there that are still being supported and updated, such as RapidWeaver, Sandvox, Freeway Pro/Express, Flux 4, WebAcapella 4 and EverWeb (http://www.everwebapp.com).

  • JSP for Vcard cannot strip carriage return in the last line of the file.

    I am using JSP to output a Vcard (http://en.wikipedia.org/wiki/VCard)
    The following code works great in Windows but fails on the mac:
    <%@ page contentType="text/x-vcard" %><%--
    --%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--
    --%><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %><%--
    --%>BEGIN:VCARD
    VERSION:2.1
    <c:choose><%--
    --%><c:when test="${not ((empty param.lan) and (empty param.fin)) }"><%--
    --%>N:${param.lan};${param.fin}
    FN:${param.fin} ${param.lan}
    </c:when><%--
    --%><c:otherwise><%--
    --%>FN:${param.org}
    </c:otherwise><%--
    --%></c:choose><%--
    --%>ORG:${param.org}
    TITLE:${param.title}
    TEL;WORK;VOICE:${param.phwork}
    ADR;WORK:;;${param.st};${param.city};${param.state};${param.zip};
    EMAIL;PREF;INTERNET:${param.email}
    REV:20080424T195243Z
    <c:out value="${fn:replace('END:VCARD','\\\r','')}" escapeXml="false"/>After some tests, I discovered that Mac (I used Tiger, latest update, not Leopard) needs extra white space and carriage returns stripped off. Once this is achieved, the vcard will automatically import into Address Book. I have followed other forums which advice on using JSP comments as in the code above. But for some strange reason the last line of the JSP outputs an extra carraige return. How do I get rid of the carriage return at the end of the file? the replace function from JSTL is not working.
    Edited by: shogo2040 on Dec 18, 2008 7:11 PM : I added more detail to the Subject

    I originally had that END:VCARD without any carriage return.
    But I still get an extra carriage return at the end when the JSP renders to VCF
    I'm using Tomcat running on Linux.
    I found this, article which implies (but does not explicitly say) JSP in general adds a newline to the last line:
    http://www.caucho.com/resin-3.0/jsp/faq.xtp (But its not tomcat either, so maybe this info is irrelevant).
    Edited by: shogo2040 on Dec 22, 2008 3:31 PM - changed rendered to VCF from rendered to JSP

  • How to make the diagonal line in the swing table cell?

    Hi all,
    How to make the diagonal line in the swing table cell just like the link below?
    http://61.132.17.188/webber/table.gif

    One improvement.. To get a line that is neat, use a bit of Graphics2D
        public void paintComponent(java.awt.Graphics g)
            int w = getSize().width;
            int h = getSize().height;
            // draw a line between (0,0) and (w,h)  
            g.setColor(getForeground());
            if (strTop == null)
                strTop = "  ";
            if (strBottom == null)
                strBottom = "  ";
                java.awt.Graphics2D g2 = (java.awt.Graphics2D)g;
              g2.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING,java.awt.RenderingHints.VALUE_ANTIALIAS_ON);
              //g2.setStroke(new java.awt.BasicStroke(14.0f));
            g.drawLine(0, 0, w, h);
            //the following lines will draw the two strings,
            //one above the top of the line and the above below it.     
            g2.drawString(strTop, (w/2)+2, (h/2)-2);
            g2.drawString(strBottom, 2, (h / 2) + 2);
            //the x,y for drawString are only based on assumption.   //do necessary changes to suit ur needs.
        }Then create a TableCellRenderer and set it to the Table Header for ur table's 1st row.....
    Cheers

  • I need to put a line like the blue line in the file below. somebody tell me how to do that please.

    it is the blue line from the header to the footer which separates the two dividers on the sides

    You asked this same question before and I replied to your previous post.  No need to double post.
    Use a repeating background image.
    http://forums.adobe.com/message/2480426#2480426
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • When capturing video; how do I get rid of the green lines at the bottom of the frame?

    When capturing video; How do I get rid of the green lines at the bottom of the frame?

    s.haider
    You have Canon ZR950 mini DV Camcorder, why not make a firewire connection and do DV data capture into the Premiere Elements 8.0/8.0.1 Capture Window?
    Do you have any reference for what you are attempting to do or is this a creation of your own? Could you confirm what you describe as "just capturing video".
    a. From your information, you are doing Get Media/Webcam or WDM Device with the Capture Window showing the Capturing Device as "Dazzle DVD 100 Video Device". What type of connection are you making between the Canon ZR950 and the Dazzle DVD 100 and the computer?
    b. What exactly do you expect to be putting on the Premiere Elements 8.0/8.0.1 Timeline from this capture...DV AVI or something else?
    Coming from the perspective of Premiere Elements 8.0/8.0.1 known issues, I would ask you to consider:
    a. Remove the check mark next to AutoAnalyzer in the Capture window. Even if you were doing this Capture the "usual way", that is highly recommended.
    b. Go to Edit Menu/Preferences/General, and compare your results with and without a check mark next to enable GPU playback. As a cross reference, please go to Edit Header/Effects/Video Effects and detemine if there is a category of Effects named GPU Effects. Do the same thing for Edit Header/Transitions/Video Transitions and determine if there is a category of Transitions named GPU Transitions.
    And, the general drill for all users of Premiere Elements 8.0
    a. Are you working with the automatic Background Rendering and AutoAnalzyer Features turned Off?
    See Premiere Elements workspace Edit Menu/Preferences/General for background rendering option and Elements Organizer workspace Edit Menu/Preferences/AutoAnalzyer Options for AutoAnalzyer options.
    b. Are you working from the 8.0.1 Update version of the program?
    Please consider.
    We will be watching for the outcome.
    Thank you.
    ATR

Maybe you are looking for