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: 

so many zeros preceeded instead of one zero here.

Former Member
0 Kudos

I have declared LV_0UPC_EAN as below

DATA : lv_0upc_ean(18) TYPE c,

I get the value as 054871020964

To select from date base, i am deleting leading zero of 054871020964...using below code:

SHIFT wa_869_input_rec-upc_ean LEFT DELETING LEADING '0'.

( So, wa_869_input_rec-upc_ean will become 54871020964, then used from database select and apply logic... )

Then APPEND wa_869_input_rec TO gt_869_input_rec.

After selecting from data base table, and if everything is successfull.

Then  I have again to pass this value back into out put file as 054871020964.  
How to do this out of 54871020964 whose size is of 18 chars.

Here I am using 'CONVERSION_EXIT_ALPZE_INPUT' like below

CALL FUNCTION 'CONVERSION_EXIT_ALPZE_INPUT'

EXPORTING

input = p_wa_869_input_rec-upc_ean

IMPORTING

output = lv_0upc_ean.

p_wa_870_output_rec-upc_adidas = lv_0upc_ean.

but it is giving preceeding zeros as 000000054871020964.

how to make this.

Please help me

1 ACCEPTED SOLUTION

Former Member
0 Kudos

LIPS-EAN11

EAN11 CHAR 18

6 REPLIES 6

former_member598013
Active Contributor
0 Kudos

Hi Sam,

Try to use the FM


CONVERSION_EXIT_ALPHA_INPUT           "-----> Remove Zero from the number
CONVERSION_EXIT_ALPHA_OUTPUT       " -----> Add Zero from the  number.

Thanks,

Chidanand

Former Member
0 Kudos

Hi,

Why dont you duplicate it ? I mean to say store both the variables separately. So when you are doing your selection you can use the one without a zero and when you need to pass this value on to this file you can use the one with a zero.

Regards,

Pramod

JozsefSzikszai
Active Contributor
0 Kudos

if the legth of the EAN is fixed (like 12 characters in your example), than why don't you define the variable with 12 characters?

like:

DATA : lv_0upc_ean(12) TYPE c,

if the length can vary, than you have to keep track somehow...

former_member188685
Active Contributor
0 Kudos

>To select from date base, i am deleting leading zero of

> 054871020964...

what is the table and what is the field..?

Former Member
0 Kudos

LIPS-EAN11

EAN11 CHAR 18

0 Kudos

the EAN number may be diiferent, it may not be possible to have 12 chars length always.

can i know from you got the data with one extra zero to the ean number.

'05.............' , and why you are expecting a zero before it. can i know the reason..?