Skip to Content
author's profile photo Former Member
Former Member

Remove leading zeros from html template

Hello,

I have modified HTML template SAPLBBP_SOCO_UI_ITS to add the ordered product to the Sourcing Cockpit screen. This data has leading zeros in the database; how do I prevent them from showing up on the screen?

My Business HTML skills are novice; so any help is appreciated!

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2008 at 06:15 PM

    Hello,

    You can also try the customizing SPRO -> SRM -> SRM Server -> Master Data -> Products -> Define Output Format & Storage Format for Product ID

    There is a check-box for "Display Leading zeros" which if you un-check, leading 0's are not shown.

    Rgds,

    Prasanna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2008 at 06:33 PM

    Hello, we would not like to touch customizing since we are already live and do not want to make potential system wide changes.

    There must be a way to strip the leading zeros in the HTML template (similar to the "SHIFT LEFT DELETING LEADING '0') command in ABAP.

    I just don't know which command to use in Business HTML....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2008 at 03:49 PM

    I have figured out the context to do this via Busineses HTML. For anyone's future reference, here is example code that I created:

    `v_prod = strSub (GS_ITEMLIST-ORDERED_PROD[j].value, 23, 18)`

    `v_flg = ""`

    `repeat with i from 1 to 18`

    `if(v_flg != "X")`

    `if(strsub (v_prod, i, 1 ) != "0" )`

    `v_prod = strsub (v_prod, i, 0)`

    `v_flg = "X"`

    `end`

    `end`

    `end`

    `TD()`

    `v_prod` </a>

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Joyce,

      Thanks for your last answer that allowed me resolving same kind of issue.

      My issue was to prevent 0 from being displayed in 3 character string for percentage. example :

      001 -> 1

      020-> 20

      There was no other way as "write" or "shift" statements working on abap side never transferred correctly on html display side

      For code example here is mine :

      `v_val = GT_SCREEN_ITM-ZZPERCENTAGE[j].value`

      `if ((strsub (v_val, 1, 1 ) == "0") && (strsub (v_val, 2, 1 ) == "0"))`

      `v_val = strsub (GT_SCREEN_ITM-ZZPERCENTAGE[j].value, 3, 1)`

      `elseif (strsub (v_val, 1, 1 ) == "0")`

      `v_val = strsub (GT_SCREEN_ITM-ZZPERCENTAGE[j].value, 2, 2)`

      `end`

      `v_val`

      for more details here is the url of saphelp :

      http://help.sap.com/saphelp_45b/helpdata/en/7e/031fa404dd11d2801d00c04fadbf76/frameset.htm

      Regards,

      Laurent.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.