SAP OCS_GET_INSTALLED_COMPS Function Module for









OCS_GET_INSTALLED_COMPS is a standard ocs get installed comps 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 ocs get installed comps FM, simply by entering the name OCS_GET_INSTALLED_COMPS into the relevant SAP transaction such as SE37 or SE38.

Function Group: OCS_CRM
Program Name: SAPLOCS_CRM
Main Program: SAPLOCS_CRM
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function OCS_GET_INSTALLED_COMPS 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 'OCS_GET_INSTALLED_COMPS'"
EXPORTING
* IV_PATCHABLE_ONLY = "Single-Character Flag
* IV_ACTIVE_ONLY = "
* IV_BUFFERED = 'X' "

TABLES
* TT_COMPTAB = "Table of installed software components
* ET_COMPONENTS = "
* ET_COMPLAYER = "Structure of the Table of Component Layers
* ET_CVERS_SUB = "

EXCEPTIONS
NO_RELEASE_FOUND = 1 WRONG_RELEASE = 2
.



IMPORTING Parameters details for OCS_GET_INSTALLED_COMPS

IV_PATCHABLE_ONLY - Single-Character Flag

Data type: SPAM_CVERS-COMP_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_ACTIVE_ONLY -

Data type: SPAM_CVERS-COMP_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_BUFFERED -

Data type: CHAR1
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for OCS_GET_INSTALLED_COMPS

TT_COMPTAB - Table of installed software components

Data type: SPAM_CVERS
Optional: Yes
Call by Reference: Yes

ET_COMPONENTS -

Data type: COMP_PROPS
Optional: Yes
Call by Reference: Yes

ET_COMPLAYER - Structure of the Table of Component Layers

Data type: SPAM_CLAYR
Optional: Yes
Call by Reference: Yes

ET_CVERS_SUB -

Data type: CVERS_SUB
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

NO_RELEASE_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WRONG_RELEASE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for OCS_GET_INSTALLED_COMPS 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_tt_comptab  TYPE STANDARD TABLE OF SPAM_CVERS, "   
lv_no_release_found  TYPE SPAM_CVERS, "   
lv_iv_patchable_only  TYPE SPAM_CVERS-COMP_TYPE, "   
lt_et_components  TYPE STANDARD TABLE OF COMP_PROPS, "   
lv_wrong_release  TYPE COMP_PROPS, "   
lv_iv_active_only  TYPE SPAM_CVERS-COMP_TYPE, "   
lv_iv_buffered  TYPE CHAR1, "   'X'
lt_et_complayer  TYPE STANDARD TABLE OF SPAM_CLAYR, "   
lt_et_cvers_sub  TYPE STANDARD TABLE OF CVERS_SUB. "   

  CALL FUNCTION 'OCS_GET_INSTALLED_COMPS'  "
    EXPORTING
         IV_PATCHABLE_ONLY = lv_iv_patchable_only
         IV_ACTIVE_ONLY = lv_iv_active_only
         IV_BUFFERED = lv_iv_buffered
    TABLES
         TT_COMPTAB = lt_tt_comptab
         ET_COMPONENTS = lt_et_components
         ET_COMPLAYER = lt_et_complayer
         ET_CVERS_SUB = lt_et_cvers_sub
    EXCEPTIONS
        NO_RELEASE_FOUND = 1
        WRONG_RELEASE = 2
. " OCS_GET_INSTALLED_COMPS




ABAP code using 7.40 inline data declarations to call FM OCS_GET_INSTALLED_COMPS

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 COMP_TYPE FROM SPAM_CVERS INTO @DATA(ld_iv_patchable_only).
 
 
 
"SELECT single COMP_TYPE FROM SPAM_CVERS INTO @DATA(ld_iv_active_only).
 
DATA(ld_iv_buffered) = 'X'.
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!