SAP TB_REF_REFERENCE_CREATE_GUI Function Module for Send Screen (Dialog Box/Full Screen) to Enter REFTYP/REFNR Etc.
TB_REF_REFERENCE_CREATE_GUI is a standard tb ref reference create gui SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Send Screen (Dialog Box/Full Screen) to Enter REFTYP/REFNR Etc. 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 reference create gui FM, simply by entering the name TB_REF_REFERENCE_CREATE_GUI 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_REFERENCE_CREATE_GUI 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_REFERENCE_CREATE_GUI'"Send Screen (Dialog Box/Full Screen) to Enter REFTYP/REFNR Etc..
EXPORTING
* IMP_REFTYP = ' ' "Typ der Referenzierung(hat Prio vor REFH!)
* IMP_REFNR = ' ' "Nr der Referenzierung
* IMP_BUKRS = ' ' "Company Code
* IMP_RFHA = ' ' "Transaction
* IMP_DZTERM = '00000000' "Val.date
* FLG_POPUP = ' ' "Entry-Screen als Popup('X') oder Fullscreen ('')
IMPORTING
EXP_CH = "erweiterter Ref.Kopf als Struktur
EXP_CP = "erweiterte Ref.Pos als Struktur(wg. RFHA ua.)
EXP_OK = "OKCODE (' '= Weiter, else CNCL=Abbruch)
TABLES
T_REFH = "Tabelle Ref.Kopf
T_REFON = "Tabelle Ref.Position
EXCEPTIONS
INTERNAL_ERROR = 1
IMPORTING Parameters details for TB_REF_REFERENCE_CREATE_GUI
IMP_REFTYP - Typ der Referenzierung(hat Prio vor REFH!)
Data type: REFH-REFTYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMP_REFNR - Nr der Referenzierung
Data type: REFH-REFNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMP_BUKRS - Company Code
Data type: VTBFHA-BUKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMP_RFHA - Transaction
Data type: VTBFHA-RFHADefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMP_DZTERM - Val.date
Data type: VTBFHAPO-DZTERMDefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_POPUP - Entry-Screen als Popup('X') oder Fullscreen ('')
Data type: TBREF_BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TB_REF_REFERENCE_CREATE_GUI
EXP_CH - erweiterter Ref.Kopf als Struktur
Data type: VTB_CHOptional: No
Call by Reference: Yes
EXP_CP - erweiterte Ref.Pos als Struktur(wg. RFHA ua.)
Data type: VTB_CPOptional: No
Call by Reference: Yes
EXP_OK - OKCODE (SPACE= Weiter, else CNCL=Abbruch)
Data type: SY-TCODEOptional: No
Call by Reference: Yes
TABLES Parameters details for TB_REF_REFERENCE_CREATE_GUI
T_REFH - Tabelle Ref.Kopf
Data type: REFHOptional: No
Call by Reference: No ( called with pass by value option)
T_REFON - Tabelle Ref.Position
Data type: REFONOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
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_REFERENCE_CREATE_GUI 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_exp_ch | TYPE VTB_CH, " | |||
| lt_t_refh | TYPE STANDARD TABLE OF REFH, " | |||
| lv_imp_reftyp | TYPE REFH-REFTYP, " SPACE | |||
| lv_internal_error | TYPE REFH, " | |||
| lv_exp_cp | TYPE VTB_CP, " | |||
| lt_t_refon | TYPE STANDARD TABLE OF REFON, " | |||
| lv_imp_refnr | TYPE REFH-REFNR, " SPACE | |||
| lv_exp_ok | TYPE SY-TCODE, " | |||
| lv_imp_bukrs | TYPE VTBFHA-BUKRS, " SPACE | |||
| lv_imp_rfha | TYPE VTBFHA-RFHA, " SPACE | |||
| lv_imp_dzterm | TYPE VTBFHAPO-DZTERM, " '00000000' | |||
| lv_flg_popup | TYPE TBREF_BOOLE. " SPACE |
|   CALL FUNCTION 'TB_REF_REFERENCE_CREATE_GUI' "Send Screen (Dialog Box/Full Screen) to Enter REFTYP/REFNR Etc. |
| EXPORTING | ||
| IMP_REFTYP | = lv_imp_reftyp | |
| IMP_REFNR | = lv_imp_refnr | |
| IMP_BUKRS | = lv_imp_bukrs | |
| IMP_RFHA | = lv_imp_rfha | |
| IMP_DZTERM | = lv_imp_dzterm | |
| FLG_POPUP | = lv_flg_popup | |
| IMPORTING | ||
| EXP_CH | = lv_exp_ch | |
| EXP_CP | = lv_exp_cp | |
| EXP_OK | = lv_exp_ok | |
| TABLES | ||
| T_REFH | = lt_t_refh | |
| T_REFON | = lt_t_refon | |
| EXCEPTIONS | ||
| INTERNAL_ERROR = 1 | ||
| . " TB_REF_REFERENCE_CREATE_GUI | ||
ABAP code using 7.40 inline data declarations to call FM TB_REF_REFERENCE_CREATE_GUI
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 REFH INTO @DATA(ld_imp_reftyp). | ||||
| DATA(ld_imp_reftyp) | = ' '. | |||
| "SELECT single REFNR FROM REFH INTO @DATA(ld_imp_refnr). | ||||
| DATA(ld_imp_refnr) | = ' '. | |||
| "SELECT single TCODE FROM SY INTO @DATA(ld_exp_ok). | ||||
| "SELECT single BUKRS FROM VTBFHA INTO @DATA(ld_imp_bukrs). | ||||
| DATA(ld_imp_bukrs) | = ' '. | |||
| "SELECT single RFHA FROM VTBFHA INTO @DATA(ld_imp_rfha). | ||||
| DATA(ld_imp_rfha) | = ' '. | |||
| "SELECT single DZTERM FROM VTBFHAPO INTO @DATA(ld_imp_dzterm). | ||||
| DATA(ld_imp_dzterm) | = '00000000'. | |||
| DATA(ld_flg_popup) | = ' '. | |||
Search for further information about these or an SAP related objects