SAP SREL_GET_NEXT_RELATIONS Function Module for Determines all Relationships for the Object
SREL_GET_NEXT_RELATIONS is a standard srel get next relations SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determines all Relationships for the Object 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 srel get next relations FM, simply by entering the name SREL_GET_NEXT_RELATIONS into the relevant SAP transaction such as SE37 or SE38.
Function Group: SREL
Program Name: SAPLSREL
Main Program:
Appliation area: S
Release date: 09-Aug-2002
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SREL_GET_NEXT_RELATIONS 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 'SREL_GET_NEXT_RELATIONS'"Determines all Relationships for the Object.
EXPORTING
OBJECT = "BOR Object ID
* ROLETYPE = "Role Type
* RELATIONTYPE = "Relationship Type
* MAX_HOPS = 1 "Maximum Number of Jumps
* INCL_APPLRELS = ' ' "'X' Read Application Relationships
* EXCL_ROLES = "Excluded Role Types
* EXCL_RELATIONS = "Excluded Relationship Types
* BYPASS_BUFFER = ' ' "'X' Read Again from the Database
TABLES
* LINKS = "Relationships
* ROLES = "Roles of Objects
* APPLLINKS = "Relationships of the Application (Object Supports IFAPPLRELS)
EXCEPTIONS
INTERNAL_ERROR = 1 NO_LOGSYS = 2
IMPORTING Parameters details for SREL_GET_NEXT_RELATIONS
OBJECT - BOR Object ID
Data type: BORIDENTOptional: No
Call by Reference: No ( called with pass by value option)
ROLETYPE - Role Type
Data type: RELROLES-ROLETYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
RELATIONTYPE - Relationship Type
Data type: BRELTYP-RELTYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
MAX_HOPS - Maximum Number of Jumps
Data type: RELHOPSDefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
INCL_APPLRELS - 'X' Read Application Relationships
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXCL_ROLES - Excluded Role Types
Data type: TRL_RTYPEOptional: Yes
Call by Reference: Yes
EXCL_RELATIONS - Excluded Relationship Types
Data type: TRL_BTYPEOptional: Yes
Call by Reference: Yes
BYPASS_BUFFER - 'X' Read Again from the Database
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SREL_GET_NEXT_RELATIONS
LINKS - Relationships
Data type: RELGRAPHLKOptional: Yes
Call by Reference: Yes
ROLES - Roles of Objects
Data type: RELROLESOptional: Yes
Call by Reference: Yes
APPLLINKS - Relationships of the Application (Object Supports IFAPPLRELS)
Data type: BORIDENTOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
INTERNAL_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_LOGSYS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SREL_GET_NEXT_RELATIONS 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: | ||||
| lt_links | TYPE STANDARD TABLE OF RELGRAPHLK, " | |||
| lv_object | TYPE BORIDENT, " | |||
| lv_internal_error | TYPE BORIDENT, " | |||
| lt_roles | TYPE STANDARD TABLE OF RELROLES, " | |||
| lv_roletype | TYPE RELROLES-ROLETYPE, " | |||
| lv_no_logsys | TYPE RELROLES, " | |||
| lt_appllinks | TYPE STANDARD TABLE OF BORIDENT, " | |||
| lv_relationtype | TYPE BRELTYP-RELTYPE, " | |||
| lv_max_hops | TYPE RELHOPS, " 1 | |||
| lv_incl_applrels | TYPE C, " SPACE | |||
| lv_excl_roles | TYPE TRL_RTYPE, " | |||
| lv_excl_relations | TYPE TRL_BTYPE, " | |||
| lv_bypass_buffer | TYPE FLAG. " SPACE |
|   CALL FUNCTION 'SREL_GET_NEXT_RELATIONS' "Determines all Relationships for the Object |
| EXPORTING | ||
| OBJECT | = lv_object | |
| ROLETYPE | = lv_roletype | |
| RELATIONTYPE | = lv_relationtype | |
| MAX_HOPS | = lv_max_hops | |
| INCL_APPLRELS | = lv_incl_applrels | |
| EXCL_ROLES | = lv_excl_roles | |
| EXCL_RELATIONS | = lv_excl_relations | |
| BYPASS_BUFFER | = lv_bypass_buffer | |
| TABLES | ||
| LINKS | = lt_links | |
| ROLES | = lt_roles | |
| APPLLINKS | = lt_appllinks | |
| EXCEPTIONS | ||
| INTERNAL_ERROR = 1 | ||
| NO_LOGSYS = 2 | ||
| . " SREL_GET_NEXT_RELATIONS | ||
ABAP code using 7.40 inline data declarations to call FM SREL_GET_NEXT_RELATIONS
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 ROLETYPE FROM RELROLES INTO @DATA(ld_roletype). | ||||
| "SELECT single RELTYPE FROM BRELTYP INTO @DATA(ld_relationtype). | ||||
| DATA(ld_max_hops) | = 1. | |||
| DATA(ld_incl_applrels) | = ' '. | |||
| DATA(ld_bypass_buffer) | = ' '. | |||
Search for further information about these or an SAP related objects