SAP OIH_GET_ITEM_DATA_MATDOC Function Module for Get TDP data from material document item









OIH_GET_ITEM_DATA_MATDOC is a standard oih get item data matdoc SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Get TDP data from material document item 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 oih get item data matdoc FM, simply by entering the name OIH_GET_ITEM_DATA_MATDOC into the relevant SAP transaction such as SE37 or SE38.

Function Group: OIH_EXCISE_DUTY
Program Name: SAPLOIH_EXCISE_DUTY
Main Program: SAPLOIH_EXCISE_DUTY
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function OIH_GET_ITEM_DATA_MATDOC 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 'OIH_GET_ITEM_DATA_MATDOC'"Get TDP data from material document item
EXPORTING
I_MATDOC_NO = "Number of material document
I_MATDOC_YEAR = "Material doc. year
I_MATDOC_ITEM = "Item in material document

IMPORTING
E_TDP_DATA = "Structure with display TDP fields for goods movement

EXCEPTIONS
E_MISSING_MANDATORY_PARAM = 1 E_MATERIAL_DOC_NOT_FOUND = 2 E_MATERIAL_DOC_ITEM_NOT_FOUND = 3
.



IMPORTING Parameters details for OIH_GET_ITEM_DATA_MATDOC

I_MATDOC_NO - Number of material document

Data type: MSEG-MBLNR
Optional: No
Call by Reference: No ( called with pass by value option)

I_MATDOC_YEAR - Material doc. year

Data type: MSEG-MJAHR
Optional: No
Call by Reference: No ( called with pass by value option)

I_MATDOC_ITEM - Item in material document

Data type: MSEG-ZEILE
Optional: No
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for OIH_GET_ITEM_DATA_MATDOC

E_TDP_DATA - Structure with display TDP fields for goods movement

Data type: OIH_S_GOITEM_TDP
Optional: No
Call by Reference: Yes

EXCEPTIONS details

E_MISSING_MANDATORY_PARAM - Null input parameter

Data type:
Optional: No
Call by Reference: Yes

E_MATERIAL_DOC_NOT_FOUND - Material document does not exist

Data type:
Optional: No
Call by Reference: Yes

E_MATERIAL_DOC_ITEM_NOT_FOUND - No such item in material document

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for OIH_GET_ITEM_DATA_MATDOC 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_tdp_data  TYPE OIH_S_GOITEM_TDP, "   
lv_i_matdoc_no  TYPE MSEG-MBLNR, "   
lv_e_missing_mandatory_param  TYPE MSEG, "   
lv_i_matdoc_year  TYPE MSEG-MJAHR, "   
lv_e_material_doc_not_found  TYPE MSEG, "   
lv_i_matdoc_item  TYPE MSEG-ZEILE, "   
lv_e_material_doc_item_not_found  TYPE MSEG. "   

  CALL FUNCTION 'OIH_GET_ITEM_DATA_MATDOC'  "Get TDP data from material document item
    EXPORTING
         I_MATDOC_NO = lv_i_matdoc_no
         I_MATDOC_YEAR = lv_i_matdoc_year
         I_MATDOC_ITEM = lv_i_matdoc_item
    IMPORTING
         E_TDP_DATA = lv_e_tdp_data
    EXCEPTIONS
        E_MISSING_MANDATORY_PARAM = 1
        E_MATERIAL_DOC_NOT_FOUND = 2
        E_MATERIAL_DOC_ITEM_NOT_FOUND = 3
. " OIH_GET_ITEM_DATA_MATDOC




ABAP code using 7.40 inline data declarations to call FM OIH_GET_ITEM_DATA_MATDOC

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 MBLNR FROM MSEG INTO @DATA(ld_i_matdoc_no).
 
 
"SELECT single MJAHR FROM MSEG INTO @DATA(ld_i_matdoc_year).
 
 
"SELECT single ZEILE FROM MSEG INTO @DATA(ld_i_matdoc_item).
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!