SAP MD_CREATE_SORT Function Module for
MD_CREATE_SORT is a standard md create sort SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 md create sort FM, simply by entering the name MD_CREATE_SORT into the relevant SAP transaction such as SE37 or SE38.
Function Group: M61K
Program Name: SAPLM61K
Main Program: SAPLM61K
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MD_CREATE_SORT 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 'MD_CREATE_SORT'".
EXPORTING
ESNAME = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* EBUILD = ' ' "DE-EN-LANG-SWITCH-NO-TRANSLATION
* ECALLT = "
* EAPPLI = "
* EGRPFL = ' ' "
IMPORTING
IPNAME = "DE-EN-LANG-SWITCH-NO-TRANSLATION
IFCODE = "DE-EN-LANG-SWITCH-NO-TRANSLATION
TABLES
SORTX = "DE-EN-LANG-SWITCH-NO-TRANSLATION
EXCEPTIONS
ERROR = 1
IMPORTING Parameters details for MD_CREATE_SORT
ESNAME - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: MDSORT-TNAMEOptional: No
Call by Reference: No ( called with pass by value option)
EBUILD - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ECALLT -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
EAPPLI -
Data type: CHAR4Optional: Yes
Call by Reference: No ( called with pass by value option)
EGRPFL -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MD_CREATE_SORT
IPNAME - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: RS38M-PROGRAMMOptional: No
Call by Reference: No ( called with pass by value option)
IFCODE - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: RM61M-FCODEOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MD_CREATE_SORT
SORTX - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: MDSORTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MD_CREATE_SORT 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_error | TYPE STRING, " | |||
| lt_sortx | TYPE STANDARD TABLE OF MDSORT, " | |||
| lv_esname | TYPE MDSORT-TNAME, " | |||
| lv_ipname | TYPE RS38M-PROGRAMM, " | |||
| lv_ebuild | TYPE RS38M, " SPACE | |||
| lv_ifcode | TYPE RM61M-FCODE, " | |||
| lv_ecallt | TYPE RM61M, " | |||
| lv_eappli | TYPE CHAR4, " | |||
| lv_egrpfl | TYPE CHAR4. " SPACE |
|   CALL FUNCTION 'MD_CREATE_SORT' " |
| EXPORTING | ||
| ESNAME | = lv_esname | |
| EBUILD | = lv_ebuild | |
| ECALLT | = lv_ecallt | |
| EAPPLI | = lv_eappli | |
| EGRPFL | = lv_egrpfl | |
| IMPORTING | ||
| IPNAME | = lv_ipname | |
| IFCODE | = lv_ifcode | |
| TABLES | ||
| SORTX | = lt_sortx | |
| EXCEPTIONS | ||
| ERROR = 1 | ||
| . " MD_CREATE_SORT | ||
ABAP code using 7.40 inline data declarations to call FM MD_CREATE_SORT
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 TNAME FROM MDSORT INTO @DATA(ld_esname). | ||||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_ipname). | ||||
| DATA(ld_ebuild) | = ' '. | |||
| "SELECT single FCODE FROM RM61M INTO @DATA(ld_ifcode). | ||||
| DATA(ld_egrpfl) | = ' '. | |||
Search for further information about these or an SAP related objects