Skip to Content
author's profile photo
Former Member

padding of objects

pls let me know how to do padding of digits and out put ony few digits for that field.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    Posted on Sep 21, 2005 at 06:38 AM

    Hi Anu,

    You have to move this to a character field and use the following sytax.

    a = '123456789'.

    b = a+2(3).

    Now value of 'b' is 345.

    The index starts from zero. i.e. the digit '1' is at position zero.

    Thanks

    Vinod

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 21, 2005 at 06:46 AM

    what is the data type u r using?

    if u r using type n then u can use sub-field access

    like...

    data n1(5) type n.

    ...

    ....

    write :/ n1+0(2).

    however u cannot do the same for type p or f . for these u need to convert to a character type and then use sub-field access...

    what is the scenario? u want to restrict only the decimal places or what?

    rgds,

    PJ

    Message was edited by: Priyank Jain

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 21, 2005 at 07:20 AM

    I want to pad few digits with 0 and output only few digits.all are chacrater fileds.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Durairaj Athavan Raja

      Hi!!!!!!!! I do not know any thing about Padding , Rounding and Arthematic and logical expressions but I have an Idea

      can u Please send blogs or PDF formates regarding these concepts to study them

  • Posted on Sep 21, 2005 at 07:29 AM

    Hi Anu,

    pls describe your problem in detail

    for the moment you could look here: Processing" target="_blank">http://help.sap.com/saphelp_47x200/helpdata/EN/fc/eb3357358411d1829f0000e829fbfe/frameset.htm">Processing Character Strings

    Andreas

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 21, 2005 at 07:31 AM

    DATA NAME(10) VALUE '1234'.

    DO 5 Times.

    CONCATENATE '0' NAME INTO NAME.

    ENDDO

    WRITE :/ NAME.

    This will give output as 0000012234.

    Change 5 times to desired value.

    Cheers

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 21, 2005 at 07:59 AM

    Hi Anu,

    Have a look at demo programs

    DEMO_DATA_PROCESS_FIELDS

    DEMO_DATA_STRING

    Thanks

    Lakshman

    Add comment
    10|10000 characters needed characters exceeded