The information on previous period values from some tables of the material master is no longer stored directly in these tables but in special history tables.
The calculation of these previous period values requires the call of special function modules with name XXXX_EXTEND, with XXXX being the name of the corresponding table, thus, for example, MBEW_EXTEND for table MBEW, MARD_EXTEND for table MARD and so on.
In order to calculate the values of the previous period using function modules XXXX_EXTEND, the data obtained from table XXXX must be transferred in table XXXX_TAB. Then the module calculates the corresponding values from table XXXXH and fills them into the corresponding pervious period fields of table XXXX_TAB.
The import parameters in the interface of module XXXX_EXTEND have the following significance. For example, the current period is 05/2001 with 12 periods in the fiscal year. If one of the following four parameters is set, then the following applies:
- XVPER: The values for the previous period (04/2001) are calculated
- XVVPR: The values for the period before last (03/2001) are calculated
- XVJAH:The values for the last period of the previous year (12/2000) are calculated
- XVVJA:The values for the last period of the year before last (12/1999) are calculated
Not all function modules can calculate these periods. Correspondingly not all function modules have all four parameters.
The two other import parameters have following significance:
- KZRFB:The modules have internal buffers in which values already calculated once are stored in order to reduce the number of database accesses. If KZRFB = 'X', the data which belongs to the materials in table XXXX_TAB, are read again from the database. If KZRFB = SPACE, the data from the buffer is used, if existing.In particular, when using the corresponding read modules from the material master function groups, the buffers of the XXXX_EXTEND modules and the read modules should always be deleted together.
- MAXTZ: Defines the maximum number of buffer entries.If MAXTZ = 0, the buffer size is not restricted.In general, you do not have to restrict the buffer size.
The modules can have additional tables or export parameters.These are only relevant for SAP.
A calculation of previous period data for table MARD could have the following form.
select * from mard into table mard_tab where werks = '0001'.
call function 'MARD_EXTEND'
xvper = 'X'
mard_tab = mard_tab.
After this, table MARD_TAB is filled with the previous period information.There is no buffer restriction and the buffer is not deleted.
If you have any further questions contact SAP Consulting.