SAP Function Modules

WLF_REGU_DOCUMENT_COPY SAP Function module







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

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


Pattern for FM WLF_REGU_DOCUMENT_COPY - WLF REGU DOCUMENT COPY





CALL FUNCTION 'WLF_REGU_DOCUMENT_COPY' "
  EXPORTING
    i_documentnumber =          " komlfk-wbeln  Agency Business: Document Number
*   i_invoice_type =            " komlfk-lfart  Agency Business: Billing Document Type
*   i_invoice_date =            " komlfk-wfdat  Agency Business: Posting Date
*   i_pricing_date =            " komlfp-prsdt  Date for Pricing and Exchange Rate
*   i_bill_reason =             " komlfk-lfgru  Agency Business: Reason for Activity
*   i_with_posting = SPACE      " c             Post Document
*   i_enqueue = 'X'             " rwlf2-sperren  Block all Documents
*   i_commit = 'X'              " c             Execute Commit
*   i_no_check =                " c             No check
*   i_create_docu_flow = 'X'    " c
*   i_currency =                " waerl         Currency of Agency Document
*   i_partner_change =          " wlf_partner_change_parameters  Data for Partner Change
*   i_post_party = SPACE        " wlf_post_party  Posting Partner
*   i_payment_type =            " komlfk-wrart  Agency Business: Payment Type
  IMPORTING
    e_komlfk =                  " komlfk
  TABLES
    t_error_messages =          " wlf1_error    Vendor billing document: Error message structure
*   t_copy_parameters =         " wlf_copy_parameters  AB: Parameter Table for Copying Items
*   t_copy_references =         " wlf_copy_references  AB: Referencing Structure for Copying Agency Documents
*   t_komlfk =                  " komlfk        Communication Structure: Vendor Billing Document Header
*   t_komlfp =                  " komlfp        Vendor Billing Document: Billing Document Items
*   t_komv =                    " komv          Pricing: Communications Condition Record
*   t_komk =                    " komk          Communication Header for Pricing
*   t_komp =                    " komp          Communication Item for Pricing
*   t_komlfktxt =               " komlfktxt     Communication Structure: Change Texts using BAPI
*   t_ykomlfk =                 " komlfk
*   t_ykomlfp =                 " komlfp
*   t_ykomv =                   " komv
* CHANGING
*   ct_komwbpa =                " wlf_tt_komwbpa
*   ct_komwbpa_old =            " wlf_tt_komwbpa
    .  "  WLF_REGU_DOCUMENT_COPY

ABAP code example for Function Module WLF_REGU_DOCUMENT_COPY





The ABAP code below is a full code listing to execute function module WLF_REGU_DOCUMENT_COPY 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_e_komlfk  TYPE KOMLFK ,
it_t_error_messages  TYPE STANDARD TABLE OF WLF1_ERROR,"TABLES PARAM
wa_t_error_messages  LIKE LINE OF it_t_error_messages ,
it_t_copy_parameters  TYPE STANDARD TABLE OF WLF_COPY_PARAMETERS,"TABLES PARAM
wa_t_copy_parameters  LIKE LINE OF it_t_copy_parameters ,
it_t_copy_references  TYPE STANDARD TABLE OF WLF_COPY_REFERENCES,"TABLES PARAM
wa_t_copy_references  LIKE LINE OF it_t_copy_references ,
it_t_komlfk  TYPE STANDARD TABLE OF KOMLFK,"TABLES PARAM
wa_t_komlfk  LIKE LINE OF it_t_komlfk ,
it_t_komlfp  TYPE STANDARD TABLE OF KOMLFP,"TABLES PARAM
wa_t_komlfp  LIKE LINE OF it_t_komlfp ,
it_t_komv  TYPE STANDARD TABLE OF KOMV,"TABLES PARAM
wa_t_komv  LIKE LINE OF it_t_komv ,
it_t_komk  TYPE STANDARD TABLE OF KOMK,"TABLES PARAM
wa_t_komk  LIKE LINE OF it_t_komk ,
it_t_komp  TYPE STANDARD TABLE OF KOMP,"TABLES PARAM
wa_t_komp  LIKE LINE OF it_t_komp ,
it_t_komlfktxt  TYPE STANDARD TABLE OF KOMLFKTXT,"TABLES PARAM
wa_t_komlfktxt  LIKE LINE OF it_t_komlfktxt ,
it_t_ykomlfk  TYPE STANDARD TABLE OF KOMLFK,"TABLES PARAM
wa_t_ykomlfk  LIKE LINE OF it_t_ykomlfk ,
it_t_ykomlfp  TYPE STANDARD TABLE OF KOMLFP,"TABLES PARAM
wa_t_ykomlfp  LIKE LINE OF it_t_ykomlfp ,
it_t_ykomv  TYPE STANDARD TABLE OF KOMV,"TABLES PARAM
wa_t_ykomv  LIKE LINE OF it_t_ykomv .

DATA(ld_ct_komwbpa) = 'Check type of data required'.
DATA(ld_ct_komwbpa_old) = 'Check type of data required'.

DATA(ld_i_documentnumber) = some text here

DATA(ld_i_invoice_type) = some text here

DATA(ld_i_invoice_date) = 20210129

DATA(ld_i_pricing_date) = 20210129

DATA(ld_i_bill_reason) = some text here
DATA(ld_i_with_posting) = 'Check type of data required'.

DATA(ld_i_enqueue) = some text here
DATA(ld_i_commit) = 'Check type of data required'.
DATA(ld_i_no_check) = 'Check type of data required'.
DATA(ld_i_create_docu_flow) = 'Check type of data required'.
DATA(ld_i_currency) = 'Check type of data required'.
DATA(ld_i_partner_change) = 'Check type of data required'.
DATA(ld_i_post_party) = 'Check type of data required'.

DATA(ld_i_payment_type) = some text here

"populate fields of struture and append to itab
append wa_t_error_messages to it_t_error_messages.

"populate fields of struture and append to itab
append wa_t_copy_parameters to it_t_copy_parameters.

"populate fields of struture and append to itab
append wa_t_copy_references to it_t_copy_references.

"populate fields of struture and append to itab
append wa_t_komlfk to it_t_komlfk.

"populate fields of struture and append to itab
append wa_t_komlfp to it_t_komlfp.

"populate fields of struture and append to itab
append wa_t_komv to it_t_komv.

"populate fields of struture and append to itab
append wa_t_komk to it_t_komk.

"populate fields of struture and append to itab
append wa_t_komp to it_t_komp.

"populate fields of struture and append to itab
append wa_t_komlfktxt to it_t_komlfktxt.

"populate fields of struture and append to itab
append wa_t_ykomlfk to it_t_ykomlfk.

"populate fields of struture and append to itab
append wa_t_ykomlfp to it_t_ykomlfp.

"populate fields of struture and append to itab
append wa_t_ykomv to it_t_ykomv. . CALL FUNCTION 'WLF_REGU_DOCUMENT_COPY' EXPORTING i_documentnumber = ld_i_documentnumber * i_invoice_type = ld_i_invoice_type * i_invoice_date = ld_i_invoice_date * i_pricing_date = ld_i_pricing_date * i_bill_reason = ld_i_bill_reason * i_with_posting = ld_i_with_posting * i_enqueue = ld_i_enqueue * i_commit = ld_i_commit * i_no_check = ld_i_no_check * i_create_docu_flow = ld_i_create_docu_flow * i_currency = ld_i_currency * i_partner_change = ld_i_partner_change * i_post_party = ld_i_post_party * i_payment_type = ld_i_payment_type IMPORTING e_komlfk = ld_e_komlfk TABLES t_error_messages = it_t_error_messages * t_copy_parameters = it_t_copy_parameters * t_copy_references = it_t_copy_references * t_komlfk = it_t_komlfk * t_komlfp = it_t_komlfp * t_komv = it_t_komv * t_komk = it_t_komk * t_komp = it_t_komp * t_komlfktxt = it_t_komlfktxt * t_ykomlfk = it_t_ykomlfk * t_ykomlfp = it_t_ykomlfp * t_ykomv = it_t_ykomv * CHANGING * ct_komwbpa = ld_ct_komwbpa * ct_komwbpa_old = ld_ct_komwbpa_old . " WLF_REGU_DOCUMENT_COPY
IF SY-SUBRC EQ 0. "All OK 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_ct_komwbpa  TYPE WLF_TT_KOMWBPA ,
ld_e_komlfk  TYPE KOMLFK ,
ld_i_documentnumber  TYPE KOMLFK-WBELN ,
it_t_error_messages  TYPE STANDARD TABLE OF WLF1_ERROR ,
wa_t_error_messages  LIKE LINE OF it_t_error_messages,
ld_ct_komwbpa_old  TYPE WLF_TT_KOMWBPA ,
ld_i_invoice_type  TYPE KOMLFK-LFART ,
it_t_copy_parameters  TYPE STANDARD TABLE OF WLF_COPY_PARAMETERS ,
wa_t_copy_parameters  LIKE LINE OF it_t_copy_parameters,
ld_i_invoice_date  TYPE KOMLFK-WFDAT ,
it_t_copy_references  TYPE STANDARD TABLE OF WLF_COPY_REFERENCES ,
wa_t_copy_references  LIKE LINE OF it_t_copy_references,
ld_i_pricing_date  TYPE KOMLFP-PRSDT ,
it_t_komlfk  TYPE STANDARD TABLE OF KOMLFK ,
wa_t_komlfk  LIKE LINE OF it_t_komlfk,
ld_i_bill_reason  TYPE KOMLFK-LFGRU ,
it_t_komlfp  TYPE STANDARD TABLE OF KOMLFP ,
wa_t_komlfp  LIKE LINE OF it_t_komlfp,
ld_i_with_posting  TYPE C ,
it_t_komv  TYPE STANDARD TABLE OF KOMV ,
wa_t_komv  LIKE LINE OF it_t_komv,
ld_i_enqueue  TYPE RWLF2-SPERREN ,
it_t_komk  TYPE STANDARD TABLE OF KOMK ,
wa_t_komk  LIKE LINE OF it_t_komk,
ld_i_commit  TYPE C ,
it_t_komp  TYPE STANDARD TABLE OF KOMP ,
wa_t_komp  LIKE LINE OF it_t_komp,
ld_i_no_check  TYPE C ,
it_t_komlfktxt  TYPE STANDARD TABLE OF KOMLFKTXT ,
wa_t_komlfktxt  LIKE LINE OF it_t_komlfktxt,
it_t_ykomlfk  TYPE STANDARD TABLE OF KOMLFK ,
wa_t_ykomlfk  LIKE LINE OF it_t_ykomlfk,
ld_i_create_docu_flow  TYPE C ,
it_t_ykomlfp  TYPE STANDARD TABLE OF KOMLFP ,
wa_t_ykomlfp  LIKE LINE OF it_t_ykomlfp,
ld_i_currency  TYPE WAERL ,
it_t_ykomv  TYPE STANDARD TABLE OF KOMV ,
wa_t_ykomv  LIKE LINE OF it_t_ykomv,
ld_i_partner_change  TYPE WLF_PARTNER_CHANGE_PARAMETERS ,
ld_i_post_party  TYPE WLF_POST_PARTY ,
ld_i_payment_type  TYPE KOMLFK-WRART .

ld_ct_komwbpa = 'Check type of data required'.

ld_i_documentnumber = some text here

"populate fields of struture and append to itab
append wa_t_error_messages to it_t_error_messages.
ld_ct_komwbpa_old = 'Check type of data required'.

ld_i_invoice_type = some text here

"populate fields of struture and append to itab
append wa_t_copy_parameters to it_t_copy_parameters.

ld_i_invoice_date = 20210129

"populate fields of struture and append to itab
append wa_t_copy_references to it_t_copy_references.

ld_i_pricing_date = 20210129

"populate fields of struture and append to itab
append wa_t_komlfk to it_t_komlfk.

ld_i_bill_reason = some text here

"populate fields of struture and append to itab
append wa_t_komlfp to it_t_komlfp.
ld_i_with_posting = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_komv to it_t_komv.

ld_i_enqueue = some text here

"populate fields of struture and append to itab
append wa_t_komk to it_t_komk.
ld_i_commit = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_komp to it_t_komp.
ld_i_no_check = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_komlfktxt to it_t_komlfktxt.

"populate fields of struture and append to itab
append wa_t_ykomlfk to it_t_ykomlfk.
ld_i_create_docu_flow = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_ykomlfp to it_t_ykomlfp.
ld_i_currency = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_ykomv to it_t_ykomv.
ld_i_partner_change = 'Check type of data required'.
ld_i_post_party = 'Check type of data required'.

ld_i_payment_type = 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 WLF_REGU_DOCUMENT_COPY or its description.