SAP WCHC_API_WCA_CREATE_WITH_REF Function Module for WCM: API - Create (Work Clearance) Applications with Reference









WCHC_API_WCA_CREATE_WITH_REF is a standard wchc api wca create with ref 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) Applications with Reference 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 wca create with ref FM, simply by entering the name WCHC_API_WCA_CREATE_WITH_REF 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_WCA_CREATE_WITH_REF 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_WCA_CREATE_WITH_REF'"WCM: API - Create (Work Clearance) Applications with Reference
EXPORTING
IV_TMPLFLG = "WCA Templates = X
* IV_UPD_MODE = WCTP1_UPD_MODE-POST "Requested Mode for Data Update
* IV_WAPITYP = WCTP1_OBJTYP-WCA "Application Type
IT_HEADER = "WCA Header Data
* IV_REFKEY = "Object Key of Copy Reference
* IV_REFART = WCTP1_OBJART-WAPI "Object Type of Copy Reference
* IV_REFOBJ = "Status Object Number of Copy Reference (alternatively to IV_REFKEY)
* IV_ASGNKEY = "Object Key of Assigned Object
* IV_ASGNART = "Object Type of Assigned Object
* IV_ASGNOBJ = "Status Object Number of Assigned Object (alternatively to IV_ASGNKEY)

IMPORTING
ET_RESULT = "Message Log

EXCEPTIONS
ERROR = 1
.



IMPORTING Parameters details for WCHC_API_WCA_CREATE_WITH_REF

IV_TMPLFLG - WCA Templates = X

Data type: WCTP1_FLG_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

IV_UPD_MODE - Requested Mode for Data Update

Data type: WCTP1_UPD_MODE_TYPE
Default: WCTP1_UPD_MODE-POST
Optional: No
Call by Reference: No ( called with pass by value option)

IV_WAPITYP - Application Type

Data type: WCTP1_OBJTYP_TYPE
Default: WCTP1_OBJTYP-WCA
Optional: Yes
Call by Reference: No ( called with pass by value option)

IT_HEADER - WCA Header Data

Data type: WCTP1_WCAAPTAB_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

IV_REFKEY - Object Key of Copy Reference

Data type: WCTP1_OBJKEY_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_REFART - Object Type of Copy Reference

Data type: WCTP1_OBJART_TYPE
Default: WCTP1_OBJART-WAPI
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_REFOBJ - Status Object Number of Copy Reference (alternatively to IV_REFKEY)

Data type: WCTP1_OBJNR_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_ASGNKEY - Object Key of Assigned Object

Data type: WCTP1_OBJKEY_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_ASGNART - Object Type of Assigned Object

Data type: WCTP1_OBJART_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_ASGNOBJ - Status Object Number of Assigned Object (alternatively to IV_ASGNKEY)

Data type: WCTP1_OBJNR_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for WCHC_API_WCA_CREATE_WITH_REF

ET_RESULT - Message Log

Data type: WCTP1_MSGLOGTAB_TYPE
Optional: 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_WCA_CREATE_WITH_REF 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_iv_upd_mode  TYPE WCTP1_UPD_MODE_TYPE, "   WCTP1_UPD_MODE-POST
lv_iv_wapityp  TYPE WCTP1_OBJTYP_TYPE, "   WCTP1_OBJTYP-WCA
lv_it_header  TYPE WCTP1_WCAAPTAB_TYPE, "   
lv_iv_refkey  TYPE WCTP1_OBJKEY_TYPE, "   
lv_iv_refart  TYPE WCTP1_OBJART_TYPE, "   WCTP1_OBJART-WAPI
lv_iv_refobj  TYPE WCTP1_OBJNR_TYPE, "   
lv_iv_asgnkey  TYPE WCTP1_OBJKEY_TYPE, "   
lv_iv_asgnart  TYPE WCTP1_OBJART_TYPE, "   
lv_iv_asgnobj  TYPE WCTP1_OBJNR_TYPE. "   

  CALL FUNCTION 'WCHC_API_WCA_CREATE_WITH_REF'  "WCM: API - Create (Work Clearance) Applications with Reference
    EXPORTING
         IV_TMPLFLG = lv_iv_tmplflg
         IV_UPD_MODE = lv_iv_upd_mode
         IV_WAPITYP = lv_iv_wapityp
         IT_HEADER = lv_it_header
         IV_REFKEY = lv_iv_refkey
         IV_REFART = lv_iv_refart
         IV_REFOBJ = lv_iv_refobj
         IV_ASGNKEY = lv_iv_asgnkey
         IV_ASGNART = lv_iv_asgnart
         IV_ASGNOBJ = lv_iv_asgnobj
    IMPORTING
         ET_RESULT = lv_et_result
    EXCEPTIONS
        ERROR = 1
. " WCHC_API_WCA_CREATE_WITH_REF




ABAP code using 7.40 inline data declarations to call FM WCHC_API_WCA_CREATE_WITH_REF

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.
 
DATA(ld_iv_wapityp) = WCTP1_OBJTYP-WCA.
 
 
 
DATA(ld_iv_refart) = WCTP1_OBJART-WAPI.
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!