SAP Function Modules

GM_SPONSORED_PROGRAM_READ SAP Function module - Read Sponsored Program







GM_SPONSORED_PROGRAM_READ 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_SPONSORED_PROGRAM_READ into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM GM_SPONSORED_PROGRAM_READ - GM SPONSORED PROGRAM READ





CALL FUNCTION 'GM_SPONSORED_PROGRAM_READ' "Read Sponsored Program
  EXPORTING
    i_sponsored_program =       " gm_sponsored_prog  Sponsored Program
*   i_bypass_buffer =           " xfeld         Checkbox
*   i_fm_area =                 " fikrs         Financial Management Area
*   i_language = SY-LANGU       " sy-langu      R/3 System, current language
  IMPORTING
    e_gmspprogram =             " gmspprogram   Sponsored program master
    e_gmspprogramtexts =        " gmspprogramtexts  Sponsored Program texts
* TABLES
*   t_gmspresponsible =         " gmspresponsible  Objects responsible for the sponsored program
*   t_gmspprogram_fmbt =        " gmspprogram_fmbt  Sponsored Program Master Data - Budget Transfer Objects
*   t_gmspprogram_fmba =        " gmspprogram_fmba  Sponsored Program Master Data - Budget Allowed Object
  EXCEPTIONS
    PROGRAM_NOT_FOUND = 1       "               Program not found
    .  "  GM_SPONSORED_PROGRAM_READ

ABAP code example for Function Module GM_SPONSORED_PROGRAM_READ





The ABAP code below is a full code listing to execute function module GM_SPONSORED_PROGRAM_READ 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_gmspprogram  TYPE GMSPPROGRAM ,
ld_e_gmspprogramtexts  TYPE GMSPPROGRAMTEXTS ,
it_t_gmspresponsible  TYPE STANDARD TABLE OF GMSPRESPONSIBLE,"TABLES PARAM
wa_t_gmspresponsible  LIKE LINE OF it_t_gmspresponsible ,
it_t_gmspprogram_fmbt  TYPE STANDARD TABLE OF GMSPPROGRAM_FMBT,"TABLES PARAM
wa_t_gmspprogram_fmbt  LIKE LINE OF it_t_gmspprogram_fmbt ,
it_t_gmspprogram_fmba  TYPE STANDARD TABLE OF GMSPPROGRAM_FMBA,"TABLES PARAM
wa_t_gmspprogram_fmba  LIKE LINE OF it_t_gmspprogram_fmba .

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

"populate fields of struture and append to itab
append wa_t_gmspresponsible to it_t_gmspresponsible.

"populate fields of struture and append to itab
append wa_t_gmspprogram_fmbt to it_t_gmspprogram_fmbt.

"populate fields of struture and append to itab
append wa_t_gmspprogram_fmba to it_t_gmspprogram_fmba. . CALL FUNCTION 'GM_SPONSORED_PROGRAM_READ' EXPORTING i_sponsored_program = ld_i_sponsored_program * i_bypass_buffer = ld_i_bypass_buffer * i_fm_area = ld_i_fm_area * i_language = ld_i_language IMPORTING e_gmspprogram = ld_e_gmspprogram e_gmspprogramtexts = ld_e_gmspprogramtexts * TABLES * t_gmspresponsible = it_t_gmspresponsible * t_gmspprogram_fmbt = it_t_gmspprogram_fmbt * t_gmspprogram_fmba = it_t_gmspprogram_fmba EXCEPTIONS PROGRAM_NOT_FOUND = 1 . " GM_SPONSORED_PROGRAM_READ
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_gmspprogram  TYPE GMSPPROGRAM ,
ld_i_sponsored_program  TYPE GM_SPONSORED_PROG ,
it_t_gmspresponsible  TYPE STANDARD TABLE OF GMSPRESPONSIBLE ,
wa_t_gmspresponsible  LIKE LINE OF it_t_gmspresponsible,
ld_e_gmspprogramtexts  TYPE GMSPPROGRAMTEXTS ,
ld_i_bypass_buffer  TYPE XFELD ,
it_t_gmspprogram_fmbt  TYPE STANDARD TABLE OF GMSPPROGRAM_FMBT ,
wa_t_gmspprogram_fmbt  LIKE LINE OF it_t_gmspprogram_fmbt,
ld_i_fm_area  TYPE FIKRS ,
it_t_gmspprogram_fmba  TYPE STANDARD TABLE OF GMSPPROGRAM_FMBA ,
wa_t_gmspprogram_fmba  LIKE LINE OF it_t_gmspprogram_fmba,
ld_i_language  TYPE SY-LANGU .

ld_i_sponsored_program = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_gmspresponsible to it_t_gmspresponsible.
ld_i_bypass_buffer = 'Check type of data required'.

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

"populate fields of struture and append to itab
append wa_t_gmspprogram_fmba to it_t_gmspprogram_fmba.
ld_i_language = '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_SPONSORED_PROGRAM_READ or its description.