SAP Function Modules

MRM_XMLBAPI_INCINV_CREATE SAP Function module







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

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


Pattern for FM MRM_XMLBAPI_INCINV_CREATE - MRM XMLBAPI INCINV CREATE





CALL FUNCTION 'MRM_XMLBAPI_INCINV_CREATE' "
  EXPORTING
    headerdata =                " bapi_incinv_create_header  Header Data in Incoming Invoice (Create)
    i_invoice =                 " rbkp-xrech
    i_creditmemo =              " rbkp-xrech
*   addressdata =               " bapi_incinv_create_addressdata  Transfer Structure: Address Data Incoming Invoice (Create)
  IMPORTING
    invoicedocnumber =          " bapi_incinv_fld-inv_doc_no  Document Number of an Invoice Document
    fiscalyear =                " bapi_incinv_fld-fisc_year  Fiscal Year
  TABLES
    itemdata =                  " bapi_incinv_create_item  Item Data in Incoming Invoice
*   taxdata =                   " bapi_incinv_create_tax  Tax Code in Incoming Invoice
*   withtaxdata =               " bapi_incinv_create_withtax  Transfer Structure: Withholding Tax Data (Create)
*   vendoritemsplitdata =       " bapi_incinv_create_vendorsplit  Transfer Structure: Vendor Split Incoming Invoice (Create)
    return =                    " bapiret2      Return Messages
    .  "  MRM_XMLBAPI_INCINV_CREATE

ABAP code example for Function Module MRM_XMLBAPI_INCINV_CREATE





The ABAP code below is a full code listing to execute function module MRM_XMLBAPI_INCINV_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_invoicedocnumber  TYPE BAPI_INCINV_FLD-INV_DOC_NO ,
ld_fiscalyear  TYPE BAPI_INCINV_FLD-FISC_YEAR ,
it_itemdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_ITEM,"TABLES PARAM
wa_itemdata  LIKE LINE OF it_itemdata ,
it_taxdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_TAX,"TABLES PARAM
wa_taxdata  LIKE LINE OF it_taxdata ,
it_withtaxdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_WITHTAX,"TABLES PARAM
wa_withtaxdata  LIKE LINE OF it_withtaxdata ,
it_vendoritemsplitdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_VENDORSPLIT,"TABLES PARAM
wa_vendoritemsplitdata  LIKE LINE OF it_vendoritemsplitdata ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return .

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

SELECT single XRECH
FROM RBKP
INTO @DATA(ld_i_invoice).


SELECT single XRECH
FROM RBKP
INTO @DATA(ld_i_creditmemo).

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

"populate fields of struture and append to itab
append wa_itemdata to it_itemdata.

"populate fields of struture and append to itab
append wa_taxdata to it_taxdata.

"populate fields of struture and append to itab
append wa_withtaxdata to it_withtaxdata.

"populate fields of struture and append to itab
append wa_vendoritemsplitdata to it_vendoritemsplitdata.

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'MRM_XMLBAPI_INCINV_CREATE' EXPORTING headerdata = ld_headerdata i_invoice = ld_i_invoice i_creditmemo = ld_i_creditmemo * addressdata = ld_addressdata IMPORTING invoicedocnumber = ld_invoicedocnumber fiscalyear = ld_fiscalyear TABLES itemdata = it_itemdata * taxdata = it_taxdata * withtaxdata = it_withtaxdata * vendoritemsplitdata = it_vendoritemsplitdata return = it_return . " MRM_XMLBAPI_INCINV_CREATE
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_invoicedocnumber  TYPE BAPI_INCINV_FLD-INV_DOC_NO ,
ld_headerdata  TYPE BAPI_INCINV_CREATE_HEADER ,
it_itemdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_ITEM ,
wa_itemdata  LIKE LINE OF it_itemdata,
ld_fiscalyear  TYPE BAPI_INCINV_FLD-FISC_YEAR ,
ld_i_invoice  TYPE RBKP-XRECH ,
it_taxdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_TAX ,
wa_taxdata  LIKE LINE OF it_taxdata,
ld_i_creditmemo  TYPE RBKP-XRECH ,
it_withtaxdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_WITHTAX ,
wa_withtaxdata  LIKE LINE OF it_withtaxdata,
ld_addressdata  TYPE BAPI_INCINV_CREATE_ADDRESSDATA ,
it_vendoritemsplitdata  TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_VENDORSPLIT ,
wa_vendoritemsplitdata  LIKE LINE OF it_vendoritemsplitdata,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return.

ld_headerdata = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_itemdata to it_itemdata.

SELECT single XRECH
FROM RBKP
INTO ld_i_invoice.


"populate fields of struture and append to itab
append wa_taxdata to it_taxdata.

SELECT single XRECH
FROM RBKP
INTO ld_i_creditmemo.


"populate fields of struture and append to itab
append wa_withtaxdata to it_withtaxdata.
ld_addressdata = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_vendoritemsplitdata to it_vendoritemsplitdata.

"populate fields of struture and append to itab
append wa_return to it_return.

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 MRM_XMLBAPI_INCINV_CREATE or its description.