SAP Function Modules

INV_SAMPLE_EXTERN_BILLDOCS SAP Function module







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

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


Pattern for FM INV_SAMPLE_EXTERN_BILLDOCS - INV SAMPLE EXTERN BILLDOCS





CALL FUNCTION 'INV_SAMPLE_EXTERN_BILLDOCS' "
  EXPORTING
    x_fkkvkp_tab =              " fkkvkp_t
    x_log_system =              " fkkinvbill_h-log_system
    x_bukrs =                   " t001-bukrs
    x_tax_det_type =            " fkkinvbill_h-tax_det_type
    x_tax_date_type =           " fkkinvbill_h-tax_date_type
    x_simulated =               " fkkinvbill_h-simulated
    x_date_from =               " fkkinvbill_h-date_from
    x_date_to =                 " fkkinvbill_h-date_to
    x_num_postrel_items =       " i
    x_num_info_items =          " i
    x_item_simulated =          " fkkinvbill_i-item_simulated
    x_add_items =               " xfeld
    x_testrun =                 " testrun
*   x_max_random_amount =       " fkkinvbill_i-bill_amount
*   x_max_random_amount_curr =   " fkkinvbill_i-bill_curr
  IMPORTING
    y_header_tab =              " bapi_extdoc_h_tab  Standard Table for Structure BAPI_IST_EXTDOC_H
    y_item_tab =                " bapi_extdoc_i_tab  Standard Table for Structure BAPI_IST_EXTDOC_I
    y_taxitem_tab =             " bapi_extdoc_t_tab  Standard Table for Structure BAPI_IST_EXTDOC_T
    y_additem_tab =             " bapi_extdoc_a_tab  Standard Table for Structure BAPI_IST_EXTDOC_A
  EXCEPTIONS
    GENERAL_FAULT = 1           "
    .  "  INV_SAMPLE_EXTERN_BILLDOCS

ABAP code example for Function Module INV_SAMPLE_EXTERN_BILLDOCS





The ABAP code below is a full code listing to execute function module INV_SAMPLE_EXTERN_BILLDOCS 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_y_header_tab  TYPE BAPI_EXTDOC_H_TAB ,
ld_y_item_tab  TYPE BAPI_EXTDOC_I_TAB ,
ld_y_taxitem_tab  TYPE BAPI_EXTDOC_T_TAB ,
ld_y_additem_tab  TYPE BAPI_EXTDOC_A_TAB .

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

DATA(ld_x_log_system) = some text here

SELECT single BUKRS
FROM T001
INTO @DATA(ld_x_bukrs).


DATA(ld_x_tax_det_type) = some text here

DATA(ld_x_tax_date_type) = some text here

DATA(ld_x_simulated) = some text here

DATA(ld_x_date_from) = 20210129

DATA(ld_x_date_to) = 20210129
DATA(ld_x_num_postrel_items) = 'Check type of data required'.
DATA(ld_x_num_info_items) = 'Check type of data required'.

DATA(ld_x_item_simulated) = some text here
DATA(ld_x_add_items) = 'Check type of data required'.
DATA(ld_x_testrun) = 'Check type of data required'.

DATA(ld_x_max_random_amount) = 20.50

DATA(ld_x_max_random_amount_curr) = Check type of data required . CALL FUNCTION 'INV_SAMPLE_EXTERN_BILLDOCS' EXPORTING x_fkkvkp_tab = ld_x_fkkvkp_tab x_log_system = ld_x_log_system x_bukrs = ld_x_bukrs x_tax_det_type = ld_x_tax_det_type x_tax_date_type = ld_x_tax_date_type x_simulated = ld_x_simulated x_date_from = ld_x_date_from x_date_to = ld_x_date_to x_num_postrel_items = ld_x_num_postrel_items x_num_info_items = ld_x_num_info_items x_item_simulated = ld_x_item_simulated x_add_items = ld_x_add_items x_testrun = ld_x_testrun * x_max_random_amount = ld_x_max_random_amount * x_max_random_amount_curr = ld_x_max_random_amount_curr IMPORTING y_header_tab = ld_y_header_tab y_item_tab = ld_y_item_tab y_taxitem_tab = ld_y_taxitem_tab y_additem_tab = ld_y_additem_tab EXCEPTIONS GENERAL_FAULT = 1 . " INV_SAMPLE_EXTERN_BILLDOCS
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_y_header_tab  TYPE BAPI_EXTDOC_H_TAB ,
ld_x_fkkvkp_tab  TYPE FKKVKP_T ,
ld_y_item_tab  TYPE BAPI_EXTDOC_I_TAB ,
ld_x_log_system  TYPE FKKINVBILL_H-LOG_SYSTEM ,
ld_y_taxitem_tab  TYPE BAPI_EXTDOC_T_TAB ,
ld_x_bukrs  TYPE T001-BUKRS ,
ld_y_additem_tab  TYPE BAPI_EXTDOC_A_TAB ,
ld_x_tax_det_type  TYPE FKKINVBILL_H-TAX_DET_TYPE ,
ld_x_tax_date_type  TYPE FKKINVBILL_H-TAX_DATE_TYPE ,
ld_x_simulated  TYPE FKKINVBILL_H-SIMULATED ,
ld_x_date_from  TYPE FKKINVBILL_H-DATE_FROM ,
ld_x_date_to  TYPE FKKINVBILL_H-DATE_TO ,
ld_x_num_postrel_items  TYPE I ,
ld_x_num_info_items  TYPE I ,
ld_x_item_simulated  TYPE FKKINVBILL_I-ITEM_SIMULATED ,
ld_x_add_items  TYPE XFELD ,
ld_x_testrun  TYPE TESTRUN ,
ld_x_max_random_amount  TYPE FKKINVBILL_I-BILL_AMOUNT ,
ld_x_max_random_amount_curr  TYPE FKKINVBILL_I-BILL_CURR .

ld_x_fkkvkp_tab = 'Check type of data required'.

ld_x_log_system = some text here

SELECT single BUKRS
FROM T001
INTO ld_x_bukrs.


ld_x_tax_det_type = some text here

ld_x_tax_date_type = some text here

ld_x_simulated = some text here

ld_x_date_from = 20210129

ld_x_date_to = 20210129
ld_x_num_postrel_items = 'Check type of data required'.
ld_x_num_info_items = 'Check type of data required'.

ld_x_item_simulated = some text here
ld_x_add_items = 'Check type of data required'.
ld_x_testrun = 'Check type of data required'.

ld_x_max_random_amount = 20.50

ld_x_max_random_amount_curr = 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 INV_SAMPLE_EXTERN_BILLDOCS or its description.