SAP Function Modules

DIP21_OBJECTS_DETERMINE SAP Function module - Change Object List and Hierarchy







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

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


Pattern for FM DIP21_OBJECTS_DETERMINE - DIP21 OBJECTS DETERMINE





CALL FUNCTION 'DIP21_OBJECTS_DETERMINE' "Change Object List and Hierarchy
* EXPORTING
*   i_vbeln =                   " vbak-vbeln    Sales Document
*   i_vbpos =                   " vbap-posnr
*   i_aufnr =                   " aufk-aufnr    CO Order
*   i_pspnr =                   " prps-pspnr
*   i_usage = '01'              " ad01c_prof-dpus  Usage of DIP Profile
*   i_vpkus =                   " vpkus         Sales Pricing Usage
*   i_vsnmr =                   " vsprps_cn-vsnmr  Number or description of a version
  TABLES
    et_objects =                " ad01obj       Objects
    et_rsthie =                 " rsthie
  EXCEPTIONS
    INPUT_ERROR = 1             "               Error in Interface
    OBJECT_SELECTION_ERROR = 2  "
    DELETED_WBS_ELEMENT = 3     "
    .  "  DIP21_OBJECTS_DETERMINE

ABAP code example for Function Module DIP21_OBJECTS_DETERMINE





The ABAP code below is a full code listing to execute function module DIP21_OBJECTS_DETERMINE 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_et_objects  TYPE STANDARD TABLE OF AD01OBJ,"TABLES PARAM
wa_et_objects  LIKE LINE OF it_et_objects ,
it_et_rsthie  TYPE STANDARD TABLE OF RSTHIE,"TABLES PARAM
wa_et_rsthie  LIKE LINE OF it_et_rsthie .


SELECT single VBELN
FROM VBAK
INTO @DATA(ld_i_vbeln).


SELECT single POSNR
FROM VBAP
INTO @DATA(ld_i_vbpos).


SELECT single AUFNR
FROM AUFK
INTO @DATA(ld_i_aufnr).


SELECT single PSPNR
FROM PRPS
INTO @DATA(ld_i_pspnr).


SELECT single DPUS
FROM AD01C_PROF
INTO @DATA(ld_i_usage).

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

SELECT single VSNMR
FROM VSPRPS_CN
INTO @DATA(ld_i_vsnmr).


"populate fields of struture and append to itab
append wa_et_objects to it_et_objects.

"populate fields of struture and append to itab
append wa_et_rsthie to it_et_rsthie. . CALL FUNCTION 'DIP21_OBJECTS_DETERMINE' * EXPORTING * i_vbeln = ld_i_vbeln * i_vbpos = ld_i_vbpos * i_aufnr = ld_i_aufnr * i_pspnr = ld_i_pspnr * i_usage = ld_i_usage * i_vpkus = ld_i_vpkus * i_vsnmr = ld_i_vsnmr TABLES et_objects = it_et_objects et_rsthie = it_et_rsthie EXCEPTIONS INPUT_ERROR = 1 OBJECT_SELECTION_ERROR = 2 DELETED_WBS_ELEMENT = 3 . " DIP21_OBJECTS_DETERMINE
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 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_vbeln  TYPE VBAK-VBELN ,
it_et_objects  TYPE STANDARD TABLE OF AD01OBJ ,
wa_et_objects  LIKE LINE OF it_et_objects,
ld_i_vbpos  TYPE VBAP-POSNR ,
it_et_rsthie  TYPE STANDARD TABLE OF RSTHIE ,
wa_et_rsthie  LIKE LINE OF it_et_rsthie,
ld_i_aufnr  TYPE AUFK-AUFNR ,
ld_i_pspnr  TYPE PRPS-PSPNR ,
ld_i_usage  TYPE AD01C_PROF-DPUS ,
ld_i_vpkus  TYPE VPKUS ,
ld_i_vsnmr  TYPE VSPRPS_CN-VSNMR .


SELECT single VBELN
FROM VBAK
INTO ld_i_vbeln.


"populate fields of struture and append to itab
append wa_et_objects to it_et_objects.

SELECT single POSNR
FROM VBAP
INTO ld_i_vbpos.


"populate fields of struture and append to itab
append wa_et_rsthie to it_et_rsthie.

SELECT single AUFNR
FROM AUFK
INTO ld_i_aufnr.


SELECT single PSPNR
FROM PRPS
INTO ld_i_pspnr.


SELECT single DPUS
FROM AD01C_PROF
INTO ld_i_usage.

ld_i_vpkus = 'Check type of data required'.

SELECT single VSNMR
FROM VSPRPS_CN
INTO ld_i_vsnmr.

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