Remove leading space(blank) REGUH-RWBTR in script

hi,
i am now dealing with cheque priting in word issue.
the output format should be :
<b>USD 111,000 AND CENT 45 ONLY.</b>
the amount field i use is REGUH-RWBTR in script. but the output come with leading of space.
<b>which is as : USD         111,000    AND CENT 45 ONLY,</b>
which this is not i want. how am i going to remove the blank space leading and ending for REGUH-RWBTR?
below is my current code:
&'***RM'REGUH-RWBTR(.0)&&' AND SEN 'SPELL-DECIMAL(2)& ONLY ***
please any one can help me. either using this field, or any other way to do display it?

can i see the exact o/p as how u r seeing it for comparision.
i hope u r using &rxxxx-rwbtr(C.0)&
did u check the second option also . ? confirm
Since the data type is currency format and here we are supressing the decimals so in order to supress the blank space at the end you can go for a variable declaration with type char
say gv_val(13) type c
and then move the rxxx-btr to this gv_val as
gv_val = rxxx-rwbtr.
now replace in the code display the amount filed as &&gv_val(C.0)&&
Im not logged onto sap now.
you have to confirm the result.
regards,
vijay.

Similar Messages

  • Removing Leading Spaces in the field to be displayed

    Hi,
    Could you please tell me how to remove leading spaces in currency field in write statement?
    the length of the field cannot be changed by writing fieldname(length).
    is there any other method to do the same. the length should vary according to the amount in the field.
    Ragards,
    Krutika

    hi,
    please use "SPLIT "  or condense  .
    eg:  SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
    to better understand refer this code:
    IF it_mhnd IS NOT INITIAL.
      SELECT hzuon bukrs gjahr augdt augbl
      FROM Bseg
      INTO TABLE it_bseg
      FOR ALL ENTRIES IN it_mhnd
      WHERE belnr = it_mhnd-belnr
        AND bukrs = it_mhnd-bukrs
        AND gjahr = it_mhnd-gjahr
        AND umskz = 'E'.
    endif.
    data: l_space type char6.
    loop at it_bseg into wa_bseg.
      SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
      wa_bseg1-bukrs = wa_bseg-bukrs.
      wa_bseg1-hzuon = wa_bseg-belnr.
      wa_bseg1-hzuon = wa_bseg-gjahr.
      wa_bseg1-hzuon = wa_bseg-umskz.
      append wa_bseg1 to it_bseg1.
      clear: l_space, wa_bseg1.
    endloop.
    IF it_bseg1 IS NOT INITIAL.
          SELECT belnr bldat
            FROM bsad into table it_bsad
            FOR ALL ENTRIES IN it_bseg1
            WHERE belnr = it_bseg1-hzuon
            AND   bukrs = it_bseg1-bukrs
            AND   augbl = it_bseg1-belnr.
    endif.
    regards
    rahul
    Edited by: RAHUL SHARMA on Jan 5, 2009 12:19 PM
    Edited by: RAHUL SHARMA on Jan 5, 2009 12:20 PM

  • SAPSCRIPT - Symbol for removing leading spaces/zero's?

    Hi,
    How do you remove leading spaces/zeros in a variable that is sent from the print program?
    Do you use symbols and if so, how (i've never worked with symbols, ever)?
    Please help.
    Thanks,
    John

    I think the "Z" symbol will remove the zeros in the sapscript form.  For example,......
    /     &EKKO-EBELN(Z)&
    Regards,
    Rich Heilman

  • Removing leading spaces

    How can I remove leading spaces on a field before it is saved to the database. I know that I need to use the LTrim function. However, I am unsure as to where.
    thanks.

    though there are plenty of ways you could do this depending on your page's setup, a simple implementation of this in a wizard-generated form on a table would be to put a Computation on your page for that item that fires with a "Computation Point" of after submit. so if you had a form on the Emp table, and you wanted to ltrim your P1_JOB item, you could do it using an after submit computation with a "Type" of "SQL Expression" where the body of your computation would simply be...
    ltrim(:P1_JOB)
    ...hope this helps,
    raj

  • Removing leading spaces in a decimal number

    I have a decimal number field of length 28 with 9 spaces.I have to print it right justified and remove the leading spaces.I appreciate if anyone can let me the statement for this

    Hi,
      Try this..
    DATA: V_P TYPE P DECIMALS 2.
    V_P = '112.00'.
    WRITE: / V_P.
    DATA: STR TYPE STRING.
    STR = V_P.
    SHIFT STR LEFT DELETING LEADING SPACE.
    WRITE: / STR.
    Thanks,
    Naren

  • Removing leading spaces in smartforms

    When I print numbers in smartforms, they usually have a bunch of leading spaces, which messes up the formatting. E.g. a CURR 15 field containing 5000 will print as "          5.000,00".
    I saw the formatting options in the BC470 manual but there are only options to remove leading zeros, or to replace leading spaces with a Filler. What I need is to remove the leading spaces. Anyone know how?
    For the moment I'm copying all the numbers I want to print to string fields and using CONDENSE on those, but then I don't get the right number formatting, e.g. I get "5000.00" while I need "5.000,00".

    Hi
    The format of amount field depends on the currency key, the smartforms should write the amount in right format if it can understand which currency is to be used.
    The link between these field is done in the dictionary.
    If the samrtform can't understand it you can move the amount in the char field using WRITE statament and print this field instead of original one:
    WRITE <AMOUNT> CURRENCY <CURRENCY> TO CHAR_AMOUNT.
    Max

  • How can I remove leading spaces?

    I have a 40 page PDF and I used the Form Wizard to generate fields for me. I noticed that some of the fields have leading spaces in the name. These fields cannot be used via the doc.getField(name) syntax. It simply returns null.
    If I manually rename the field and remove the leading space it works, but this would take a long time. Is there any way to programmatically refer to a field with a leading space in the name? Perhaps some sort of escape character for the space? Or can I refer to a field by index instead of name? (For example, I can use doc.getNthFieldName(index) but this just returns the name (with leading space). If I could have something like doc.getNthField(index) that would work too)
    Thanks in advance.

    A very good question! A leading space in generated form field names is a bug if it afterwards keeps you from getting the field by name (which is the only method?).
    I have made an Action in Javascript to loop through all those generated form fields and delete all junk except the two signature fields that were intentional.
    Afterwards, I have to manually delete all the fields that have a leading space in their generated name.
    Please fix.

  • Removing leading spaces for type P variable

    Hi,
    I am declaring the 2 variables as type P. The below code was working fine, But our client, wants to remove the leading spaces for these variables,
    v_lower(16)           TYPE p DECIMALS 2,
    v_upper(16)           TYPE p DECIMALS 2.
    v_lower = i_plmk-toleranzun.
    v_upper = i_plmk-toleranzob.
    i_output-toleranzun  = v_lower.
    i_output-toleranzob  = v_upper.
    Can any one suggest how can we achieve this. Is there any function module for achieving this.
    Thanks In Advance,
    Regards,
    Ramana Trapatla.

    Hi,
    If your question was in the context of displaying data of type p without the leading space, then you can use left-justified addtion to your write statement.
    data: val(10) type p decimals 2.
    val = '0000000123.43'.
    write: val LEFT-JUSTIFIED.
    Regards,
    Vikranth

  • FM to remove Leading spaces

    Hi,
      Can any tell me how to remove the leading spaces from the variable with sample code or any function module.
    I have field which is of 40 characters. slpit that into two different variables first 4 and rest 36 characters.
    But there is possibility that 5 character (which will be the first character out of 36) is a space.
    I want to remove that space from that as i have to compare this after removing the space with another variable.
    Pls tell me how to do this? is there any Function module or any other way.

    Hi Hema,
    1. we can use
       CONDENSE
       REPLACE
    2. Just see the documentation on this. F1
    3. Both functionality is different
       as the name suggests.
    4. U can use as per ur requirement.
    regards,
    amit m.

  • Removing \n and leading spaces with String.replaceAll()

    I am trying to format a large XML string that contains carriage returns and lines with leading spaces. Something like this (pseudo example)...
    s: "<a>
    ��<b>some text</b>
    ��<c>
    ����<d>more text</d>
    ��</c>
    </a>"When i am done, i want it to look like this...
    s: "<a><b>some text</b><c><d>more text</d></c></a>"I have tried using replaceAll() in this way....
      s = s.replaceAll("^\\s+","");// to remove leading spaces
      s = s.replaceAll("\\n","");// to remove carriage returnsHowever, I am not getting the results I expect. In fact, the entire string seems to simply turn into all whitespace....
    s: "                                           "My question is: Is there an easier way? (or at least a way that works?)

    try this:
    public String transformXML(String s) {
        s = s.replace("^\\s+", "");
        s = s.replace("\\s+$", "");
        s = s.replace("\\s+", " ");
        s = s.replace("\\s*<\\s*([^<>]*?)\\s*>\\s*", "<$1>");
        return s;
    }which would transform your example expression from:
    <a>
    <b>some text</b>
    <c>
    <d>more text</d>
    </c>
    </a>
    to probably what you want:
    <a><b>some text</b><c><d>more text</d></c></a>
    Hope this helps~
    Alex Lam S.L.

  • How do I remove a space before the first word in a sentence using find and replace or GREP?

    Right, so I am laying out a document in inDesign from a word document and it has a space before every first word in a sentence. It is really annoying and I need a quick way to get rid of them. I wasn't too sure how to do it with find/change but I am sure there is a way in GREP if someone can help me. I have included an image so that people can see exactly what I mean.

    The ^ location works for all paragraphs.
    But a note to the OP, there is a sample script called FindChangeByList that removes leading and trailing spaces as well as extra spaces after punctuation, all in one go. But if you want to continue to use a GREP find/change to remove leading space, I'd modify Joel's suggestion to ^\s+ to get those cases where the user typed multiple spaces as well.
    And don't forget there are actually legitimate places for leading tabs, which both the script and this GREP will find and remove, so be careful.

  • How to remove the space in the info object level?

    Hi,
    I created a Master Data info Object and gave the data type as <b>Char</b> and length as <b>30</b>.
    From the source system I am getting the data of length 9. But at PSA level I am getting some erroneous records.
    Example: Data from the source system  'a12345678'
                   Data in PSA 'a12345678b'     -
    ***  where b  - Blank
    With out changing the length how can I remove the spaces (Blank)?
    Can any one suggest me how to remove, where and what to apply ?
    I need to do any settings at the info object level or at the Transfer Rule?
    Please provide the each and every step to resolve my problem.
    Thank you

    Hey  you can allow space in RSKC tcode and execute it... .that's it .
    and below is the routine for invalid chars and you can have this in update rules ..
    data: w_fielda(x) type c.
    data: w_result(x) type c.
    data: w_temp_field(1) type c.
    data: w_count type i.
    w_fielda = COMM_STRUCTURE-/BIC/Zxxxxxx.
    w_count = 0.
    do x times.
    clear w_temp_field.
    w_temp_field = w_fielda+w_count(1).
    if w_temp_field CA
    '!"%&''()*+,-./:;<=>? _0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    w_result+w_count(1) = w_temp_field.
    endif.
    w_count = w_count + 1.
    enddo.

  • File Content Conversion Removes Leading Blank/Space

    I'm having a problem where file content conversion is trimming leading blanks/space/whitespace from fields when reading in the inbound file.  I've seen where people have posted that you need to use fieldContentFormatting to prevent content conversion from stripping the leading/trailing whitespace.  I added that parameter to my list (see below example) but it still appears to be trimming the leading whitespace.  Look forward to hearing your thoughts.  Here are the details:
    I'm using fixed length file content conversion for Sender File Adapter (SP15).  I have the following parameters set:
    Document Name = MaterialData
    Recordset name = item
    Recordset Structure = MaterialLine, 1
    I have:
    MaterialLine.fieldNames = matno_external, mat_description
    MaterialLine.fieldFixedLengths = 40, 40
    MaterialLine.fieldContentFormatting = nothing, nothing
    The following is the input file (notice spaces prior to second occurrence of material numbers)
    ZED00000001                             AIMS LIGHT A
    ZED00000001                            AIMS LIGHT B
    ZED00000002                             AIMS SWITCH A
    ZED00000002                            AIMS SWITCH B
    ZED00000003                             AIMS SEMICONDUCTOR A
    ZED00000003                            AIMS SEMICONDUCTOR B
    The following is the source XML after file content conversion from SXMB_MONI (note spaces no longer exist in matno_external tag).
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MaterialData xmlns:ns="http://xxxxxxx.com/yyy/test">
    - <item>
    - <MaterialLine>
      <matno_external>ZED00000001</matno_external>
      <mat_description>AIMS LIGHT A</mat_description>
      </MaterialLine>
      </item>
    - <item>
    - <MaterialLine>
      <matno_external>ZED00000001</matno_external>
      <create_date>10/09/06</create_date>
      <mat_description>AIMS LIGHT B</mat_description>
      </MaterialLine>
      </item>
    - <item>
    - <MaterialLine>
      <matno_external>ZED00000002</matno_external>
      <mat_description>AIMS SWITCH A</mat_description>
      </MaterialLine>
      </item>
    - <item>
    - <MaterialLine>
      <matno_external>ZED00000002</matno_external>
      <mat_description>AIMS SWITCH B</mat_description>
      </MaterialLine>
      </item>
    - <item>
    - <MaterialLine>
      <matno_external>ZED00000003</matno_external>
      <mat_description>AIMS SEMICONDUCTOR A</mat_description>
      </MaterialLine>
      </item>
    - <item>
    - <MaterialLine>
      <matno_external>ZED00000003</matno_external>
      <mat_description>AIMS SEMICONDUCTOR B</mat_description>
      </MaterialLine>
      </item>
      </ns:MaterialData>

    Thanks all for your attempts but I figured it out and wasn't this the biggest case of irony.
    Here I was trying to prevent leading spaces from being trimmed in the loading of my file and my problem was that when I typed:
    MaterialLine.fieldContentFormatting
    I actually left a "blank" at the end of the "g" in Formatting.  Apparently XI didn't like that and neither gave me a runtime or compile error.  Anyway I found this and though I'd share in case anyone else encounters it.  I removed the blank and all is working now.

  • How to remove leading zeros and leading blanks from numc

    Hi experts,
             i wanted to show personal number into my smartform..The field name is PERNR(8) which is of type N. But, in my smartform I get output as (000234)..if I use &pernr(Z)& leading zeros r removed but then the output is (   234)..Now, I wanted to remove this leading space also...
    please tell me the solution for this...
    thanks

    Hi Ujjwala,
    You can use SHIFT.
    DATA: V_CHAR(10) VALUE '00000'.
    SHIFT V_CHAR LEFT DELETING LEADING '0'.
    Regards,
    Ramesh
    *award the points if answer was helpful

  • Removing leading zeros for the quantity field

    Hi all,
    In my script form there is a quantity field, of 13 and 3 decimals , on the out put its taking that much space un neccesarily,and messing up.
    how to make this adjustable in the provided space.
    It always 3 digits and 2 decimal points in our case.
    Please help me out,
    Thanks,
    Praveen

    Hi,
    For removing leading zeros
    &V_VARIABLE(Z)&
    Thanks,
    Naren

Maybe you are looking for

  • Error while deleting the application deployed in WLS10.3

    Hi everyone , I have installed WLS10.3 on a AIX box , and deployed a .ear file and a .rar file . When i try to stop them and then attempt to delete the file a error is thrown . However this error is not thrown consistently. Would be really glad if i

  • How to format body message while using SO_DOCUMENT_SEND_API1?

    hi,            i am having some data in internal table that i want to format as text message and mail through SO_DOCUMENT_SEND_API1 function module but not as a attachement. i am using contents in body message. but i am not able to do formating , is

  • My ThinkPad T400 won't boot!

    I honestly have no clue what could have caused this!  I turned it on this morning & it was stuck on the booting screen. It read "ThinkPad" in large letters followed by "To interrupt normal start up, press the blue ThinkVantage button." I waited for a

  • My iPhone 4 is stuck in recovery and won't restore. Should I take it to Verizon or Apple Store?

    Out of nowhere my iPhone wouldn't turn on. I plugged it into iTunes to try to restore it but kept getting the message, "The iPhone 'iPhone' can't be restored. An unknown error occured (2001 or 2006)." When I try to restore it now, I get the message "

  • RV220W not showing DHCP Leased Clients (LAN)

    I have notice that when I click on Networking -->LAN -->DCHP Leased Clients (LAN) I get 0 results found, but If I click on Status-->Avaiable LAN Host I see all my clients, most (all but 1) are listed as "unknown" under the Name. How do I get them to