cancel
Showing results for 
Search instead for 
Did you mean: 

When data types are different

Former Member
0 Kudos

Hi,

I have a requirement like this:

Assignment field u2013 if it is a valid employee number then move the data to employee info object .

But the data type and length of assignment and employee are different.

Assignment: CHAR and length 18

Employee: NUMC and lenght is 8.

i am writing this routine in update rule. since data types are different i am not able to compare.

Pl suggest me is there any way to achieve this? is this possible?

Full points will be assigned!

Thanks & Regar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I have create a program and "MOVE" works on type conversion

-


REPORT Z_TEST.

DATA: W_NUM_CHAR(10),

W_NUM TYPE P.

W_NUM = '1234567'.

W_NUM_CHAR = 'hello'.

WRITE W_NUM_CHAR.

MOVE W_NUM TO W_NUM_CHAR.

WRITE W_NUM_CHAR.

-


I am new to ABAP. So please take a test. I found following conversion code from Char to number, just for your reference:

-


REPORT ZDEMO.

DATA: W_NUM_CHAR(10),

W_NUM TYPE P.

W_NUM_CHAR = '223231.23'.

CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 128.

MOVE W_NUM_CHAR TO W_NUM.

ENDCATCH.

IF SY-SUBRC = 128.

W_NUM = 0.

ENDIF.

-


Hope it helps.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Thanks for the inputs.

I am using a function module to truncate 0s of employee and comparing with allocation number.

This is working fine but only with few records. With large data set it is not loading and remain in yellow for long time and records wont get added.

pl find my code and suggest me how can i improve the performance so that i can load all data.

No of records in Employee master data table: 109000

No of records in the extractor: 12,115

.

Start routine:

SELECT employee FROM /bi0/memployee INTO TABLE itab_emp.

SORT itab_emp BY employee.

DELETE ADJACENT DUPLICATES FROM itab_emp COMPARING employee.

Update routine for Employee:

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = COMM_STRUCTURE-alloc_nmbr

IMPORTING

output = alloc.

READ TABLE itab_emp WITH KEY employee = alloc.

IF sy-subrc EQ 0.

RESULT = itab_emp-employee.

ENDIF.

Thanks & Regards,

Vijaya

Former Member
0 Kudos

Hi Vijaya,

You can convert your Num to String and then you can compare it. You can do it by string Functions.

Regards

Karthik

Former Member
0 Kudos

Thanks Karthik.

I am not getting any string functionto convert....can u pl provide me?

Thanks & Regards,

Vijaya

Former Member
0 Kudos

Hi vijay

check this function module u can convert from character to any type... check what parameters shoulld u pass and jst go through this function module in se37 'CONVERT_FROM_CHAR_SORT_RFW'

and once converted use it for assigning for ut type...

Regards

vamsi

Former Member
0 Kudos

And you can also find the document at ABAPDOCU

ABAP - Key word documentation -> ABAP - BY Theme -> Assignments -> Conversion Rules -> Conversion rules for Elementary data