MR_CREATE_INVOICE 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 MR_CREATE_INVOICE into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
MRBI
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'MR_CREATE_INVOICE' "
* EXPORTING
* i_stblg = ' ' " bkpf-stblg Reference document to be cancelled (with cancellations)
* i_stjah = 0000 " bkpf-stjah Document year of reference document (with cancellations)
* i_groupid = " apqi-groupid
* i_xusvr = SPACE " bkpf-xusvr
IMPORTING
e_belnr = " bkpf-belnr Number of the created document
e_gjahr = " bkpf-gjahr Fiscal year of created document
TABLES
t_bbkpf = " bbkpf Document header data
t_mesg = " mesg
t_rbsec = " rbsec
t_rbseg = " rbseg Line item data
t_rbset = " rbset
EXCEPTIONS
DOCUMENT_NOT_BOOKED = 1 "
HEADER_NOT_VALID = 2 "
POSITIONS_NOT_VALID = 3 "
. " MR_CREATE_INVOICE
The ABAP code below is a full code listing to execute function module MR_CREATE_INVOICE 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).
| ld_e_belnr | TYPE BKPF-BELNR , |
| ld_e_gjahr | TYPE BKPF-GJAHR , |
| it_t_bbkpf | TYPE STANDARD TABLE OF BBKPF,"TABLES PARAM |
| wa_t_bbkpf | LIKE LINE OF it_t_bbkpf , |
| it_t_mesg | TYPE STANDARD TABLE OF MESG,"TABLES PARAM |
| wa_t_mesg | LIKE LINE OF it_t_mesg , |
| it_t_rbsec | TYPE STANDARD TABLE OF RBSEC,"TABLES PARAM |
| wa_t_rbsec | LIKE LINE OF it_t_rbsec , |
| it_t_rbseg | TYPE STANDARD TABLE OF RBSEG,"TABLES PARAM |
| wa_t_rbseg | LIKE LINE OF it_t_rbseg , |
| it_t_rbset | TYPE STANDARD TABLE OF RBSET,"TABLES PARAM |
| wa_t_rbset | LIKE LINE OF it_t_rbset . |
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_belnr | TYPE BKPF-BELNR , |
| ld_i_stblg | TYPE BKPF-STBLG , |
| it_t_bbkpf | TYPE STANDARD TABLE OF BBKPF , |
| wa_t_bbkpf | LIKE LINE OF it_t_bbkpf, |
| ld_e_gjahr | TYPE BKPF-GJAHR , |
| ld_i_stjah | TYPE BKPF-STJAH , |
| it_t_mesg | TYPE STANDARD TABLE OF MESG , |
| wa_t_mesg | LIKE LINE OF it_t_mesg, |
| ld_i_groupid | TYPE APQI-GROUPID , |
| it_t_rbsec | TYPE STANDARD TABLE OF RBSEC , |
| wa_t_rbsec | LIKE LINE OF it_t_rbsec, |
| ld_i_xusvr | TYPE BKPF-XUSVR , |
| it_t_rbseg | TYPE STANDARD TABLE OF RBSEG , |
| wa_t_rbseg | LIKE LINE OF it_t_rbseg, |
| it_t_rbset | TYPE STANDARD TABLE OF RBSET , |
| wa_t_rbset | LIKE LINE OF it_t_rbset. |
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 MR_CREATE_INVOICE or its description.