SAP TB_REF_OBJECT_CHECK Function Module for Check if an Object Number Is Contained in a Reference
TB_REF_OBJECT_CHECK is a standard tb ref object check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Check if an Object Number Is Contained in a Reference 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 tb ref object check FM, simply by entering the name TB_REF_OBJECT_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: TB91
Program Name: SAPLTB91
Main Program: SAPLTB91
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TB_REF_OBJECT_CHECK 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 'TB_REF_OBJECT_CHECK'"Check if an Object Number Is Contained in a Reference.
EXPORTING
* IMP_REFTYP = ' ' "Type of Referencing
IMP_OBJNR = "CO Object Number
* IMP_DZTERM = '00000000' "Fälligkeit/Valuta(nur bei Kompens. erforderlich)
TABLES
* T_REFH = "Tabelle des Ref.Kopf (1 bis n)
* T_REFON = "Tabelle der Objektnummern (mind. 2!)
EXCEPTIONS
REFTYP_UNKNOWN = 1 NO_REFERENCE_FOUND = 2 REF_TYPE_NOT_FOUND = 3 INTERNAL_ERROR = 4
IMPORTING Parameters details for TB_REF_OBJECT_CHECK
IMP_REFTYP - Type of Referencing
Data type: REFON-REFTYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMP_OBJNR - CO Object Number
Data type: REFON-OBJNROptional: No
Call by Reference: No ( called with pass by value option)
IMP_DZTERM - Fälligkeit/Valuta(nur bei Kompens. erforderlich)
Data type: REFH-DZTERMDefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for TB_REF_OBJECT_CHECK
T_REFH - Tabelle des Ref.Kopf (1 bis n)
Data type: REFHOptional: Yes
Call by Reference: No ( called with pass by value option)
T_REFON - Tabelle der Objektnummern (mind. 2!)
Data type: REFONOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
REFTYP_UNKNOWN - Typ ist unbekannt (ATR1 beachten!)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_REFERENCE_FOUND - Objekt ist in keiner Referenz enthalten
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REF_TYPE_NOT_FOUND - Objekt ist in keiner Ref des gen. Typs enthalten
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR - Internal Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TB_REF_OBJECT_CHECK 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: | ||||
| lt_t_refh | TYPE STANDARD TABLE OF REFH, " | |||
| lv_imp_reftyp | TYPE REFON-REFTYP, " SPACE | |||
| lv_reftyp_unknown | TYPE REFON, " | |||
| lt_t_refon | TYPE STANDARD TABLE OF REFON, " | |||
| lv_imp_objnr | TYPE REFON-OBJNR, " | |||
| lv_no_reference_found | TYPE REFON, " | |||
| lv_imp_dzterm | TYPE REFH-DZTERM, " '00000000' | |||
| lv_ref_type_not_found | TYPE REFH, " | |||
| lv_internal_error | TYPE REFH. " |
|   CALL FUNCTION 'TB_REF_OBJECT_CHECK' "Check if an Object Number Is Contained in a Reference |
| EXPORTING | ||
| IMP_REFTYP | = lv_imp_reftyp | |
| IMP_OBJNR | = lv_imp_objnr | |
| IMP_DZTERM | = lv_imp_dzterm | |
| TABLES | ||
| T_REFH | = lt_t_refh | |
| T_REFON | = lt_t_refon | |
| EXCEPTIONS | ||
| REFTYP_UNKNOWN = 1 | ||
| NO_REFERENCE_FOUND = 2 | ||
| REF_TYPE_NOT_FOUND = 3 | ||
| INTERNAL_ERROR = 4 | ||
| . " TB_REF_OBJECT_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM TB_REF_OBJECT_CHECK
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 REFTYP FROM REFON INTO @DATA(ld_imp_reftyp). | ||||
| DATA(ld_imp_reftyp) | = ' '. | |||
| "SELECT single OBJNR FROM REFON INTO @DATA(ld_imp_objnr). | ||||
| "SELECT single DZTERM FROM REFH INTO @DATA(ld_imp_dzterm). | ||||
| DATA(ld_imp_dzterm) | = '00000000'. | |||
Search for further information about these or an SAP related objects