SAP OIU_UOM Function Module for Gets Unit of Measure
OIU_UOM is a standard oiu uom SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Gets Unit of Measure 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 oiu uom FM, simply by entering the name OIU_UOM into the relevant SAP transaction such as SE37 or SE38.
Function Group: OIU_COMMON_SB
Program Name: SAPLOIU_COMMON_SB
Main Program: SAPLOIU_COMMON_SB
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function OIU_UOM 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 'OIU_UOM'"Gets Unit of Measure.
EXPORTING
I_DN_NO = "Delivery network number
I_DATE = "Effective From Date
I_MAJPD_CD = "Major Product Code
I_DIMID = "Dimension key
* I_MATNR = "Production Material
IMPORTING
E_MSEHI = "Unit of Measure
IMPORTING Parameters details for OIU_UOM
I_DN_NO - Delivery network number
Data type: OIU_PR_DN-DN_NOOptional: No
Call by Reference: No ( called with pass by value option)
I_DATE - Effective From Date
Data type: OIU_PR_DNVD-EFF_FROM_DTOptional: No
Call by Reference: No ( called with pass by value option)
I_MAJPD_CD - Major Product Code
Data type: OIU_PR_DN_UOMG-MAJPD_CDOptional: No
Call by Reference: No ( called with pass by value option)
I_DIMID - Dimension key
Data type: T006-DIMIDOptional: No
Call by Reference: No ( called with pass by value option)
I_MATNR - Production Material
Data type: OIU_PR_DN_UOMG-MATNROptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for OIU_UOM
E_MSEHI - Unit of Measure
Data type: OIB05-MSEHIOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for OIU_UOM 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_e_msehi | TYPE OIB05-MSEHI, " | |||
| lv_i_dn_no | TYPE OIU_PR_DN-DN_NO, " | |||
| lv_i_date | TYPE OIU_PR_DNVD-EFF_FROM_DT, " | |||
| lv_i_majpd_cd | TYPE OIU_PR_DN_UOMG-MAJPD_CD, " | |||
| lv_i_dimid | TYPE T006-DIMID, " | |||
| lv_i_matnr | TYPE OIU_PR_DN_UOMG-MATNR. " |
|   CALL FUNCTION 'OIU_UOM' "Gets Unit of Measure |
| EXPORTING | ||
| I_DN_NO | = lv_i_dn_no | |
| I_DATE | = lv_i_date | |
| I_MAJPD_CD | = lv_i_majpd_cd | |
| I_DIMID | = lv_i_dimid | |
| I_MATNR | = lv_i_matnr | |
| IMPORTING | ||
| E_MSEHI | = lv_e_msehi | |
| . " OIU_UOM | ||
ABAP code using 7.40 inline data declarations to call FM OIU_UOM
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 MSEHI FROM OIB05 INTO @DATA(ld_e_msehi). | ||||
| "SELECT single DN_NO FROM OIU_PR_DN INTO @DATA(ld_i_dn_no). | ||||
| "SELECT single EFF_FROM_DT FROM OIU_PR_DNVD INTO @DATA(ld_i_date). | ||||
| "SELECT single MAJPD_CD FROM OIU_PR_DN_UOMG INTO @DATA(ld_i_majpd_cd). | ||||
| "SELECT single DIMID FROM T006 INTO @DATA(ld_i_dimid). | ||||
| "SELECT single MATNR FROM OIU_PR_DN_UOMG INTO @DATA(ld_i_matnr). | ||||
Search for further information about these or an SAP related objects