SAP Function Modules

CR_WORKCENTER_SELECT SAP Function module - Select resource







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

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


Pattern for FM CR_WORKCENTER_SELECT - CR WORKCENTER SELECT





CALL FUNCTION 'CR_WORKCENTER_SELECT' "Select resource
* EXPORTING
*   obj_plpo_plnty =            " plpo-plnty    Operation requirements - task list type
*   obj_plpo_plnnr =            " plpo-plnnr    Operation requirements - task list number
*   obj_plpo_plnkn =            " plpo-plnkn    Operation requirements - task list points
*   date = SY-DATUM             " sy-datum      Key date
*   network =                   " crhh-objid    Resource network
*   arbid_imp =                 " crhd-objid    Current Resource of the Operation
*   list = SPACE                " sy-datar      Manual selection
*   order =                     " caufvd-aufnr  Order (for display)
*   operation =                 " plpo-vornr    Operation (for display)
*   after_rel = 'X'             " sy-datar      Only resources permitted after release
*   check_imp =                 " sy-datar      Only Test of Actual Resource
  IMPORTING
    arbid_sel =                 " crhd-objid    Selected Resource
    imp_not_in_network =        " sy-datar      Current Resource Contained in Resource Network
    imp_not_selected =          " sy-datar      Current resource does not meet selection criteria
    imp_not_after_rel =         " sy-datar      Current Resource Only Permitted to Release
* TABLES
*   arbid_pre =                 " crid          Work centers - predecessor
*   arbid_suc =                 " crid          Work centers - successor
*   arbid_exp =                 " crid          Allowed work centers
  EXCEPTIONS
    NO_SELECTION = 1            "               No selection possible
    .  "  CR_WORKCENTER_SELECT

ABAP code example for Function Module CR_WORKCENTER_SELECT





The ABAP code below is a full code listing to execute function module CR_WORKCENTER_SELECT 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_arbid_sel  TYPE CRHD-OBJID ,
ld_imp_not_in_network  TYPE SY-DATAR ,
ld_imp_not_selected  TYPE SY-DATAR ,
ld_imp_not_after_rel  TYPE SY-DATAR ,
it_arbid_pre  TYPE STANDARD TABLE OF CRID,"TABLES PARAM
wa_arbid_pre  LIKE LINE OF it_arbid_pre ,
it_arbid_suc  TYPE STANDARD TABLE OF CRID,"TABLES PARAM
wa_arbid_suc  LIKE LINE OF it_arbid_suc ,
it_arbid_exp  TYPE STANDARD TABLE OF CRID,"TABLES PARAM
wa_arbid_exp  LIKE LINE OF it_arbid_exp .


SELECT single PLNTY
FROM PLPO
INTO @DATA(ld_obj_plpo_plnty).


SELECT single PLNNR
FROM PLPO
INTO @DATA(ld_obj_plpo_plnnr).


SELECT single PLNKN
FROM PLPO
INTO @DATA(ld_obj_plpo_plnkn).

DATA(ld_date) = '20210129'.

SELECT single OBJID
FROM CRHH
INTO @DATA(ld_network).


SELECT single OBJID
FROM CRHD
INTO @DATA(ld_arbid_imp).

DATA(ld_list) = 'some text here'.

DATA(ld_order) = some text here

SELECT single VORNR
FROM PLPO
INTO @DATA(ld_operation).

DATA(ld_after_rel) = 'some text here'.
DATA(ld_check_imp) = 'some text here'.

"populate fields of struture and append to itab
append wa_arbid_pre to it_arbid_pre.

"populate fields of struture and append to itab
append wa_arbid_suc to it_arbid_suc.

"populate fields of struture and append to itab
append wa_arbid_exp to it_arbid_exp. . CALL FUNCTION 'CR_WORKCENTER_SELECT' * EXPORTING * obj_plpo_plnty = ld_obj_plpo_plnty * obj_plpo_plnnr = ld_obj_plpo_plnnr * obj_plpo_plnkn = ld_obj_plpo_plnkn * date = ld_date * network = ld_network * arbid_imp = ld_arbid_imp * list = ld_list * order = ld_order * operation = ld_operation * after_rel = ld_after_rel * check_imp = ld_check_imp IMPORTING arbid_sel = ld_arbid_sel imp_not_in_network = ld_imp_not_in_network imp_not_selected = ld_imp_not_selected imp_not_after_rel = ld_imp_not_after_rel * TABLES * arbid_pre = it_arbid_pre * arbid_suc = it_arbid_suc * arbid_exp = it_arbid_exp EXCEPTIONS NO_SELECTION = 1 . " CR_WORKCENTER_SELECT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_arbid_sel  TYPE CRHD-OBJID ,
ld_obj_plpo_plnty  TYPE PLPO-PLNTY ,
it_arbid_pre  TYPE STANDARD TABLE OF CRID ,
wa_arbid_pre  LIKE LINE OF it_arbid_pre,
ld_imp_not_in_network  TYPE SY-DATAR ,
ld_obj_plpo_plnnr  TYPE PLPO-PLNNR ,
it_arbid_suc  TYPE STANDARD TABLE OF CRID ,
wa_arbid_suc  LIKE LINE OF it_arbid_suc,
ld_imp_not_selected  TYPE SY-DATAR ,
ld_obj_plpo_plnkn  TYPE PLPO-PLNKN ,
it_arbid_exp  TYPE STANDARD TABLE OF CRID ,
wa_arbid_exp  LIKE LINE OF it_arbid_exp,
ld_imp_not_after_rel  TYPE SY-DATAR ,
ld_date  TYPE SY-DATUM ,
ld_network  TYPE CRHH-OBJID ,
ld_arbid_imp  TYPE CRHD-OBJID ,
ld_list  TYPE SY-DATAR ,
ld_order  TYPE CAUFVD-AUFNR ,
ld_operation  TYPE PLPO-VORNR ,
ld_after_rel  TYPE SY-DATAR ,
ld_check_imp  TYPE SY-DATAR .


SELECT single PLNTY
FROM PLPO
INTO ld_obj_plpo_plnty.


"populate fields of struture and append to itab
append wa_arbid_pre to it_arbid_pre.

SELECT single PLNNR
FROM PLPO
INTO ld_obj_plpo_plnnr.


"populate fields of struture and append to itab
append wa_arbid_suc to it_arbid_suc.

SELECT single PLNKN
FROM PLPO
INTO ld_obj_plpo_plnkn.


"populate fields of struture and append to itab
append wa_arbid_exp to it_arbid_exp.
ld_date = '20210129'.

SELECT single OBJID
FROM CRHH
INTO ld_network.


SELECT single OBJID
FROM CRHD
INTO ld_arbid_imp.

ld_list = 'some text here'.

ld_order = some text here

SELECT single VORNR
FROM PLPO
INTO ld_operation.

ld_after_rel = 'some text here'.
ld_check_imp = 'some text here'.

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