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.

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

  • Delete leading spaces in sapscript

    Hi experts,
    is there a way to delete the leading spaces in spascript
    i have the value: (.........7685524,5) how to delete the spaces?(i have spaces instead of the points)
    Regards,
    Soufiane
    Message was edited by:
            Soufiane FAYSSAL

    Use PERFORM-ENDPERFORM to do the deletion of space in a FORM defined in external ABAP program.
    The following example demonstrates the ability to execute ABAP c ode from with SAPScript.
    eg.
          /:PERFORM get_date IN PROGRAM zreport
                /:USING &SALESORDER&
                /:CHANGING &S_DATE&
                /:ENDPERFORM  
                The date &S_DATE& ....
               The  ABAP Code would be
               REPORT zreport.
               TABLES ztab.
               FORM get_date TABLES in_tab STRUCTURE ITCSY out_tab
               STRUCTURE ITCSY .
               READ TABLE in_tab INDEX 1.
               SELECT some_date FROM ztab WHERE salesorder = in_tab-value.
               IF sy-subrc EQ 0.
               READ TABLE out-tab INDEX 1.
               MOVE ztab-somedate TO out_tab-value
               MODIFY out_tab INDEX 1.
               ENDIF.
               ENDFORM.
    In the above code USING is used to pass the value to the subroutine while changing is used to recieve the value from the subroutine ,for further paramters we can use either USING or CHANGING .
    In the subroutine the type of paramter is always an internal table of type ITCSY  irrespective of the value passed.The VALUE field of the internal table is used to fill and recieve the values

  • To delete leading space

    Hi Experts,
    Actually I want to pass a a field to a smartform which is concatenation of currency and char fields.
    But there is a space at the beginning and so when I am printiong in smartform I am getting that space.
    So can anyone tell me any function module or command to delete the leading space????
    Thanks in advance.........

    Hi,
    Use Condense keyword
    DATA NAME (30).
            NAME(10)    = '    Dr.',
            NAME+10(10) = 'Michael',
            NAME+20(10) = 'Hofmann'.
    CONDENSE NAME.
    WRITE NAME.
    displays the following:
    Dr. Michael Hofmann
    DATA: BEGIN OF NAME,
            TITLE(8)       VALUE '    Dr.',
            FIRST_NAME(10) VALUE 'Michael',
            SURNAME(10)    VALUE 'Hofmann',
          END   OF NAME.
    CONDENSE NAME NO-GAPS.
    The contents of NAME is now "Dr.MichaelHofmann".

  • Delete leading zeros for a field on the pdf form

    Hi,
    i know it is possible to delete leading zeros via abap coding in the interface.
    But is it also possible to this directly on the pdf form - scripting or a setting?
    Thank you
    Kind regards
    Manfred

    I believe you can set this up as a field display pattern (if you use LCD 8.1 or something like that).
    Or you can script that out. In formcalc you can easily process characater by character, test if that is zero and remove it.
    http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf
    Otto

  • New Address Book contacts insert leading space into Notes field

    When I create a new contact from scratch in Address Book (4.1) the Notes field at the bottom contains leading spaces / tabs. (I can't tell which). This means that information I type in at the bottom looks unusually formatted. This behaviour (I seem to remember) was also in Tiger; although now I m using Leopard (10.5.2).
    2 questions:
    1) How can I get rid of this leading space / tab for new contacts?
    2) How can I get rid of this leading space for all existing contacts Notes' field.
    thanx!
    Diddles.

    Ahh, I see. After you have entered the contact details, click the edit button to turn off editing mode before putting anything in the notes field. You don't need edit on to change notes.
    AK

  • How to delete leading zeros for amount  fields

    Hi all,
    I have problem with the leading zeros, where I am populating nearly 30 amount fileds in my  statement.i want to delete leading zeros.
    I have tried with shift and pack.
    and I cannot call every time the function module *alpha_output or input.
    can anybody suggest me the better solution.
    Regards,
    Sre

    You could use a syntax like 
    SHIFT: w10a LEFT DELETING LEADING '0',
           w10b LEFT DELETING LEADING '0',
           w10c LEFT DELETING LEADING '0',
           w10d LEFT DELETING LEADING '0'.
    or using macros like
    DEFINE delzero.
      shift &1 left deleting leading '0'.
    END-OF-DEFINITION.
    delzero: w10a, w10b, w10c, w10d.
    Regards

  • Delete leading space in integer

    Hello,
    i have a requirement where I need to pass integer value only and do not need leading spaces. Can someone please help me to get this issue resolved?
    I have tried using "shift"/condense and many more options. None of them works as they are for type C,N,D,T.
    Plese help.

    Hi
    your issue is not very clear, I can't understand where u have the integer and where u have to put the integer, anyway try to see if this sample is helpfull for you:
    DATA: V_CHAR(10) TYPE C,
            I          TYPE I VALUE 8,
            LEN        TYPE I.
      WRITE I TO V_CHAR.
      CONDENSE V_CHAR NO-GAPS.
      LEN = STRLEN( V_CHAR ).
      WRITE V_CHAR(LEN).
    Max

  • Condense the leading spaces for a particular field

    hi
    total_weight            TYPE char10,
    I need to condense the leading spaces.for a particular
    how shd i do it.

    shift total_weight  left deleting leading space.
    Regards,
    RIch Heilman

  • Deleting blank spaces in internal table

    Hi Gurus,
    I want to delete the empty spaces of a particular field in internal table.I used condense and shift statements but didnt work because the work area value is already condensed.I am not sure why the internal table field is having so much of empty spaces to its left.It's a character field with length 60.
    Please suggest.

    Hi,
    This is the rellevant code   
    LOOP AT IT_HIER INTO WFL_HIER.
            WFL_FINAL-NODEID = WFL_HIER-NID.
            WFL_FINAL-IOBJNM = WFL_HIER-IOBJ.
            WFL_FINAL-NODENAME = WFL_HIER-NNAME.
            WFL_FINAL-PID = WFL_HIER-PID.
            condense wfl_hier-desc.
            WFL_FINAL-DESCRIPTION = WFL_HIER-DESC.
            SHIFT WFL_FINAL-DESCRIPTION LEFT DELETING LEADING SPACE.
            APPEND WFL_FINAL TO E_T_DATA.
            CLEAR WFL_FINAL.
            CLEAR: WFL_HIER,OUT.
          ENDLOOP.
    The problem is not with the work area.
    Say if I have a value apple in the work area wa, (wa - 'apple').
    It doesnt have any leading sapces to the left.
    But when I am appending it to the internal table it gets posted at the last say like this (it -  '                                       apple'.
    It occupies the last five characters.
    Not sure how to resolve this.

  • 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

  • 'SHIFT variable RIGHT deleting trailing space' not working

    I have a character field in a transaction that occasionally gets populated with a value that has a space at the end or at the beginning or both. This is causing the dataload to fail. I added code below to remove these spaces from the end and beginning-
    SHIFT <variable> RIGHT deleting TRAILING space.
    SHIFT <variable> LEFT deleting LEADING space.
    The SHIFT LEFT works perfectly and deletes the space at the begining of the value but SHIFT RIGHT does not delete the space at the end for some reason. I tried defining the variable as a char (16), string but nothing seems to make it work.
    Note: I cannot use CONDENSE because the value can have spaces in between that we cannot delete.
    Any ideas why shift right wouldn't work?

    Hi Maanasa,
                           First of all Shift works only with string datatype. So transfer the contents of that character field into a string datatype and do the shift operation.
    Declare a string variable of that type. Data v_str type string.
    Pass the contents of the character field into the string.
    And do the shift operation on the string and pass the value of the string back to the character field.
    Shift v_str by 1 places right.
    Please try this.
    Thanking you,
    Jerry

  • 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

  • Leading space in timestamp.

    HI,
    data: gv_timestamp type RKE_TSTMP.
    I have to delete the leading spaces from time stamp.
    i used 
      SHIFT gv_timestmp LEFT DELETING LEADING space.
    But shift operation we can do only ob CHAR or string.
    How can i delete leading spaces form timestamp.
    Regards,
    Oorvi

    Hi Oorvi,
    Check this.
    data: v_timstmp type string.
    v_timstmp = gv_timestamp.
    condense v_timstmp.
    gv_timestamp = v_timstmp.
    Regards,
    Swarna Munukoti

  • 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

Maybe you are looking for

  • Using an on update or insert trigger on a SAP table

    Hi all, A question for you regarding using a database trigger in and SAP system.  We are needing to export data for our datawarehouse.  Currently we export all the data.  That data is getting quite large tho and time is becoming an issue. One suggest

  • File to RFC - Missing data in table parameter

    Hello, I have a file-to-rfc scenario.  My RFC function contains both inbound parameters and a table parameter. When the RFC function is called, my data is passed correctly to the inbound parameters, however the table is empty.  I have tested my mappi

  • Design RG in Route Pattern

    I  would like to set that all calls to a specific destination, were commuted to a Gateway A, and if  all lines are busy, these calls are switched by Gateway B. I have this configuration: Actual RP: Route Pattern* : 9199.XXXXXX      Partition: Outgoin

  • Arabic in Oracle 10g Forms & Report

    Hi All; I have a requirement that we have an ERP with default language (English US) and now we need to put arabic support in our forms and reports so what should we do for it? and for writing arabic do we need Rich Text tools or not? if yes then how

  • Cisco Prime NCS appliance & license

    Hi all, I'm looking for getting a Cisco prime NCS appliance (PRIME-NCS-APL-K9). I'm a little bit confused regarding to the license scheme: 1. Does the appliance has any license coming with it or we need to order the license separately? 2. If I have a