on 11-19-2008 6:07 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijaya,
You can convert your Num to String and then you can compare it. You can do it by string Functions.
Regards
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And you can also find the document at ABAPDOCU
ABAP - Key word documentation -> ABAP - BY Theme -> Assignments -> Conversion Rules -> Conversion rules for Elementary data
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.