Skip to Content
Jan 03, 2019 at 07:18 AM

Function Module to convert base quantity to the nearest order unit for a material

723 Views Last edit Jan 03, 2019 at 07:20 AM 2 rev

Dear Folks,

I have created a program to create PR, which uses the 'BAPI_REQUISITION_CREATE'. My requirement is the BAPI should take care of the quantity conversion like how standard ME51 behave.

For example, a material ABC with 'EA' as base UOM and 'BOX' as Order Unit. and.

Quantity conversion is maintanied as One Box = 28 EA.

When the material ABC is entered in ME51N with the quantity as 2. System automatically convert the quantity to 28 (rounding of nearest Order Unit) while creating PR. But bapi 'BAPI_REQUISITION_CREATE' is not taking care of this unit conversion to the nearest order Unit. If I input 2 as the quantity to the BAPI, it is creating PR with 2 EA instead of 28 EA. Do we need to pass any parameters to the BAPI or is there any function module to converted the entered quantity to the nearest order unit for a material? Please suggest.

I have already searched SDN, but coudln't able to find proper solution unless I have to do it manually.

Thanks in advance