FMS2_SET_INIT_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_SET_INIT_STATUS into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
FMS2
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'FMS2_SET_INIT_STATUS' "
EXPORTING
i_fikrs = " fm01-fikrs
* i_ctr_objnr = ' ' " fmfctr-ctr_objnr
* i_fictr = ' ' " fmfctr-fictr
* i_fipos = ' ' " fmfpo-fipos
* i_posit = ' ' " fmapstat-posit
i_geber = " fmapstat-geber
i_gjahr = " fmapstat-gjahr
* i_update_db_now = ' ' "
* i_update_in_itab = 'X' "
* i_datum = SY-DATUM " fmapstat-datbis
EXCEPTIONS
FICTR_NOT_FOUND = 1 "
FIKRS_NOT_FOUND = 2 "
FIPOS_NOT_FOUND = 3 "
GEBER_NOT_FOUND = 4 "
ERROR_OCCURED = 5 "
. " FMS2_SET_INIT_STATUS
The ABAP code below is a full code listing to execute function module FMS2_SET_INIT_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).
SELECT single FIKRS
FROM FM01
INTO @DATA(ld_i_fikrs).
SELECT single CTR_OBJNR
FROM FMFCTR
INTO @DATA(ld_i_ctr_objnr).
SELECT single FICTR
FROM FMFCTR
INTO @DATA(ld_i_fictr).
SELECT single FIPOS
FROM FMFPO
INTO @DATA(ld_i_fipos).
SELECT single POSIT
FROM FMAPSTAT
INTO @DATA(ld_i_posit).
SELECT single GEBER
FROM FMAPSTAT
INTO @DATA(ld_i_geber).
SELECT single GJAHR
FROM FMAPSTAT
INTO @DATA(ld_i_gjahr).
DATA(ld_i_update_db_now) = 'some text here'.
DATA(ld_i_update_in_itab) = 'some text here'.
SELECT single DATBIS
FROM FMAPSTAT
INTO @DATA(ld_i_datum).
. CALL FUNCTION 'FMS2_SET_INIT_STATUS' EXPORTING i_fikrs = ld_i_fikrs * i_ctr_objnr = ld_i_ctr_objnr * i_fictr = ld_i_fictr * i_fipos = ld_i_fipos * i_posit = ld_i_posit i_geber = ld_i_geber i_gjahr = ld_i_gjahr * i_update_db_now = ld_i_update_db_now * i_update_in_itab = ld_i_update_in_itab * i_datum = ld_i_datum EXCEPTIONS FICTR_NOT_FOUND = 1 FIKRS_NOT_FOUND = 2 FIPOS_NOT_FOUND = 3 GEBER_NOT_FOUND = 4 ERROR_OCCURED = 5 . " FMS2_SET_INIT_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.
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_i_fikrs | TYPE FM01-FIKRS , |
| ld_i_ctr_objnr | TYPE FMFCTR-CTR_OBJNR , |
| ld_i_fictr | TYPE FMFCTR-FICTR , |
| ld_i_fipos | TYPE FMFPO-FIPOS , |
| ld_i_posit | TYPE FMAPSTAT-POSIT , |
| ld_i_geber | TYPE FMAPSTAT-GEBER , |
| ld_i_gjahr | TYPE FMAPSTAT-GJAHR , |
| ld_i_update_db_now | TYPE STRING , |
| ld_i_update_in_itab | TYPE STRING , |
| ld_i_datum | TYPE FMAPSTAT-DATBIS . |
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_SET_INIT_STATUS or its description.