Application Development 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: 

to delete the preceding space

Former Member
0 Kudos

hi,

in my scenario i need the output based on the following condi tions.

i have to link the BKTXT field and the gate no field.but here BKTXT is in text format and gate no is in integer format how will i link this two field.

i linked bktxt = gateno

so while debugging i got this output

the gate no is 0000000012

bktxt = 0000000012

then i deleted that zeros using packed.

now

bktxt = 12.

it taking the i have delete that space.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sharmila,

You can use the below statement.


SHIFT w_leading LEFT DELETING LEADING '0'.

14 REPLIES 14

GauthamV
Active Contributor
0 Kudos

Use condense statement.

Former Member
0 Kudos

Use CONDENSE bktxt NO-GAPS

0 Kudos

hi,

im just using that as the condition.i dont want that field in the output.

Former Member
0 Kudos

Hi Sharmila,

To delete the zeros you can use no-zeros in your write statement.

To delete your space use condense.This a string operation.

CONDENSE STRING NO-GAPS.

LEN = STRLEN( STRING ).

WRITE: STRING, '!'.

WRITE: / 'Length: ', LEN.

Much Regards,

Amuktha.

0 Kudos

hi,

im just using that as the condition.i dont want that field in the output.

0 Kudos

Hi,

you' get only the field-value and not the field.

check this ex:

data: str type string.
data: str1 type string.

str = '0001234'.

pack str to str1.

CONDENSE Str1 NO-GAPS.

write:/ str1.

I355602
Advisor
Advisor
0 Kudos

Hi,

Use FM's :-

CONVERSION_EXIT_ALPHA_INPUT -- It is used to add the 0(Zero) at the begining of the value. You dont require to add zero manually for any variable.

CONVERSION_EXIT_ALPHA_OUTPUT -- It is used to Remove 0(Zero) from the Begining of the value. You dont require to remove Zero manually for any variable. Just call this Function Module and it will automatically removes zero from the begining

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

Use FM CONVERSION_EXIT_ALPHA_OUTPUT

Former Member
0 Kudos

Hi Sharmila,

You can use the below statement.


SHIFT w_leading LEFT DELETING LEADING '0'.

Former Member
0 Kudos

Try this,

CONDENSE bktxt NO-GAPS.

Regards,

Joan

Former Member
0 Kudos

hi,

Use function module CONVERSION_EXIT_ALPHA_OUTPUT

or use

DATA: gv_manuserf TYPE char10.

gv_manuserf = ' 0000000012.

SHIFT gv_manuserf LEFT DELETING LEADING '0'.

WRITE:/ gv_manuserf.

or condense statement.

thanks

Former Member
0 Kudos

use this Fm..

BKK_DELETE_LEADING_ZERO

former_member632729
Contributor
0 Kudos

Hi ,

you have the FM to remove the 000 preceding zeros..

CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external

If you pass '0012' to import parameter.. you will get the value 12 as output.

Former Member
0 Kudos

As u have correct value in the text .. and have 12 in it

move it to a num field

For the gate no field use

FM CONVERSION_EXIT_ALPHA_OUTPUT

FM CONVERSION_EXIT_ALPHA_INPUT

to add or replace leading zeros.

Then link them..

Regards,

Prashant