SAP Function Modules

MB_CONTROL_MOVETYPE_GET SAP Function module







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

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


Pattern for FM MB_CONTROL_MOVETYPE_GET - MB CONTROL MOVETYPE GET





CALL FUNCTION 'MB_CONTROL_MOVETYPE_GET' "
* EXPORTING
*   i_mandt = SY-MANDT          " t001-mandt
*   i_bwart = '*'               " t156sc-bwart
*   i_wertu = '*'               " t156sc-wertu
*   i_mengu = '*'               " t156sc-mengu
*   i_sobkz = '*'               " t156sc-sobkz
*   i_kzbew = '*'               " t156sc-kzbew
*   i_kzzug = '*'               " t156sc-kzzug
*   i_kzvbr = '*'               " t156sc-kzvbr
  IMPORTING
    e_st156s =                  " st156s
* TABLES
*   te_st156s_tab =             " st156s
  EXCEPTIONS
    INCONSISTENT_ENTRIES = 1    "
    NO_ENTRIES_FOUND = 2        "
    .  "  MB_CONTROL_MOVETYPE_GET

ABAP code example for Function Module MB_CONTROL_MOVETYPE_GET





The ABAP code below is a full code listing to execute function module MB_CONTROL_MOVETYPE_GET 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_st156s  TYPE ST156S ,
it_te_st156s_tab  TYPE STANDARD TABLE OF ST156S,"TABLES PARAM
wa_te_st156s_tab  LIKE LINE OF it_te_st156s_tab .


SELECT single MANDT
FROM T001
INTO @DATA(ld_i_mandt).


SELECT single BWART
FROM T156SC
INTO @DATA(ld_i_bwart).


SELECT single WERTU
FROM T156SC
INTO @DATA(ld_i_wertu).


SELECT single MENGU
FROM T156SC
INTO @DATA(ld_i_mengu).


SELECT single SOBKZ
FROM T156SC
INTO @DATA(ld_i_sobkz).


SELECT single KZBEW
FROM T156SC
INTO @DATA(ld_i_kzbew).


SELECT single KZZUG
FROM T156SC
INTO @DATA(ld_i_kzzug).


SELECT single KZVBR
FROM T156SC
INTO @DATA(ld_i_kzvbr).


"populate fields of struture and append to itab
append wa_te_st156s_tab to it_te_st156s_tab. . CALL FUNCTION 'MB_CONTROL_MOVETYPE_GET' * EXPORTING * i_mandt = ld_i_mandt * i_bwart = ld_i_bwart * i_wertu = ld_i_wertu * i_mengu = ld_i_mengu * i_sobkz = ld_i_sobkz * i_kzbew = ld_i_kzbew * i_kzzug = ld_i_kzzug * i_kzvbr = ld_i_kzvbr IMPORTING e_st156s = ld_e_st156s * TABLES * te_st156s_tab = it_te_st156s_tab EXCEPTIONS INCONSISTENT_ENTRIES = 1 NO_ENTRIES_FOUND = 2 . " MB_CONTROL_MOVETYPE_GET
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_st156s  TYPE ST156S ,
ld_i_mandt  TYPE T001-MANDT ,
it_te_st156s_tab  TYPE STANDARD TABLE OF ST156S ,
wa_te_st156s_tab  LIKE LINE OF it_te_st156s_tab,
ld_i_bwart  TYPE T156SC-BWART ,
ld_i_wertu  TYPE T156SC-WERTU ,
ld_i_mengu  TYPE T156SC-MENGU ,
ld_i_sobkz  TYPE T156SC-SOBKZ ,
ld_i_kzbew  TYPE T156SC-KZBEW ,
ld_i_kzzug  TYPE T156SC-KZZUG ,
ld_i_kzvbr  TYPE T156SC-KZVBR .


SELECT single MANDT
FROM T001
INTO ld_i_mandt.


"populate fields of struture and append to itab
append wa_te_st156s_tab to it_te_st156s_tab.

SELECT single BWART
FROM T156SC
INTO ld_i_bwart.


SELECT single WERTU
FROM T156SC
INTO ld_i_wertu.


SELECT single MENGU
FROM T156SC
INTO ld_i_mengu.


SELECT single SOBKZ
FROM T156SC
INTO ld_i_sobkz.


SELECT single KZBEW
FROM T156SC
INTO ld_i_kzbew.


SELECT single KZZUG
FROM T156SC
INTO ld_i_kzzug.


SELECT single KZVBR
FROM T156SC
INTO ld_i_kzvbr.

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