SAP Function Modules

J_1BNFE_INVOICE_CREATE SAP Function module - Create invoice by XML-data







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

Associated Function Group: J_1B_NFE_IN
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM J_1BNFE_INVOICE_CREATE - J 1BNFE INVOICE CREATE





CALL FUNCTION 'J_1BNFE_INVOICE_CREATE' "Create invoice by XML-data
  EXPORTING
    i_bldat =                   " bldat         Document Date in Document
    i_budat = SY-DATUM          " budat         Posting Date in the Document
    i_amnt =                    " j_1bnftot     Amount in Local Currency
    i_simulate =                " j_1bnfe_simulate  Character Field Length 1
    i_simulation_level =        " j_1bnfe_simulation_level  Character Field Length 1
    i_xblnr =                   " xblnr1        Reference Document Number
*   i_access_key =              " j_1b_nfe_access_key  NFe Access Key
*   i_xmlgovvers =              " j_1bnfegovversion  NFe: Authority XML Version
*   i_authcode =                " j_1bnfeauthcode  NF-e: Protocol Number
*   i_authdate =                " j_1bauthdate  NF-e Processing Timestamp - Date
*   i_authtime =                " j_1bauthtime  NF-e Processing Timestamp - Time
*   i_future_delivery = ' '     " flag          Future Delivery - OLD (replaced by i_process)
*   i_consignment = ' '         " flag          Consignment - OLD (replaced by i_process)
*   i_acckey_ref =              " j_1b_nfe_access_key  NFe Access Key - Reference Document
*   i_process =                 " j_1bnfe_process_erp_grc  NF-e Incoming: Business Process (GRC <--> ERP)
  IMPORTING
    e_xml_header =              " j1b_nf_xml_header  Nota Fiscal Eletronica / NF-e Data -  HEADER (1:1)
    et_xml_item =               " j1b_nf_xml_item_tab  Table type for RFC call  J1B_NF_XML_ITEM
    e_belnr =                   " rbkp-belnr    Document Number of an Invoice Document
    e_gjahr =                   " rbkp-gjahr    Fiscal Year
    e_rbstat =                  " rbkp-rbstat   Invoice document status
  TABLES
*   it_nfe_in_tax =             " j_1bnfe_in_tax_tab  NF-e incoming: Tax Data-  OLD (replaced by IT_NFE_IN_TAX_2)
*   it_nfe_in_item =            " j_1bnfe_invoice_tab  NF-e incoming: Purchase Order Items  - OLD (replaced by IT_NFE_IN_ITEM_2)
*   it_extension =              " j_1bnfe_extension_tab  Container for 'Customer Exit' Parameter
*   it_extensionc =             " j_1bnfe_extensionc_tab  Container for 'Customer Exit' Parameter
*   et_nfe_in_tax =             " j_1bnfe_in_tax_tab  NF-e incoming: Tax Data - OLD (replaced by ET_NFE_IN_TAX_2)
*   et_nfe_in_item =            " j_1bnfe_in_item_tab  NF-e incoming: XML items with PO details- OLD (replaced by ET_NFE_IN_ITEM_2)
    et_bapiret2 =               " bapirettab    Table with BAPI Return Information
*   it_nfe_in_tax_2 =           " j_1bnfe_in_tax_tab_2  NF-e incoming: Tax Data - with XML position
*   it_nfe_in_item_2 =          " j_1bnfe_invoice_tab_2  NF-e incoming: XML items with PO details - with XML poistion
*   et_nfe_in_tax_2 =           " j_1bnfe_in_tax_tab_2  NF-e incoming: Tax Data - with XML position
*   et_nfe_in_item_2 =          " j_1bnfe_in_item_tab_2  NF-e incoming: XML items with PO details - with XML position
*   it_nfe_item_add_info =      " j_1bnfe_item_add_info_tab  NF-e incoming: Details for XML Items in Consignment Process
  EXCEPTIONS
    ERROR = 1                   "
    .  "  J_1BNFE_INVOICE_CREATE

ABAP code example for Function Module J_1BNFE_INVOICE_CREATE





The ABAP code below is a full code listing to execute function module J_1BNFE_INVOICE_CREATE 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_xml_header  TYPE J1B_NF_XML_HEADER ,
ld_et_xml_item  TYPE J1B_NF_XML_ITEM_TAB ,
ld_e_belnr  TYPE RBKP-BELNR ,
ld_e_gjahr  TYPE RBKP-GJAHR ,
ld_e_rbstat  TYPE RBKP-RBSTAT ,
it_it_nfe_in_tax  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB,"TABLES PARAM
wa_it_nfe_in_tax  LIKE LINE OF it_it_nfe_in_tax ,
it_it_nfe_in_item  TYPE STANDARD TABLE OF J_1BNFE_INVOICE_TAB,"TABLES PARAM
wa_it_nfe_in_item  LIKE LINE OF it_it_nfe_in_item ,
it_it_extension  TYPE STANDARD TABLE OF J_1BNFE_EXTENSION_TAB,"TABLES PARAM
wa_it_extension  LIKE LINE OF it_it_extension ,
it_it_extensionc  TYPE STANDARD TABLE OF J_1BNFE_EXTENSIONC_TAB,"TABLES PARAM
wa_it_extensionc  LIKE LINE OF it_it_extensionc ,
it_et_nfe_in_tax  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB,"TABLES PARAM
wa_et_nfe_in_tax  LIKE LINE OF it_et_nfe_in_tax ,
it_et_nfe_in_item  TYPE STANDARD TABLE OF J_1BNFE_IN_ITEM_TAB,"TABLES PARAM
wa_et_nfe_in_item  LIKE LINE OF it_et_nfe_in_item ,
it_et_bapiret2  TYPE STANDARD TABLE OF BAPIRETTAB,"TABLES PARAM
wa_et_bapiret2  LIKE LINE OF it_et_bapiret2 ,
it_it_nfe_in_tax_2  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB_2,"TABLES PARAM
wa_it_nfe_in_tax_2  LIKE LINE OF it_it_nfe_in_tax_2 ,
it_it_nfe_in_item_2  TYPE STANDARD TABLE OF J_1BNFE_INVOICE_TAB_2,"TABLES PARAM
wa_it_nfe_in_item_2  LIKE LINE OF it_it_nfe_in_item_2 ,
it_et_nfe_in_tax_2  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB_2,"TABLES PARAM
wa_et_nfe_in_tax_2  LIKE LINE OF it_et_nfe_in_tax_2 ,
it_et_nfe_in_item_2  TYPE STANDARD TABLE OF J_1BNFE_IN_ITEM_TAB_2,"TABLES PARAM
wa_et_nfe_in_item_2  LIKE LINE OF it_et_nfe_in_item_2 ,
it_it_nfe_item_add_info  TYPE STANDARD TABLE OF J_1BNFE_ITEM_ADD_INFO_TAB,"TABLES PARAM
wa_it_nfe_item_add_info  LIKE LINE OF it_it_nfe_item_add_info .

DATA(ld_i_bldat) = 'Check type of data required'.
DATA(ld_i_budat) = 'Check type of data required'.
DATA(ld_i_amnt) = 'Check type of data required'.
DATA(ld_i_simulate) = 'Check type of data required'.
DATA(ld_i_simulation_level) = 'Check type of data required'.
DATA(ld_i_xblnr) = 'Check type of data required'.
DATA(ld_i_access_key) = 'Check type of data required'.
DATA(ld_i_xmlgovvers) = 'Check type of data required'.
DATA(ld_i_authcode) = 'Check type of data required'.
DATA(ld_i_authdate) = 'Check type of data required'.
DATA(ld_i_authtime) = 'Check type of data required'.
DATA(ld_i_future_delivery) = 'Check type of data required'.
DATA(ld_i_consignment) = 'Check type of data required'.
DATA(ld_i_acckey_ref) = 'Check type of data required'.
DATA(ld_i_process) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_nfe_in_tax to it_it_nfe_in_tax.

"populate fields of struture and append to itab
append wa_it_nfe_in_item to it_it_nfe_in_item.

"populate fields of struture and append to itab
append wa_it_extension to it_it_extension.

"populate fields of struture and append to itab
append wa_it_extensionc to it_it_extensionc.

"populate fields of struture and append to itab
append wa_et_nfe_in_tax to it_et_nfe_in_tax.

"populate fields of struture and append to itab
append wa_et_nfe_in_item to it_et_nfe_in_item.

"populate fields of struture and append to itab
append wa_et_bapiret2 to it_et_bapiret2.

"populate fields of struture and append to itab
append wa_it_nfe_in_tax_2 to it_it_nfe_in_tax_2.

"populate fields of struture and append to itab
append wa_it_nfe_in_item_2 to it_it_nfe_in_item_2.

"populate fields of struture and append to itab
append wa_et_nfe_in_tax_2 to it_et_nfe_in_tax_2.

"populate fields of struture and append to itab
append wa_et_nfe_in_item_2 to it_et_nfe_in_item_2.

"populate fields of struture and append to itab
append wa_it_nfe_item_add_info to it_it_nfe_item_add_info. . CALL FUNCTION 'J_1BNFE_INVOICE_CREATE' EXPORTING i_bldat = ld_i_bldat i_budat = ld_i_budat i_amnt = ld_i_amnt i_simulate = ld_i_simulate i_simulation_level = ld_i_simulation_level i_xblnr = ld_i_xblnr * i_access_key = ld_i_access_key * i_xmlgovvers = ld_i_xmlgovvers * i_authcode = ld_i_authcode * i_authdate = ld_i_authdate * i_authtime = ld_i_authtime * i_future_delivery = ld_i_future_delivery * i_consignment = ld_i_consignment * i_acckey_ref = ld_i_acckey_ref * i_process = ld_i_process IMPORTING e_xml_header = ld_e_xml_header et_xml_item = ld_et_xml_item e_belnr = ld_e_belnr e_gjahr = ld_e_gjahr e_rbstat = ld_e_rbstat TABLES * it_nfe_in_tax = it_it_nfe_in_tax * it_nfe_in_item = it_it_nfe_in_item * it_extension = it_it_extension * it_extensionc = it_it_extensionc * et_nfe_in_tax = it_et_nfe_in_tax * et_nfe_in_item = it_et_nfe_in_item et_bapiret2 = it_et_bapiret2 * it_nfe_in_tax_2 = it_it_nfe_in_tax_2 * it_nfe_in_item_2 = it_it_nfe_in_item_2 * et_nfe_in_tax_2 = it_et_nfe_in_tax_2 * et_nfe_in_item_2 = it_et_nfe_in_item_2 * it_nfe_item_add_info = it_it_nfe_item_add_info EXCEPTIONS ERROR = 1 . " J_1BNFE_INVOICE_CREATE
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_e_xml_header  TYPE J1B_NF_XML_HEADER ,
ld_i_bldat  TYPE BLDAT ,
it_it_nfe_in_tax  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB ,
wa_it_nfe_in_tax  LIKE LINE OF it_it_nfe_in_tax,
ld_et_xml_item  TYPE J1B_NF_XML_ITEM_TAB ,
ld_i_budat  TYPE BUDAT ,
it_it_nfe_in_item  TYPE STANDARD TABLE OF J_1BNFE_INVOICE_TAB ,
wa_it_nfe_in_item  LIKE LINE OF it_it_nfe_in_item,
ld_e_belnr  TYPE RBKP-BELNR ,
ld_i_amnt  TYPE J_1BNFTOT ,
it_it_extension  TYPE STANDARD TABLE OF J_1BNFE_EXTENSION_TAB ,
wa_it_extension  LIKE LINE OF it_it_extension,
ld_e_gjahr  TYPE RBKP-GJAHR ,
ld_i_simulate  TYPE J_1BNFE_SIMULATE ,
it_it_extensionc  TYPE STANDARD TABLE OF J_1BNFE_EXTENSIONC_TAB ,
wa_it_extensionc  LIKE LINE OF it_it_extensionc,
ld_e_rbstat  TYPE RBKP-RBSTAT ,
ld_i_simulation_level  TYPE J_1BNFE_SIMULATION_LEVEL ,
it_et_nfe_in_tax  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB ,
wa_et_nfe_in_tax  LIKE LINE OF it_et_nfe_in_tax,
ld_i_xblnr  TYPE XBLNR1 ,
it_et_nfe_in_item  TYPE STANDARD TABLE OF J_1BNFE_IN_ITEM_TAB ,
wa_et_nfe_in_item  LIKE LINE OF it_et_nfe_in_item,
it_et_bapiret2  TYPE STANDARD TABLE OF BAPIRETTAB ,
wa_et_bapiret2  LIKE LINE OF it_et_bapiret2,
ld_i_access_key  TYPE J_1B_NFE_ACCESS_KEY ,
it_it_nfe_in_tax_2  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB_2 ,
wa_it_nfe_in_tax_2  LIKE LINE OF it_it_nfe_in_tax_2,
ld_i_xmlgovvers  TYPE J_1BNFEGOVVERSION ,
it_it_nfe_in_item_2  TYPE STANDARD TABLE OF J_1BNFE_INVOICE_TAB_2 ,
wa_it_nfe_in_item_2  LIKE LINE OF it_it_nfe_in_item_2,
ld_i_authcode  TYPE J_1BNFEAUTHCODE ,
it_et_nfe_in_tax_2  TYPE STANDARD TABLE OF J_1BNFE_IN_TAX_TAB_2 ,
wa_et_nfe_in_tax_2  LIKE LINE OF it_et_nfe_in_tax_2,
ld_i_authdate  TYPE J_1BAUTHDATE ,
it_et_nfe_in_item_2  TYPE STANDARD TABLE OF J_1BNFE_IN_ITEM_TAB_2 ,
wa_et_nfe_in_item_2  LIKE LINE OF it_et_nfe_in_item_2,
ld_i_authtime  TYPE J_1BAUTHTIME ,
it_it_nfe_item_add_info  TYPE STANDARD TABLE OF J_1BNFE_ITEM_ADD_INFO_TAB ,
wa_it_nfe_item_add_info  LIKE LINE OF it_it_nfe_item_add_info,
ld_i_future_delivery  TYPE FLAG ,
ld_i_consignment  TYPE FLAG ,
ld_i_acckey_ref  TYPE J_1B_NFE_ACCESS_KEY ,
ld_i_process  TYPE J_1BNFE_PROCESS_ERP_GRC .

ld_i_bldat = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_nfe_in_tax to it_it_nfe_in_tax.
ld_i_budat = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_nfe_in_item to it_it_nfe_in_item.
ld_i_amnt = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_extension to it_it_extension.
ld_i_simulate = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_extensionc to it_it_extensionc.
ld_i_simulation_level = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_nfe_in_tax to it_et_nfe_in_tax.
ld_i_xblnr = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_nfe_in_item to it_et_nfe_in_item.

"populate fields of struture and append to itab
append wa_et_bapiret2 to it_et_bapiret2.
ld_i_access_key = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_nfe_in_tax_2 to it_it_nfe_in_tax_2.
ld_i_xmlgovvers = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_nfe_in_item_2 to it_it_nfe_in_item_2.
ld_i_authcode = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_nfe_in_tax_2 to it_et_nfe_in_tax_2.
ld_i_authdate = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_nfe_in_item_2 to it_et_nfe_in_item_2.
ld_i_authtime = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_nfe_item_add_info to it_it_nfe_item_add_info.
ld_i_future_delivery = 'Check type of data required'.
ld_i_consignment = 'Check type of data required'.
ld_i_acckey_ref = 'Check type of data required'.
ld_i_process = '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 J_1BNFE_INVOICE_CREATE or its description.