Inserting new line in output based on character count +sapscript

Dear All,
I want to print amount in words on cheque. Condition is if on the first line the character
count reaches 40 the rest words should be printed in next line. Also amount in word
should be printed  on the same line. 
I have the internal table values itab-amtwords(amount in words and ) itab-rbetr(amount in number)
I want to print them something like this -
   Sixty seven crore eighty five lakh twelve thousand     
   fourty five                                                                678512045.00
the amount in word should come in second line only. The amount in word if reaches certain point
the rest word should print in second line.
How to write the logic in script editor
Regards,
Sandeep
Moderator message - Cross post locked
Edited by: Rob Burbank on Apr 17, 2009 10:46 AM

the amount in number should print in the second .
2163126312.00
Regards,
Sandeep

Similar Messages

  • Inserting new line in script output based on character count

    Dear All,
    I want to print amount in words on cheque. Condition is if on the first line the character
    count reaches 40 the rest words should be printed in next line. Also amount in word
    should be printed  on the same line. 
    I have the internal table values itab-amtwords(amount in words and ) itab-rbetr(amount in number)
    I want to print them something like this -
       Sixty seven crore eighty five lakh twelve thousand     
       fourty five                                                                678512045.00
    the amount in word should come in second line only. The amount in word if reaches certain point
    the rest word should print in second line.
    How to write the logic in script editor
    Regards,
    Sandeep

    the amount in number should print in the second line.
    2163126312.00
    regards
    sandeep
    Edited by: Sandeep Sahoo on Apr 17, 2009 4:34 PM
    Edited by: Sandeep Sahoo on Apr 17, 2009 4:38 PM

  • How to insert new line character?

    Hi all,
    I have two lines to print.
    out.println("Available number of columns="+cols);
    out.println("Number of columns must be present=10");My problem is:
    i want both the lines to be printed one below the other. But, it is displayed in one single line.....
    Can anyone please tell me how to insert new line character?
    I tried with \n, '\n' and \r\n but, in vain......
    Thanks for your time.
    Regards,
    Ashvini

    You should never use "\n" directly.
    The line separator character is different on different operating systems.
    And putting quotes around it in your string will make absolutely no difference in the JSP.
    To find out what the line separator is you should use System.getProperty("line.separator");
    The JSPWriter and PrintWriter classes will automatically use this property with a println statement, so a println will always finish with a line separator.
    The issue here was that HTML by default ignores all whitespace.
    The solutions provided
    - use a <br> tag instead of a carriage return
    - use <pre> tags, which tells the browser not to ignore whitespace. That can be troublesome in JSP which generates a lot of extraneous carriage returns into the code.
    Cheers,
    evnafets

  • How to insert new line in the copied schema with transaction code PE01?

    Dear Experts,
             I have copied HKT0 to ZKT0 , i want to insert new line between  line 150 and line 160 in ZKT0, I don't know how to insert new line 160, who can tell me ?
             Looking forward to your reply.
    Best Regards,
    Merry

    Hi,
    1. Open your schema,
    2. In first colume "Line" select line where you want to add new line,
    3. Replace first value in the column field (that indicates number of line) with character I (means insert),
    4. Press enter
    The line will be added. The same way you can add lines to PCR.
    To delete use character D.
    Cheers

  • How to insert new line break in XSLT mapping

    Hi experts,
    I am doing file to mail scenario, i am sending the text file as an attachment using reciever mail adapter.
    I did everything, i can able to send the mail with text file attachment, but with in the file i got multiple rows, i need to put line break in XSLT mapping.
    I did use following statement but it is inserting small rectangle between the records, the records are not separating with new lines, all are in one line.
    <xsl:text>*#xA;</xsl:text>   
    note: in real coding replace * with &
    Can anyone suggest me how to insert new line in XSLT mapping.
    My XSLT mapping as look like:
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ns0="http://www.Coj.co.za/SapIsuToABSA/DirectDebitFile">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:variable name="break">&lt;br/&gt;</xsl:variable>
    <xsl:variable name="space"> </xsl:variable>
    <xsl:variable name="newline"><xsl:text></xsl:text></xsl:variable>
    <xsl:template match="/">
    <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
    <Subject>Please Check Attached Direct Debit File</Subject>
    <From>S@za</From>
    <To>P@za</To>
    <Content_Type>text/plain</Content_Type>
    <Content>
    <xsl:for-each select="MT_SapIsuToABSA_DirectDebitFile/DirectDebitRec/Body">
    <xsl:value-of select="Space1"/>
    <xsl:value-of select="Cust_AccNo"/>
    <xsl:value-of select="Reserve_1"/>
    <xsl:value-of select="Cust_Name"/>
    <xsl:value-of select="Cust_Name1"/>
    <xsl:value-of select="Cust_Bank_AccNo"/>
    <xsl:value-of select="Space2"/>
    <xsl:value-of select="Cust_Bank_BranchNo"/>
    <xsl:value-of select="Reserve_2"/>
    <xsl:value-of select="Space3"/>
    <xsl:value-of select="Cust_AccNo_1"/>
    <xsl:value-of select="Space4"/>
    <xsl:value-of select="Reserve_3"/>
    <xsl:value-of select="Deduction_Amnt"/>
    <xsl:value-of select="Space5"/>
    <xsl:value-of select="Reserve_4"/>
    <xsl:value-of select="Space6"/>
    <xsl:value-of select="Action_Date"/>
    <xsl:value-of select="Space7"/>
    <xsl:value-of select="Reserve_5"/>
    <xsl:text>*#xA;</xsl:text>   
    note: in real coding replace * with &
    </xsl:for-each>
    </Content>
      </ns1:Mail>
      </xsl:template>
      </xsl:stylesheet>
    Kind regards,
    Praveen

    Hi,
    I think <xsl:text>#xa;</xsl:text> should do the trick, but depending on which OS (ux or win), the "new line" chars sequence is different (win would require a CRLF like <xsl:text>#xd;*#xa;</xsl:text>)
    Chris
    -> &
    Edited by: Christophe PFERTZEL on Apr 14, 2010 2:16 PM

  • Inserting New Line item in PO

    Hi,
    I need to insert new line item into PO if the material entered is BOM material.  My requirement is like this, If the user creates the PO with BOM material then i need to insert all the inside components as line item in that PO. Please suggest me any user exits avaiable or any way to achieve this( It's not a subcontracting PO).
    Thanks,
    Ganga.

    hi
    PCSD0001  Applications development R/3 BOMS
    PCSD0002  BOMs: Customer fields in item
    PCSD0003  BOMs: Customer fields in header
    PCSD0004  BOM comparison
    PCSD0005  BOMs: component check for material items
    PCSD0006  Mass changes user exit
    PCSD0007  Check changes in STKO
    PCSD0008  WBS BOM: Customer-specific explosion for creating
    PCSD0009  Order/WBS BOM, determine URL page
    PCSD0010  Order/WBS BOM, determine explosion date
    PCSD0011  Knowledge-based order BOM, parallel update
    PCSD0012  Customer - Mat. number/mat. number during material exch
    PCSD0013  Customer-specific processing of an explosion for BOM br
    **Please reward suitable points***
    With Regards
    Navin Khedikar

  • Insert new line item in va01&va02 - urgent

    Hi frndz,
    At the time of creation standard sales order using va01.
    When user enters the sold to party in header and then
    material & quantity in line item reocrds. After user enters the details in first line. I have some checks to be executed and on the basis of that customer will get the free material that should come on second line item.
    I am getting the details which i will be inserting on new line item but the problem is that in which exit i should write the code for the same.
    So frndz could you please let me know, in which userexit I should insert this new line item. There can be more than one free material.
    If anyone has done this already, please let me know.
    I know one exit i.e.MV45AFZB but in that there are many forms. so exactly which form i should where i will write the code to insert new line item???
    Points will be awarded surely.
    Regards,
    Prashant

    HI Stephen,
    I have the same prolem. I modified the 5 global tables, but I don't see the new line in the screen.
    Can you help me with some details?
    Thx!
    Mihaela

  • Inserting new line to a text file at position #

    Hi,.
    Is it possible to do this in java?
    1. Open a new text File (woutFile)
    2. woutFile.write(" line #1\r\n"); // write new line
    3. woutFile.write(" line #2\r\n"); // write new line
    4.woutFile.write(" line #3\r\n"); // write new line
    5. Go to line #2 position on a text file
    6. Insert NEW LINE between line #2 and Line #3
    7. move to the end-of-file
    8.Close the file
    Please help

    Is it possible to do this? please look at question
    inside comments.Your question has already been answered. Beyond that,
    if you have some code and you want to know if it will
    work, then run it and see.The answer was no. It's one of the fundamental properties of files that you cannot insert content in the middle, just at the end. To insert content you first have to make room for it. In this respect a file works like an array and not like a linked list.

  • Inserting new line item into existing delivery using BAPI

    Hi
    can you send me the code for inserting new line item into existing delivery either using BAPI or
    Function module.
    We are using SAP 4.7 version

    Hi Sreekanth,
    Refer to this links
    New item for outbound delivery via FM/BAPI?
    /message/3976349#3976349 [original link is broken]
    BAPI_OUTB_DELIVERY_CHANGE Help - Add new line item
    hope it is useful to you.
    Regards!

  • BOM Change - Delete an item(s) and insert new line items

    Hi,
    We need to mass update BOMs like for some of the existing BOM's we need to delete some line items and insert new line items. We want to use the BOMMAT04 IDOC in LSMW but I'd like to know couple of things before I go ahead with that approach
    For instance, I've a finished good material 12345678 and it has three components
                          a) Item 0010 Material 30101010 of quantity 10
                          b) Item 0020 Material 30101011 of quantity 11
                          C) Item 0030 Material 30101012 of quantity 12
    Now, I'd like delete Item 0010 and add a new item 0040 Material 30101013 of quantity 13. 
    In the segment E1STKOM, there is LOEKZ (Deletion Flag) but I dont want to flag for deletion but instead delete the whole line item and add a new line item.
    Is there any way to achieve this using BOMMAT04 IDOC? If not, can you please suggest me a better way to do it
    Any help is greatly appreciated
    Thanks,
    Srinivas

    Dear Srinivas,
    1.IF you want to change for an individual BOM,use CS02,select the item which you want to delete,select the entire and click on
    delete button and then add new line items and save.
    2.For Mass changes of BOM you can use CS20.
    3.Check these functional module's also if you want to change using a report,
    CS_BI_BOM_CHANGE_BATCH_INPUT   Change bill of material via batch input    
    CSEP_MAT_BOM_SELECT_CHANGE     API Bills of Material: Select BOM(s)    
    CS_CL_P_BOM_MASS_CHANGE     
    CS_CL_S_BOM_CHANGE_COMPLETE 
    Check and revert back,.
    Regards
    Mangalraj.S

  • Insert new line items in Delivery

    Hello All,
    Is there any BAPI or FM in which i can add new line item in SD delivery vl01n? The new line item will not be there in SO , but i want it in delivery. Manually i can insert new line item using VL01n , but i need FM to do the same.
    Thanks

    Hello,
    I need a Bapi or FM through which i can add new line item in delivery , maybe while creation of delivery or changing the delivery i.e. via VL01n or Vl02n. The new item will not be there in SO. It is a non valuated material.
    Helpful answers will be rewarded.
    Thank you

  • Insert new line using rule in InfoPath 2010

    Hi All,
    How to insert new line on the multiline textbox using rules. I followed the below article. But it didnt help to resolve the issue.
    http://blogs.msdn.com/b/infopath/archive/2005/03/04/385577.aspx
    Any help would be appreciated.
    Rajasekar A.C

    Hi,
    I followed the above link and it worked for me. Can you please make sure if the formulae is verified by clicking on "Verify" after entering following lines?
    concat(field1, @crlf,
    "Hello, world!")
    You can even try this link
    http://www.sharepointmaestra.com/Blog/Post/4/InfoPath---Appending-Text-in-Multiline-Field-with-Line-Feed
    Thanks,
    Avni Bhatt 
    If this helped you resolve your issue, please mark it Answered

  • XSLT - inserting new line character

    Hi, hoping somebody could help me please.
    I'm attempting in 10g to convert a XML purchase-order with multiple detail lines to a CSV delimited output using an XSLT to undertake the transformation. Each line of the purchase-order, namely the header and each detail line must go on separate lines within the CSV file. This means each line must be clearly terminated with a CR-LF.
    While I can happily convert the XML purchase-order to CSV format, my experiments in inserting a CR-LF have failed, resulting in all lines collapsed onto one large line.
    According to various sources on the Net, inserting the following entry in my XSLT file should generate the new line that I'm looking for:
    <xsl:text>ampersand#xa;</xsl:text>(In the above code replace the text "ampersand" with an actual & - I'm unable to display the proper ampersand hash value xa as this HTML page renders it as newline character)
    However with no success.
    The sample program below shows the conversion process. Anybody any idea on why I'm not seeing the output with new lines?
    Your help appreciated.
    CM.
    DECLARE
    v_xml XMLType;
    v_xml2 XMLTYPe;
    v_xslt XMLType;
    BEGIN
    v_xml := XMLType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.xxxx.com.au/schemas/gatewayPurchaseOrder.xsd gatewayPurchaseOrder.xsd"
    xmlns="http://www.xxxx.com.au/schemas/gatewayPurchaseOrder.xsd">
    <Header>
    <GatewayPurchaseOrderNo>1234</GatewayPurchaseOrderNo>
    <PharmacyReference>2345</PharmacyReference>
    </Header>
    <Detail>
    <ProductNo>9876</ProductNo>
    <APNNo>7654</APNNo>
    </Detail>
    <Detail>
    <ProductNo>8888</ProductNo>
    <APNNo>7777</APNNo>
    </Detail>
    </PurchaseOrder>');
    v_xslt := XMLType(
    '<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.xxxx.com.au/schemas/gatewayPurchaseOrder.xsd">
    <xsl:output method="text"/>
    <xsl:template match="/PurchaseOrder/Header">
    <xsl:value-of select="normalize-space(GatewayPurchaseOrderNo)"/>,<xsl:value-of select="normalize-space(PharmacyReference)"/>
    <xsl:text>ampersand #xa;</xsl:text>
    </xsl:template>
    <xsl:template match="/PurchaseOrder/Detail">
    <xsl:value-of select="normalize-space(ProductNo)"/>,<xsl:value-of select="normalize-space(APNNo)"/>
    <xsl:text>ampersand#xa;</xsl:text>
    </xsl:template>
    </xsl:stylesheet>');
    v_xml2 := v_xml.transform(v_xslt);
    dbms_output.put_line(v_xml2.getclobval);
    END;(In the above code replace the text "ampersand" with an actual & - I'm unable to display the proper ampersand hash value xa as this HTML page renders it as newline character)

    I don't know much about XSLT yet, but tickeled by the problem, after wandering over the internet and found stuff like this - http://forums.devshed.com/xml-programming-19/cannot-output-crlf-xslt-348042.html - I constructed the following...
    SQL> set serveroutput on size 50000
    SQL> DECLARE
       v_xml XMLType;
       v_xml2 XMLTYPe;
       v_xslt XMLType;
    BEGIN
       v_xml := XMLType(
          '<?xml version="1.0" encoding="UTF-8"?>
          <PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.xxxx.com.au/schemas/gatewayPurchaseOrder.xsd gatewayPurchaseOrder.xsd"
             xmlns="http://www.xxxx.com.au/schemas/gatewayPurchaseOrder.xsd">
             <Header>
                <GatewayPurchaseOrderNo>1234</GatewayPurchaseOrderNo>
                <PharmacyReference>2345</PharmacyReference>
             </Header>
             <Detail>
                <ProductNo>9876</ProductNo>
                <APNNo>7654</APNNo>
             </Detail>
             <Detail>
                <ProductNo>8888</ProductNo>
                <APNNo>7777</APNNo>
             </Detail>
          </PurchaseOrder>');
          v_xslt := XMLType(
             '<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns="http://www.xxxx.com.au/schemas/gatewayPurchaseOrder.xsd">
             <xsl:output method="text"/>
             <xsl:template match="/PurchaseOrder/Header">
                <xsl:value-of select="normalize-space(GatewayPurchaseOrderNo)"/>,<xsl:value-of select="normalize-space(PharmacyReference)"/>
                <xsl:text>AMPERSAND#xa0;AMPERSAND#xa;</xsl:text>
             </xsl:template>
             <xsl:template match="/PurchaseOrder/Detail">
                <xsl:value-of select="normalize-space(ProductNo)"/>,<xsl:value-of select="normalize-space(APNNo)"/>
                <xsl:text>AMPERSAND#xa0;AMPERSAND#xa;</xsl:text>
             </xsl:template>
             </xsl:stylesheet>');
       v_xml2 := v_xml.transform(v_xslt);
       dbms_output.put_line(v_xml2.getclobval);
    END;
    SQL>
    1234,2345
    9876,7654
    8888,7777
    PL/SQL procedure successfully completed.So first one space and then the CR-LF.
    Hope this helps?
    Message was edited by:
    mgralike

  • ADF: how to insert new line character in column of VO?

    Hi Everyone,
    Im using Jdev 11G.
    i have a VO with 5 columns displayed on the ADF page.(VO has total 8 columns)
    1 column is the combination of 3 columns. i concatenated the 3 columns and added new line character after each column chr(13).
    VO query is working very fine in Toad. the columnn displays each concatenated column value after a new line character but the same query is not working in ADF.
    The column which is concatenating 3 columns and has to display with new line character is not displaying new line character its just concatenating the 3 values and displaying it on the page.
    wat can be the solution for this in ADF?
    Thank you.

    Setting escape="false" will allow putting html <BR> in the column and it will display ok however if your table allows export to excel the <BR> gets exported and displays as text in your exported file. Also & will export as &amp; To prevent that, use your original text without the escape=false setting and insert LF or CR (10 or 13 character), then add inline style of white-space: pre-line; to column or to style class in your skin. That will cause all line feeds to wrap but will export to excel without mixing html in the export.
    http://www.w3schools.com/cssref/pr_text_white-space.asp
    Edited by: Don Kleppinger on Jan 14, 2013 4:06 PM

  • How to insert new line char while writing bytes into file

    Hello Sir,
    Is it possible to insert the new line character in set of String variables and stored them into bytearray ,then finally write into File?
    This is the sample code which i tried:
                 File f = new File(messagesDir,"msg" + msgnum + ".txt");
                 FileOutputStream fout = new FileOutputStream(f);
                    String fromString = "From:    "+msg.getFrom()+"\n";
                    String toString = "To:     "+msg.getTo()+"\n";
                    String dateString = "Sent:    "+msg.getDate()+"\n";
                      String msgString =msg.getBody()+"\n";
                    String finalString=fromString+toString+dateString+msgString;
                    byte[] msgBytes = finalString.getBytes();
                    fout.write(msgBytes);
                 fout.close();in the above code , i tried to add the new line as "\n" in end of each string. but when i look into the generated files msg1.txt , it contains some junk char [] .
    please provide me the help
    regards
    venki

    but it has still shown the the junk char, its not able
    to create the new line in the created file i am afraid
    how am i going to get the solution?:(Do not be afraid dear sir. You are obviously using a windows operating system or a mac operating system. On windows a newline is "\r\n" not '\n', and on a mac a newline is '\r', not '\n'. If you make that correction, dear sir, your program will work.
    However, there is a better way. First, you probably want to buffer your output if you are going to write more than one time to the file, which will make writing to the file more efficient. In addition, when you buffer your output, you can use the newLine() method of the BufferedWriter object to insert a newline. The newline will be appropriate for the operating system that the program is running on. Here is an example:
    File f = new File("C:/TestData/atest.txt");
    BufferedWriter out = new BufferedWriter(new FileWriter(f) );
    String fromString = "From: Jane";
    out.write(fromString);
    //Not written to the file until enough data accumulates.
    //The data is stored in a buffer until then.
    out.newLine();
    String toString = "To: Dick";
    out.write(toString);
    out.newLine();
    String dateString = "Sent: October 27, 2006";
    out.write(dateString);
    out.newLine();
    out.close(); 
    //Causes any unwritten data to be flushed from
    //the buffer and written to the file.

Maybe you are looking for