View
224
Download
6
Category
Preview:
DESCRIPTION
Testing
Citation preview
PROJECT IDENTIFICATION DETAILSProject Name PMIS Code Project Start Date
JAFRA ACE PROJECT PR15_003917 10th May 2015Project End Date SDC Regional Delivery Head SDC Project Manager
29th Jan 2016 Amarnath Jayaraman Michael SturmanSDC QC Member SDC QA Lead SAP Subsidiary
Priya Kota Sandeep Kehra SAP NA
DOCUMENT REVISION, REVIEW, & APPROVAL HISTORY
TECHNICAL SPECIFICATION - PTM_IF_002_TS - TOLUCA INVENTORY INTERFACE
PTM_IF_002_TS_Toluca Inventory Interface Page 2 of 13
VER DATE AUTHOR REVIEWER/APPROVER REMARKS
1.0 Aug 18, 2015 Srinivas Rao Aare Priya Kota and or Ashish Saxena
Final
Table of contents
1. Program Summary.................................................................................................................32. Detailed Technical Design.....................................................................................................53. Appendix...............................................................................................................................13
Copyright © 2011 SAP AG. All rights reserved 2
PTM_IF_002_TS_Toluca Inventory Interface Page 3 of 13
1. Program Summary
OBJECT OVERVIEW
Object ID PTM_IF_002Business Process
Material Requirements Planning / Inventory
Object Title Visibility of Toluca Inventory in SAP
Object Description Interface of Toluca Inventory to SAP
SAP Release SAP Module Production Planning (PP)
Cycle of Testing C4Required Development Completion Date
DDMONYY
Complexity of Object Medium Interface run Batch / Real-time / Both
Interface Type Inbound Priority Low / Medium / High
Non-SAP System(s) and Descriptions
BPCS Commercial
Non-SAP System(s) and corresponding File Names
TS CONTROL
TS Author and Phone Srinivas Rao Aare Jafra Process Solis, Sergio
Copyright © 2011 SAP AG. All rights reserved 3
PTM_IF_002_TS_Toluca Inventory Interface Page 4 of 13
NumberOwner and Phone Number
TS Approved ByPriya Kota/Ashish Saxena
TS Approval date DDMONYY
Other Contact and Phone Number
Other Contact and Phone Number
PROGRAM ATTRIBUTES
Program title Visibility of Toluca Inventory in SAPProgram Name ZPI_TOLUCA_INVProgram Type ExecutablePackage ZPP_MPAuthorization Group N/A
Transaction Code ZTOLUCAINVInclude Programs ZPI_TOLUCA_INV_TOP – for declerations
ZPI_TOLUCA_INV_SCR – for selectio screenZPI_TOLUCA_INV_FRM – for routines
Function Modules N/AMessage Class ZACE_MSG_PPClasses N/A
SELECTION SCREEN
Selection Screen Block Name / Description -
Parameter / Select Options
Type / Field Name
Mandatory Default Value
ParamID
Search Help
Selection Screen Text
P_Plant WERKS Yes 5565
Note: Currently an option to provide presentation file and also choose glocal file option. However this is Provided temporarily to help with initial testing by FA.
VALIDATION OF SELECTION CRITERIA
N/A
Copyright © 2011 SAP AG. All rights reserved 4
PTM_IF_002_TS_Toluca Inventory Interface Page 5 of 13
AUTHORIZATION REQUIREMENTS
N/A
TECHNICAL FLOW DIAGRAM
2. Detailed Technical Design
TABLE REQUIREMENTS
Table name: ZPINTRANSIT.Delivery Class: AData Browser/Table View Maint.: Display/Maintenance Not Allowed.Data Class: APPL0Size: 0Buffering: Not allowedEnhancement Category: Cannot be enhanced.Table Maintenance Generator: N/A but provided temporarily for helping with testing.Function Group: N/A but currently ZPINTRANSIT
Structure
Key Field Data Element Currency/Quan Type and Length
Yes MANDT MANDT None CLNT 3Yes MATNR MATNR None CHAR 18No MENGE MENGE_D MSEG-MEINS QUAN 13No AEDAT AEDAT None DATS 8
PROCESSING LOGIC
1. Validate plant against T001W table. If Invalid rasie an error message E057(ZACE_MSG_PP).2. Retrieve the logical file path using class method ZCL_ACE_GEN_UTILITY=>
GET_LOGIFILE_WITH_PATH_FILE. Then extract only directory and collect files using class method
Copyright © 2011 SAP AG. All rights reserved 5
PTM_IF_002_TS_Toluca Inventory Interface Page 6 of 13
ZCL_ACE_GEN_UTILITY=>GET_FILES_IN_DIRECTORIES.
ZCL_ACE_GEN_UTILITY=> GET_LOGIFILE_WITH_PATH_FILE.EXPORTING IMPORTINGIV_LOGICAL_PATH = ‘Z_ACE_PTM002_IN’IV_FILENAME = ‘DUMMY.TXT’
EV_FILENAME = LV_FILENAMEET_RETURN = LT_RETURN.
Then from LV_FILENAME, remove DUMMY.TXT to keep only directory. Use below to get all files from the directory.
ZCL_ACE_GEN_UTILITY=>GET_FILES_IN_DIRECTORIESEXPORTING IMPORTINGIV_DIRPATH = LV_DIRNAME ET_FILES = LT_FILELIST
ET_RETURN = LT_RETURN.
Validate file by using OPEN DATASET LV_FILENAME and if any message generated or any exception, raise an error message.
3. SPLIT the file reord with HORIZONTAL TAB and prepare final data table.4. Get data
Get MATNR for each material in file from MARA for validating material Get RSNUM MATNR CHARG from RESB table for each material in file, WERKS = P_PLANT, XLOEK =
SPACE, CHARG IN DV-SERVIDA, LM-SERVIDA, VN-SERVIDA, TR-SERVIDA and BWART = 501. Get MATNR WERKS CHARG from MCHA table for each file material, WERKS = P_PLANT and CHARGE
IN DV-SERVIDA, LM-SERVIDA, VN-SERVIDA, TR-SERVIDA. Join MKPF and MSEG and get MBLNR, MJAHR, ZEILE, BWART,MATNR, MENGE where MKPF-CPUDT
= Yesterday (SY-DATUM-1), WERKS = P_PLANT and BWART IN (901, 902). Select * from ZPINTRANSIT for each material in file. Claculate Accumulated QTY as for each material add MSEG-MENGE with 901 movement type and
subtract MSEG-MENGE with 902 movement type Update ZPINTRANSIT-MENGE = Accumulated QTY + ZPINTRANSIT-MENGE only when the
ZPINTRANSIT-AEDAT not equals to SY-DATUM.
5. BATCH CREATE Check for duplicate entries with combination of Material and Batch Code. If duplicate exist, then mark that
material as invalid and to avoid further processing. Loop the final table
Check if FILE-MATNR eixts in MARA. If not, mark the material as invalid and avoid further processing for this material.
Check if Batch code is in following list DV, LM, VN, TR. If not, mark this material as invalid and avoid further processing..
READ MCHA with Material, Plant and Batch. If the entry already exists, then update as Already exists, Use BAPI_BATCH_CREATE to create batch by passing Material, Plant and Batch number. Update as CREATED for successful execution of BAPI and ERROR for failure. If for a material, some batches fail and some succeed, then for CREATED, update as NOT CREATED.
EXPORTING IMPORTING TABLESMATERIAL = BATCH = LV_BATCH RETURN = LT_RETURN
Copyright © 2011 SAP AG. All rights reserved 6
PTM_IF_002_TS_Toluca Inventory Interface Page 7 of 13
FINALTABLE_MATNRBATCH = FINALTABLE-CHARGPLANT = P_PLANT
AT END OF MATERIAL. Use BAPI_TRANSACTION COMMIT or ROLLBACK if all the batches for
material created or has no errors. For error cases, update the final table so that these are not required to process
further. Build a log table GT_BATCHLOG for any errors in reservation delete process.
6. RESERVATION DELETE LOOP RESB table
DELETE each reservation in RESB using BAPI_RESERVATION_DELETE.EXPORTING TABLESRESERVATION = RESB-RSNUM
RETURN = LT_RETURN
Use BAPI_COMMIT/ROLLBACK at the end of each material. For each material if there is any error while deleting a material, mark that material as having
error so that this is not used in further processing. If all reservations are deleted, then ALLRESDEL = ‘YES’ or else NO if there is any error.
For each material, build a value by concatenating list of all RESB-RSNUMs exist and also build a value of reservations that deleted for a material. These fields can be used in final log table .
Build a log table GT_RESBLOG for any errors in reservation delete process.
7. RESERVATION CREATE For error materials, use GT_BATCHLOG, GT_RESBLOG to populate final GT_LOG table. LOOP FINAL TABLE
For each material call BAPI_RESERVATION_CREATE1 as below.EXPORTING IMPORTING TABLESRESERVATIONHEADER = LS_RESHEADCALCHECK = LS_CALCHECK
RESERVATION = LV_RSNUM
RESERVATIONITEMS = LT_RESITEMSPROFITABILITYSEGMENT = LT_PROFITRETURN = LT_RETURN
Below is the mapping for BAPI call.BAPI PROGRAM VALUERESERVATIONHEADER (Structure)CREATEDBY SY-UNAMERES_DATE SY-DATUMMOVE_TYPE 501
Copyright © 2011 SAP AG. All rights reserved 7
PTM_IF_002_TS_Toluca Inventory Interface Page 8 of 13
MOVE_PLANT P_PLANTRESERVATIONHEADER (Table)MATERIAL GT_FINAL-MATERIALPLANT P_PLANTBATCH GT_FINAL-CHARGENTRY_QNT For TR batch,
(ZPINTRANSIT-MENGE + MSEG-MENGE of 901, 902) - GT_FINAL-MENGEFor other batches simly pass GT_FINAL-MENGE.
For each successful call, check if the same material has some quantity to be updated in table ZPINTRANSIT. If it is, then update using MODIFY statement and if no issues, then call BAPI_TRANSACTION_COMMIT else BAPI_TRANSACTION_ROLLBACK.
With RETURN table, fill log table GT_LOG.
8. ARCHIVE FILE Use method ZCL_ACE_GEN_UTILITY=>GET_LOGIFILE_WITH_PATH_FILE to get the folder for
archiving the executed file.EXPORTING IMPORTINGIV_LOGICAL_PATH = ‘Z_ACE_PTM002_IN_ARCHIVE’IV_FILENAME = LV_FILE
EV_FILENAME = LV_TARGETFILEET_RETURN = LT_RETURN.
Use method ZCL_ACE_GEN_UTILITY=>ARCHIVE_FILE for archiving file to target path.This method deletes the file in original folder and places it in target folder.
9. REPORTING for GT_LOG table. Use method CL_SALV_TABLE=>FACTORY and CL_SALV_TABLE=>DISPLAY for table GT_LOG to
display final report.
REUSABLE CODE
N/A
FILE ATTRIBUTES
File Type TXT
Delimited / Fixed-width
Tab
Header Record? N/A
Footer Record? N/A
Number of File Layouts and Description
1
Copyright © 2011 SAP AG. All rights reserved 8
PTM_IF_002_TS_Toluca Inventory Interface Page 9 of 13
File Layout(s)
Note: Header is provided in attachment just for understanding the column name.
INTERNAL TABLES
Name DescriptionGT_FILE_DATA File data readGT_MCHA Batch data for material and plantGT_MARA Material Master DetailsGT_RESB Resveration DetailsGT_MSEG Material Document DetailsGT_DETAILDUP Check duplicates in file dataGT_INTRANSITVAL In-transit QuantitiesGT_RESBLOG Reservation execution logGT_BATCHLOG Batch Creation LogGT_DETAIL Uploaded file dataGT_LOG Execution log details
MESSAGES
Message Class Message ID
Message Text
ZACE_MSG_FI 051 Invalid batch status & for material & in file!052 Invalid file format! Please use the correct file!053 Invalid Material &!054 Reservation & Created Successfully!055 Invalid file selected!056 No information to display! Please check the file!057 Invalid Plant &!058 Duplicate entry with material & and batch & combination!059 Reservation(s) deleted successfully!
SELECTION TEXT
NameDescription
P_FILE File
Copyright © 2011 SAP AG. All rights reserved 9
PTM_IF_002_TS_Toluca Inventory Interface Page 10 of 13
P_PLANT Plant
TEXT ELEMENTS
NameText Description
001 File selection (TEMPORARY)002 Selection Details for Toluca InterfaceA01 OnlineA02 Background Logical FileA10 DATA.VALIDA11 BATCH.CREATEA12 RES.DELETEA13 RES.CREATEA14 NOT_IN_FILE_RES.DELA15 Toluca InterfaceA17 Data Could Not be Read From File.A21 STATUSA22 STAGEA23 DV-SERVIDAA24 LM-SERVIDAA25 VN-SERVIDAA26 TR-SERVIDAA27 Existing ReservationsA28 Existing RESA29 Existg.RESA30 Deleted ReservationsA31 DEL.RESERVATIONSA32 DEL.RESERVA33 All Resrv. Deleted?A34 Resrv.Deleted?A35 Resrv.Del?A36 Reservation CreatedA37 Resrv.CreatedA38 Resrv.CRTDA39 MessageA51 CREATEDA53 ALREADY EXISTSA54 NOA55 N/AA56 YesA57 NOT CREATED
SUBROUTINES
Copyright © 2011 SAP AG. All rights reserved 10
PTM_IF_002_TS_Toluca Inventory Interface Page 11 of 13
NameDescription
OPEN_FILE_DIALOG Opens a dialog for file browsingVALIDATE_FILE_ONLINE Validates presentation server file enteredVALIDATE_FILE_BACKGROUND Validates application server file enteredDISPLAY_RESULT Display log reportCALC_QUANS Calculate In-transit quantity detailsVALIDATE_PLANT Validates PlantARCHIVE_FILE Deletes file from IN folder and places in ARCHIVE folderPOPULATE_RESERVATION_LOG Fill resveration execution logPOPULATE_FINAL_ERROR Fill final error detailsLOG_VALID_BATCH_ERROR Fill batch error details to logLOG_RESDEL_ERROR Fill reservation delete errors to logGET_DATA_AND_VALIDATE Get data for validation and executionRESERVATION_CREATE Creates reservationsRESERVATION_DELETION Deletes reservationsBATCH_CREATE Creates batchesSPLIT_INPUT_FILE Split data to individual fieldsGET_FILE_DATA Get data from file to Internal table
INTERFACE LIST OUTPUT
At the end of the interface run, please describe the details for the output list.
Output MethodALV Report. Can be downloaded to excel
Main HeadingToluca Interface
LAYOUT
TOTALINGN/A
SORTINGMATERIAL
PAGE BREAK
Copyright © 2011 SAP AG. All rights reserved 11
PTM_IF_002_TS_Toluca Inventory Interface Page 12 of 13
N/A
ERROR HANDLING1) Error in file format: Display error message and go back to selection screen2) Error in data: Display them in ALV with traffic lights and do not proceed with further steps3) Error ducring process execution: Display them in ALV with traffic light
INTERFACE LIST HEADER / FOOTER
N/A
ASSUMPTIONS IN TECHNICAL DESIGN
1. While calculating for ZPINTRANSIT-MENGE, unit of measure need not be taken into account.2. The table ZINTRANSIT will have quantity more than the material quantity provided in file.3. There will always be one file in the designated folder for Toluca Interface or IT team will make sure of it.4. AEDAT field is needed in ZPINTRANSIT table to make sure that the Accumulated quantity is updated only once.
OPEN ISSUES IN TECHNICAL DESIGN
N/A
UNIT TEST PLAN
Copyright © 2011 SAP AG. All rights reserved 12
PTM_IF_002_TS_Toluca Inventory Interface Page 13 of 13
Scenario #
Input Selection Criteria Expected Result
1 Test with an input file that contains all valid materials that exist in SAP with combination of materials with status (DV Only, LM Only, both DV and LM).
Validate that Material Reservations are generated accordingly for materials for DV Only, LM Only, and both DV and LM.
Validate the Process Log and that there are no exceptions (no errors)
2 Test with an input file that contains three or four materials that do not exist in SAP.
Validate that Material Reservations are loaded for valid materials.
Validate that the invalid materials error out and are captured on the processing log according to the messages in the Error Handling Section.
Validate the Processing Log Summary captures correctly the number of records processed correctly and incorrectly according to the Error Handling section.
3 Test with an input file that contains Valid SAP Materials and with Status Types DV, LM, VC and RC.
Validate that four types of Material reservations are properly created for „Available“, „Quarantine“, „Sales“, and „In-transit“.Validate proper MRP netting with Planned Independent Requirements present.
RELATED DOCUMENTATION (ATTACH OSS NOTES, EMAILS, DOWNLOAD OF EXISTING REPORT, ETC)
N/A
3. Appendix
N/A
Copyright © 2011 SAP AG. All rights reserved 13
Recommended