SAP DD_GET_NAMETAB Function Module for Reading the active / inactive nametab in X030L, X031L structure.
DD_GET_NAMETAB is a standard dd get nametab SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Reading the active / inactive nametab in X030L, X031L structure. 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 dd get nametab FM, simply by entering the name DD_GET_NAMETAB into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDNT
Program Name: SAPLSDNT
Main Program: SAPLSDNT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DD_GET_NAMETAB 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 'DD_GET_NAMETAB'"Reading the active / inactive nametab in X030L, X031L structure..
EXPORTING
* STATUS = 'A' "A: Read active NT, N: Read inactive, M: Latest
TABNAME = "Table name
* GET_ALL = ' ' "
IMPORTING
F_STATUS = "
R_MODEFLAG = "Mode flag if read inactive
R_STATUS = "read version (N/A)
X030L_WA = "Nametab header
TABLES
X031L_TAB = "Nametab fields
EXCEPTIONS
NOT_FOUND = 1 NO_FIELDS = 2
IMPORTING Parameters details for DD_GET_NAMETAB
STATUS - A: Read active NT, N: Read inactive, M: Latest
Data type: DD02L-AS4LOCALDefault: 'A'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABNAME - Table name
Data type: DD02L-TABNAMEOptional: No
Call by Reference: No ( called with pass by value option)
GET_ALL -
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DD_GET_NAMETAB
F_STATUS -
Data type: DD02L-AS4LOCALOptional: No
Call by Reference: No ( called with pass by value option)
R_MODEFLAG - Mode flag if read inactive
Data type: DDXTF-MODEFLAGOptional: No
Call by Reference: No ( called with pass by value option)
R_STATUS - read version (N/A)
Data type: DD02L-AS4LOCALOptional: No
Call by Reference: No ( called with pass by value option)
X030L_WA - Nametab header
Data type: X030LOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for DD_GET_NAMETAB
X031L_TAB - Nametab fields
Data type: X031LOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND - No header of the specified status is available
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_FIELDS - No fields of the specified status are available
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DD_GET_NAMETAB 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_status | TYPE DD02L-AS4LOCAL, " 'A' | |||
| lv_f_status | TYPE DD02L-AS4LOCAL, " | |||
| lv_not_found | TYPE DD02L, " | |||
| lt_x031l_tab | TYPE STANDARD TABLE OF X031L, " | |||
| lv_tabname | TYPE DD02L-TABNAME, " | |||
| lv_no_fields | TYPE DD02L, " | |||
| lv_r_modeflag | TYPE DDXTF-MODEFLAG, " | |||
| lv_get_all | TYPE DDXTF, " ' ' | |||
| lv_r_status | TYPE DD02L-AS4LOCAL, " | |||
| lv_x030l_wa | TYPE X030L. " |
|   CALL FUNCTION 'DD_GET_NAMETAB' "Reading the active / inactive nametab in X030L, X031L structure. |
| EXPORTING | ||
| STATUS | = lv_status | |
| TABNAME | = lv_tabname | |
| GET_ALL | = lv_get_all | |
| IMPORTING | ||
| F_STATUS | = lv_f_status | |
| R_MODEFLAG | = lv_r_modeflag | |
| R_STATUS | = lv_r_status | |
| X030L_WA | = lv_x030l_wa | |
| TABLES | ||
| X031L_TAB | = lt_x031l_tab | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| NO_FIELDS = 2 | ||
| . " DD_GET_NAMETAB | ||
ABAP code using 7.40 inline data declarations to call FM DD_GET_NAMETAB
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 AS4LOCAL FROM DD02L INTO @DATA(ld_status). | ||||
| DATA(ld_status) | = 'A'. | |||
| "SELECT single AS4LOCAL FROM DD02L INTO @DATA(ld_f_status). | ||||
| "SELECT single TABNAME FROM DD02L INTO @DATA(ld_tabname). | ||||
| "SELECT single MODEFLAG FROM DDXTF INTO @DATA(ld_r_modeflag). | ||||
| DATA(ld_get_all) | = ' '. | |||
| "SELECT single AS4LOCAL FROM DD02L INTO @DATA(ld_r_status). | ||||
Search for further information about these or an SAP related objects