SAP Function Modules

UPC_PACKAGE_CREATE_ADHOC SAP Function module - Creation of Ad-Hoc package







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

Associated Function Group: UPC_PACKAGE
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM UPC_PACKAGE_CREATE_ADHOC - UPC PACKAGE CREATE ADHOC





CALL FUNCTION 'UPC_PACKAGE_CREATE_ADHOC' "Creation of Ad-Hoc package
  EXPORTING
    i_area =                    " upc_y_area    Planning Area
    i_plevel =                  " upc_y_plevel  Planning Level
*   i_set_default =             " char1         Set package to default values
*   i_no_plevel_error =         " char1         Ignore errors from the level
* TABLES
*   it_charsel =                " upc_yt_charsel  Characteristic Selections
*   it_hiesel =                 " upc_yt_hiesel_rfc  Hierarchy info
*   it_hiesel_chadep =          " upc_yt_chadep_rfc  Values of Compound Characteristics
  EXCEPTIONS
    AREA_ERROR = 1              "               Error in planning area
    PLEVEL_ERROR = 2            "               Error in planning level
    CHANM_NOT_IN_PLEVEL = 3     "               Characteristic is not contained in planning level
    CHANM_SEL_IN_PLEVEL = 4     "               Characteristic already has a selection in the planning level
    .  "  UPC_PACKAGE_CREATE_ADHOC

ABAP code example for Function Module UPC_PACKAGE_CREATE_ADHOC





The ABAP code below is a full code listing to execute function module UPC_PACKAGE_CREATE_ADHOC 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_it_charsel  TYPE STANDARD TABLE OF UPC_YT_CHARSEL,"TABLES PARAM
wa_it_charsel  LIKE LINE OF it_it_charsel ,
it_it_hiesel  TYPE STANDARD TABLE OF UPC_YT_HIESEL_RFC,"TABLES PARAM
wa_it_hiesel  LIKE LINE OF it_it_hiesel ,
it_it_hiesel_chadep  TYPE STANDARD TABLE OF UPC_YT_CHADEP_RFC,"TABLES PARAM
wa_it_hiesel_chadep  LIKE LINE OF it_it_hiesel_chadep .

DATA(ld_i_area) = 'Check type of data required'.
DATA(ld_i_plevel) = 'Check type of data required'.
DATA(ld_i_set_default) = 'Check type of data required'.
DATA(ld_i_no_plevel_error) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_charsel to it_it_charsel.

"populate fields of struture and append to itab
append wa_it_hiesel to it_it_hiesel.

"populate fields of struture and append to itab
append wa_it_hiesel_chadep to it_it_hiesel_chadep. . CALL FUNCTION 'UPC_PACKAGE_CREATE_ADHOC' EXPORTING i_area = ld_i_area i_plevel = ld_i_plevel * i_set_default = ld_i_set_default * i_no_plevel_error = ld_i_no_plevel_error * TABLES * it_charsel = it_it_charsel * it_hiesel = it_it_hiesel * it_hiesel_chadep = it_it_hiesel_chadep EXCEPTIONS AREA_ERROR = 1 PLEVEL_ERROR = 2 CHANM_NOT_IN_PLEVEL = 3 CHANM_SEL_IN_PLEVEL = 4 . " UPC_PACKAGE_CREATE_ADHOC
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 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_area  TYPE UPC_Y_AREA ,
it_it_charsel  TYPE STANDARD TABLE OF UPC_YT_CHARSEL ,
wa_it_charsel  LIKE LINE OF it_it_charsel,
ld_i_plevel  TYPE UPC_Y_PLEVEL ,
it_it_hiesel  TYPE STANDARD TABLE OF UPC_YT_HIESEL_RFC ,
wa_it_hiesel  LIKE LINE OF it_it_hiesel,
ld_i_set_default  TYPE CHAR1 ,
it_it_hiesel_chadep  TYPE STANDARD TABLE OF UPC_YT_CHADEP_RFC ,
wa_it_hiesel_chadep  LIKE LINE OF it_it_hiesel_chadep,
ld_i_no_plevel_error  TYPE CHAR1 .

ld_i_area = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_charsel to it_it_charsel.
ld_i_plevel = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_hiesel to it_it_hiesel.
ld_i_set_default = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_hiesel_chadep to it_it_hiesel_chadep.
ld_i_no_plevel_error = '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 UPC_PACKAGE_CREATE_ADHOC or its description.