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

Similar Messages

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

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

  • 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

  • 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

  • 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

  • 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 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 trailing and leading spaces

    How do I remove both leading and training spaces from a statement. SHIFT LEFT is working fine....but SHIFT w_text RIGHT DELETING TRAILING '*' does not seem to work in my code.
    The field value is ***ABCCDE*FGHI**JKL****
    and I want the o/p as ABC*CDE*FGHI***JKL
    Regards,
    Sameena

    Hi, Sam.
    Test Sample Code Bellow.
    Note: Variable Must be Type String not Character with Character Type SHIFT will not work Properly
    DATA: test TYPE string.
    test = '****ABC**CDE***FGHI****JKL*****'.
    SHIFT test LEFT DELETING LEADING '*'.
    SHIFT test RIGHT DELETING TRAILING '*'.
    CONDENSE: test.
    WRITE: test.
    Regards,
    Faisal

  • Urgent: leading zeros in sapscript

    hi gurus,
    how can i remove leading zeros in sapscript form so if the matnr 00000010 would be 10 only?
    please help.
    thanks!

    Hi,
    Do like this
    &V_MATNR(Z)&
    &symbol(Z)& Omit Leading Zeros
    &symbol(S)& Omit Leading Sign
    &symbol(<)& Display Leading Sign to the Left
    &symbol(>)& Display Leading Sign to the Right
    &symbol(C)& Compress Spaces
    &symbol(.N)& Display upto N decimal places
    &symbol(T)& Omit thousands separator
    &symbol(R)& Right justified
    &symbol(I)& Suppress output of the initial value
    Regards,
    Satish
    Message was edited by:
            Satish Panakala

  • CSV as email attachment - leading spaces

    hi all,
    I am using the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send csv files as attachment. I am getting the file with a lot leading spaces in my file (except the first line is proper)
    Please note that i am adding the line breaks manually in the table.
    for ex: i am getting the file as
    name,id,contactno,city
                                                           'aaa','123','9867847594','ABCD'
                                                           'bbb','456','9789269369','BNDR'
    whats the reason? how can i delete them?
    any ideas

    Hi all,
    i solved this issue by following this thread
    Re: How to email an attachment with more than 255 characters?
    and using the FM
    call function 'SCMS_STRING_TO_FTEXT'
    exporting
    text = str
    IMPORTING
    LENGTH =
    tables
    ftext_tab = text_content.
    to prepare the text to be sent.
    Thanks,
    Sharadha

  • 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

Maybe you are looking for