SAP Function Modules

PRODUCTION_VERSIONS SAP Function module - Maintain Production Versions







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

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


Pattern for FM PRODUCTION_VERSIONS - PRODUCTION VERSIONS





CALL FUNCTION 'PRODUCTION_VERSIONS' "Maintain Production Versions
  EXPORTING
*   kzanz = SPACE               " sy-marky      Indicator: "Display only"
    matnr =                     " marc-matnr    Material Number of the Material to be Maintained
*   neuflag = SPACE             " sy-marky
*   ref_matnr = SPACE           " marc-matnr    Material number of reference
*   ref_werks = SPACE           " marc-werks    Reference plant
    werks =                     " marc-werks    Plant to be maintained
    werksserkz =                " marc-sauft
  IMPORTING
    mkalgesperrt =              " sy-marky
* TABLES
*   tmkal =                     " mkal
*   pos_tab =                   " malh
  EXCEPTIONS
    NO_DISPLAY_AUTH = 1         "
    .  "  PRODUCTION_VERSIONS

ABAP code example for Function Module PRODUCTION_VERSIONS





The ABAP code below is a full code listing to execute function module PRODUCTION_VERSIONS 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_mkalgesperrt  TYPE SY-MARKY ,
it_tmkal  TYPE STANDARD TABLE OF MKAL,"TABLES PARAM
wa_tmkal  LIKE LINE OF it_tmkal ,
it_pos_tab  TYPE STANDARD TABLE OF MALH,"TABLES PARAM
wa_pos_tab  LIKE LINE OF it_pos_tab .

DATA(ld_kzanz) = 'some text here'.

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

DATA(ld_neuflag) = 'some text here'.

SELECT single MATNR
FROM MARC
INTO @DATA(ld_ref_matnr).


SELECT single WERKS
FROM MARC
INTO @DATA(ld_ref_werks).


SELECT single WERKS
FROM MARC
INTO @DATA(ld_werks).


SELECT single SAUFT
FROM MARC
INTO @DATA(ld_werksserkz).


"populate fields of struture and append to itab
append wa_tmkal to it_tmkal.

"populate fields of struture and append to itab
append wa_pos_tab to it_pos_tab. . CALL FUNCTION 'PRODUCTION_VERSIONS' EXPORTING * kzanz = ld_kzanz matnr = ld_matnr * neuflag = ld_neuflag * ref_matnr = ld_ref_matnr * ref_werks = ld_ref_werks werks = ld_werks werksserkz = ld_werksserkz IMPORTING mkalgesperrt = ld_mkalgesperrt * TABLES * tmkal = it_tmkal * pos_tab = it_pos_tab EXCEPTIONS NO_DISPLAY_AUTH = 1 . " PRODUCTION_VERSIONS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_mkalgesperrt  TYPE SY-MARKY ,
ld_kzanz  TYPE SY-MARKY ,
it_tmkal  TYPE STANDARD TABLE OF MKAL ,
wa_tmkal  LIKE LINE OF it_tmkal,
ld_matnr  TYPE MARC-MATNR ,
it_pos_tab  TYPE STANDARD TABLE OF MALH ,
wa_pos_tab  LIKE LINE OF it_pos_tab,
ld_neuflag  TYPE SY-MARKY ,
ld_ref_matnr  TYPE MARC-MATNR ,
ld_ref_werks  TYPE MARC-WERKS ,
ld_werks  TYPE MARC-WERKS ,
ld_werksserkz  TYPE MARC-SAUFT .

ld_kzanz = 'some text here'.

"populate fields of struture and append to itab
append wa_tmkal to it_tmkal.

SELECT single MATNR
FROM MARC
INTO ld_matnr.


"populate fields of struture and append to itab
append wa_pos_tab to it_pos_tab.
ld_neuflag = 'some text here'.

SELECT single MATNR
FROM MARC
INTO ld_ref_matnr.


SELECT single WERKS
FROM MARC
INTO ld_ref_werks.


SELECT single WERKS
FROM MARC
INTO ld_werks.


SELECT single SAUFT
FROM MARC
INTO ld_werksserkz.

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