SAP Function Modules

APAR_GET_VEND_DOCUMENT SAP Function module - EBPP: Lesen einer Rechnung







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

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


Pattern for FM APAR_GET_VEND_DOCUMENT - APAR GET VEND DOCUMENT





CALL FUNCTION 'APAR_GET_VEND_DOCUMENT' "EBPP: Lesen einer Rechnung
* EXPORTING
*   i_comp_code =               " bukrs         Buchungskreis
*   i_vendor =                  " lifnr         Kontonummer des Lieferanten bzw. Kreditors
*   i_uname =                   " uname         Benutzername
*   i_awtyp =                   " awtyp         Referenzvorgang
*   i_aworg =                   " aworg         Referenzorganisationseinheiten
*   i_awref =                   " awref         Referenzbelegnummer
*   i_awsys =                   " awsys         Logisches System des Ursprungsbeleges
*   i_belnr =                   " belnr_d       Belegnummer eines Buchhaltungsbeleges
*   i_gjahr =                   " gjahr         Geschäftsjahr
*   i_buzei =                   " buzei         Nummer der Buchungszeile innerhalb des Buchhaltungsbelegs
*   i_xblnr =                   " xblnr1        Referenz-Belegnummer
*   i_open_items = 'X'          " boolean       X: offene Posten
*   i_cleared_items = 'X'       " boolean       X: ausgeglichene Posten
*   i_parked_items = 'X'        " boolean       boolsche Variable (X=true, -=false, space=unknown)
*   i_x_pay_context = SPACE     " boolean       X: Kontext der Zahlungen ermitteln
*   i_badi =                    " if_ex_apar_ebpp_get_data  BAdI-Interface IF_EX_APAR_EBPP_GET_DATA
*   i_display_currency = SPACE  " waers         Währungsschlüssel
*   i_ignore_rebzg = SPACE      " boolean       X: Rechnungsbezug wird ignoriert
* TABLES
*   t_items =                   " aparebpp_item  Biller Direct: Positionsdaten
*   t_invoices =                " aparebpp_invoice  Biller Direct: Rechnungsdaten
*   t_allocation =              " aparebpp_allocation  Biller Direct: Zuordnung Positionsdaten / Rechnungsdaten
*   t_mypayments =              " aparebpp_mypayments  Biller Direct: Meine Zahlungen
*   t_payallocation =           " aparebpp_payallocation  Biller Direct: Zuordnung Zahlungsdaten / Rechnungsdaten
*   t_init_data =               " ebpp_init_add_data  Biller Direct: Weitere Daten für Frontend
*   t_payexplanation =          " aparebpp_payexplanation  Biller Direct: Erklärung einer Zahlung
  EXCEPTIONS
    NOT_FOUND = 1               "               Rechnung wurde nicht gefunden
    .  "  APAR_GET_VEND_DOCUMENT

ABAP code example for Function Module APAR_GET_VEND_DOCUMENT





The ABAP code below is a full code listing to execute function module APAR_GET_VEND_DOCUMENT 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:
it_t_items  TYPE STANDARD TABLE OF APAREBPP_ITEM,"TABLES PARAM
wa_t_items  LIKE LINE OF it_t_items ,
it_t_invoices  TYPE STANDARD TABLE OF APAREBPP_INVOICE,"TABLES PARAM
wa_t_invoices  LIKE LINE OF it_t_invoices ,
it_t_allocation  TYPE STANDARD TABLE OF APAREBPP_ALLOCATION,"TABLES PARAM
wa_t_allocation  LIKE LINE OF it_t_allocation ,
it_t_mypayments  TYPE STANDARD TABLE OF APAREBPP_MYPAYMENTS,"TABLES PARAM
wa_t_mypayments  LIKE LINE OF it_t_mypayments ,
it_t_payallocation  TYPE STANDARD TABLE OF APAREBPP_PAYALLOCATION,"TABLES PARAM
wa_t_payallocation  LIKE LINE OF it_t_payallocation ,
it_t_init_data  TYPE STANDARD TABLE OF EBPP_INIT_ADD_DATA,"TABLES PARAM
wa_t_init_data  LIKE LINE OF it_t_init_data ,
it_t_payexplanation  TYPE STANDARD TABLE OF APAREBPP_PAYEXPLANATION,"TABLES PARAM
wa_t_payexplanation  LIKE LINE OF it_t_payexplanation .

DATA(ld_i_comp_code) = 'Check type of data required'.
DATA(ld_i_vendor) = 'Check type of data required'.
DATA(ld_i_uname) = 'Check type of data required'.
DATA(ld_i_awtyp) = 'Check type of data required'.
DATA(ld_i_aworg) = 'Check type of data required'.
DATA(ld_i_awref) = 'Check type of data required'.
DATA(ld_i_awsys) = '123 '.
DATA(ld_i_belnr) = 'some text here'.
DATA(ld_i_gjahr) = 'some text here'.
DATA(ld_i_buzei) = 'some text here'.
DATA(ld_i_xblnr) = 'some text here'.
DATA(ld_i_open_items) = 'some text here'.
DATA(ld_i_cleared_items) = 'some text here'.
DATA(ld_i_parked_items) = 'some text here'.
DATA(ld_i_x_pay_context) = 'some text here'.
DATA(ld_i_badi) = 'some text here'.
DATA(ld_i_display_currency) = 'some text here'.
DATA(ld_i_ignore_rebzg) = 'some text here'.

"populate fields of struture and append to itab
append wa_t_items to it_t_items.

"populate fields of struture and append to itab
append wa_t_invoices to it_t_invoices.

"populate fields of struture and append to itab
append wa_t_allocation to it_t_allocation.

"populate fields of struture and append to itab
append wa_t_mypayments to it_t_mypayments.

"populate fields of struture and append to itab
append wa_t_payallocation to it_t_payallocation.

"populate fields of struture and append to itab
append wa_t_init_data to it_t_init_data.

"populate fields of struture and append to itab
append wa_t_payexplanation to it_t_payexplanation. . CALL FUNCTION 'APAR_GET_VEND_DOCUMENT' * EXPORTING * i_comp_code = ld_i_comp_code * i_vendor = ld_i_vendor * i_uname = ld_i_uname * i_awtyp = ld_i_awtyp * i_aworg = ld_i_aworg * i_awref = ld_i_awref * i_awsys = ld_i_awsys * i_belnr = ld_i_belnr * i_gjahr = ld_i_gjahr * i_buzei = ld_i_buzei * i_xblnr = ld_i_xblnr * i_open_items = ld_i_open_items * i_cleared_items = ld_i_cleared_items * i_parked_items = ld_i_parked_items * i_x_pay_context = ld_i_x_pay_context * i_badi = ld_i_badi * i_display_currency = ld_i_display_currency * i_ignore_rebzg = ld_i_ignore_rebzg * TABLES * t_items = it_t_items * t_invoices = it_t_invoices * t_allocation = it_t_allocation * t_mypayments = it_t_mypayments * t_payallocation = it_t_payallocation * t_init_data = it_t_init_data * t_payexplanation = it_t_payexplanation EXCEPTIONS NOT_FOUND = 1 . " APAR_GET_VEND_DOCUMENT
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_i_comp_code  TYPE BUKRS ,
it_t_items  TYPE STANDARD TABLE OF APAREBPP_ITEM ,
wa_t_items  LIKE LINE OF it_t_items,
ld_i_vendor  TYPE LIFNR ,
it_t_invoices  TYPE STANDARD TABLE OF APAREBPP_INVOICE ,
wa_t_invoices  LIKE LINE OF it_t_invoices,
ld_i_uname  TYPE UNAME ,
it_t_allocation  TYPE STANDARD TABLE OF APAREBPP_ALLOCATION ,
wa_t_allocation  LIKE LINE OF it_t_allocation,
ld_i_awtyp  TYPE AWTYP ,
it_t_mypayments  TYPE STANDARD TABLE OF APAREBPP_MYPAYMENTS ,
wa_t_mypayments  LIKE LINE OF it_t_mypayments,
ld_i_aworg  TYPE AWORG ,
it_t_payallocation  TYPE STANDARD TABLE OF APAREBPP_PAYALLOCATION ,
wa_t_payallocation  LIKE LINE OF it_t_payallocation,
ld_i_awref  TYPE AWREF ,
it_t_init_data  TYPE STANDARD TABLE OF EBPP_INIT_ADD_DATA ,
wa_t_init_data  LIKE LINE OF it_t_init_data,
ld_i_awsys  TYPE AWSYS ,
it_t_payexplanation  TYPE STANDARD TABLE OF APAREBPP_PAYEXPLANATION ,
wa_t_payexplanation  LIKE LINE OF it_t_payexplanation,
ld_i_belnr  TYPE BELNR_D ,
ld_i_gjahr  TYPE GJAHR ,
ld_i_buzei  TYPE BUZEI ,
ld_i_xblnr  TYPE XBLNR1 ,
ld_i_open_items  TYPE BOOLEAN ,
ld_i_cleared_items  TYPE BOOLEAN ,
ld_i_parked_items  TYPE BOOLEAN ,
ld_i_x_pay_context  TYPE BOOLEAN ,
ld_i_badi  TYPE IF_EX_APAR_EBPP_GET_DATA ,
ld_i_display_currency  TYPE WAERS ,
ld_i_ignore_rebzg  TYPE BOOLEAN .

ld_i_comp_code = 'some text here'.

"populate fields of struture and append to itab
append wa_t_items to it_t_items.
ld_i_vendor = 'some text here'.

"populate fields of struture and append to itab
append wa_t_invoices to it_t_invoices.
ld_i_uname = 'some text here'.

"populate fields of struture and append to itab
append wa_t_allocation to it_t_allocation.
ld_i_awtyp = 'some text here'.

"populate fields of struture and append to itab
append wa_t_mypayments to it_t_mypayments.
ld_i_aworg = 'some text here'.

"populate fields of struture and append to itab
append wa_t_payallocation to it_t_payallocation.
ld_i_awref = 'some text here'.

"populate fields of struture and append to itab
append wa_t_init_data to it_t_init_data.
ld_i_awsys = '123 '.

"populate fields of struture and append to itab
append wa_t_payexplanation to it_t_payexplanation.
ld_i_belnr = 'some text here'.
ld_i_gjahr = 'some text here'.
ld_i_buzei = 'some text here'.
ld_i_xblnr = 'some text here'.
ld_i_open_items = 'some text here'.
ld_i_cleared_items = 'some text here'.
ld_i_parked_items = 'some text here'.
ld_i_x_pay_context = 'some text here'.
ld_i_badi = 'some text here'.
ld_i_display_currency = 'some text here'.
ld_i_ignore_rebzg = '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 APAR_GET_VEND_DOCUMENT or its description.