SAP WCHC_API_WCD_CREATE Function Module for WCM: API - Create Work Clearance Documents
WCHC_API_WCD_CREATE is a standard wchc api wcd create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for WCM: API - Create Work Clearance Documents processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for wchc api wcd create FM, simply by entering the name WCHC_API_WCD_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: WCHC
Program Name: SAPLWCHC
Main Program: SAPLWCHC
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function WCHC_API_WCD_CREATE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'WCHC_API_WCD_CREATE'"WCM: API - Create Work Clearance Documents.
EXPORTING
IV_TMPLFLG = "WCD Templates = X
* IT_OBJLST_FUNC = "WCD Object List Functions
* IT_ASGNMT_FUNC = "WCD Object Assignment Functions
* IT_ITEM_FUNC = "WCD Item Functions
* IV_UPD_MODE = WCTP1_UPD_MODE-POST "Requested Mode for Data Update
IT_HEADER = "WCD Header Data
* IT_HEADTEXT_FUNC = "WCD Header Long Text Functions
* IT_REM1TEXT_FUNC = "WCD 1. Remark Long Text Functions
* IT_REM2TEXT_FUNC = "WCD 2. Remark Long Text Functions
* IT_TGTEXT_FUNC = "WCD Tagging Long Text Functions
* IT_UNTGTEXT_FUNC = "WCD Untagging Long Text Functions
* IT_PERMIT_FUNC = "WCD Approval Functions
* IT_CATALOG_FUNC = "WCD Catalog Functions
IMPORTING
ET_RESULT = "Message Log
EXCEPTIONS
ERROR = 1
IMPORTING Parameters details for WCHC_API_WCD_CREATE
IV_TMPLFLG - WCD Templates = X
Data type: WCTP1_FLG_TYPEOptional: No
Call by Reference: No ( called with pass by value option)
IT_OBJLST_FUNC - WCD Object List Functions
Data type: WCTP1_OBJLST_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_ASGNMT_FUNC - WCD Object Assignment Functions
Data type: WCTP1_ASGNMT_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_ITEM_FUNC - WCD Item Functions
Data type: WCTP1_WCDITM_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_UPD_MODE - Requested Mode for Data Update
Data type: WCTP1_UPD_MODE_TYPEDefault: WCTP1_UPD_MODE-POST
Optional: Yes
Call by Reference: No ( called with pass by value option)
IT_HEADER - WCD Header Data
Data type: WCTP1_WCAHETAB_TYPEOptional: No
Call by Reference: No ( called with pass by value option)
IT_HEADTEXT_FUNC - WCD Header Long Text Functions
Data type: WCTP1_TLINES_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_REM1TEXT_FUNC - WCD 1. Remark Long Text Functions
Data type: WCTP1_TLINES_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_REM2TEXT_FUNC - WCD 2. Remark Long Text Functions
Data type: WCTP1_TLINES_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_TGTEXT_FUNC - WCD Tagging Long Text Functions
Data type: WCTP1_TLINES_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_UNTGTEXT_FUNC - WCD Untagging Long Text Functions
Data type: WCTP1_TLINES_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_PERMIT_FUNC - WCD Approval Functions
Data type: WCTP1_PERMIT_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_CATALOG_FUNC - WCD Catalog Functions
Data type: WCTP1_CTLG_FCODETAB_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for WCHC_API_WCD_CREATE
ET_RESULT - Message Log
Data type: WCTP1_MSGLOGTAB_TYPEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for WCHC_API_WCD_CREATE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_error | TYPE STRING, " | |||
| lv_et_result | TYPE WCTP1_MSGLOGTAB_TYPE, " | |||
| lv_iv_tmplflg | TYPE WCTP1_FLG_TYPE, " | |||
| lv_it_objlst_func | TYPE WCTP1_OBJLST_FCODETAB_TYPE, " | |||
| lv_it_asgnmt_func | TYPE WCTP1_ASGNMT_FCODETAB_TYPE, " | |||
| lv_it_item_func | TYPE WCTP1_WCDITM_FCODETAB_TYPE, " | |||
| lv_iv_upd_mode | TYPE WCTP1_UPD_MODE_TYPE, " WCTP1_UPD_MODE-POST | |||
| lv_it_header | TYPE WCTP1_WCAHETAB_TYPE, " | |||
| lv_it_headtext_func | TYPE WCTP1_TLINES_FCODETAB_TYPE, " | |||
| lv_it_rem1text_func | TYPE WCTP1_TLINES_FCODETAB_TYPE, " | |||
| lv_it_rem2text_func | TYPE WCTP1_TLINES_FCODETAB_TYPE, " | |||
| lv_it_tgtext_func | TYPE WCTP1_TLINES_FCODETAB_TYPE, " | |||
| lv_it_untgtext_func | TYPE WCTP1_TLINES_FCODETAB_TYPE, " | |||
| lv_it_permit_func | TYPE WCTP1_PERMIT_FCODETAB_TYPE, " | |||
| lv_it_catalog_func | TYPE WCTP1_CTLG_FCODETAB_TYPE. " |
|   CALL FUNCTION 'WCHC_API_WCD_CREATE' "WCM: API - Create Work Clearance Documents |
| EXPORTING | ||
| IV_TMPLFLG | = lv_iv_tmplflg | |
| IT_OBJLST_FUNC | = lv_it_objlst_func | |
| IT_ASGNMT_FUNC | = lv_it_asgnmt_func | |
| IT_ITEM_FUNC | = lv_it_item_func | |
| IV_UPD_MODE | = lv_iv_upd_mode | |
| IT_HEADER | = lv_it_header | |
| IT_HEADTEXT_FUNC | = lv_it_headtext_func | |
| IT_REM1TEXT_FUNC | = lv_it_rem1text_func | |
| IT_REM2TEXT_FUNC | = lv_it_rem2text_func | |
| IT_TGTEXT_FUNC | = lv_it_tgtext_func | |
| IT_UNTGTEXT_FUNC | = lv_it_untgtext_func | |
| IT_PERMIT_FUNC | = lv_it_permit_func | |
| IT_CATALOG_FUNC | = lv_it_catalog_func | |
| IMPORTING | ||
| ET_RESULT | = lv_et_result | |
| EXCEPTIONS | ||
| ERROR = 1 | ||
| . " WCHC_API_WCD_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM WCHC_API_WCD_CREATE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| DATA(ld_iv_upd_mode) | = WCTP1_UPD_MODE-POST. | |||
Search for further information about these or an SAP related objects