SAP Function Modules

PROMOTION_READ_FROM_ARCHIVE SAP Function module







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

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


Pattern for FM PROMOTION_READ_FROM_ARCHIVE - PROMOTION READ FROM ARCHIVE





CALL FUNCTION 'PROMOTION_READ_FROM_ARCHIVE' "
  EXPORTING
    is_sel =                    "               SelectionStructure
*   i_langu = SY-LANGU          " sy-langu      Language Key of Current Text Environment
    i_arch_obj =                " arch_idx-object  Archiving Object
    i_fieldcat =                " aind_desc     Archive Field Catalog
  IMPORTING
    et_wanted_tables =          " table
    et_messages =               " bapiret2_tty  Table Type for Structure BAPIRET2
  EXCEPTIONS
    FIELDCAT_DOES_NOT_EXIST = 1  "
    SEL_STRUC_INVALID = 2       "
    NO_INFOSTRUC_FOUND = 3      "               No suitable info structure found
    FIELD_MISSING_IN_FIELDCAT = 4  "
    NO_RECORD_FOUND = 5         "               No Data Object Found
    ARCHIVE_ERROR = 6           "
    TECHNICAL_ERROR = 7         "               Technical Error
    FIELDCAT_NOT_ACTIVE = 8     "
    .  "  PROMOTION_READ_FROM_ARCHIVE

ABAP code example for Function Module PROMOTION_READ_FROM_ARCHIVE





The ABAP code below is a full code listing to execute function module PROMOTION_READ_FROM_ARCHIVE 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_et_wanted_tables  TYPE TABLE ,
ld_et_messages  TYPE BAPIRET2_TTY .

DATA(ld_is_sel) = 'some text here'.
DATA(ld_i_langu) = 'Check type of data required'.

SELECT single OBJECT
FROM ARCH_IDX
INTO @DATA(ld_i_arch_obj).

DATA(ld_i_fieldcat) = 'Check type of data required'. . CALL FUNCTION 'PROMOTION_READ_FROM_ARCHIVE' EXPORTING is_sel = ld_is_sel * i_langu = ld_i_langu i_arch_obj = ld_i_arch_obj i_fieldcat = ld_i_fieldcat IMPORTING et_wanted_tables = ld_et_wanted_tables et_messages = ld_et_messages EXCEPTIONS FIELDCAT_DOES_NOT_EXIST = 1 SEL_STRUC_INVALID = 2 NO_INFOSTRUC_FOUND = 3 FIELD_MISSING_IN_FIELDCAT = 4 NO_RECORD_FOUND = 5 ARCHIVE_ERROR = 6 TECHNICAL_ERROR = 7 FIELDCAT_NOT_ACTIVE = 8 . " PROMOTION_READ_FROM_ARCHIVE
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 ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "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_et_wanted_tables  TYPE TABLE ,
ld_is_sel  TYPE STRING ,
ld_et_messages  TYPE BAPIRET2_TTY ,
ld_i_langu  TYPE SY-LANGU ,
ld_i_arch_obj  TYPE ARCH_IDX-OBJECT ,
ld_i_fieldcat  TYPE AIND_DESC .

ld_is_sel = 'some text here'.
ld_i_langu = 'Check type of data required'.

SELECT single OBJECT
FROM ARCH_IDX
INTO ld_i_arch_obj.

ld_i_fieldcat = '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 PROMOTION_READ_FROM_ARCHIVE or its description.