SAP Function Modules

FMS2_CHECK_ACTIVITY SAP Function module







FMS2_CHECK_ACTIVITY 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_ACTIVITY 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_ACTIVITY - FMS2 CHECK ACTIVITY





CALL FUNCTION 'FMS2_CHECK_ACTIVITY' "
  EXPORTING
*   i_fikrs = ' '               " fm01-fikrs
    i_ctr_objnr =               " fmfctr-ctr_objnr
*   i_posit = ' '               " fmapstat-posit
*   i_fipos = ' '               " fmfpo-fipos
    i_geber =                   " fmapstat-geber
*   i_gjahr = ' '               " fmapstat-gjahr
*   i_datum = SY-DATUM          " fmapstat-datbis
*   i_check_from_datum = ' '    "
    i_vrgng =                   " tj01-vrgng
*   i_check_only = ' '          "
*   i_no_update = ' '           "
*   i_msgty = 'E'               " sy-msgty
*   i_check_entries = ' '       "
*   i_update_task = SPACE       "
  IMPORTING
    e_activity_not_allowed =    "
    e_status_modified =         "
    e_status_new =              " ifmapstat
  EXCEPTIONS
    FICTR_NOT_FOUND = 1         "
    FIKRS_NOT_FOUND = 2         "
    FIPOS_NOT_FOUND = 3         "
    GEBER_NOT_FOUND = 4         "
    STATUS_NOT_FOUND = 5        "
    MISSING_ENTRY = 6           "
    .  "  FMS2_CHECK_ACTIVITY

ABAP code example for Function Module FMS2_CHECK_ACTIVITY





The ABAP code below is a full code listing to execute function module FMS2_CHECK_ACTIVITY 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_activity_not_allowed  TYPE STRING ,
ld_e_status_modified  TYPE STRING ,
ld_e_status_new  TYPE IFMAPSTAT .


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


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


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


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


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


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


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

DATA(ld_i_check_from_datum) = 'some text here'.

SELECT single VRGNG
FROM TJ01
INTO @DATA(ld_i_vrgng).

DATA(ld_i_check_only) = 'some text here'.
DATA(ld_i_no_update) = 'some text here'.
DATA(ld_i_msgty) = 'some text here'.
DATA(ld_i_check_entries) = 'some text here'.
DATA(ld_i_update_task) = 'some text here'. . CALL FUNCTION 'FMS2_CHECK_ACTIVITY' EXPORTING * i_fikrs = ld_i_fikrs i_ctr_objnr = ld_i_ctr_objnr * i_posit = ld_i_posit * i_fipos = ld_i_fipos i_geber = ld_i_geber * i_gjahr = ld_i_gjahr * i_datum = ld_i_datum * i_check_from_datum = ld_i_check_from_datum i_vrgng = ld_i_vrgng * i_check_only = ld_i_check_only * i_no_update = ld_i_no_update * i_msgty = ld_i_msgty * i_check_entries = ld_i_check_entries * i_update_task = ld_i_update_task IMPORTING e_activity_not_allowed = ld_e_activity_not_allowed e_status_modified = ld_e_status_modified e_status_new = ld_e_status_new EXCEPTIONS FICTR_NOT_FOUND = 1 FIKRS_NOT_FOUND = 2 FIPOS_NOT_FOUND = 3 GEBER_NOT_FOUND = 4 STATUS_NOT_FOUND = 5 MISSING_ENTRY = 6 . " FMS2_CHECK_ACTIVITY
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 ELSEIF SY-SUBRC EQ 6. "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_activity_not_allowed  TYPE STRING ,
ld_i_fikrs  TYPE FM01-FIKRS ,
ld_e_status_modified  TYPE STRING ,
ld_i_ctr_objnr  TYPE FMFCTR-CTR_OBJNR ,
ld_e_status_new  TYPE IFMAPSTAT ,
ld_i_posit  TYPE FMAPSTAT-POSIT ,
ld_i_fipos  TYPE FMFPO-FIPOS ,
ld_i_geber  TYPE FMAPSTAT-GEBER ,
ld_i_gjahr  TYPE FMAPSTAT-GJAHR ,
ld_i_datum  TYPE FMAPSTAT-DATBIS ,
ld_i_check_from_datum  TYPE STRING ,
ld_i_vrgng  TYPE TJ01-VRGNG ,
ld_i_check_only  TYPE STRING ,
ld_i_no_update  TYPE STRING ,
ld_i_msgty  TYPE SY-MSGTY ,
ld_i_check_entries  TYPE STRING ,
ld_i_update_task  TYPE STRING .


SELECT single FIKRS
FROM FM01
INTO ld_i_fikrs.


SELECT single CTR_OBJNR
FROM FMFCTR
INTO ld_i_ctr_objnr.


SELECT single POSIT
FROM FMAPSTAT
INTO ld_i_posit.


SELECT single FIPOS
FROM FMFPO
INTO ld_i_fipos.


SELECT single GEBER
FROM FMAPSTAT
INTO ld_i_geber.


SELECT single GJAHR
FROM FMAPSTAT
INTO ld_i_gjahr.


SELECT single DATBIS
FROM FMAPSTAT
INTO ld_i_datum.

ld_i_check_from_datum = 'some text here'.

SELECT single VRGNG
FROM TJ01
INTO ld_i_vrgng.

ld_i_check_only = 'some text here'.
ld_i_no_update = 'some text here'.
ld_i_msgty = 'some text here'.
ld_i_check_entries = 'some text here'.
ld_i_update_task = '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_ACTIVITY or its description.