SAP Function Modules

FMS2_CHECK_STATUS SAP Function module







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

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


Pattern for FM FMS2_CHECK_STATUS - FMS2 CHECK STATUS





CALL FUNCTION 'FMS2_CHECK_STATUS' "
  EXPORTING
    i_fikrs =                   " fm01-fikrs
    i_ctr_objnr =               " fmfctr-ctr_objnr
    i_fipos =                   " fmfpo-fipos
    i_posit =                   " fmapstat-posit
    i_geber =                   " fmgeber-geber
    i_gjahr =                   " fmapstat-gjahr
    i_status =                  " jest-stat
*   i_datum = SY-DATUM          " fmapstat-datbis
*   i_only_generic = ' '        "
*   i_only_explicit = ' '       "
*   i_msgty = 'E'               " sy-msgty
  IMPORTING
    e_status_active =           "
  EXCEPTIONS
    FICTR_NOT_FOUND = 1         "
    FIKRS_NOT_FOUND = 2         "
    FIPOS_NOT_FOUND = 3         "
    GEBER_NOT_FOUND = 4         "
    STATUS_NOT_FOUND = 5        "
    .  "  FMS2_CHECK_STATUS

ABAP code example for Function Module FMS2_CHECK_STATUS





The ABAP code below is a full code listing to execute function module FMS2_CHECK_STATUS 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_status_active  TYPE STRING .


SELECT single FIKRS
FROM FM01
INTO @DATA(ld_i_fikrs).


SELECT single CTR_OBJNR
FROM FMFCTR
INTO @DATA(ld_i_ctr_objnr).


SELECT single FIPOS
FROM FMFPO
INTO @DATA(ld_i_fipos).


SELECT single POSIT
FROM FMAPSTAT
INTO @DATA(ld_i_posit).


SELECT single GEBER
FROM FMGEBER
INTO @DATA(ld_i_geber).


SELECT single GJAHR
FROM FMAPSTAT
INTO @DATA(ld_i_gjahr).


SELECT single STAT
FROM JEST
INTO @DATA(ld_i_status).


SELECT single DATBIS
FROM FMAPSTAT
INTO @DATA(ld_i_datum).

DATA(ld_i_only_generic) = 'some text here'.
DATA(ld_i_only_explicit) = 'some text here'.
DATA(ld_i_msgty) = 'some text here'. . CALL FUNCTION 'FMS2_CHECK_STATUS' EXPORTING i_fikrs = ld_i_fikrs i_ctr_objnr = ld_i_ctr_objnr i_fipos = ld_i_fipos i_posit = ld_i_posit i_geber = ld_i_geber i_gjahr = ld_i_gjahr i_status = ld_i_status * i_datum = ld_i_datum * i_only_generic = ld_i_only_generic * i_only_explicit = ld_i_only_explicit * i_msgty = ld_i_msgty IMPORTING e_status_active = ld_e_status_active EXCEPTIONS FICTR_NOT_FOUND = 1 FIKRS_NOT_FOUND = 2 FIPOS_NOT_FOUND = 3 GEBER_NOT_FOUND = 4 STATUS_NOT_FOUND = 5 . " FMS2_CHECK_STATUS
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 ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "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_status_active  TYPE STRING ,
ld_i_fikrs  TYPE FM01-FIKRS ,
ld_i_ctr_objnr  TYPE FMFCTR-CTR_OBJNR ,
ld_i_fipos  TYPE FMFPO-FIPOS ,
ld_i_posit  TYPE FMAPSTAT-POSIT ,
ld_i_geber  TYPE FMGEBER-GEBER ,
ld_i_gjahr  TYPE FMAPSTAT-GJAHR ,
ld_i_status  TYPE JEST-STAT ,
ld_i_datum  TYPE FMAPSTAT-DATBIS ,
ld_i_only_generic  TYPE STRING ,
ld_i_only_explicit  TYPE STRING ,
ld_i_msgty  TYPE SY-MSGTY .


SELECT single FIKRS
FROM FM01
INTO ld_i_fikrs.


SELECT single CTR_OBJNR
FROM FMFCTR
INTO ld_i_ctr_objnr.


SELECT single FIPOS
FROM FMFPO
INTO ld_i_fipos.


SELECT single POSIT
FROM FMAPSTAT
INTO ld_i_posit.


SELECT single GEBER
FROM FMGEBER
INTO ld_i_geber.


SELECT single GJAHR
FROM FMAPSTAT
INTO ld_i_gjahr.


SELECT single STAT
FROM JEST
INTO ld_i_status.


SELECT single DATBIS
FROM FMAPSTAT
INTO ld_i_datum.

ld_i_only_generic = 'some text here'.
ld_i_only_explicit = 'some text here'.
ld_i_msgty = 'some text here'.

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 FMS2_CHECK_STATUS or its description.