Abap Specs Reports

17
Project TOUCHSTONE Project TOUCHSTONE Specification Document Reference: document.doc Version: 1.0 Prepared for: JBM Functional Author: Nitin Chhabra Technical Author: Last Revision Date: Date Created: 11/05/2009 Last changed on: Last changed by: Version: Page: 23/05/2009 05:11:00 AM Biswadeep Sarkar 1.0 1 of 17

Transcript of Abap Specs Reports

Page 1: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE

Specification

Document Reference: document.docVersion: 1.0

Prepared for: JBM

Functional Author: Nitin ChhabraTechnical Author:

Last Revision Date:Date Created: 11/05/2009

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 1 of 15

Page 2: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE

Document Information

Business Area MM

Type of development Report

SAP R/3 Version R/3 ECC 6.0

Approval

Approved by Name Role Signature DateFunctional Team

Nitin Chhabra Team Lead Nitin 11/05/2009

Technical Team

Document History

Version Reason for change Date

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 2 of 15

Page 3: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONETable of Contents

Functional Specifications 4

1 SUMMARY 4

2 SCOPE 4

2.1 Starting Conditions 4

2.2 Frequency 4

3 LOGIC OVERVIEW 4

4 THE SELECTION SCREEN 5

5 DATA MAPPING 5

5.1 Extraction Summary 5

5.1.1 Note 1 – Select deliveries 5

5.1.2 Note 2 – Get delivery items 6

5.1.3 Note 3 – etc 6

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 9

3. Report Output Display: 9

4. Technical Description: 9

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 3 of 15

Page 4: Abap Specs Reports

Project TOUCHSTONEProject 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 Starting Conditions

Manual

2.2 Frequency

Whenever required by the buyer.

3 Logic Overview

Logic: -

Selction of the materials

1) MARA / MAKT

a. Material Type (MARA-MTART) - mandatory, check correctness

b. Material Group (MARA-MATKL)

c. Material (MARA-MATNR)

2) MARC

a. Selection from MARA

b. Plant (T001W-WERKS) - mandatory, check correctness

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: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 4 of 15

Page 5: Abap Specs Reports

Project TOUCHSTONEProject 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(MBEWH-VERPR) 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 screenFilter 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 Data Type Default Value

Mandatory Selection Screen Type

Search Help

Notes

Material Type .

MARA-MTART

Mandatory,check correctness

select-option N.A N.A

Material Group

MARA-MATKL

Material MARA-MATNR

Plant T001W-WERKS

Mandatory,check correctness

Date Interval Mandatory

5 Data Mapping

N.A

5.1 Extraction Summary

N.A

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 5 of 15

Page 6: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE6 Appendices

N.A

6.1 Appendix A – Custom Table Definition

N.A

6.2 Appendix B – Report Layout

Price Movement for a period

Material Class/Type

Material Group

Material Code

Material Description

Previous Price 2

Previous Price 1 Previous Price

Current Moving Avg.Price

               

                                                                           

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 6 of 15

Page 7: Abap Specs Reports

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 7 of 15

Page 8: Abap Specs Reports

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.}

Other programs:

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 8 of 15

Page 9: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE{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 Constraints Data Type---------------------- ------------------------------------------------------------ --------------------------------

Material type OBLIGATORY NO INTERVALS NO-EXTENSION mara-mtart(CHAR 4)Material Group NO INTERVALS NO-EXTENSION mara-matkl(CHAR 9)Material No NO INTERVALS NO-EXTENSION                  mara-matnr(CHAR 18)Plant NO INTERVALS NO-EXTENSION          t001w-werks(CHAR 4)Date Interval NO-EXTENSION EIPA-BEDAT (DATS)

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 9 of 15

Page 10: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE

2. Selection Screen Display

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

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 10 of 15

Page 11: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE3. Report Output Display:

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 11 of 15

Page 12: Abap Specs Reports

Project TOUCHSTONEProject 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: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 12 of 15

Page 13: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONEBased on Selection Criteria :

1. Fetch data from tables (MARA & MARC) based on selection criteria as shown below:

Material Type mandatory

Material Group Mandatory

Plant (optional)

Date Interval (optional)

Extract the following fields from above mentioned tables (MARA & MARC):

Material Type (mara~mtart)

Material Group (mara~matkl)

Plant (marc~werks)

Material No (mara~matnr)

Material Description (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 (eipa~preis)

Previous Purchase price 1 (eipa~preis)

Previous Purchase price 2 (eipa~preis)

      IF s_Date IS INITIAL.          SELECT eina~matnr eipa~werks eipa~ebeln eipa~bedat eipa~preis            INTO TABLE i_price

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 13 of 15

Page 14: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE            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.      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          " MAP            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.

Validations on selection screen :

Material Type (mara~mtart) checks for correctness

Plant (marc~werks) checks for correctness

AT SELECTION-SCREEN.

  SELECT SINGLE mtart FROM mara INTO wa_mara-mtart WHERE mtart IN s_mtart.  IF sy-subrc <> 0.    MESSAGE e007.  ENDIF.

  SELECT SINGLE werks INTO wa_mara-werks FROM t001w WHERE werks IN s_werks.  IF sy-subrc <> 0.

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 14 of 15

Page 15: Abap Specs Reports

Project TOUCHSTONEProject TOUCHSTONE    MESSAGE e008.  ENDIF.

Last changed on: Last changed by: Version: Page:

23/05/2009 12:11:00PM

Biswadeep Sarkar 1.0 15 of 15