SAP Function Modules

GM_GET_SPONSORED_CLASS_SINGLE SAP Function module - Get sponsored class







GM_GET_SPONSORED_CLASS_SINGLE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name GM_GET_SPONSORED_CLASS_SINGLE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: GMREPPOOL
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM GM_GET_SPONSORED_CLASS_SINGLE - GM GET SPONSORED CLASS SINGLE





CALL FUNCTION 'GM_GET_SPONSORED_CLASS_SINGLE' "Get sponsored class
  EXPORTING
    i_sponsored_class =         " gmspclass-sponsored_class  Sponsored Class
*   i_language = SY-LANGU       " sy-langu      R/3 System, current language
*   i_auth_activity =           " activ_auth    Activity
*   i_fm_area =                 " fikrs         FM Area
  IMPORTING
    e_gmspclass =               " gmspclass     Sponsored class master
    e_gmspclasstexts =          " gmspclasstexts  Sponsored class texts
* TABLES
*   e_t_gmaspclass =            " gmaspclass    Sponsored class - sponsor specific data
*   e_t_gmspclass_fmbt =        " gmspclass_fmbt  FM budget transfer objects for sponsored class
*   e_t_gmspclass_fmba =        " gmspclass_fmba  FM budget allowed objects for sponsored class
  EXCEPTIONS
    NOT_FOUND = 1               "               Not found
    NOT_AUTHORIZED = 2          "               Not authorized for this class
    .  "  GM_GET_SPONSORED_CLASS_SINGLE

ABAP code example for Function Module GM_GET_SPONSORED_CLASS_SINGLE





The ABAP code below is a full code listing to execute function module GM_GET_SPONSORED_CLASS_SINGLE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_e_gmspclass  TYPE GMSPCLASS ,
ld_e_gmspclasstexts  TYPE GMSPCLASSTEXTS ,
it_e_t_gmaspclass  TYPE STANDARD TABLE OF GMASPCLASS,"TABLES PARAM
wa_e_t_gmaspclass  LIKE LINE OF it_e_t_gmaspclass ,
it_e_t_gmspclass_fmbt  TYPE STANDARD TABLE OF GMSPCLASS_FMBT,"TABLES PARAM
wa_e_t_gmspclass_fmbt  LIKE LINE OF it_e_t_gmspclass_fmbt ,
it_e_t_gmspclass_fmba  TYPE STANDARD TABLE OF GMSPCLASS_FMBA,"TABLES PARAM
wa_e_t_gmspclass_fmba  LIKE LINE OF it_e_t_gmspclass_fmba .


SELECT single SPONSORED_CLASS
FROM GMSPCLASS
INTO @DATA(ld_i_sponsored_class).

DATA(ld_i_language) = 'Check type of data required'.
DATA(ld_i_auth_activity) = 'Check type of data required'.
DATA(ld_i_fm_area) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_e_t_gmaspclass to it_e_t_gmaspclass.

"populate fields of struture and append to itab
append wa_e_t_gmspclass_fmbt to it_e_t_gmspclass_fmbt.

"populate fields of struture and append to itab
append wa_e_t_gmspclass_fmba to it_e_t_gmspclass_fmba. . CALL FUNCTION 'GM_GET_SPONSORED_CLASS_SINGLE' EXPORTING i_sponsored_class = ld_i_sponsored_class * i_language = ld_i_language * i_auth_activity = ld_i_auth_activity * i_fm_area = ld_i_fm_area IMPORTING e_gmspclass = ld_e_gmspclass e_gmspclasstexts = ld_e_gmspclasstexts * TABLES * e_t_gmaspclass = it_e_t_gmaspclass * e_t_gmspclass_fmbt = it_e_t_gmspclass_fmbt * e_t_gmspclass_fmba = it_e_t_gmspclass_fmba EXCEPTIONS NOT_FOUND = 1 NOT_AUTHORIZED = 2 . " GM_GET_SPONSORED_CLASS_SINGLE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_e_gmspclass  TYPE GMSPCLASS ,
ld_i_sponsored_class  TYPE GMSPCLASS-SPONSORED_CLASS ,
it_e_t_gmaspclass  TYPE STANDARD TABLE OF GMASPCLASS ,
wa_e_t_gmaspclass  LIKE LINE OF it_e_t_gmaspclass,
ld_e_gmspclasstexts  TYPE GMSPCLASSTEXTS ,
ld_i_language  TYPE SY-LANGU ,
it_e_t_gmspclass_fmbt  TYPE STANDARD TABLE OF GMSPCLASS_FMBT ,
wa_e_t_gmspclass_fmbt  LIKE LINE OF it_e_t_gmspclass_fmbt,
ld_i_auth_activity  TYPE ACTIV_AUTH ,
it_e_t_gmspclass_fmba  TYPE STANDARD TABLE OF GMSPCLASS_FMBA ,
wa_e_t_gmspclass_fmba  LIKE LINE OF it_e_t_gmspclass_fmba,
ld_i_fm_area  TYPE FIKRS .


SELECT single SPONSORED_CLASS
FROM GMSPCLASS
INTO ld_i_sponsored_class.


"populate fields of struture and append to itab
append wa_e_t_gmaspclass to it_e_t_gmaspclass.
ld_i_language = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_e_t_gmspclass_fmbt to it_e_t_gmspclass_fmbt.
ld_i_auth_activity = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_e_t_gmspclass_fmba to it_e_t_gmspclass_fmba.
ld_i_fm_area = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name GM_GET_SPONSORED_CLASS_SINGLE or its description.