cancel
Showing results for 
Search instead for 
Did you mean: 

Remove leading zeros from html template

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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>

laurent_touillaud
Contributor
0 Kudos

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.

Former Member
0 Kudos

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