SAP Function Modules

MARA_SINGLE_READ SAP Function module







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

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


Pattern for FM MARA_SINGLE_READ - MARA SINGLE READ





CALL FUNCTION 'MARA_SINGLE_READ' "
  EXPORTING
*   kzrfb = ' '                 " mtcom-kzrfb   Indicator: Refresh Buffer Entry
*   maxtz = 0                   " mtcom-maxtz   Max. No. of Entries in Buffer
    matnr =                     " mara-matnr
*   sperrmodus = ' '            " tvgvi-spera   Lock mode (none, shared, excl.)
*   std_sperrmodus = ' '        " tvgvi-spera   Standard lock mode (if different)
*   output_no_message =         " c
  IMPORTING
    wmara =                     " mara
  EXCEPTIONS
    LOCK_ON_MATERIAL = 1        "
    LOCK_SYSTEM_ERROR = 2       "
    WRONG_CALL = 3              "
    NOT_FOUND = 4               "
    .  "  MARA_SINGLE_READ

ABAP code example for Function Module MARA_SINGLE_READ





The ABAP code below is a full code listing to execute function module MARA_SINGLE_READ 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_wmara  TYPE MARA .


DATA(ld_kzrfb) = some text here

DATA(ld_maxtz) = 123

SELECT single MATNR
FROM MARA
INTO @DATA(ld_matnr).


SELECT single SPERA
FROM TVGVI
INTO @DATA(ld_sperrmodus).


SELECT single SPERA
FROM TVGVI
INTO @DATA(ld_std_sperrmodus).

DATA(ld_output_no_message) = 'Check type of data required'. . CALL FUNCTION 'MARA_SINGLE_READ' EXPORTING * kzrfb = ld_kzrfb * maxtz = ld_maxtz matnr = ld_matnr * sperrmodus = ld_sperrmodus * std_sperrmodus = ld_std_sperrmodus * output_no_message = ld_output_no_message IMPORTING wmara = ld_wmara EXCEPTIONS LOCK_ON_MATERIAL = 1 LOCK_SYSTEM_ERROR = 2 WRONG_CALL = 3 NOT_FOUND = 4 . " MARA_SINGLE_READ
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 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_wmara  TYPE MARA ,
ld_kzrfb  TYPE MTCOM-KZRFB ,
ld_maxtz  TYPE MTCOM-MAXTZ ,
ld_matnr  TYPE MARA-MATNR ,
ld_sperrmodus  TYPE TVGVI-SPERA ,
ld_std_sperrmodus  TYPE TVGVI-SPERA ,
ld_output_no_message  TYPE C .


ld_kzrfb = some text here

ld_maxtz = 123

SELECT single MATNR
FROM MARA
INTO ld_matnr.


SELECT single SPERA
FROM TVGVI
INTO ld_sperrmodus.


SELECT single SPERA
FROM TVGVI
INTO ld_std_sperrmodus.

ld_output_no_message = 'Check type of data required'.

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