SAP SCSM_CONTEXTS_FOR_SYSTEM Function Module for
SCSM_CONTEXTS_FOR_SYSTEM is a standard scsm contexts for system 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 scsm contexts for system FM, simply by entering the name SCSM_CONTEXTS_FOR_SYSTEM into the relevant SAP transaction such as SE37 or SE38.
Function Group: SCSMROUTE
Program Name: SAPLSCSMROUTE
Main Program: SAPLSCSMROUTE
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SCSM_CONTEXTS_FOR_SYSTEM 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 'SCSM_CONTEXTS_FOR_SYSTEM'".
EXPORTING
* ALSYSTEM = "Name of SAP R/3 System
* CSMSYSID = "
* ROUTES_BY_COMMTYPE = AL_CSM_CTYPE_HIGHPRIO "
* USE_CACHE = 'X' "
* FILL_CACHE = 'X' "
* DO_NOT_PING_SYSTEM = ' ' "Alert: SALC: Flag (X) if only local input for function call
* MTE_CLASS_PATTERN = ' ' "
IMPORTING
SYSTEM_CTX_AND_SEGMS = "CCMS: Lines with Sysid, segments and monitor contexts
TABLES
* UNREACHABLE_CONTEXTS = "
* ALL_CONTEXTS = "
EXCEPTIONS
NO_CONTEXTS_FOUND = 1 NO_CONTEXTS_REACHABLE = 2 SYSTEM_UNKNOWN = 3 SYSTEM_NOT_REACHABLE = 4 ONLY_LOCAL_SYSID_ALLOWED = 5
IMPORTING Parameters details for SCSM_CONTEXTS_FOR_SYSTEM
ALSYSTEM - Name of SAP R/3 System
Data type: SY-SYSIDOptional: Yes
Call by Reference: Yes
CSMSYSID -
Data type: SY-SYSIDOptional: Yes
Call by Reference: Yes
ROUTES_BY_COMMTYPE -
Data type: CSMSEGM-COMMTYPEDefault: AL_CSM_CTYPE_HIGHPRIO
Optional: Yes
Call by Reference: Yes
USE_CACHE -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: Yes
FILL_CACHE -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: Yes
DO_NOT_PING_SYSTEM - Alert: SALC: Flag (X) if only local input for function call
Data type: ALPARAMS-ONLY_LOCALDefault: SPACE
Optional: Yes
Call by Reference: Yes
MTE_CLASS_PATTERN -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for SCSM_CONTEXTS_FOR_SYSTEM
SYSTEM_CTX_AND_SEGMS - CCMS: Lines with Sysid, segments and monitor contexts
Data type: CSM_SYS_CSOptional: No
Call by Reference: Yes
TABLES Parameters details for SCSM_CONTEXTS_FOR_SYSTEM
UNREACHABLE_CONTEXTS -
Data type: ALCONSEGOptional: Yes
Call by Reference: Yes
ALL_CONTEXTS -
Data type: ALCONSEGOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_CONTEXTS_FOUND -
Data type:Optional: No
Call by Reference: Yes
NO_CONTEXTS_REACHABLE -
Data type:Optional: No
Call by Reference: Yes
SYSTEM_UNKNOWN -
Data type:Optional: No
Call by Reference: Yes
SYSTEM_NOT_REACHABLE -
Data type:Optional: No
Call by Reference: Yes
ONLY_LOCAL_SYSID_ALLOWED -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SCSM_CONTEXTS_FOR_SYSTEM 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_alsystem | TYPE SY-SYSID, " | |||
| lv_no_contexts_found | TYPE SY, " | |||
| lv_system_ctx_and_segms | TYPE CSM_SYS_CS, " | |||
| lt_unreachable_contexts | TYPE STANDARD TABLE OF ALCONSEG, " | |||
| lv_csmsysid | TYPE SY-SYSID, " | |||
| lt_all_contexts | TYPE STANDARD TABLE OF ALCONSEG, " | |||
| lv_no_contexts_reachable | TYPE ALCONSEG, " | |||
| lv_system_unknown | TYPE ALCONSEG, " | |||
| lv_routes_by_commtype | TYPE CSMSEGM-COMMTYPE, " AL_CSM_CTYPE_HIGHPRIO | |||
| lv_use_cache | TYPE C, " 'X' | |||
| lv_system_not_reachable | TYPE C, " | |||
| lv_fill_cache | TYPE C, " 'X' | |||
| lv_only_local_sysid_allowed | TYPE C, " | |||
| lv_do_not_ping_system | TYPE ALPARAMS-ONLY_LOCAL, " SPACE | |||
| lv_mte_class_pattern | TYPE C. " SPACE |
|   CALL FUNCTION 'SCSM_CONTEXTS_FOR_SYSTEM' " |
| EXPORTING | ||
| ALSYSTEM | = lv_alsystem | |
| CSMSYSID | = lv_csmsysid | |
| ROUTES_BY_COMMTYPE | = lv_routes_by_commtype | |
| USE_CACHE | = lv_use_cache | |
| FILL_CACHE | = lv_fill_cache | |
| DO_NOT_PING_SYSTEM | = lv_do_not_ping_system | |
| MTE_CLASS_PATTERN | = lv_mte_class_pattern | |
| IMPORTING | ||
| SYSTEM_CTX_AND_SEGMS | = lv_system_ctx_and_segms | |
| TABLES | ||
| UNREACHABLE_CONTEXTS | = lt_unreachable_contexts | |
| ALL_CONTEXTS | = lt_all_contexts | |
| EXCEPTIONS | ||
| NO_CONTEXTS_FOUND = 1 | ||
| NO_CONTEXTS_REACHABLE = 2 | ||
| SYSTEM_UNKNOWN = 3 | ||
| SYSTEM_NOT_REACHABLE = 4 | ||
| ONLY_LOCAL_SYSID_ALLOWED = 5 | ||
| . " SCSM_CONTEXTS_FOR_SYSTEM | ||
ABAP code using 7.40 inline data declarations to call FM SCSM_CONTEXTS_FOR_SYSTEM
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 SYSID FROM SY INTO @DATA(ld_alsystem). | ||||
| "SELECT single SYSID FROM SY INTO @DATA(ld_csmsysid). | ||||
| "SELECT single COMMTYPE FROM CSMSEGM INTO @DATA(ld_routes_by_commtype). | ||||
| DATA(ld_routes_by_commtype) | = AL_CSM_CTYPE_HIGHPRIO. | |||
| DATA(ld_use_cache) | = 'X'. | |||
| DATA(ld_fill_cache) | = 'X'. | |||
| "SELECT single ONLY_LOCAL FROM ALPARAMS INTO @DATA(ld_do_not_ping_system). | ||||
| DATA(ld_do_not_ping_system) | = ' '. | |||
| DATA(ld_mte_class_pattern) | = ' '. | |||
Search for further information about these or an SAP related objects