SAP CO_ZF_ORDER_UNIT_CONVERSION Function Module for NOTRANSL: Auftragskopf: Umrechnung von einer Mengeneinheit in eine andere
CO_ZF_ORDER_UNIT_CONVERSION is a standard co zf order unit conversion SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Auftragskopf: Umrechnung von einer Mengeneinheit in eine andere processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for co zf order unit conversion FM, simply by entering the name CO_ZF_ORDER_UNIT_CONVERSION into the relevant SAP transaction such as SE37 or SE38.
Function Group: COZF
Program Name: SAPLCOZF
Main Program: SAPLCOZF
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CO_ZF_ORDER_UNIT_CONVERSION pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'CO_ZF_ORDER_UNIT_CONVERSION'"NOTRANSL: Auftragskopf: Umrechnung von einer Mengeneinheit in eine andere.
EXPORTING
UNIT_IN = "
* QUANTITY_IN = "
* UNIT_OUT = "
* I_AUFNR = "
* I_CAUFVD = "
* I_AFPOD = "
* FLG_PROD_UNIT_CHANGED = ' ' "
* I_POSNR = 0001 "Number of Order Item
* I_CHARGE = "Batch Number
IMPORTING
QUANTITY_OUT = "
UMREN_OUT = "
UMREZ_OUT = "
FLG_MATERIAL_READ = "
UNIT_OUT = "
EXCEPTIONS
NO_AUFNR = 1 WRONG_AUFNR = 2 NOT_CONVERTABLE = 3 NO_UNIT_IN = 4 NO_UNIT_OUT = 5 NO_PLANT = 6 MATERIAL_NOT_FOUND = 7
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLCOZF_001 Customer Exits in Function Group COZF
EXIT_SAPLCOZF_002 Customer Exits in Function Group COZF
EXIT_SAPLCOZF_003 Exit for Predefining Fields in the Order Header
IMPORTING Parameters details for CO_ZF_ORDER_UNIT_CONVERSION
UNIT_IN -
Data type: CAUFVD-GMEINOptional: No
Call by Reference: No ( called with pass by value option)
QUANTITY_IN -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
UNIT_OUT -
Data type: CAUFVD-GMEINOptional: Yes
Call by Reference: No ( called with pass by value option)
I_AUFNR -
Data type: CAUFVD-AUFNROptional: Yes
Call by Reference: No ( called with pass by value option)
I_CAUFVD -
Data type: CAUFVDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_AFPOD -
Data type: AFPODOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_PROD_UNIT_CHANGED -
Data type: CDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_POSNR - Number of Order Item
Data type: AFPOD-POSNRDefault: 0001
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CHARGE - Batch Number
Data type: RESBD-CHARGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CO_ZF_ORDER_UNIT_CONVERSION
QUANTITY_OUT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UMREN_OUT -
Data type: AFPOD-UMRENOptional: No
Call by Reference: No ( called with pass by value option)
UMREZ_OUT -
Data type: AFPOD-UMREZOptional: No
Call by Reference: No ( called with pass by value option)
FLG_MATERIAL_READ -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
UNIT_OUT -
Data type: CAUFVD-GMEINOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_AUFNR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_AUFNR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_CONVERTABLE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_UNIT_IN -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_UNIT_OUT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_PLANT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MATERIAL_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CO_ZF_ORDER_UNIT_CONVERSION Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_unit_in | TYPE CAUFVD-GMEIN, " | |||
| lv_no_aufnr | TYPE CAUFVD, " | |||
| lv_quantity_out | TYPE CAUFVD, " | |||
| lv_umren_out | TYPE AFPOD-UMREN, " | |||
| lv_quantity_in | TYPE AFPOD, " | |||
| lv_wrong_aufnr | TYPE AFPOD, " | |||
| lv_unit_out | TYPE CAUFVD-GMEIN, " | |||
| lv_umrez_out | TYPE AFPOD-UMREZ, " | |||
| lv_not_convertable | TYPE AFPOD, " | |||
| lv_i_aufnr | TYPE CAUFVD-AUFNR, " | |||
| lv_no_unit_in | TYPE CAUFVD, " | |||
| lv_flg_material_read | TYPE C, " | |||
| lv_i_caufvd | TYPE CAUFVD, " | |||
| lv_unit_out | TYPE CAUFVD-GMEIN, " | |||
| lv_no_unit_out | TYPE CAUFVD, " | |||
| lv_i_afpod | TYPE AFPOD, " | |||
| lv_no_plant | TYPE AFPOD, " | |||
| lv_material_not_found | TYPE AFPOD, " | |||
| lv_flg_prod_unit_changed | TYPE C, " ' ' | |||
| lv_i_posnr | TYPE AFPOD-POSNR, " 0001 | |||
| lv_i_charge | TYPE RESBD-CHARG. " |
|   CALL FUNCTION 'CO_ZF_ORDER_UNIT_CONVERSION' "NOTRANSL: Auftragskopf: Umrechnung von einer Mengeneinheit in eine andere |
| EXPORTING | ||
| UNIT_IN | = lv_unit_in | |
| QUANTITY_IN | = lv_quantity_in | |
| UNIT_OUT | = lv_unit_out | |
| I_AUFNR | = lv_i_aufnr | |
| I_CAUFVD | = lv_i_caufvd | |
| I_AFPOD | = lv_i_afpod | |
| FLG_PROD_UNIT_CHANGED | = lv_flg_prod_unit_changed | |
| I_POSNR | = lv_i_posnr | |
| I_CHARGE | = lv_i_charge | |
| IMPORTING | ||
| QUANTITY_OUT | = lv_quantity_out | |
| UMREN_OUT | = lv_umren_out | |
| UMREZ_OUT | = lv_umrez_out | |
| FLG_MATERIAL_READ | = lv_flg_material_read | |
| UNIT_OUT | = lv_unit_out | |
| EXCEPTIONS | ||
| NO_AUFNR = 1 | ||
| WRONG_AUFNR = 2 | ||
| NOT_CONVERTABLE = 3 | ||
| NO_UNIT_IN = 4 | ||
| NO_UNIT_OUT = 5 | ||
| NO_PLANT = 6 | ||
| MATERIAL_NOT_FOUND = 7 | ||
| . " CO_ZF_ORDER_UNIT_CONVERSION | ||
ABAP code using 7.40 inline data declarations to call FM CO_ZF_ORDER_UNIT_CONVERSION
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single GMEIN FROM CAUFVD INTO @DATA(ld_unit_in). | ||||
| "SELECT single UMREN FROM AFPOD INTO @DATA(ld_umren_out). | ||||
| "SELECT single GMEIN FROM CAUFVD INTO @DATA(ld_unit_out). | ||||
| "SELECT single UMREZ FROM AFPOD INTO @DATA(ld_umrez_out). | ||||
| "SELECT single AUFNR FROM CAUFVD INTO @DATA(ld_i_aufnr). | ||||
| "SELECT single GMEIN FROM CAUFVD INTO @DATA(ld_unit_out). | ||||
| DATA(ld_flg_prod_unit_changed) | = ' '. | |||
| "SELECT single POSNR FROM AFPOD INTO @DATA(ld_i_posnr). | ||||
| DATA(ld_i_posnr) | = 0001. | |||
| "SELECT single CHARG FROM RESBD INTO @DATA(ld_i_charge). | ||||
Search for further information about these or an SAP related objects