SAP MCV_STATISTICS_INVOICE Function Module for NOTRANSL: Statistikfortschreibung Faktura









MCV_STATISTICS_INVOICE is a standard mcv statistics invoice SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Statistikfortschreibung Faktura processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for mcv statistics invoice FM, simply by entering the name MCV_STATISTICS_INVOICE into the relevant SAP transaction such as SE37 or SE38.

Function Group: MCS6
Program Name: SAPLMCS6
Main Program: SAPLMCS6
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function MCV_STATISTICS_INVOICE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'MCV_STATISTICS_INVOICE'"NOTRANSL: Statistikfortschreibung Faktura
EXPORTING
* BELNR = ' ' "
* I_CONTROL = "
* KEINE_REFERENZWERTE = ' ' "neue Eingabewerte
* MODUS = ' ' "
* SPROG = ' ' "
* SROUT = ' ' "
TRTYP = "Transaction type
* VRSIO = '000' "
* XVBRK_TABIX = 0 "
* ZEITP = ' ' "

TABLES
MCINF = "
YVBPA = "Old billing doc. partner
YVBRK = "Old billing doc. header
YVBRP = "Old billing doc. item
YVBUK = "Old billing doc. header status
YVBUP = "Old billing doc. item status
* XFPLA = "
* XFPLT = "
* YFPLA = "
* YFPLT = "
* XVBAPF = "Dynamischer Teil Auftragspositionsfluß
XKOMV = "
XVBFA = "New billing document flow
XVBPA = "New billing doc. partner
XVBRK = "New billing doc. header
XVBRP = "New billing doc. item
XVBUK = "New billing doc. header status
XVBUP = "New billing document item status
YVBFA = "Old billing doc. flow
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLMCS6_001 SIS: User Exit for Billing Documents - Header Data
EXIT_SAPLMCS6_002 SIS: User Exit for Billing Documents - Item Data

IMPORTING Parameters details for MCV_STATISTICS_INVOICE

BELNR -

Data type: VBRK-VBELN
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_CONTROL -

Data type: MCCONTROL
Optional: Yes
Call by Reference: No ( called with pass by value option)

KEINE_REFERENZWERTE - neue Eingabewerte

Data type: XFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MODUS -

Data type: MCCONTROL-MODUS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SPROG -

Data type: MCCONTROL-SPROG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SROUT -

Data type: MCCONTROL-SROUT
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TRTYP - Transaction type

Data type: T180-TRTYP
Optional: No
Call by Reference: No ( called with pass by value option)

VRSIO -

Data type: MCCONTROL-VRSIO
Default: '000'
Optional: Yes
Call by Reference: No ( called with pass by value option)

XVBRK_TABIX -

Data type: SY-TABIX
Optional: Yes
Call by Reference: No ( called with pass by value option)

ZEITP -

Data type: TMC2F-ZEITP
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for MCV_STATISTICS_INVOICE

MCINF -

Data type: MCSOINF
Optional: No
Call by Reference: No ( called with pass by value option)

YVBPA - Old billing doc. partner

Data type: VBPAVB
Optional: No
Call by Reference: No ( called with pass by value option)

YVBRK - Old billing doc. header

Data type: VBRKVB
Optional: No
Call by Reference: No ( called with pass by value option)

YVBRP - Old billing doc. item

Data type: VBRPVB
Optional: No
Call by Reference: No ( called with pass by value option)

YVBUK - Old billing doc. header status

Data type: VBUKVB
Optional: No
Call by Reference: No ( called with pass by value option)

YVBUP - Old billing doc. item status

Data type: VBUPVB
Optional: No
Call by Reference: No ( called with pass by value option)

XFPLA -

Data type: FPLAVB
Optional: Yes
Call by Reference: No ( called with pass by value option)

XFPLT -

Data type: FPLTVB
Optional: Yes
Call by Reference: No ( called with pass by value option)

YFPLA -

Data type: FPLAVB
Optional: Yes
Call by Reference: No ( called with pass by value option)

YFPLT -

Data type: FPLTVB
Optional: Yes
Call by Reference: No ( called with pass by value option)

XVBAPF - Dynamischer Teil Auftragspositionsfluß

Data type: VBAPF
Optional: Yes
Call by Reference: No ( called with pass by value option)

XKOMV -

Data type: KOMV
Optional: No
Call by Reference: No ( called with pass by value option)

XVBFA - New billing document flow

Data type: VBFAVB
Optional: No
Call by Reference: No ( called with pass by value option)

XVBPA - New billing doc. partner

Data type: VBPAVB
Optional: No
Call by Reference: No ( called with pass by value option)

XVBRK - New billing doc. header

Data type: VBRKVB
Optional: No
Call by Reference: No ( called with pass by value option)

XVBRP - New billing doc. item

Data type: VBRPVB
Optional: No
Call by Reference: No ( called with pass by value option)

XVBUK - New billing doc. header status

Data type: VBUKVB
Optional: No
Call by Reference: No ( called with pass by value option)

XVBUP - New billing document item status

Data type: VBUPVB
Optional: No
Call by Reference: No ( called with pass by value option)

YVBFA - Old billing doc. flow

Data type: VBFAVB
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for MCV_STATISTICS_INVOICE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_belnr  TYPE VBRK-VBELN, "   SPACE
lt_mcinf  TYPE STANDARD TABLE OF MCSOINF, "   
lt_yvbpa  TYPE STANDARD TABLE OF VBPAVB, "   
lv_i_control  TYPE MCCONTROL, "   
lt_yvbrk  TYPE STANDARD TABLE OF VBRKVB, "   
lt_yvbrp  TYPE STANDARD TABLE OF VBRPVB, "   
lt_yvbuk  TYPE STANDARD TABLE OF VBUKVB, "   
lt_yvbup  TYPE STANDARD TABLE OF VBUPVB, "   
lt_xfpla  TYPE STANDARD TABLE OF FPLAVB, "   
lt_xfplt  TYPE STANDARD TABLE OF FPLTVB, "   
lt_yfpla  TYPE STANDARD TABLE OF FPLAVB, "   
lt_yfplt  TYPE STANDARD TABLE OF FPLTVB, "   
lt_xvbapf  TYPE STANDARD TABLE OF VBAPF, "   
lt_xkomv  TYPE STANDARD TABLE OF KOMV, "   
lv_keine_referenzwerte  TYPE XFLAG, "   SPACE
lv_modus  TYPE MCCONTROL-MODUS, "   SPACE
lt_xvbfa  TYPE STANDARD TABLE OF VBFAVB, "   
lv_sprog  TYPE MCCONTROL-SPROG, "   SPACE
lt_xvbpa  TYPE STANDARD TABLE OF VBPAVB, "   
lv_srout  TYPE MCCONTROL-SROUT, "   SPACE
lt_xvbrk  TYPE STANDARD TABLE OF VBRKVB, "   
lv_trtyp  TYPE T180-TRTYP, "   
lt_xvbrp  TYPE STANDARD TABLE OF VBRPVB, "   
lv_vrsio  TYPE MCCONTROL-VRSIO, "   '000'
lt_xvbuk  TYPE STANDARD TABLE OF VBUKVB, "   
lt_xvbup  TYPE STANDARD TABLE OF VBUPVB, "   
lv_xvbrk_tabix  TYPE SY-TABIX, "   0
lt_yvbfa  TYPE STANDARD TABLE OF VBFAVB, "   
lv_zeitp  TYPE TMC2F-ZEITP. "   SPACE

  CALL FUNCTION 'MCV_STATISTICS_INVOICE'  "NOTRANSL: Statistikfortschreibung Faktura
    EXPORTING
         BELNR = lv_belnr
         I_CONTROL = lv_i_control
         KEINE_REFERENZWERTE = lv_keine_referenzwerte
         MODUS = lv_modus
         SPROG = lv_sprog
         SROUT = lv_srout
         TRTYP = lv_trtyp
         VRSIO = lv_vrsio
         XVBRK_TABIX = lv_xvbrk_tabix
         ZEITP = lv_zeitp
    TABLES
         MCINF = lt_mcinf
         YVBPA = lt_yvbpa
         YVBRK = lt_yvbrk
         YVBRP = lt_yvbrp
         YVBUK = lt_yvbuk
         YVBUP = lt_yvbup
         XFPLA = lt_xfpla
         XFPLT = lt_xfplt
         YFPLA = lt_yfpla
         YFPLT = lt_yfplt
         XVBAPF = lt_xvbapf
         XKOMV = lt_xkomv
         XVBFA = lt_xvbfa
         XVBPA = lt_xvbpa
         XVBRK = lt_xvbrk
         XVBRP = lt_xvbrp
         XVBUK = lt_xvbuk
         XVBUP = lt_xvbup
         YVBFA = lt_yvbfa
. " MCV_STATISTICS_INVOICE




ABAP code using 7.40 inline data declarations to call FM MCV_STATISTICS_INVOICE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single VBELN FROM VBRK INTO @DATA(ld_belnr).
DATA(ld_belnr) = ' '.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
DATA(ld_keine_referenzwerte) = ' '.
 
"SELECT single MODUS FROM MCCONTROL INTO @DATA(ld_modus).
DATA(ld_modus) = ' '.
 
 
"SELECT single SPROG FROM MCCONTROL INTO @DATA(ld_sprog).
DATA(ld_sprog) = ' '.
 
 
"SELECT single SROUT FROM MCCONTROL INTO @DATA(ld_srout).
DATA(ld_srout) = ' '.
 
 
"SELECT single TRTYP FROM T180 INTO @DATA(ld_trtyp).
 
 
"SELECT single VRSIO FROM MCCONTROL INTO @DATA(ld_vrsio).
DATA(ld_vrsio) = '000'.
 
 
 
"SELECT single TABIX FROM SY INTO @DATA(ld_xvbrk_tabix).
 
 
"SELECT single ZEITP FROM TMC2F INTO @DATA(ld_zeitp).
DATA(ld_zeitp) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!