SAP DD_RTOBJ_TO_SOURCE Function Module for Creation of preliminary sources from the nametab
DD_RTOBJ_TO_SOURCE is a standard dd rtobj to source SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Creation of preliminary sources from the nametab 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 rtobj to source FM, simply by entering the name DD_RTOBJ_TO_SOURCE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDB6
Program Name: SAPLSDB6
Main Program: SAPLSDB6
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DD_RTOBJ_TO_SOURCE 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_RTOBJ_TO_SOURCE'"Creation of preliminary sources from the nametab.
EXPORTING
* RTOBJ = "
TABNAME = "
* TARGETNAME = '' "
* WRITE_SOURCE = ' ' "
* PUT_STATE = 'N' "
* REFNAME = '' "
* X030L_WA = "
IMPORTING
DD02V_WA = "
DD06V_WA = "Dummy for DD06V
DD09L_WA = "
TABLES
* DD03P_TAB = "
* DD16V_TAB = "Dummy for DD16V
* X031L_TAB = "
EXCEPTIONS
NAMETAB_NOT_FOUND = 1 WRONG_NAMETAB = 2 CANNOT_WRITE_SOURCE = 3
IMPORTING Parameters details for DD_RTOBJ_TO_SOURCE
RTOBJ -
Data type: DCRTOBDEFOptional: Yes
Call by Reference: No ( called with pass by value option)
TABNAME -
Data type: TICNV-TABNAMEOptional: No
Call by Reference: No ( called with pass by value option)
TARGETNAME -
Data type: TICNV-TABNAMEDefault: ''
Optional: Yes
Call by Reference: No ( called with pass by value option)
WRITE_SOURCE -
Data type: DDREFSTRUC-BOOLDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PUT_STATE -
Data type: DDREFSTRUC-STATEDefault: 'N'
Optional: Yes
Call by Reference: Yes
REFNAME -
Data type: TICNV-TARGETTABDefault: ''
Optional: Yes
Call by Reference: No ( called with pass by value option)
X030L_WA -
Data type: X030LOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DD_RTOBJ_TO_SOURCE
DD02V_WA -
Data type: DD02VOptional: No
Call by Reference: Yes
DD06V_WA - Dummy for DD06V
Data type: DD06VOptional: No
Call by Reference: Yes
DD09L_WA -
Data type: DD09LOptional: No
Call by Reference: Yes
TABLES Parameters details for DD_RTOBJ_TO_SOURCE
DD03P_TAB -
Data type: DD03POptional: Yes
Call by Reference: No ( called with pass by value option)
DD16V_TAB - Dummy for DD16V
Data type: DD16VOptional: Yes
Call by Reference: No ( called with pass by value option)
X031L_TAB -
Data type: X031LOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NAMETAB_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_NAMETAB -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CANNOT_WRITE_SOURCE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DD_RTOBJ_TO_SOURCE 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_rtobj | TYPE DCRTOBDEF, " | |||
| lv_dd02v_wa | TYPE DD02V, " | |||
| lt_dd03p_tab | TYPE STANDARD TABLE OF DD03P, " | |||
| lv_nametab_not_found | TYPE DD03P, " | |||
| lv_tabname | TYPE TICNV-TABNAME, " | |||
| lv_dd06v_wa | TYPE DD06V, " | |||
| lt_dd16v_tab | TYPE STANDARD TABLE OF DD16V, " | |||
| lv_wrong_nametab | TYPE DD16V, " | |||
| lv_dd09l_wa | TYPE DD09L, " | |||
| lt_x031l_tab | TYPE STANDARD TABLE OF X031L, " | |||
| lv_targetname | TYPE TICNV-TABNAME, " '' | |||
| lv_cannot_write_source | TYPE TICNV, " | |||
| lv_write_source | TYPE DDREFSTRUC-BOOL, " ' ' | |||
| lv_put_state | TYPE DDREFSTRUC-STATE, " 'N' | |||
| lv_refname | TYPE TICNV-TARGETTAB, " '' | |||
| lv_x030l_wa | TYPE X030L. " |
|   CALL FUNCTION 'DD_RTOBJ_TO_SOURCE' "Creation of preliminary sources from the nametab |
| EXPORTING | ||
| RTOBJ | = lv_rtobj | |
| TABNAME | = lv_tabname | |
| TARGETNAME | = lv_targetname | |
| WRITE_SOURCE | = lv_write_source | |
| PUT_STATE | = lv_put_state | |
| REFNAME | = lv_refname | |
| X030L_WA | = lv_x030l_wa | |
| IMPORTING | ||
| DD02V_WA | = lv_dd02v_wa | |
| DD06V_WA | = lv_dd06v_wa | |
| DD09L_WA | = lv_dd09l_wa | |
| TABLES | ||
| DD03P_TAB | = lt_dd03p_tab | |
| DD16V_TAB | = lt_dd16v_tab | |
| X031L_TAB | = lt_x031l_tab | |
| EXCEPTIONS | ||
| NAMETAB_NOT_FOUND = 1 | ||
| WRONG_NAMETAB = 2 | ||
| CANNOT_WRITE_SOURCE = 3 | ||
| . " DD_RTOBJ_TO_SOURCE | ||
ABAP code using 7.40 inline data declarations to call FM DD_RTOBJ_TO_SOURCE
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 TABNAME FROM TICNV INTO @DATA(ld_tabname). | ||||
| "SELECT single TABNAME FROM TICNV INTO @DATA(ld_targetname). | ||||
| DATA(ld_targetname) | = ''. | |||
| "SELECT single BOOL FROM DDREFSTRUC INTO @DATA(ld_write_source). | ||||
| DATA(ld_write_source) | = ' '. | |||
| "SELECT single STATE FROM DDREFSTRUC INTO @DATA(ld_put_state). | ||||
| DATA(ld_put_state) | = 'N'. | |||
| "SELECT single TARGETTAB FROM TICNV INTO @DATA(ld_refname). | ||||
| DATA(ld_refname) | = ''. | |||
Search for further information about these or an SAP related objects