SAP Function Modules

AIPK_TOP_WBS_ELEMENTS_OLD SAP Function module







AIPK_TOP_WBS_ELEMENTS_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_TOP_WBS_ELEMENTS_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_TOP_WBS_ELEMENTS_OLD - AIPK TOP WBS ELEMENTS OLD





CALL FUNCTION 'AIPK_TOP_WBS_ELEMENTS_OLD' "
  EXPORTING
*   i_flg_from_objects = 'X'    " c
    i_pkokr =                   " tka01-kokrs
*   i_flg_only_invest = 'X'     " c
  TABLES
*   t_prart_range =             " range_c2
*   t_pbukr_range =             " range_c4
*   t_pspid_range =             " rng_pspid
*   t_posid_range =             " rng_posid
*   t_objnr =                   " jsto_pre
    t_prps =                    " prps
    t_proj =                    " proj
  EXCEPTIONS
    KOKRS_INCONSISTENCY = 1     "
    NO_PROJ_FOR_WBS_ELMENTS = 2  "
    .  "  AIPK_TOP_WBS_ELEMENTS_OLD

ABAP code example for Function Module AIPK_TOP_WBS_ELEMENTS_OLD





The ABAP code below is a full code listing to execute function module AIPK_TOP_WBS_ELEMENTS_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_prart_range  TYPE STANDARD TABLE OF RANGE_C2,"TABLES PARAM
wa_t_prart_range  LIKE LINE OF it_t_prart_range ,
it_t_pbukr_range  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_t_pbukr_range  LIKE LINE OF it_t_pbukr_range ,
it_t_pspid_range  TYPE STANDARD TABLE OF RNG_PSPID,"TABLES PARAM
wa_t_pspid_range  LIKE LINE OF it_t_pspid_range ,
it_t_posid_range  TYPE STANDARD TABLE OF RNG_POSID,"TABLES PARAM
wa_t_posid_range  LIKE LINE OF it_t_posid_range ,
it_t_objnr  TYPE STANDARD TABLE OF JSTO_PRE,"TABLES PARAM
wa_t_objnr  LIKE LINE OF it_t_objnr ,
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 .

DATA(ld_i_flg_from_objects) = 'Check type of data required'.

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

DATA(ld_i_flg_only_invest) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_prart_range to it_t_prart_range.

"populate fields of struture and append to itab
append wa_t_pbukr_range to it_t_pbukr_range.

"populate fields of struture and append to itab
append wa_t_pspid_range to it_t_pspid_range.

"populate fields of struture and append to itab
append wa_t_posid_range to it_t_posid_range.

"populate fields of struture and append to itab
append wa_t_objnr to it_t_objnr.

"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. . CALL FUNCTION 'AIPK_TOP_WBS_ELEMENTS_OLD' EXPORTING * i_flg_from_objects = ld_i_flg_from_objects i_pkokr = ld_i_pkokr * i_flg_only_invest = ld_i_flg_only_invest TABLES * t_prart_range = it_t_prart_range * t_pbukr_range = it_t_pbukr_range * t_pspid_range = it_t_pspid_range * t_posid_range = it_t_posid_range * t_objnr = it_t_objnr t_prps = it_t_prps t_proj = it_t_proj EXCEPTIONS KOKRS_INCONSISTENCY = 1 NO_PROJ_FOR_WBS_ELMENTS = 2 . " AIPK_TOP_WBS_ELEMENTS_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_flg_from_objects  TYPE C ,
it_t_prart_range  TYPE STANDARD TABLE OF RANGE_C2 ,
wa_t_prart_range  LIKE LINE OF it_t_prart_range,
ld_i_pkokr  TYPE TKA01-KOKRS ,
it_t_pbukr_range  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_t_pbukr_range  LIKE LINE OF it_t_pbukr_range,
ld_i_flg_only_invest  TYPE C ,
it_t_pspid_range  TYPE STANDARD TABLE OF RNG_PSPID ,
wa_t_pspid_range  LIKE LINE OF it_t_pspid_range,
it_t_posid_range  TYPE STANDARD TABLE OF RNG_POSID ,
wa_t_posid_range  LIKE LINE OF it_t_posid_range,
it_t_objnr  TYPE STANDARD TABLE OF JSTO_PRE ,
wa_t_objnr  LIKE LINE OF it_t_objnr,
it_t_prps  TYPE STANDARD TABLE OF PRPS ,
wa_t_prps  LIKE LINE OF it_t_prps,
it_t_proj  TYPE STANDARD TABLE OF PROJ ,
wa_t_proj  LIKE LINE OF it_t_proj.

ld_i_flg_from_objects = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_prart_range to it_t_prart_range.

SELECT single KOKRS
FROM TKA01
INTO ld_i_pkokr.


"populate fields of struture and append to itab
append wa_t_pbukr_range to it_t_pbukr_range.
ld_i_flg_only_invest = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_pspid_range to it_t_pspid_range.

"populate fields of struture and append to itab
append wa_t_posid_range to it_t_posid_range.

"populate fields of struture and append to itab
append wa_t_objnr to it_t_objnr.

"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.

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