SAP Function Modules

AIPK_GENERATE_EXTRACT_FOR_OLD SAP Function module







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

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


Pattern for FM AIPK_GENERATE_EXTRACT_FOR_OLD - AIPK GENERATE EXTRACT FOR OLD





CALL FUNCTION 'AIPK_GENERATE_EXTRACT_FOR_OLD' "
  EXPORTING
    i_obart =                   " taigk-obart
    i_kokrs =                   " tka01-kokrs
    i_waers =                   " imtp-waers
    i_periv =                   " imtp-periv
*   i_ratio_key = SPACE         " taigk-ratio
*   i_flg_total_values = 'X'    " c
*   i_flg_test = 'X'            "
*   i_flg_no_invprog = ' '      " c
  TABLES
    t_gjahr_range =             " rng_gjahr
*   t_aufk =                    " aufk
*   t_impr =                    " impr
*   t_prps =                    " prps
*   t_proj =                    " proj
    t_objnr =                   " jsto_pre
  EXCEPTIONS
    INCORRECT_FLAGS = 1         "
    NO_DATA_FOUND = 2           "
    .  "  AIPK_GENERATE_EXTRACT_FOR_OLD

ABAP code example for Function Module AIPK_GENERATE_EXTRACT_FOR_OLD





The ABAP code below is a full code listing to execute function module AIPK_GENERATE_EXTRACT_FOR_OLD 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_t_gjahr_range  TYPE STANDARD TABLE OF RNG_GJAHR,"TABLES PARAM
wa_t_gjahr_range  LIKE LINE OF it_t_gjahr_range ,
it_t_aufk  TYPE STANDARD TABLE OF AUFK,"TABLES PARAM
wa_t_aufk  LIKE LINE OF it_t_aufk ,
it_t_impr  TYPE STANDARD TABLE OF IMPR,"TABLES PARAM
wa_t_impr  LIKE LINE OF it_t_impr ,
it_t_prps  TYPE STANDARD TABLE OF PRPS,"TABLES PARAM
wa_t_prps  LIKE LINE OF it_t_prps ,
it_t_proj  TYPE STANDARD TABLE OF PROJ,"TABLES PARAM
wa_t_proj  LIKE LINE OF it_t_proj ,
it_t_objnr  TYPE STANDARD TABLE OF JSTO_PRE,"TABLES PARAM
wa_t_objnr  LIKE LINE OF it_t_objnr .


SELECT single OBART
FROM TAIGK
INTO @DATA(ld_i_obart).


SELECT single KOKRS
FROM TKA01
INTO @DATA(ld_i_kokrs).


SELECT single WAERS
FROM IMTP
INTO @DATA(ld_i_waers).


SELECT single PERIV
FROM IMTP
INTO @DATA(ld_i_periv).


SELECT single RATIO
FROM TAIGK
INTO @DATA(ld_i_ratio_key).

DATA(ld_i_flg_total_values) = 'Check type of data required'.
DATA(ld_i_flg_test) = 'some text here'.
DATA(ld_i_flg_no_invprog) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_gjahr_range to it_t_gjahr_range.

"populate fields of struture and append to itab
append wa_t_aufk to it_t_aufk.

"populate fields of struture and append to itab
append wa_t_impr to it_t_impr.

"populate fields of struture and append to itab
append wa_t_prps to it_t_prps.

"populate fields of struture and append to itab
append wa_t_proj to it_t_proj.

"populate fields of struture and append to itab
append wa_t_objnr to it_t_objnr. . CALL FUNCTION 'AIPK_GENERATE_EXTRACT_FOR_OLD' EXPORTING i_obart = ld_i_obart i_kokrs = ld_i_kokrs i_waers = ld_i_waers i_periv = ld_i_periv * i_ratio_key = ld_i_ratio_key * i_flg_total_values = ld_i_flg_total_values * i_flg_test = ld_i_flg_test * i_flg_no_invprog = ld_i_flg_no_invprog TABLES t_gjahr_range = it_t_gjahr_range * t_aufk = it_t_aufk * t_impr = it_t_impr * t_prps = it_t_prps * t_proj = it_t_proj t_objnr = it_t_objnr EXCEPTIONS INCORRECT_FLAGS = 1 NO_DATA_FOUND = 2 . " AIPK_GENERATE_EXTRACT_FOR_OLD
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_obart  TYPE TAIGK-OBART ,
it_t_gjahr_range  TYPE STANDARD TABLE OF RNG_GJAHR ,
wa_t_gjahr_range  LIKE LINE OF it_t_gjahr_range,
ld_i_kokrs  TYPE TKA01-KOKRS ,
it_t_aufk  TYPE STANDARD TABLE OF AUFK ,
wa_t_aufk  LIKE LINE OF it_t_aufk,
ld_i_waers  TYPE IMTP-WAERS ,
it_t_impr  TYPE STANDARD TABLE OF IMPR ,
wa_t_impr  LIKE LINE OF it_t_impr,
ld_i_periv  TYPE IMTP-PERIV ,
it_t_prps  TYPE STANDARD TABLE OF PRPS ,
wa_t_prps  LIKE LINE OF it_t_prps,
ld_i_ratio_key  TYPE TAIGK-RATIO ,
it_t_proj  TYPE STANDARD TABLE OF PROJ ,
wa_t_proj  LIKE LINE OF it_t_proj,
ld_i_flg_total_values  TYPE C ,
it_t_objnr  TYPE STANDARD TABLE OF JSTO_PRE ,
wa_t_objnr  LIKE LINE OF it_t_objnr,
ld_i_flg_test  TYPE STRING ,
ld_i_flg_no_invprog  TYPE C .


SELECT single OBART
FROM TAIGK
INTO ld_i_obart.


"populate fields of struture and append to itab
append wa_t_gjahr_range to it_t_gjahr_range.

SELECT single KOKRS
FROM TKA01
INTO ld_i_kokrs.


"populate fields of struture and append to itab
append wa_t_aufk to it_t_aufk.

SELECT single WAERS
FROM IMTP
INTO ld_i_waers.


"populate fields of struture and append to itab
append wa_t_impr to it_t_impr.

SELECT single PERIV
FROM IMTP
INTO ld_i_periv.


"populate fields of struture and append to itab
append wa_t_prps to it_t_prps.

SELECT single RATIO
FROM TAIGK
INTO ld_i_ratio_key.


"populate fields of struture and append to itab
append wa_t_proj to it_t_proj.
ld_i_flg_total_values = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_objnr to it_t_objnr.
ld_i_flg_test = 'some text here'.
ld_i_flg_no_invprog = '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 AIPK_GENERATE_EXTRACT_FOR_OLD or its description.