SAP Function Modules

WLF_INVOICE_DOCUMENT_CLOSE SAP Function module







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

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


Pattern for FM WLF_INVOICE_DOCUMENT_CLOSE - WLF INVOICE DOCUMENT CLOSE





CALL FUNCTION 'WLF_INVOICE_DOCUMENT_CLOSE' "
* EXPORTING
*   i_enqueue = 'X'             " rwlf2-sperren
*   i_testrun = SPACE           " c
*   i_synch = SPACE             " rqm06-sync_verbu  Indicator: Synchronous Update
*   i_wdtyp = WDTYP-INVOICE     " doctype       Agency Business: Document Category
*   i_online =                  " c
*   i_exit_on_error =           " xfeld
*   i_lfgru =                   " wfgru
  IMPORTING
    et_komlfk =                 " komlfk_itab   Table for KOMLFK
  TABLES
    t_komlfk =                  " komlfk
*   t_error_messages =          " wlf1_error
* CHANGING
*   ct_komlfktxt =              " komlfktxt_itab
  EXCEPTIONS
    FATAL_ERROR = 1             "
    .  "  WLF_INVOICE_DOCUMENT_CLOSE

ABAP code example for Function Module WLF_INVOICE_DOCUMENT_CLOSE





The ABAP code below is a full code listing to execute function module WLF_INVOICE_DOCUMENT_CLOSE 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_et_komlfk  TYPE KOMLFK_ITAB ,
it_t_komlfk  TYPE STANDARD TABLE OF KOMLFK,"TABLES PARAM
wa_t_komlfk  LIKE LINE OF it_t_komlfk ,
it_t_error_messages  TYPE STANDARD TABLE OF WLF1_ERROR,"TABLES PARAM
wa_t_error_messages  LIKE LINE OF it_t_error_messages .

DATA(ld_ct_komlfktxt) = 'Check type of data required'.

DATA(ld_i_enqueue) = some text here
DATA(ld_i_testrun) = 'Check type of data required'.

DATA(ld_i_synch) = some text here
DATA(ld_i_wdtyp) = 'Check type of data required'.
DATA(ld_i_online) = 'Check type of data required'.
DATA(ld_i_exit_on_error) = 'Check type of data required'.
DATA(ld_i_lfgru) = 'Check type of data required'.

"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_error_messages to it_t_error_messages. . CALL FUNCTION 'WLF_INVOICE_DOCUMENT_CLOSE' * EXPORTING * i_enqueue = ld_i_enqueue * i_testrun = ld_i_testrun * i_synch = ld_i_synch * i_wdtyp = ld_i_wdtyp * i_online = ld_i_online * i_exit_on_error = ld_i_exit_on_error * i_lfgru = ld_i_lfgru IMPORTING et_komlfk = ld_et_komlfk TABLES t_komlfk = it_t_komlfk * t_error_messages = it_t_error_messages * CHANGING * ct_komlfktxt = ld_ct_komlfktxt EXCEPTIONS FATAL_ERROR = 1 . " WLF_INVOICE_DOCUMENT_CLOSE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_ct_komlfktxt  TYPE KOMLFKTXT_ITAB ,
ld_et_komlfk  TYPE KOMLFK_ITAB ,
ld_i_enqueue  TYPE RWLF2-SPERREN ,
it_t_komlfk  TYPE STANDARD TABLE OF KOMLFK ,
wa_t_komlfk  LIKE LINE OF it_t_komlfk,
ld_i_testrun  TYPE C ,
it_t_error_messages  TYPE STANDARD TABLE OF WLF1_ERROR ,
wa_t_error_messages  LIKE LINE OF it_t_error_messages,
ld_i_synch  TYPE RQM06-SYNC_VERBU ,
ld_i_wdtyp  TYPE DOCTYPE ,
ld_i_online  TYPE C ,
ld_i_exit_on_error  TYPE XFELD ,
ld_i_lfgru  TYPE WFGRU .

ld_ct_komlfktxt = 'Check type of data required'.

ld_i_enqueue = some text here

"populate fields of struture and append to itab
append wa_t_komlfk to it_t_komlfk.
ld_i_testrun = 'Check type of data required'.

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

ld_i_synch = some text here
ld_i_wdtyp = 'Check type of data required'.
ld_i_online = 'Check type of data required'.
ld_i_exit_on_error = 'Check type of data required'.
ld_i_lfgru = '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 WLF_INVOICE_DOCUMENT_CLOSE or its description.