SAP OIB2_TD_QUANTITY_GET Function Module for Read quantity from appendage or calculate for 'new' unit of measure
OIB2_TD_QUANTITY_GET is a standard oib2 td quantity get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read quantity from appendage or calculate for 'new' 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 oib2 td quantity get FM, simply by entering the name OIB2_TD_QUANTITY_GET into the relevant SAP transaction such as SE37 or SE38.
Function Group: OIB_MM
Program Name: SAPLOIB_MM
Main Program: SAPLOIB_MM
Appliation area: V
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function OIB2_TD_QUANTITY_GET 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 'OIB2_TD_QUANTITY_GET'"Read quantity from appendage or calculate for 'new' unit of measure.
EXPORTING
I_MSEHI = "
I_OIGSVMQ = "
I_DATE = "
* I_VLUOM = "
* I_TIME = "Dat and time, current application server time
* I_SET = "Activity category in SAP transaction
* I_MAT_ITM_OLD = "TD material item sequence number
* I_HPM_ITM_OLD = "Sequence number for HPM segments
CHANGING
E_ADQNT = "Additional oil/gas quantity
EXCEPTIONS
MISSING_QTY = 1
IMPORTING Parameters details for OIB2_TD_QUANTITY_GET
I_MSEHI -
Data type: OIGSVMQO2-MSEHIOptional: No
Call by Reference: No ( called with pass by value option)
I_OIGSVMQ -
Data type: ROIGSVMQOptional: No
Call by Reference: No ( called with pass by value option)
I_DATE -
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
I_VLUOM -
Data type: OIGS-VOL_UOMOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TIME - Dat and time, current application server time
Data type: SY-UZEITOptional: Yes
Call by Reference: No ( called with pass by value option)
I_SET - Activity category in SAP transaction
Data type: T180-AKTYPOptional: Yes
Call by Reference: Yes
I_MAT_ITM_OLD - TD material item sequence number
Data type: OIGSM-MAT_ITMOptional: Yes
Call by Reference: Yes
I_HPM_ITM_OLD - Sequence number for HPM segments
Data type: OIGSM-HPM_ITMOptional: Yes
Call by Reference: Yes
CHANGING Parameters details for OIB2_TD_QUANTITY_GET
E_ADQNT - Additional oil/gas quantity
Data type: OIGSVMQO2-ADQNTOptional: No
Call by Reference: Yes
EXCEPTIONS details
MISSING_QTY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for OIB2_TD_QUANTITY_GET 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_adqnt | TYPE OIGSVMQO2-ADQNT, " | |||
| lv_i_msehi | TYPE OIGSVMQO2-MSEHI, " | |||
| lv_missing_qty | TYPE OIGSVMQO2, " | |||
| lv_i_oigsvmq | TYPE ROIGSVMQ, " | |||
| lv_i_date | TYPE SY-DATUM, " | |||
| lv_i_vluom | TYPE OIGS-VOL_UOM, " | |||
| lv_i_time | TYPE SY-UZEIT, " | |||
| lv_i_set | TYPE T180-AKTYP, " | |||
| lv_i_mat_itm_old | TYPE OIGSM-MAT_ITM, " | |||
| lv_i_hpm_itm_old | TYPE OIGSM-HPM_ITM. " |
|   CALL FUNCTION 'OIB2_TD_QUANTITY_GET' "Read quantity from appendage or calculate for 'new' unit of measure |
| EXPORTING | ||
| I_MSEHI | = lv_i_msehi | |
| I_OIGSVMQ | = lv_i_oigsvmq | |
| I_DATE | = lv_i_date | |
| I_VLUOM | = lv_i_vluom | |
| I_TIME | = lv_i_time | |
| I_SET | = lv_i_set | |
| I_MAT_ITM_OLD | = lv_i_mat_itm_old | |
| I_HPM_ITM_OLD | = lv_i_hpm_itm_old | |
| CHANGING | ||
| E_ADQNT | = lv_e_adqnt | |
| EXCEPTIONS | ||
| MISSING_QTY = 1 | ||
| . " OIB2_TD_QUANTITY_GET | ||
ABAP code using 7.40 inline data declarations to call FM OIB2_TD_QUANTITY_GET
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 ADQNT FROM OIGSVMQO2 INTO @DATA(ld_e_adqnt). | ||||
| "SELECT single MSEHI FROM OIGSVMQO2 INTO @DATA(ld_i_msehi). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_i_date). | ||||
| "SELECT single VOL_UOM FROM OIGS INTO @DATA(ld_i_vluom). | ||||
| "SELECT single UZEIT FROM SY INTO @DATA(ld_i_time). | ||||
| "SELECT single AKTYP FROM T180 INTO @DATA(ld_i_set). | ||||
| "SELECT single MAT_ITM FROM OIGSM INTO @DATA(ld_i_mat_itm_old). | ||||
| "SELECT single HPM_ITM FROM OIGSM INTO @DATA(ld_i_hpm_itm_old). | ||||
Search for further information about these or an SAP related objects