on 09-16-2016 1:29 AM
Hi,
Is there any standard function module in SAP EWM system to calculate check digit for SSCC (EAN 128). i am aware of the logic behind the calculation but why to re-invent the wheel if it exist already.
The logic to calculate:
(00)00872150999000002
Disregard the application identifier:
(00)
The UCC SSCC barcode uses a function code 1. Therefore, 1 is the first digit in the string to evaluate.
Therefore, the string to evaluate is:
100872150999000002
Let me know if anyone is aware of standard FM to do the task for me
i wrote an FM for this as i couldnot find any standard FMs.
DATA: length TYPE i.
DATA: lv_temp TYPE n,
lv_sum_first TYPE int4,
lv_sum_second TYPE int4,
lv_final_res TYPE int4.
DATA: work_string(50) TYPE c.
DATA: lv_first TYPE int4 VALUE 1,
lv_second TYPE int4 VALUE 2.
work_string = iv_number.
length = strlen( work_string ).
SHIFT work_string LEFT DELETING LEADING space.
DO length TIMES.
WRITE work_string+lv_first(1) TO lv_temp.
lv_sum_first = lv_sum_first + lv_temp.
WRITE work_string+lv_second(1) TO lv_temp.
lv_sum_second = lv_sum_second + lv_temp.
lv_first = lv_first + 2.
lv_second = lv_second + 2.
ENDDO.
lv_final_res = ( lv_sum_first * 3 ) + lv_sum_second.
*Logic to calculate the smallest number to add the the final result
*which is a multiple of 10
lv_final_res = 10 - ( lv_final_res MOD 10 ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.