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

Similar Messages

  • How to set space between the fields in SearchPG- Display issue

    Hi Friends
    I Have created a searchPG with a QueryRN , In my searchPG i have some display issue after running the page its looks like this
    For Example assue its a page with 3 field and one table region
    Employee no
    Employee name
    Phone no
    ResulttableBut i want my searchPG should hav some space between two field as shown below
    Employee no
    Employee name
    Phone no
    ResulttablePlease adviice me
    I appreciate all ur advice
    Thanks
    A.T

    Hi Peddi
    In my structure pannel I have simpleSearchPanel below that only i have the two lov fields ex: emp_no and emp_name . how to set the spacer between this From which Region where can find the spacer bean what proerty do i need to set
    Thanks
    AT

  • 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

  • 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.

  • Subroutine to remove preceding spaces in a field

    Hi,
    I am from SAP BW.
    Can anyone help me to write a sub routine to remove preceding spaces in a field .
    The data is in excel sheet which we need to load into info cube. But as the data in the field contains preceding spaces,its unable to load and showing an error.
    I need to write a sub routine for that.
    Awaiting ur response.
    Thnx
    kapil

    Hi,
    use fm CONVERSION_EXIT_ALPHA_OUTPUT
    or commands :
    -pack
    -shift val left deleting leading space
    A.
    Message was edited by:
            Andreas Mann

  • 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.

  • 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.

  • Delete leading spaces of CURR field

    Hi Experts,
    I want to delete the leading spaces of a field of type CURR and display on the report. Can anyone please help me with this?
    Thanks
    Dany

    Hi,
    Say ur amt field is var_amt.
    Create a char variable say wl_char(20).
    then do
           Write var_amt to wl_char.
            Condense wl_char.
    now use wl_char for printing in ur report.
    Enjoy SAP.
    Pankaj Singh.

  • 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

  • How to set white spaces between the fields in dataset??

    Hi all,
    I am writing a set on information to from infotypes to a text file. Its a fixed width file. How do set white spaces in the fields for dataset?
    Example:
    TYPES: begin of header,
                    filler(40)  type c,
                    id(3)        type c,
                    filler2(7) type  c,
                    delimiter  type  c,
                 end of header.
    DATA header type header.
    header-filler1 = ' '.
    header-id       = '100'.
    header-filler2 = ' '.
    header-delimiter = cl_abap_char_utilities=>newline.   ( do it to get a new line)
    my_table = header.
    append my_table.
    DATA: out_file(256) type C,
          codepage_ref type ref to CX_SY_CONVERSION_CODEPAGE,
          out_char type c,
          size type i,
          insert_string type string,
          insert_size type i.
      out_file = filename.
      open dataset out_file for output in text mode ENCODING NON-UNICODE.
      LOOP AT my_table.
        size = strlen( my_table ).
        insert_string = ''.
        DO size TIMES.
          offset = sy-index - 1.
          try.
              out_char = my_table+offset(1).
              IF out_char = SPACE.
                CONCATENATE insert_string '' INTO insert_string SEPARATED BY SPACE.
              ELSE.
                CONCATENATE insert_string out_char INTO insert_string.
                transfer insert_string to out_file NO END OF LINE .
                insert_string = ''.
              ENDIF.
            catch CX_SY_CONVERSION_CODEPAGE.
              insert_size = strlen( insert_string ) - 1.
              insert_string = insert_string(insert_size).
          endtry.
        ENDDO.
       transfer CL_ABAP_CHAR_UTILITIES=>NEWLINE TO out_file NO END OF LINE.
      ENDLOOP.
      close dataset out_file.
    How do I get to insert the space for filler1 and filler2?
    Edited by: Siong Chao on Oct 4, 2011 4:56 AM
    Edited by: Siong Chao on Oct 4, 2011 8:27 AM
    Edited by: Siong Chao on Oct 4, 2011 8:29 AM

    problem lies in the open dataset codes
    Used:
    open dataset out_file for output in text mode encoding non-unicode message msg.
    if sy-subrc= 0.
    loop at my_table.
    transfer my_table to out_file
    transfer cl_abap_char_utilities=>newline to out_file no end of line.
    endloop.

  • How  can i check the space in the field.

    hi:
    how  can i check the space in the field.!
    for example:
    data: string(30) type c value 'sent ence'.
    search  string for space.
    if sy-subrc = 0.
    write: 'i am right'.
    endif.
    but the result is that it cann't check the space.
    so how can check the space in the field!!
    thank you very much!

    Hi,
    data: v_string(30) type c value 'sent ence'.
    DATA : v_cnt TYPE I,
                v_num TYPE I  VALUE 1,
                v_num1 TYPE I.
    v_cnt =  strlrn( v_string ).
    DO v_cnt TIMES.
      IF v_string+v_num1(v_num)  EQ SPACE.
        write: 'i am right'.    
    ELSE.
       write: 'i am WRONG'.
      ENDIF.
      v_num1  =  v_num1 + 1. 
    ENDDO.

  • How do you change the fields that are displayed on the email preview list after a search?

    How do you modify the fields that are displayed in the mail preview list in the center column of Mac mail after you conduct a search of your email?   All of a sudden the displayed fields changed on me whenever I do a search in mail.   When I have not filtered my email with a search, the default field shown in bold at the top of each message's preview is the "From" field.   However, when I do a search this changes to the "To" field.   Can anyone help?   Thanks, ccarey

    ipicus
    But why would you want this?
    iTunes is responsible for the File Management, let it get on with it, you do your organisation in the iTunes window. And everything you need to do, you can do via the iTunes Window. Want to find the file of a track quickly? Right click on it in the iTunes Window and select Show File: A finder window pops open with the file already selected.
    Regards
    TD

  • How can I remove fine scratches off the I Pad Retina Display ?

    Dear Community,
    I would appreciate to receive your experiences and tipps how to remove fine scratches off the  I pad retina display without harming its surface ! Thx

    Apple Stores sell a good screen cleaner which I would recommend for cleaning screens - it works well and doesn't do any damage.  This might clean away a lot of what you see as fine scratches.
    Other than this, I would stay away from anything else as you may well do a lot more harm than good.

  • 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

  • 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

Maybe you are looking for

  • MuVo TX Sudden loss in sound quality -irrecoverab

    My MuVo Tx simply stopped working as usual. I was listening to it, put it away on the shelf i keep it decided to go out for a walk later on picked it up turned it on and nowit sounds as though it's only playing higher pitched notes and background voc

  • 2.5 inch black bands on either side of monitor

    I just installed Mavericks 10.9.2 on my Mac Mini and strange things have been happening, among them are two black bands on either side of the display.   How do I get rid of the bands and get my display back to the full width of my screen?

  • Micro usb to lightning adapter works in IOS7??

    There are plenty of discussion flowing around saying that IOS7 doesn't support 3rd party cable. However, I have couple of devices that uses micro USB cables and I am thinking about getting the micro usb to lightning adapter (official apple one). Does

  • 11.0.4 podcast artwork in mini player not showing chapter artwork

    This has still not been fixed. Is there any plan to fix this for those of us using iTunes on Mac and PC for podcasts?

  • Airplay Third Party Devices

    I was looking into using a device such as the Tronsmart T2000 to mirror my students ipads and android devices. Is this device legal to use in the US? Is it in violation because it uses Airplay to mirror?