cancel
Showing results for 
Search instead for 
Did you mean: 

how to remove leading zeroes of a coloumn in a table

Former Member

can someone tell me how to remove the leading zeroes in a table's coloumn .... its a NUMC data type..

i tried with abap statement shift leading zeroes, but its not working for me.... the sorting is missing..

in properties is there any option to remove the leading zerores>

niraja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi niraja,

The attribute which you have binded ...do the formatting of that attribute by making property display leading zeros as Zeros as Blanks.

Regards,

Rohit

Former Member
0 Kudos

rohit where are we going to do that?

Former Member
0 Kudos

Hi Niraja,

Just click on the context attribute which You have binded below that only You will see a table having coloumns property and value.

Over there You will see One Formattingoption. Under that if You are able to see property Display leading zeros then change it accordingly. if u r nt able to see that then click on Formatting You will able to see that property.

get back to me if still you get the problem.

Greetings,

Rohit

Former Member
0 Kudos

Rohit,

I am not able to see the formatting option under the Context node->attribute.. I can see the Property and Value coloumns, but i dont see the formatting option.

can u pls be precise on this.

Niraja

arjun_thakur
Active Contributor
0 Kudos

hi niraja,

if you go through the link i provided you in my previous post, you'll definitely be able to solve your problem

regards

Former Member
0 Kudos

Hi Niraja,

You can use following syntax also to remove zeros.

SHIFT <attribute_name> LEFT DELETING LEADING '0'.

I hope it works.

Regards,

Rohit

Former Member
0 Kudos

arjun,

I saw ur preivous link aswell.. but in my context attribute i can see property and value coloumns. but not the Formatting option..

can u pls forwrd the screen shot if u can to mmate4u at gmail.com... plsss

Niraja

Former Member
0 Kudos

I am not able to see Formatting options im in CRM 5.0. May be later releases has that option.

leading zeroes, is not woring for me.. the soritng is mismatching..

niraja

uday_gubbala2
Active Contributor

Hi Niraja,

I am displaying a table with information from SFLIGHT. The CONNID field is of type NUMC and so it too used to contain the leading zeroes. I so deleted the leading zeroes in my WDDOINIT method before binding the internal table to the context node. The table now does not display the leading zeroes as earlier. Find my coding as shown below:

METHOD wddoinit .
  DATA: lr_node TYPE REF TO if_wd_context_node,
        wa_sflight TYPE ig_componentcontroller=>element_node,
        lt_sflight TYPE ig_componentcontroller=>elements_node.
  SELECT * FROM sflight INTO TABLE lt_sflight.

  LOOP AT lt_sflight INTO wa_sflight.
    SHIFT wa_sflight-connid LEFT DELETING LEADING '0'.
    MODIFY lt_sflight FROM wa_sflight TRANSPORTING connid.
  ENDLOOP.

  lr_node = wd_context->get_child_node( name = ig_componentcontroller=>wdctx_node ).
  lr_node->bind_table( new_items = lt_sflight ).
ENDMETHOD.

Regards,

Uday

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

check this.........

[https://forums.sdn.sap.com/click.jspa?searchID=19606118&messageID=6203953]

arjun_thakur
Active Contributor
0 Kudos

hi,

try this code:

SHIFT wa_table-ca_amount LEFT DELETING LEADING '0'.

or refer to the following thread:

i hope it works.

regards

arjun

Edited by: arjun on Dec 6, 2008 11:45 AM