SAP Function Modules

WGT_SAPI_0016_CREATE_0012 SAP Function module - [EXPORT] Shipping Completion for Stock: Create from N/I







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

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


Pattern for FM WGT_SAPI_0016_CREATE_0012 - WGT SAPI 0016 CREATE 0012





CALL FUNCTION 'WGT_SAPI_0016_CREATE_0012' "[EXPORT] Shipping Completion for Stock: Create from N/I
  EXPORTING
    action_mode = SPACE         " wb2_tew_action_mode  Classification of Subsequent Action
*   recovery_mode = SPACE       " wb2_sapi_recovery_mode
*   call_source = SPACE         " wb2_sapi_call_source
    i_leading_control =         " wb2_bdc_control  TEW: Batch Input Control Data
    billingdocument =           " bapivbrksuccess-bill_doc  Billing Document
    header_siv_data =           " sapi_siv_headersub  Step API: Header Data For Sales Invoices
*   extensionin =               " wb2_sapi_parex_tab  StepAPI: Table for Extensions
*   addon_data =                " komwbgt_tab   Communication Structure of WBGT
    i_tew_type =                " wb2_tew_type  Trading Execution Workbench Type
    i_step =                    " wb2_step      Step in the Business Process
    i_mode =                    " wb2_mode      Mode in the Steps of a Business Process
    i_pre_step =                " wb2_pre_step  Prestep in a Business Process
*   it_source_so =              " wb2_so_data_stab
*   it_source_po =              " wb2_po_data_stab
*   it_source_delivery =        " wb2_delivery_data_stab
*   it_source_tc =              " wb2_tc_data_stab
*   it_source_si =              " wb2_si_data_stab
*   it_source_md =              " wb2_md_data_stab
*   it_source_agency =          " wb2_agency_data_stab
*   it_source_agency_lst =      " wb2_agency_lst_data_stab
*   it_source_iv =              " wb2_iv_data_stab  Data From Incoming Invoices
*   it_source_ac =              " wb2_ac_data_stab  Data From Accounting Documents
*   it_source_si_lst =          " wb2_si_lst_data_stab  Data From SD Documents: Invoice List
*   it_target_so =              " wb2_so_data_stab
*   it_target_po =              " wb2_po_data_stab
*   it_target_delivery =        " wb2_delivery_data_stab
*   it_target_tc =              " wb2_tc_data_stab
*   it_target_si =              " wb2_si_data_stab
*   it_target_agency =          " wb2_agency_data_stab
*   it_target_agency_lst =      " wb2_agency_lst_data_stab
*   it_target_md =              " wb2_md_data_stab
*   it_target_iv =              " wb2_iv_data_stab  Data From Incoming Invoices
*   it_target_ac =              " wb2_ac_data_stab  Data From Accounting Documents
*   it_target_si_lst =          " wb2_si_lst_data_stab  Data From SD Documents: Invoice List
*   it_tewstep2para =           " wb2_tewstep2para_stab
*   it_heads_and_items =        " wb2_heads_and_items_stab
*   it_heads_and_items_target =   " wb2_heads_and_items_stab
*   it_cross_ref_data =         " wb2_alv_n2m_io_ref_tab
  IMPORTING
    error_tew =                 " wb2b_error_tew
    documentkeys =              " sapi_doc_key_tab  Sorted Tables with Document Keys
    extensionout =              " wb2_sapi_parex_tab  StepAPI: Table for Extensions
  TABLES
    return =                    " sapi_return   Return Parameter(s)
  EXCEPTIONS
    ERROR_OCCURRED = 1          "
    CANCELED = 2                "
    .  "  WGT_SAPI_0016_CREATE_0012

ABAP code example for Function Module WGT_SAPI_0016_CREATE_0012





The ABAP code below is a full code listing to execute function module WGT_SAPI_0016_CREATE_0012 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_error_tew  TYPE WB2B_ERROR_TEW ,
ld_documentkeys  TYPE SAPI_DOC_KEY_TAB ,
ld_extensionout  TYPE WB2_SAPI_PAREX_TAB ,
it_return  TYPE STANDARD TABLE OF SAPI_RETURN,"TABLES PARAM
wa_return  LIKE LINE OF it_return .

DATA(ld_action_mode) = 'Check type of data required'.
DATA(ld_recovery_mode) = 'Check type of data required'.
DATA(ld_call_source) = 'Check type of data required'.
DATA(ld_i_leading_control) = 'Check type of data required'.

DATA(ld_billingdocument) = some text here
DATA(ld_header_siv_data) = 'Check type of data required'.
DATA(ld_extensionin) = 'Check type of data required'.
DATA(ld_addon_data) = 'Check type of data required'.
DATA(ld_i_tew_type) = 'Check type of data required'.
DATA(ld_i_step) = 'Check type of data required'.
DATA(ld_i_mode) = 'Check type of data required'.
DATA(ld_i_pre_step) = 'Check type of data required'.
DATA(ld_it_source_so) = 'Check type of data required'.
DATA(ld_it_source_po) = 'Check type of data required'.
DATA(ld_it_source_delivery) = 'Check type of data required'.
DATA(ld_it_source_tc) = 'Check type of data required'.
DATA(ld_it_source_si) = 'Check type of data required'.
DATA(ld_it_source_md) = 'Check type of data required'.
DATA(ld_it_source_agency) = 'Check type of data required'.
DATA(ld_it_source_agency_lst) = 'Check type of data required'.
DATA(ld_it_source_iv) = 'Check type of data required'.
DATA(ld_it_source_ac) = 'Check type of data required'.
DATA(ld_it_source_si_lst) = 'Check type of data required'.
DATA(ld_it_target_so) = 'Check type of data required'.
DATA(ld_it_target_po) = 'Check type of data required'.
DATA(ld_it_target_delivery) = 'Check type of data required'.
DATA(ld_it_target_tc) = 'Check type of data required'.
DATA(ld_it_target_si) = 'Check type of data required'.
DATA(ld_it_target_agency) = 'Check type of data required'.
DATA(ld_it_target_agency_lst) = 'Check type of data required'.
DATA(ld_it_target_md) = 'Check type of data required'.
DATA(ld_it_target_iv) = 'Check type of data required'.
DATA(ld_it_target_ac) = 'Check type of data required'.
DATA(ld_it_target_si_lst) = 'Check type of data required'.
DATA(ld_it_tewstep2para) = 'Check type of data required'.
DATA(ld_it_heads_and_items) = 'Check type of data required'.
DATA(ld_it_heads_and_items_target) = 'Check type of data required'.
DATA(ld_it_cross_ref_data) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'WGT_SAPI_0016_CREATE_0012' EXPORTING action_mode = ld_action_mode * recovery_mode = ld_recovery_mode * call_source = ld_call_source i_leading_control = ld_i_leading_control billingdocument = ld_billingdocument header_siv_data = ld_header_siv_data * extensionin = ld_extensionin * addon_data = ld_addon_data i_tew_type = ld_i_tew_type i_step = ld_i_step i_mode = ld_i_mode i_pre_step = ld_i_pre_step * it_source_so = ld_it_source_so * it_source_po = ld_it_source_po * it_source_delivery = ld_it_source_delivery * it_source_tc = ld_it_source_tc * it_source_si = ld_it_source_si * it_source_md = ld_it_source_md * it_source_agency = ld_it_source_agency * it_source_agency_lst = ld_it_source_agency_lst * it_source_iv = ld_it_source_iv * it_source_ac = ld_it_source_ac * it_source_si_lst = ld_it_source_si_lst * it_target_so = ld_it_target_so * it_target_po = ld_it_target_po * it_target_delivery = ld_it_target_delivery * it_target_tc = ld_it_target_tc * it_target_si = ld_it_target_si * it_target_agency = ld_it_target_agency * it_target_agency_lst = ld_it_target_agency_lst * it_target_md = ld_it_target_md * it_target_iv = ld_it_target_iv * it_target_ac = ld_it_target_ac * it_target_si_lst = ld_it_target_si_lst * it_tewstep2para = ld_it_tewstep2para * it_heads_and_items = ld_it_heads_and_items * it_heads_and_items_target = ld_it_heads_and_items_target * it_cross_ref_data = ld_it_cross_ref_data IMPORTING error_tew = ld_error_tew documentkeys = ld_documentkeys extensionout = ld_extensionout TABLES return = it_return EXCEPTIONS ERROR_OCCURRED = 1 CANCELED = 2 . " WGT_SAPI_0016_CREATE_0012
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.







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_error_tew  TYPE WB2B_ERROR_TEW ,
ld_action_mode  TYPE WB2_TEW_ACTION_MODE ,
it_return  TYPE STANDARD TABLE OF SAPI_RETURN ,
wa_return  LIKE LINE OF it_return,
ld_documentkeys  TYPE SAPI_DOC_KEY_TAB ,
ld_recovery_mode  TYPE WB2_SAPI_RECOVERY_MODE ,
ld_extensionout  TYPE WB2_SAPI_PAREX_TAB ,
ld_call_source  TYPE WB2_SAPI_CALL_SOURCE ,
ld_i_leading_control  TYPE WB2_BDC_CONTROL ,
ld_billingdocument  TYPE BAPIVBRKSUCCESS-BILL_DOC ,
ld_header_siv_data  TYPE SAPI_SIV_HEADERSUB ,
ld_extensionin  TYPE WB2_SAPI_PAREX_TAB ,
ld_addon_data  TYPE KOMWBGT_TAB ,
ld_i_tew_type  TYPE WB2_TEW_TYPE ,
ld_i_step  TYPE WB2_STEP ,
ld_i_mode  TYPE WB2_MODE ,
ld_i_pre_step  TYPE WB2_PRE_STEP ,
ld_it_source_so  TYPE WB2_SO_DATA_STAB ,
ld_it_source_po  TYPE WB2_PO_DATA_STAB ,
ld_it_source_delivery  TYPE WB2_DELIVERY_DATA_STAB ,
ld_it_source_tc  TYPE WB2_TC_DATA_STAB ,
ld_it_source_si  TYPE WB2_SI_DATA_STAB ,
ld_it_source_md  TYPE WB2_MD_DATA_STAB ,
ld_it_source_agency  TYPE WB2_AGENCY_DATA_STAB ,
ld_it_source_agency_lst  TYPE WB2_AGENCY_LST_DATA_STAB ,
ld_it_source_iv  TYPE WB2_IV_DATA_STAB ,
ld_it_source_ac  TYPE WB2_AC_DATA_STAB ,
ld_it_source_si_lst  TYPE WB2_SI_LST_DATA_STAB ,
ld_it_target_so  TYPE WB2_SO_DATA_STAB ,
ld_it_target_po  TYPE WB2_PO_DATA_STAB ,
ld_it_target_delivery  TYPE WB2_DELIVERY_DATA_STAB ,
ld_it_target_tc  TYPE WB2_TC_DATA_STAB ,
ld_it_target_si  TYPE WB2_SI_DATA_STAB ,
ld_it_target_agency  TYPE WB2_AGENCY_DATA_STAB ,
ld_it_target_agency_lst  TYPE WB2_AGENCY_LST_DATA_STAB ,
ld_it_target_md  TYPE WB2_MD_DATA_STAB ,
ld_it_target_iv  TYPE WB2_IV_DATA_STAB ,
ld_it_target_ac  TYPE WB2_AC_DATA_STAB ,
ld_it_target_si_lst  TYPE WB2_SI_LST_DATA_STAB ,
ld_it_tewstep2para  TYPE WB2_TEWSTEP2PARA_STAB ,
ld_it_heads_and_items  TYPE WB2_HEADS_AND_ITEMS_STAB ,
ld_it_heads_and_items_target  TYPE WB2_HEADS_AND_ITEMS_STAB ,
ld_it_cross_ref_data  TYPE WB2_ALV_N2M_IO_REF_TAB .

ld_action_mode = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_return to it_return.
ld_recovery_mode = 'Check type of data required'.
ld_call_source = 'Check type of data required'.
ld_i_leading_control = 'Check type of data required'.

ld_billingdocument = some text here
ld_header_siv_data = 'Check type of data required'.
ld_extensionin = 'Check type of data required'.
ld_addon_data = 'Check type of data required'.
ld_i_tew_type = 'Check type of data required'.
ld_i_step = 'Check type of data required'.
ld_i_mode = 'Check type of data required'.
ld_i_pre_step = 'Check type of data required'.
ld_it_source_so = 'Check type of data required'.
ld_it_source_po = 'Check type of data required'.
ld_it_source_delivery = 'Check type of data required'.
ld_it_source_tc = 'Check type of data required'.
ld_it_source_si = 'Check type of data required'.
ld_it_source_md = 'Check type of data required'.
ld_it_source_agency = 'Check type of data required'.
ld_it_source_agency_lst = 'Check type of data required'.
ld_it_source_iv = 'Check type of data required'.
ld_it_source_ac = 'Check type of data required'.
ld_it_source_si_lst = 'Check type of data required'.
ld_it_target_so = 'Check type of data required'.
ld_it_target_po = 'Check type of data required'.
ld_it_target_delivery = 'Check type of data required'.
ld_it_target_tc = 'Check type of data required'.
ld_it_target_si = 'Check type of data required'.
ld_it_target_agency = 'Check type of data required'.
ld_it_target_agency_lst = 'Check type of data required'.
ld_it_target_md = 'Check type of data required'.
ld_it_target_iv = 'Check type of data required'.
ld_it_target_ac = 'Check type of data required'.
ld_it_target_si_lst = 'Check type of data required'.
ld_it_tewstep2para = 'Check type of data required'.
ld_it_heads_and_items = 'Check type of data required'.
ld_it_heads_and_items_target = 'Check type of data required'.
ld_it_cross_ref_data = '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 WGT_SAPI_0016_CREATE_0012 or its description.