You are on page 1of 15

Project TOUCHSTONE

Specification

Document Reference: 108033007.doc Version: 1.0

Prepared for: Functional Author: Technical Author:

JBM Nitin Chhabra

Last Revision Date: Date Created:

11/05/2009

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 1 of 15

Project TOUCHSTONE
Document Information
Business Area Type of development SAP R/3 Version MM Report R/3 ECC 6.0

Approval
Approved by Functional Team Technical Team Name Nitin Chhabra Role Team Lead Signature Nitin Date 11/05/2009

Document History
Version Reason for change Date

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 2 of 15

Project TOUCHSTONE
Table of Contents
Functional Specifications........................................................................................................4

1 SUMMARY .................................................................................................................4 2 SCOPE .......................................................................................................................4
2.1 Starting Conditions..............................................................................................................4 2.2 Frequency.............................................................................................................................4

3 LOGIC OVERVIEW ...................................................................................................4
1. Logic for displaying Moving Average Price........................................................................4
a.If no date interval entered in the selection screen.............................................................................................5

4 THE SELECTION SCREEN .......................................................................................5 5 DATA MAPPING.........................................................................................................5
5.1 Extraction Summary............................................................................................................5

6 APPENDICES ............................................................................................................6
6.1 Appendix A – Custom Table Definition..............................................................................6 6.2 Appendix B – Report Layout...............................................................................................6 Technical Specifications..........................................................................................................8

ABAP ATTRIBUTES.....................................................................................................8 TECHNICAL DESIGN...................................................................................................9
1. Input Selection Criteria:........................................................................................................9 2. Selection Screen Display....................................................................................................10 3. Report Output Display:........................................................................................................11 4. Technical Description:........................................................................................................12

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 3 of 15

Project TOUCHSTONE
Functional Specifications 1 Summary
In the standard SAP , there is no standard report available , by which a buyer can see the month wise moving Average price of any material and price in the last 3 purchase orders of the material, which is required for the analysis purpose. END OF GUIDANCE TEXT

2 Scope 2.1
Manual

Starting Conditions

2.2

Frequency

Whenever required by the buyer.

3 Logic Overview
Logic: Selction of the materials 1) MARA / MAKT a. b. c. 2) MARC a. b. Selection from MARA Plant (T001W-WERKS) - mandatory, check correctness Material Type (MARA-MTART) - mandatory, check correctness Material Group (MARA-MATKL) Material (MARA-MATNR)

1.

Logic for displaying Moving Average Price
a. When no interval is entered or period is current month in the selection screen Enter the selected materials in the field (MBEW- MATNR) and the corresponding plant in the field (MBEW- BWKEY) get the current MAP(MBEW- VERPR) of the materials.

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 4 of 15

Project TOUCHSTONE
b. When interval is entered in the selection screen! = current month Get the fiscal year and fiscal month for the selection date entered in the selection screen ,then enter the selected materials in the field(MBEWH-MATNR) ,and plants(MBEWH- BWKEY)with the fiscal year in the filed (MBEWH- LFGJA) and fiscal month (MBEWH- LFMON )and get the corresponding MAP(MBEWHVERPR) and if the entry is not there then find for the previous fiscal months upto 12 last months till it gets the entry ,if the system could’t find any entry in last 12 months ,then set the MAP as “ZERO”.

2. Logic for displaying the last 3 purchase order price
Enter the selected materials in the field (EINA-MATNR) and as per the selection extract the purchasing info record (EINA- INFNR) and then enter all these info (records in the filed EIPA- INFNR) and filter them by entering selected plants in the field (EIPA-WERKS) a. If no date interval entered in the selection screen Filter out all info record(EIPA-INFNR) having PO date(EIPA- BEDAT) within 1 year and take the PO price(EIPA- PREIS) of the latest 3 purchase order b. If the date interval is entered in the selection screen Filter out all info record (EIPA-INFNR) having PO date (EIPA- BEDAT) <= date enterd in the selection screen for 1 year and take the PO price(EIPA- PREIS) of the latest 3 purchase order

4 The Selection screen
Description Material Type . Material Group Material Plant Date Interval Data Type
MARAMTART MARAMATKL MARAMATNR T001WWERKS

Default Value

Mandatory
Mandatory,chec k correctness

Selection Screen Type select-option

Search Help N.A

Notes N.A

Mandatory,chec k correctness Mandatory

5 Data Mapping
N.A

5.1
N.A

Extraction Summary

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 5 of 15

Project TOUCHSTONE
6 Appendices
N.A

6.1
N.A

Appendix A – Custom Table Definition Appendix B – Report Layout
Price Movement for a period

6.2

Material Class/Type

Material Group

Material Code

Material Description

Previous Price 2

Previous Price 1

Previous Price

Current Moving Avg.Price

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 6 of 15

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 7 of 15

Technical Specifications ABAP Attributes
Program Name:
ZMMR_Price_movement

{Indicate the name to be given to the program.}

Program Title:
Price Movement for a Period

{Indicate the description of the program.}

Program Type:
Report

{Enter the type of program this will be.}

Application:
MM

{Indicate with which functional area this program is associated.}

Development Class:
ZDEV (presently , it will be stored as a local object)

{Enter the development class this program should be created in.}

Transport Request:
DR!xxxxx (to get after report development)

{Indicate the request number with request description of the program.}

Message Class:
Z001

{Indicate the message class for messages of the program.}

SAP Transaction Code:
ZRM01

{Indicates transaction code this code is executed with.}
Last changed on: 23/05/2009 05:11:00 AM Last changed by: Biswadeep Sarkar Version: 1.0 Page: 8 of 15

Project TOUCHSTONE
Other programs:
{Other programs that must be created to support the primary program must be listed here.}

Technical Design 1. Input Selection Criteria:

All are Select Options: Label ---------------------Material type Material Group Material No Plant Date Interval

Constraints -----------------------------------------------------------OBLIGATORY NO INTERVALS NO-EXTENSION NO INTERVALS NO-EXTENSION NO INTERVALS NO-EXTENSION NO INTERVALS NO-EXTENSION NO-EXTENSION

Data Type -------------------------------mara-mtart(CHAR 4) mara-matkl(CHAR 9)
mara-matnr(CHAR 18) t001w-werks(CHAR 4) EIPA-BEDAT (DATS)

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 9 of 15

Project TOUCHSTONE
2. Selection Screen Display

{This section will contain a display of the required input selection screen.}

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 10 of 15

Project TOUCHSTONE
3. Report Output Display:

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 11 of 15

Project TOUCHSTONE

{Enter sample layout for each reporting level or provide a document link containing the layout(s).}

4.

Technical Description:

{This section of the technical specification would include the pseudo-code in simple language that should be understandable to any related person, such as the functional consultant. This section will describe in detail the data extraction, data validation, data processing and output processing steps.}

<Example Report Layout>
Last changed on: 23/05/2009 05:11:00 AM Last changed by: Biswadeep Sarkar Version: 1.0 Page: 12 of 15

Project TOUCHSTONE
Based on Selection Criteria:
1. Fetch data from tables (MARA & MARC) based on selection criteria as shown below: Material Type Material Group Plant Date Interval mandatory Mandatory (optional) (optional)

Extract the following fields from above mentioned tables (MARA & MARC): Material Type Material Group Plant Material No Material Description (mara~mtart) (mara~matkl) (marc~werks) (mara~matnr) (makt~maktx)

SELECT mara~mtart mara~matkl mara~matnr makt~maktx marc~werks INTO TABLE i_mara FROM mara INNER JOIN marc ON marc~mandt = mara~mandt AND marc~matnr = mara~matnr INNER JOIN makt ON marc~mandt = makt~mandt AND marc~matnr = makt~matnr WHERE mara~matnr IN s_matnr AND marc~werks IN s_werks.

Extract the following fields from above tables (EINA, EIPA): Calculate the Fiscal year using following Functions:
GM_GET_FISCAL_YEAR and HR_E_GET_FISC_YEAR_DATES

Derive the following data as per the Fiscal Year obtained. Purchase Price Previous Purchase price 1 Previous Purchase price 2 (eipa~preis) (eipa~preis) (eipa~preis)

IF s_Date IS INITIAL. SELECT eina~matnr eipa~werks eipa~ebeln eipa~bedat eipa~preis
Last changed on: 23/05/2009 05:11:00 AM Last changed by: Biswadeep Sarkar Version: 1.0 Page: 13 of 15

Project TOUCHSTONE
INTO TABLE FROM eina INNER JOIN eipa~mandt eipa~infnr i_price eipa ON = eina~mandt AND = eina~infnr

FOR ALL ENTRIES IN i_mara WHERE eina~matnr = i_mara-matnr. ELSE. SELECT eina~matnr eipa~werks eipa~ebeln eipa~bedat eipa~preis INTO TABLE i_price FROM eina INNER JOIN eipa ON eipa~mandt = eina~mandt AND eipa~infnr = eina~infnr FOR ALL ENTRIES IN i_mara WHERE eina~matnr = i_mara-matnr AND eipa~bedat IN s_date. ENDIF.

Extract the following fields from above tables (MBEW, MBEWH): MAP (Moving Average Price) (mbewh~verpr)
IF SY-DATUM IN s_date. SELECT matnr bwkey verpr " MAP INTO TABLE i_verpr FROM mbew FOR ALL ENTRIES IN i_mara WHERE mbew~matnr = i_mara-matnr AND mbew~bwkey = i_mara-werks. ELSE. SELECT mbewh~matnr mbewh~bwkey mbewh~verpr INTO TABLE i_verpr FROM mbewh FOR ALL ENTRIES IN i_mara WHERE mbewh~matnr = i_mara-matnr AND mbewh~bwkey = i_mara-werks AND mbewh~lfgja = s_date-high+0(4) AND mbewh~lfmon <= s_date-high+4(2). ENDIF.

" MAP

Validations on selection screen:
Material Type (mara~mtart) Plant (marc~werks)
AT SELECTION-SCREEN. SELECT SINGLE mtart FROM mara INTO wa_mara-mtart WHERE mtart IN s_mta rt. IF sy-subrc <> 0. MESSAGE e007. ENDIF. SELECT SINGLE werks INTO wa_mara-werks FROM t001w WHERE werks IN s_we rks.
Last changed on: 23/05/2009 05:11:00 AM Last changed by: Biswadeep Sarkar Version: 1.0 Page: 14 of 15

checks for correctness checks for correctness

Project TOUCHSTONE
IF sy-subrc <> 0. MESSAGE e008. ENDIF.

Last changed on: 23/05/2009 05:11:00 AM

Last changed by: Biswadeep Sarkar

Version: 1.0

Page: 15 of 15