Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

command for removing preceeding zeros .

Former Member
0 Likes
1,166

hi good evening to all off u .

i am facing one problem in text display . when i am retriving the text data

i am getting

00000 00000000000000 0000000000000000000000 0 450 MM WIDTH , LAST PURCHASE ORDER NO. PC06Y-00088.PREVIOUS INDENT NO. IP07Y-00883 DATED 26-02-08

i want to remove the leading zeros so i have use the code

REPLACE ALL OCCURRENCES of '0' in fs_readhead with ' ' .

condense fs_readhead .

after that i am getting

45 MM WIDTH , LAST PURCHASE ORDER NO. PC6Y-88.PREVIOUS INDENT NO. IP07Y-883 DATED 26-2-8

i just want to remove preceeding zeros

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,113

Hi,

Use SHIFT LEFT until no zero is remained statement.

Regards,

Rama.

10 REPLIES 10
Read only

Former Member
0 Likes
1,113

call function 'CONVERSION_EXIT_ALPHA_OUTPUT'

use this FM

Regards

Anbu

Read only

Former Member
0 Likes
1,114

Hi,

Use SHIFT LEFT until no zero is remained statement.

Regards,

Rama.

Read only

0 Likes
1,113

check this sample

data c(20) type c.
data zeroes(10) type C value '0000000000'.

c = '000000asdasdsa'.
shift C left deleting leading zeroes.
write c.

also you can use the function conversion_Exit_alpha_output with the doc number, and the concatenate it with the rest of the message

Read only

Former Member
0 Likes
1,113

hi,

Use the below statement

shift fs_readhead left deleting leading '0'.

Read only

Former Member
0 Likes
1,113

Hi!

SHIFT fs_readhead LEFT DELETING LEADING '0'.

Regards

Tamá

Read only

Former Member
0 Likes
1,113

hiii

use statement

SHIFT [string_name] LEFT DELETING LEADING '0'.

regards

twinkal

Read only

Former Member
0 Likes
1,113

hi use this fm ..

BKK_DELETE_LEADING_ZERO

BKK_ACCNT_DELETE_LEADING_ZERO

Read only

Former Member
0 Likes
1,113

Hi,

Try the following:

Shift fs_readhead left deleting leading '0'.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
1,113

Hi

Just use the condense statement... remove the replace statement..

regards

padma

Read only

Former Member
0 Likes
1,113

Hi,

Here is the complete code:

data:

w_str type string value '000345',

w_flag type c value '0' ,

w_char.

while w_flag ne 1.

shift w_str left by 1 places.

w_char = w_str+0(1).

if w_char eq '0'.

w_flag = 0.

else.

w_flag = 1.

endif.

endwhile.

write:

/ W_str.

Regards,

Rama Chary.Pammi.