CO_SD_INSERT_REF_ROUTING 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 CO_SD_INSERT_REF_ROUTING into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
COSD
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'CO_SD_INSERT_REF_ROUTING' "
EXPORTING
caufvd_imp = " caufvd
index_seq_imp = " rc27i-index_plfl
plnal_imp = " rcn10-stdal
plnnr_imp = " rcn10-stdnr
* opr_start_imp = " rcn10-opr_start
* opr_end_imp = " rcn10-opr_end
* flg_dark_imp = " rc27x-flg_sel
* vornr_step = '0001' " rcn10-vornr
* trtyp_imp = 'V' " tc10-trtyp
* sttag_imp = " caufvd-plauf
EXCEPTIONS
NEW_VORNR_FAILED = 1 "
NOT_FOUND = 2 " Reference operation set not found
. " CO_SD_INSERT_REF_ROUTING
The ABAP code below is a full code listing to execute function module CO_SD_INSERT_REF_ROUTING 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_caufvd_imp) = 'Check type of data required'.
DATA(ld_index_seq_imp) = 123
DATA(ld_plnal_imp) = some text here
DATA(ld_plnnr_imp) = some text here
DATA(ld_opr_start_imp) = some text here
DATA(ld_opr_end_imp) = some text here
DATA(ld_flg_dark_imp) = some text here
DATA(ld_vornr_step) = some text here
SELECT single TRTYP
FROM TC10
INTO @DATA(ld_trtyp_imp).
DATA(ld_sttag_imp) = 20210129 . CALL FUNCTION 'CO_SD_INSERT_REF_ROUTING' EXPORTING caufvd_imp = ld_caufvd_imp index_seq_imp = ld_index_seq_imp plnal_imp = ld_plnal_imp plnnr_imp = ld_plnnr_imp * opr_start_imp = ld_opr_start_imp * opr_end_imp = ld_opr_end_imp * flg_dark_imp = ld_flg_dark_imp * vornr_step = ld_vornr_step * trtyp_imp = ld_trtyp_imp * sttag_imp = ld_sttag_imp EXCEPTIONS NEW_VORNR_FAILED = 1 NOT_FOUND = 2 . " CO_SD_INSERT_REF_ROUTING
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.
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_caufvd_imp | TYPE CAUFVD , |
| ld_index_seq_imp | TYPE RC27I-INDEX_PLFL , |
| ld_plnal_imp | TYPE RCN10-STDAL , |
| ld_plnnr_imp | TYPE RCN10-STDNR , |
| ld_opr_start_imp | TYPE RCN10-OPR_START , |
| ld_opr_end_imp | TYPE RCN10-OPR_END , |
| ld_flg_dark_imp | TYPE RC27X-FLG_SEL , |
| ld_vornr_step | TYPE RCN10-VORNR , |
| ld_trtyp_imp | TYPE TC10-TRTYP , |
| ld_sttag_imp | TYPE CAUFVD-PLAUF . |
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 CO_SD_INSERT_REF_ROUTING or its description.