SAP Function Modules

F4_ALLOWED_QUANTITY_UNIT SAP Function module







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

Associated Function Group: MDR1
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM F4_ALLOWED_QUANTITY_UNIT - F4 ALLOWED QUANTITY UNIT





CALL FUNCTION 'F4_ALLOWED_QUANTITY_UNIT' "
  EXPORTING
    i_s_general =               " mdr1inallowedqtunit
    i_dialog =                  " mdr1dialog
*   i_dynpprog =                " syrepid
*   i_dynpnr =                  " sy-dynnr
*   i_dynprofield =             " help_info-dynprofld
*   i_stepl = 0                 " help_info-stepl
*   i_display =                 " ddrefstruc-bool
*   i_titel =                   " mdr1titel     Heading for F4 Help (Max. 100 Characters)
* TABLES
*   o_t_qt_units =              " mdr1toutallowedqtunit
  EXCEPTIONS
    BAD_PARAMS = 1              "               Incorrect input parameters
    ERROR = 2                   "               Critical Error
    .  "  F4_ALLOWED_QUANTITY_UNIT

ABAP code example for Function Module F4_ALLOWED_QUANTITY_UNIT





The ABAP code below is a full code listing to execute function module F4_ALLOWED_QUANTITY_UNIT 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:
it_o_t_qt_units  TYPE STANDARD TABLE OF MDR1TOUTALLOWEDQTUNIT,"TABLES PARAM
wa_o_t_qt_units  LIKE LINE OF it_o_t_qt_units .

DATA(ld_i_s_general) = 'Check type of data required'.
DATA(ld_i_dialog) = 'Check type of data required'.
DATA(ld_i_dynpprog) = '123 '.
DATA(ld_i_dynpnr) = 'some text here'.

DATA(ld_i_dynprofield) = some text here

DATA(ld_i_stepl) = 123

DATA(ld_i_display) = some text here
DATA(ld_i_titel) = 'some text here'.

"populate fields of struture and append to itab
append wa_o_t_qt_units to it_o_t_qt_units. . CALL FUNCTION 'F4_ALLOWED_QUANTITY_UNIT' EXPORTING i_s_general = ld_i_s_general i_dialog = ld_i_dialog * i_dynpprog = ld_i_dynpprog * i_dynpnr = ld_i_dynpnr * i_dynprofield = ld_i_dynprofield * i_stepl = ld_i_stepl * i_display = ld_i_display * i_titel = ld_i_titel * TABLES * o_t_qt_units = it_o_t_qt_units EXCEPTIONS BAD_PARAMS = 1 ERROR = 2 . " F4_ALLOWED_QUANTITY_UNIT
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_i_s_general  TYPE MDR1INALLOWEDQTUNIT ,
it_o_t_qt_units  TYPE STANDARD TABLE OF MDR1TOUTALLOWEDQTUNIT ,
wa_o_t_qt_units  LIKE LINE OF it_o_t_qt_units,
ld_i_dialog  TYPE MDR1DIALOG ,
ld_i_dynpprog  TYPE SYREPID ,
ld_i_dynpnr  TYPE SY-DYNNR ,
ld_i_dynprofield  TYPE HELP_INFO-DYNPROFLD ,
ld_i_stepl  TYPE HELP_INFO-STEPL ,
ld_i_display  TYPE DDREFSTRUC-BOOL ,
ld_i_titel  TYPE MDR1TITEL .

ld_i_s_general = 'some text here'.

"populate fields of struture and append to itab
append wa_o_t_qt_units to it_o_t_qt_units.
ld_i_dialog = 'some text here'.
ld_i_dynpprog = 'some text here'.
ld_i_dynpnr = 'some text here'.

ld_i_dynprofield = some text here

ld_i_stepl = 123

ld_i_display = some text here
ld_i_titel = '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 F4_ALLOWED_QUANTITY_UNIT or its description.