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

cannot use CONVERSION_EXIT_ALPHA_INPUT - is there any other solution

Former Member
0 Likes
722

Hi All,

Sorry in my previous post i forgot to say that due to some other problems which we are facing, we couldn use CONVERSION_EXIT_ALPHA_INPUT

My requirement is i have work area with a field as shown below.

wa_table-registerno. this has some value say 12345678.

Now i have to check if the value is equal to a DB table field say wa_table-bnumber. This field has value 0012345678.

Both fields are having length of 10.

Now problem is the field in table is appending zeros in front, so when i check if they are equal, the condition is failing.

I have to have make my field wa_table-registerno to fill the remaining zeros in front for different cases, (two zeros for this case,but it may vary for next number). if so how to proceed?

Or is there any other way.

My requirement is even if there are zeros in front, the condition should not fail.

How to proceed?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
690

instead of ading zeroes in your field why dont you remove extra zeroes before comparing the field using SHIFT <> DELETING ZEROES command.

5 REPLIES 5
Read only

Former Member
0 Likes
690

Hi

If u not using the conversion exit. Then take a varibale of length 10 with type n.

before comparing the internal table value to DB,pass the internal table value to the variable.

regards,

Raghu

Read only

Former Member
0 Likes
691

instead of ading zeroes in your field why dont you remove extra zeroes before comparing the field using SHIFT <> DELETING ZEROES command.

Read only

0 Likes
690

if i use shift then how to proceed for each record,

for example in the first time of loop the value is 0012345678

the next time it is 0000123456

the next time 0000000234

so how to proceed.. plz explain

Read only

0 Likes
690

Hi,

try this way...


"if w_mara lenght is 18characters..

data : w_len type int2.

w_mara = '12345'.

w_len = strlen( w_mara).  "lenght is 5

w_len = 18 - w_len.         "now lenght is 13

do w_len times.                "now it will loop 13 times and add 13 zeros to matnr.
concatenate '0' w_mara into w_mar.
enddo.


write : w_mara.

"output is : 000000000000012345.

regards,

Prabhudas

Read only

Former Member
0 Likes
690

If you cannot use CONVERSION_EXIT_ALPHA_INPUT then try UNPACK command. Check this example.


DATA: FIELD1(2) TYPE P VALUE '10',
C_FIELD2(4) TYPE C.
UNPACK FIELD1 TO FIELD2.

WRITE: / FIELD2.

Regards,

Vikranth