2 Ts Arr-product

62
8/20/2019 2 Ts Arr-product http://slidepdf.com/reader/full/2-ts-arr-product 1/62 Corporate Centre Technical Specification Technical Specification for Annual Review Report for Material

Transcript of 2 Ts Arr-product

Page 1: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 1/62

Corporate Centre 

Technical Specification

Technical Specification for Annual Review Report

for Material

Page 2: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 2/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 2 of 62

Table of Contents

1.  Introduction ................................................................................................................................................................. 3 

2.  Overview ..................................................................................................................................................................... 3 

3.  Design Specification .................................................................................................Error! Bookmark not defined. 

3.1  Function 1  – Generation of the report. .......................................................................................................... 3 

3.2  Function 2  – Viewing and modification of report using Web dynpro ....................................................... 44 

4.  Data .................................................................. ................................................................. ......................................... 59 

5.  Interfaces ......................................................... ................................................................... ....................................... 60 

6.  Non-functional Attributes......................................................................................................................................... 60 

7.  Environment ............................................................... ................................................................. .............................. 60 

8.  Glossary .................................................................................................................................................................... 60 

9.  References ................................................................ .................................................................. .............................. 60 

10.   Annexure ............................................................... ................................................ Error! Bookmark not defined. 

Revision History ............................................................................................................................................................... 61 

 APPROVAL & AUTHORIZATION ................................................................................................................................. 62 

Page 3: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 3/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 3 of 62

1. Introduction

This technical specification document will explain areas where functionalities have to be achieved through

technical development with details of all ABAP objects.

2. Overview.

The requirement is to test Annual Review Report for Material where the detail report will be created with

combination of manual entry and system generated data for each of the material after a period of one year (review

 period). There are as many as 19 report for each of the material which will be created at the end of the review period.

The reports will reviewed at different level which finally will be consolidated into one PDF report.

3. Design Specification

Function provide testing of Annual Review Report for Material where different report will be generated at the end of

the review period of each of the Material. Report will be generated partly by manual intervention and partly by thesystem. The report will be reviewed at each level with comments by the person responsible. And finally all the reports

will be consolidated at the end. There are two major functions to get performed. They are

1.  Generation of the report

2.  Viewing and modification of the report using Web dynpro and Workflow

3.1 Function 1  – Generation of the report.

  Objective  –  The function will helps to generate report associated with each of the material for the given review

 period (review period is for one year)

  Details of Use  –  This function is used to extract all the data related to each material entered in the system for the

given reviewing period. There are about 19 reports which will extract all the important data in the system in the

form of PDF for the given material.

Following are the reports for each material in the given reviewing period.

The logic of extracting the data in the given internal table is done by the function module. And the

function module will consolidate the data from the Z-table. The reports are explained below with logic ofextracting the data as follow:

# Transaction Code Name of the Table Brief Description of the functionality

1 ZQMT_CPARR_PRDDSC zqm_cto_arr_0151 PRODUCT DESCRIPTION

2 ZQMT_CPARR_REVIEWP zqm_review_per Maintains Review Period of Product

3 ZQMT_CPARR_YIELD zqm_cto_arr_0251

BATCH PRODUCTION AND DISPATCHDETAILS

REVIEW OF REPROCESS & REWORK

4 ZQMT_CPARR_STRT_PK_NS zqm_cto_arr_0551REVIEW OF STARTING MATERIALS &

PACKAGING MATERIALS FROM NEW

SOURCE

Page 4: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 4/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 4 of 62

6 ZQMT_CPARR_OOS_OOTREV zqm_cto_arr_0651 REVIEW OF OOS & OOT RESULTS

7 ZQMT_CPARR_INCDNTREV zqm_cto_arr_0652 REVIEW OF INCIDENTS

8 ZQMT_CPARR_CCTRLREV zqm_cto_arr_0655 REVIEW OF CHANGE CONTROLS

10 ZQMT_CPARR_COMPLREV zqm_cto_arr_0658 REVIEW OF CUSTOMER COMPLAINTS

11 ZQMT_CPARR_RETGDREV zqm_cto_arr_0659 RETURNED GOODS

12 ZQMT_CPARR_RECALL_UL zqm_cto_arr_2051 RECALLS

13 ZQMT_CPARR_PROCESSCNT zqm_cto_arr_0664 REVIEW OF VALIDATION ACTIVITIES

14 ZQMT_CPARR_REGFILSTS zqm_cto_arr_2052 REVIEW OF REGULATORY FILING STATUS

15 ZQMT_CPARR_RESSAMPLES zqm_cto_arr_0661REVIEW OF RETAINED SAMPLES(FINISHED

PRODUCT)

a.  Report-1- Product description

The data for this report will be extracted from the z-table which will be updated by the BOM

explosion report. The function module will extract the data by giving Plant, year and the material

number and will extract Bulk API and the material type for it.

All the fields for table will be directly extract from the z-table except Chemical name and Codes ofmanufacturing stages

  Chemical name is the description of the material obtained by using the standard

functional module of extracting the long text from the material master.

  Code of manufacturing stages- By inputting the material type as INT, KSM, API (or ARR

material type) , it will extract the BOM from the z-table.

Logic- This function is achieved through Function module Zqm_cto_arr_9000 &ABAP programming. Program –  ZQM_CTO_ARR_0151 was developed for the report compilation 

Page 5: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 5/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 5 of 62

*---------------------------------------------------------------------------------------------------------------------------*  *------------------------------------------------1.0 PRODUCT DESCRIPTION----------------------------------------------------*  

"code added  DATA : zyear1 TYPE zyear. zyear1 = zyear + 1. "ended  

SELECT SINGLE bulk_apiarr_mat_type

FROM zqm_cto_arr_0151

Page 6: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 6/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 6 of 62

INTO wa_pr_descWHERE bom_component EQ bulk_apiAND plant EQ werksAND zyear EQ zyear . 

* AND arr_mat_type EQ 'API'."CODE COMMENTED ON 20/7/2014 

wa_pr_desc-arr_mat_type = 'API'. 

IF sy-subrc IS INITIAL. MOVE wa_pr_desc-sap_code TO lv_name. CALL FUNCTION 'READ_TEXT' 

EXPORTING client = sy-mandtid = 'GRUN' language = 'E' name = lv_nameobject = 'MATERIAL' 

TABLES lines = it_lines

EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. 

IF sy-subrc <> 0. * Implement suitable error handling here 

ENDIF. LOOP AT it_lines INTO wa_lines WHERE tdline IS NOT INITIAL. 

if sy-tabix eq 1. CONCATENATE wa_pr_desc-chemical_name wa_lines-TDLINE INTO wa_pr_desc-

chemical_name. else. CONCATENATE wa_pr_desc-chemical_name wa_lines-TDLINE INTO wa_pr_desc-

chemical_name. endif. ENDLOOP. 

SELECT SINGLE in_housecode "in_housecode_api FROM zqm_cto_arr_0151INTO wa_pr_desc-name_of_product

WHERE bom_component EQ wa_pr_desc-sap_code. ENDIF. 

SELECT bom_componentFROM zqm_cto_arr_0151INTO TABLE it_pr_desc_intWHERE bulk_api EQ bulk_apiAND plant EQ werksAND zyear EQ zyear "COMMENTED FOR 628 

* AND zyear EQ zyear1 AND arr_mat_type EQ 'INT'. 

DATA : lv_int_text TYPE ZMAKTX, lv_int_cnt type int4. 

IF it_pr_desc_int[] IS NOT INITIAL. 

Page 7: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 7/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 7 of 62

SELECT *FROM zqm_cto_arr_0151INTO TABLE it_maktFOR ALL ENTRIES IN it_pr_desc_intWHERE bom_component EQ it_pr_desc_int-sap_code

and arr_mat_type = 'INT'. 

IF sy-subrc IS INITIAL. LOOP AT it_pr_desc_int ASSIGNING <fs_it_pr_desc_int>. 

lv_int_text = <fs_it_pr_desc_int>-sap_code. lv_int_cnt = sy-tabix. if SY-TABIX ne 1 and <fs_it_pr_desc_int>-sap_code = lv_int_text. 

READ TABLE it_makt INTO wa_makt INDEX lv_int_cnt. IF sy-subrc IS INITIAL. <fs_it_pr_desc_int>-in_house = wa_makt-

in_housecode_api. CLEAR wa_makt. 

endif. ELSE. READ TABLE it_makt INTO wa_makt

WITH KEY bom_component = <fs_it_pr_desc_int>-sap_code. 

IF sy-subrc IS INITIAL. <fs_it_pr_desc_int>-in_house = wa_makt-in_housecode_api. CLEAR wa_makt. 

ENDIF. ENDIF. 

ENDLOOP. ENDIF. ENDIF. 

SELECT bom_componentFROM zqm_cto_arr_0151INTO TABLE it_pr_desc_ksmWHERE bulk_api EQ bulk_apiAND plant EQ werksAND zyear EQ zyear

* AND zyear EQ zyear1 AND arr_mat_type EQ 'KSM'. 

IF it_pr_desc_ksm[] IS NOT INITIAL. SELECT *

FROM zqm_cto_arr_0151

INTO TABLE it_maktFOR ALL ENTRIES IN it_pr_desc_ksmWHERE bom_component EQ it_pr_desc_ksm-sap_codeand arr_mat_type = 'KSM'. 

IF sy-subrc IS INITIAL. LOOP AT it_pr_desc_ksm ASSIGNING <fs_it_pr_desc_ksm>. 

READ TABLE it_makt INTO wa_maktWITH KEY bom_component = <fs_it_pr_desc_ks

m>-sap_code. IF sy-subrc IS INITIAL. 

<fs_it_pr_desc_ksm>-in_house = wa_makt-in_housecode_api. 

CLEAR wa_makt. 

ENDIF. 

Page 8: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 8/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 8 of 62

ENDLOOP. ENDIF. 

ENDIF. 

 b.  Report -2- Batch production and dispatch details

This report consists of three sections as given below

 b.1 Summery of Production of Intermediate and API’s Batch 

The fields will be extracted from the z-table already filled up by the report program using the SAP

data base. The data will be extracted by the function module by giving the material number, Plant

and the review period as the input.

  Product stages is the primary key and consists of either API or INT material type. On the

 basis of this the data will get extracted from the Z-table.

  Material code and Product stage code will be obtained from the z-table used for Report-1

   No of Batches Manufactured –  group batches by taking the movement type 101 and 102

(that is good issue and good return). Condition should be batches for 101 good movement

 plus batches for 102 good movement will be greater than 0

  Quantity Manufactured - Use table MSEG , Pass the INT and API Material's along with plant and filter with Movement type 101 and 102 for the review period and get the Batch

& Quantity details along with UOM (Unit of Measurement)

  UOM (Unit Of Measurement)- It uses standard SAP table MSEG

  *-------------------------------------------------------------------------------------------------------------------------* *---------------------------------------------2.1 Summary of production --------------------------------------------------* REFRESH : it_makt1. 

CLEAR wa_makt. CLEAR: lv_str_code, lv_str_des, wa_makt. 

SELECT matnrbulk_apibatch_countmengemeinsmaktxpostpDAUAT "added on 1/9/2014 

FROM zqm_cto_arr_0251INTO TABLE it_prWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werks. 

IF sy-subrc IS INITIAL. SELECT *

FROM zqm_cto_arr_0151INTO TABLE it_makt1FOR ALL ENTRIES IN it_prWHERE bulk_api EQ it_pr-matnr. 

SELECT * from T003PINTO TABLE it_T003P

Page 9: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 9/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 9 of 62

FOR ALL ENTRIES IN it_prWHERE AUART eq it_pr-DAUAT. 

ENDIF. 

IF sy-subrc IS INITIAL. LOOP AT it_pr INTO wa_pr. 

COLLECT wa_pr INTO it_pr_cumulate. CLEAR wa_pr. 

ENDLOOP. LOOP AT it_pr_cumulate INTO wa_pr. 

READ TABLE it_makt1 INTO wa_makt WITH KEY bom_component = wa_pr-matnr. 

CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING 

input = wa_pr-matnrIMPORTING 

output = wa_pr-matnr. 

lv_str_code = wa_makt-in_housecode_api. * SPLIT wa_makt-in_housecode_api AT '(' INTO  * lv_str_code * lv_str_des. * REPLACE ')' WITH ' ' INTO  * lv_str_des. 

IF wa_pr-postp EQ 'ARR' OR wa_pr-postp EQ 'ARR1' OR wa_pr-postp EQ 'ARR2' OR wa_pr-postp EQ 'ARR3'. 

wa_pr-postp = 'API'. ENDIF. CONCATENATE wa_pr-matnr ' ' '(' wa_pr-postp ')' 

INTO wa_batch_pr-pr_stage. wa_batch_pr-

pr_stage_code = lv_str_code. wa_batch_pr-batch_count = wa_pr-

batch_count. wa_batch_pr-qty_manufactured = wa_pr-

menge. wa_batch_pr-meins = wa_pr-

meins. 

READ TABLE it_t003p INTO wa_t003p WITH KEY auart = wa_pr-dauat. 

wa_batch_pr-TXT = wa_t003p-

txt. 

APPEND wa_batch_pr TO it_batch_pr. CLEAR wa_batch_pr. CLEAR lv_str_code. CLEAR lv_str_des. CLEAR wa_makt. 

ENDLOOP. ENDIF. 

 b.2 Dispatch details of the product against the sales order

In this part function module will be used to extract the data from the Z-table as well as from the

standard SAP table.

Page 10: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 10/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 10 of 62

  A Z table has to be created where in Market and country name will be maintained

  A Z table has to be created which updates the dispatched details of 35 series material for

the current year.

  Material code- will be obtained from Report -1

  Market name- Pass the API material in MSEG table along with 261 movement type, getthe details of Sales Order. Pass the Sales Order into VBAK table, get the KGVR4 to get

the Country name. Check the Country name in Z table where country name and Market

name is maintained. Pick the Market name and populate.

  Dispatch quantity- Pass the Sales order into LIPS table against movement type 601 and

get the Dispatched quantity. Populate this quantity as dispatched quantity.

  UOM (Unit Of Measurement)- It uses standard SAP table MSEG

 b.3 Dispatch details of the product against STO.

In this part function module will be used to extract the data from the Z-table as well as from the

standard SAP table.

  Material code- will be obtained from Report -1  FTO unit- Pass the API material in MSEG table along with 261 movement type to get the

details of Process order. Pass the Process Order into AFPO and get the FTO Unit No,

  Dispatch quantity- Pass the API material in MSEG table along with 261 movement typeto get the details of Process order. Pass the Process Order into AFPO and get the FTO

Unit No and get the quantity using 603 movement type.

  UOM (Unit Of Measurement)- It uses standard SAP table MSEG

*------------------------------------------------------------------------------------------------------------------------*  *----------------------------------------------2.2 Dispatch details------------------------------------------------------*  

CLEAR: lv_tot_sum, lv_serial_no, wa_disp_mar_tot. 

SELECT market_desclfimgmeins

FROM zqm_cto_arr_0351INTO TABLE it_dispWHERE bulk_api EQ bulk_apiAND werks EQ werksAND zyear EQ zyear. 

IF sy-subrc IS INITIAL. 

LOOP AT it_disp INTO wa_disp_sos. lv_tot_sum = lv_tot_sum + wa_disp_sos-

lfimg. wa_disp_mar_tot-total_quan = lv_tot_sum. wa_disp_mar_tot-uom = wa_disp_sos-uom. COLLECT wa_disp_sos INTO it_disp_sos. 

ENDLOOP. CLEAR wa_disp_sos. LOOP AT it_disp_sos INTO wa_disp_sos. 

lv_serial_no = lv_serial_no + 1. wa_disp_sos-serial_no = lv_serial_no. MODIFY it_disp_sos FROM wa_disp_sos. 

ENDLOOP. 

ENDIF. 

Page 11: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 11/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 11 of 62

CLEAR wa_disp_sto_tot. CLEAR lv_serial_no. CLEAR lv_tot_sum. SELECT werks1

lfimgmeins

FROM zqm_cto_arr_0352INTO TABLE it_disp1WHERE bulk_api EQ bulk_apiAND werks EQ werksAND zyear EQ zyear. 

IF sy-subrc IS INITIAL. LOOP AT it_disp1 INTO wa_disp_sto. 

lv_tot_sum = lv_tot_sum + wa_disp_sto-lfimg. 

wa_disp_sto_tot-total_quan = lv_tot_sum. 

wa_disp_sto_tot-uom = wa_disp_sos-uom. COLLECT wa_disp_sto INTO it_disp_sto. 

ENDLOOP. * lv_disp_sum = lv_tot_sum. 

CLEAR wa_disp_sto. LOOP AT it_disp_sto INTO wa_disp_sto. 

lv_serial_no = lv_serial_no + 1. wa_disp_sto-serial_no = lv_serial_no. MODIFY it_disp_sto FROM wa_disp_sto. 

ENDLOOP. ENDIF. 

c.  Report-3- Review of quality trends of API Starting material.

This reports will give the trend of the API as the Starting material. The function module will be

used to extract the trend of the each of the character assigned to the API product with respect to the

 batch used for the product.

There will be as many as 40 column maintained for the given batch which will be dynamically

extracted with the MIC (Maintenance Inspection characteristics) value from the Z-table for given

 product.

The data will be extracted on the basis of the Product number, plant and the review period.

  All API Starting materials should be taken into account

  API Starting material- Material extracted with Item category "5" from BOM of Bulk API

  Chemical name- using the standard function module extract the long text from thematerial master of the given product

  Specification Ref No- It will be extracted using the Task list Header of the given

inspection lot number of the given batch and the product in the review period.

  Batch No- API Starting material will be obtained from the table MSEG table and furtheron the basis of Material/Plant/101 Batch for the review period will be extracted.

  Batch-->QALS->Group and Counter Pass Group and Counter-->PLMK-->Characteristics

and KURZTEXT and populate in dynamic columns

  If the Characteristics is Qualitative, then for the assigned MIC, the Catalog type, Selected

set indicator/Selected set /Catalog group for the plant read the long text using FMREAD_TEXT and find out the long text description for the" code "starting with "S" and

should be populated in above.

Page 12: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 12/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 12 of 62

  If the Characteristics is Quantitative, then for the assigned MIC, the Specification limit

along with UOM is to be populated along with the MIC description in col1,2,3 as shown

 below.

  IL will be extracted from QAMR , for each characteristics, find out the Recorded

values(ISTSTPUMF) Values. If this charac is qualitative, Get the Code group and codedetails field and the corresponding Long text using FM READ_TEXT.If this is recorded

value is 1 and characteristic is quantitative, get the Original value filed and populate in

table as value for the charac.If recorded values is more than 1, Pass the IL in QASE table,

get the Original value field for all the values and populate in table.

  Mean, sigma, 3 sigma and Standard deviation will be calculated automatically and on the basis of this for given batch and product the graph will be populated.

Logic- This function is achieved through Function module Zqm_cto_arr_9013,

ZQM_CTO_ARR_9014 & ABAP programming. Program –  ZQM_CTO_ARR_0458 was developed for thereport compilation 

Page 13: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 13/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 13 of 62

These FM inturn uses Tables ZQM_CTO_ARR_0451 & ZQM_CTO_ARR_0452.

The below FM ‘ZQM_CTO_ARR_9051’ generates Graph based on Mean values. 

g_ixml = cl_ixml=>create( ). 

refresh mime. perform create_data_demo using l_ixml_data_doc. 

* perform create_custom_demo using l_ixml_custom_doc. 

create object l_igs_ceexporting 

destination = 'IGS_RFC_DEST'. 

call function 'SCMS_BINARY_TO_XSTRING' exporting 

input_length = content_length* FIRST_LINE = 0 * LAST_LINE = 0 

importing buffer = l_xstream

tables binary_tab = mime

* EXCEPTIONS  * FAILED = 1 * OTHERS = 2 

call function 'SSFC_BASE64_ENCODE' exporting 

bindata = l_xstream

importing b64data = chartstring. 

xstring = l_xstream. if sy-subrc <> 0. 

* Implement suitable error handling here endif. clear l_cached_response. create object l_cached_responsetype cl_http_responseexporting 

add_c_msg = 1. l_cached_response->set_data( l_xstream ). l_cached_response-

>set_header_field( name = if_http_header_fields=>content_type value = 'image/bmp' ). 

l_cached_response->set_status( code = 200 reason = 'OK' ). l_cached_response->server_cache_expire_rel( expires_rel = 300 ). 

concatenate 'HTTP://ECCDCS1S.MYDRREDDYS.COM:8001/sap/bc/webdynpro/sap/ztest_pk' 

'/image1.bmp' into l_image_url1. 

cl_http_server=>server_cache_upload( url = l_image_url1 response = l_cach

Page 14: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 14/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 14 of 62

ed_response ). * call method  

clear url. url = l_image_url1. 

* endif. 

endfunction. 

*&---------------------------------------------------------------------*  *& Form create_data_demo *&---------------------------------------------------------------------*  * text *----------------------------------------------------------------------*  * -->P_IXML_DOC text *----------------------------------------------------------------------*  form create_data_demo using p_ixml_doc type ref to if_ixml_document. 

data: l_simplechartdata type ref to if_ixml_element, l_categories type ref to if_ixml_element, l_series type ref to if_ixml_element, l_element type ref to if_ixml_element, 

* l_text type ref to if_ixml_element, l_encoding type ref to if_ixml_encoding, l_globalsettings type ref to if_ixml_element, string1 type string, string2 type string. 

data: 

igs_chart type ref to cl_igs_chart, 

line type igs_data, data type igs_data_tab, l_igs_ce type ref to cl_igs_chart_engine, ext_line type igs_ext, extension type igs_ext_tab, html type w3htmltabtype, html_line type w3html, content_type type w3param-cont_type, content_subtype type w3param-cont_type, p_html type w3htmltabtype, g_html_control type ref to cl_gui_html_viewer. 

* CREATE OBJECT g_html_control. * EXPORTING  * parent = cl_gui_container=>default_screen. 

p_ixml_doc = g_ixml->create_document( ). 

l_encoding = g_ixml->create_encoding( byte_order = if_ixml_encoding=>co_little_endiancharacter_set = 'utf-8' ). 

p_ixml_doc->set_encoding( l_encoding ). 

* empty result table 

refresh p_html. 

Page 15: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 15/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 15 of 62

* create chart object create object igs_chart. if chart_type1 = 'LINES' or chart_type1 = 'LINE'. igs_chart->type = cl_igs_chart=>co_type_lines. 

else. * set chart type 

igs_chart->type = cl_igs_chart=>co_type_cols. endif. 

* igs_chart->CO_SCHEME_STRAIGHT = 'STRAIGHT'. * set picture size 

igs_chart->width = 3600." 2300."1600. "1000. igs_chart->height = 700. "450. ".270 

* some data to be displayed  if nos ge '1'. line-groupid = series1. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val. line-x = string1. line-y = string2. 

* if sy-tabix = 3. * line-datalabel = string1. * ENDIF. * line-extension = 'href="http://www.sap.com"'. 

append line to data. 

clear string1. clear string2. clear wa_table. 

endloop. endif. if nos ge '2'. line-groupid = series2. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val1. line-x = string1. line-y = string2. 

* line-extension = 'href="http://www.sap.com"'. append line to data. 

clear string1. 

clear string2. clear wa_table. 

endloop. endif. if nos ge '3'. line-groupid = series3. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val2. line-x = string1. line-y = string2. 

* line-extension = 'href="http://www.sap.com"'. append line to data. 

Page 16: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 16/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 16 of 62

clear string1. clear string2. clear wa_table. 

endloop. endif. 

if nos ge '4'. line-groupid = series4. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val3. line-x = string1. line-y = string2. 

* line-extension = 'href="http://www.sap.com"'. append line to data. 

clear string1. clear string2. 

clear wa_table. endloop. endif. if nos ge '5'. 

line-groupid = series5. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val4. line-x = string1. line-y = string2. 

* line-extension = 'href="http://www.sap.com"'. append line to data. 

clear string1. clear string2. clear wa_table. 

endloop. endif. if nos ge '6'. 

line-groupid = series6. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val5. line-x = string1. line-y = string2. 

* line-extension = 'href="http://www.sap.com"'. 

append line to data. 

clear string1. clear string2. clear wa_table. 

endloop. endif. if nos ge '7'. 

line-groupid = series7. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val6. line-x = string1. 

line-y = string2. 

Page 17: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 17/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 17 of 62

* line-extension = 'href="http://www.sap.com"'. append line to data. 

clear string1. clear string2. 

clear wa_table. endloop. endif. if nos ge '8'. 

line-groupid = series8. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val7. line-x = string1. line-y = string2. 

* line-extension = 'href="http://www.sap.com"'. append line to data. 

clear string1. clear string2. clear wa_table. 

endloop. endif. if nos ge '9'. 

line-groupid = series9. loop at it_table into wa_table. 

string1 = wa_table-x_axis. string2 = wa_table-i_val8. line-x = string1. line-y = string2. 

* line-extension = 'href="http://www.sap.com"'. 

append line to data. 

clear string1. clear string2. clear wa_table. 

endloop. endif. 

igs_chart->data = data. 

* set titles igs_chart->title = header. igs_chart->title_values = y_axis. 

igs_chart->title_categories = x_axis. * igs_chart->SUBTITLE = 'abcd'. * set some extensions 

ext_line-token = 'TITLE'. * ext_line-value = 'href="http://www.sap.com"'. 

append ext_line to extension. 

ext_line-token = 'LGNDI'. * ext_line-value = 'href="http://www.spiegel.de"'. 

append ext_line to extension. 

igs_chart->extension = extension. 

Page 18: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 18/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 18 of 62

* create picture " commtnting for testing start.......... 

call method igs_chart->sendimporting 

content_type = content_typecontent_length = content_lengthcontent = mimeimagemap = html

exceptions rfc_communication_error = 1 rfc_system_error = 2 internal_error = 3 others = 4. 

" commtnting for testing end.......... * IF sy-subrc IS INITIAL AND p_real NE space. * SPLIT content_type AT '/' INTO content_type content_subtype. * CALL METHOD g_html_control->load_data 

* EXPORTING  * type = content_type * subtype = content_subtype * size = content_length * IMPORTING  * assigned_url = url * CHANGING  * data_table = mime. * ENDIF. endform. " create_data_demo 

d.  Report-4- Review of starting material and Packaging material from new source.

Here the report will be having two sections where the data will be extracted by taking thecombination of Product number, plant and review period.

  Function module will be used to extract the data from the Z-table for the Raw Material

considering the material type as VERP

  Function module will be used to extract the data from the Z-table for the Packing Material

considering the material type as KSM

*------------------------------------------------------------------------------------------------------------------------*  *------------------------------------------4.1 Raw Materials-------------------------------------------------------------*  

REFRESH: IT_MAKT1. CLEAR: WA_MAKT. LV_TOTAL_D = 'Total no. of vendors approved during the review period:'. LV_TOT = 'Total no. of vendor evaluation under progress during the review

 period:'. LV_TOT_D = 'Total no. of vendor rejected/blocked during the review period

:'. CLEAR LV_SERIAL_NO. SELECT *FROM ZQM_CTO_ARR_0551INTO CORRESPONDING FIELDS OF TABLE IT_RAWWHERE BULK_API EQ BULK_API

AND WERKS EQ WERKS

Page 19: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 19/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 19 of 62

AND ZYEAR EQ ZYEARAND POSTP NE 'VERP'. 

IF SY-SUBRC IS INITIAL. SELECT *

FROM ZQM_CTO_ARR_0151INTO CORRESPONDING FIELDS OF TABLE IT_MAKT1FOR ALL ENTRIES IN IT_RAWWHERE BOM_COMPONENT EQ IT_RAW-MATNR. 

ENDIF. 

* IF sy-subrc IS INITIAL. "commented on 25/8/2014 LOOP AT IT_RAW INTO WA_RAW. 

READ TABLE IT_MAKT1 INTO WA_MAKT WITH KEY BOM_COMPONENT = WA_RAW-MATNR. 

LV_SERIAL_NO = LV_SERIAL_NO + 1. CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' 

EXPORTING 

INPUT = WA_RAW-MATNRIMPORTING 

OUTPUT = WA_RAW-MATNR. CONCATENATE WA_RAW-MATNR '(' WA_MAKT-IN_HOUSECODE_API ')' INTO WA_RAW_MAT-MATNR_DES. WA_RAW_MAT-SERIAL_NO = LV_SERIAL_NO. WA_RAW_MAT-SOURCE_DETAIL = WA_RAW-SOURCE_DETAIL. WA_RAW_MAT-VENDOR_STATUS = WA_RAW-VENDOR_STATUS. WA_RAW_MAT-DATUV = WA_RAW-DATUV. WA_RAW_MAT-ZBLOCK_REASON = WA_RAW-ZBLOCK_REASON. IF WA_RAW_MAT-VENDOR_STATUS = 'Approved vendor'. 

LV_APPROVED = LV_APPROVED + 1. ELSEIF WA_RAW_MAT-VENDOR_STATUS = 'Provisional vendor'. 

LV_U_EVAL = LV_U_EVAL + 1. ELSEIF ( WA_RAW_MAT-VENDOR_STATUS = 'Rejected vendor' OR WA_RAW_MAT-

VENDOR_STATUS = 'Blocked vendor' ). LV_REJECTED = LV_REJECTED + 1. 

ENDIF. APPEND WA_RAW_MAT TO IT_RAW_MAT. CLEAR WA_RAW_MAT. CLEAR WA_RAW. 

ENDLOOP. LV_APPROVED = LV_SERIAL_NO. CONCATENATE LV_TOTAL_D LV_APPROVED INTO LV_DESC1_S. CONCATENATE LV_TOT LV_U_EVAL INTO LV_DESC2_S. CONCATENATE LV_TOT_D LV_REJECTED INTO LV_DESC3_S. 

CONCATENATE LV_DESC1_S LV_DESC2_S LV_DESC3_S INTO WA_RAW_SU-SYS_MSG SEPARATED BY NEWLINE. 

IF IT_RAW IS INITIAL. LV_APPROVED = 'NIL'. LV_U_EVAL = 'NIL'. LV_REJECTED = 'NIL'. 

CONCATENATE LV_TOTAL_D LV_APPROVED INTO LV_DESC1_S. CONCATENATE LV_TOT LV_U_EVAL INTO LV_DESC2_S. CONCATENATE LV_TOT_D LV_REJECTED INTO LV_DESC3_S. CONCATENATE LV_DESC1_S LV_DESC2_S LV_DESC3_S INTO WA_RAW_SU-

SYS_MSG SEPARATED BY NEWLINE. ENDIF. 

* ENDIF. "commented on 25/8/2014 

CLEAR WA_MAKT. 

Page 20: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 20/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 20 of 62

REFRESH IT_MAKT1. 

*------------------------------------------------------------------------------------------------------------------------*  *-------------------------------------------------4.2 Packaging Materials--

----------------------------------------------*  REFRESH: IT_MAKT1. CLEAR WA_MAKT. CLEAR: LV_SERIAL_NO, 

LV_APPROVED, LV_U_EVAL, LV_REJECTED, LV_DESC1_S, LV_DESC2_S, LV_DESC3_S. 

LV_SERIAL_NO = 0. LV_APPROVED = 0. 

LV_U_EVAL = 0. LV_REJECTED = 0. 

SELECT *FROM ZQM_CTO_ARR_0551INTO CORRESPONDING FIELDS OF TABLE IT_PACKWHERE BULK_API EQ BULK_APIAND WERKS EQ WERKSAND ZYEAR EQ ZYEARAND POSTP NE 'KSM'. 

IF SY-SUBRC IS INITIAL. SELECT *

FROM ZQM_CTO_ARR_0151INTO TABLE IT_MAKT1FOR ALL ENTRIES IN IT_PACKWHERE BULK_API = IT_PACK-MATNR. 

ENDIF. * IF sy-subrc IS INITIAL. 

LOOP AT IT_PACK INTO WA_PACK. READ TABLE IT_MAKT1 INTO WA_MAKT WITH KEY BULK_API = WA_PACK-MATNR. LV_SERIAL_NO = LV_SERIAL_NO + 1. CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' 

EXPORTING INPUT = WA_PACK-MATNR

IMPORTING 

OUTPUT = WA_PACK-MATNR. CONCATENATE WA_PACK-MATNR '(' WA_MAKT-IN_HOUSECODE_API ')' INTO WA_PACK_MAT-MATNR_DES. WA_PACK_MAT-SERIAL_NO = LV_SERIAL_NO. WA_PACK_MAT-SOURCE_DETAIL = WA_PACK-SOURCE_DETAIL. WA_PACK_MAT-VENDOR_STATUS = WA_PACK-VENDOR_STATUS. WA_PACK_MAT-DATUV = WA_PACK-DATUV. WA_PACK_MAT-ZBLOCK_REASON = WA_PACK-ZBLOCK_REASON. IF WA_PACK_MAT-VENDOR_STATUS = 'Approved vendor'. 

LV_APPROVED = LV_APPROVED + 1. ELSEIF WA_PACK_MAT-VENDOR_STATUS = 'Provisional vendor'. 

LV_U_EVAL = LV_U_EVAL + 1. ELSEIF ( WA_PACK_MAT-

VENDOR_STATUS = 'Rejected vendor' OR WA_PACK_MAT-

Page 21: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 21/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 21 of 62

VENDOR_STATUS = 'Blocked vendor' ). LV_REJECTED = LV_REJECTED + 1. 

ENDIF. APPEND WA_PACK_MAT TO IT_PACK_MAT. CLEAR WA_PACK_MAT. 

CLEAR WA_PACK. ENDLOOP. CONCATENATE LV_TOTAL_D LV_APPROVED INTO LV_DESC1_S. CONCATENATE LV_TOT LV_U_EVAL INTO LV_DESC2_S. CONCATENATE LV_TOT_D LV_REJECTED INTO LV_DESC3_S. CONCATENATE LV_DESC1_S LV_DESC2_S LV_DESC3_S INTO WA_PACK_SU-

SYS_MSG SEPARATED BY NEWLINE. 

IF IT_PACK IS INITIAL. LV_APPROVED = 'NIL'. LV_U_EVAL = 'NIL'. LV_REJECTED = 'NIL'. 

CONCATENATE LV_TOTAL_D LV_APPROVED INTO LV_DESC1_S. 

CONCATENATE LV_TOT LV_U_EVAL INTO LV_DESC2_S. CONCATENATE LV_TOT_D LV_REJECTED INTO LV_DESC3_S. CONCATENATE LV_DESC1_S LV_DESC2_S LV_DESC3_S INTO WA_PACK_SU-

SYS_MSG SEPARATED BY NEWLINE. ENDIF. 

* ENDIF. CLEAR WA_MAKT. REFRESH IT_MAKT1. 

e.  Report-5- Review of quality and yield trends of Intermediate stages of materials

This report extraction is exactly similar like that of Report-3 on the basis of two trends

  Quality Trend- Where the quality trend of the intermediate product of the Bulk API will be extracted and the value will be captured along with the quality trend graph. Theintermediate product will be obtained from the formation of the BOM explosion of the

Bulk API from the Z-table. The characteristics will be obtained from the Z-table.CALL FUNCTION 'ZQM_CTO_ARR_9013' 

EXPORTING BULK_API = LV_BULKWERKS = LV_WERKSZYEAR = LV_YEARARR_MAT_TYPE = ARR_MAT_TYPE

* INSP_LOT_ORIGIN =  * INSP_TYPE =  

TABLES 

* IT_MAT_ALL = IT_MAT_K_ALL * IT_CPP_ALL =  

IT_QT_ALL = IT_QT_K_ALL_I* IT_YT_ALL =  * IT_CPP_BPR =  * IT_YT_BPR =  

IT_QYT = IT_K_QYT_I. "MATNR 

*"QUALITY  CALL FUNCTION 'ZQM_CTO_ARR_9014' 

EXPORTING BULK_API = LV_BULKWERKS = LV_WERKS

ZYEAR = LV_YEAR

Page 22: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 22/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 22 of 62

ARR_MAT_TYPE = ARR_MAT_TYPETABLES 

* it_mat_all = it_mat_K_all IT_QT_MAT_ALL = IT_QT_K_ALL_IIT_QT_MIC_HDR = IT_QT_MIC_K_HDR_I

IT_QT_MIC_VALUE = IT_QT_MIC_K_VALUE_IIT_QT_MIC_MEAN = IT_QT_MIC_K_MEAN_I.

The above Function modules used the table ZQM_CTO_ARR_0451 which holds MIC

description and ZQM_CTO_ARR_0452 which holds result values.

  Yield Trend- This will be obtained using the function module from the standard Z-table

for the given batch of the intermediate products for the Bulk API product. And Yield

Graph will be triggered on the basis of the data extracted.

  * "YIELD  CALL FUNCTION 'ZQM_CTO_ARR_9016' 

EXPORTING BULK_API = LV_BULKWERKS = LV_WERKSZYEAR = LV_YEAR

TABLES IT_MAT_ALL = IT_MAT_I_ALLIT_YT_ALL_BPR = IT_YT_I_BPRIT_YT_ALL_INC = IT_YT_I_ALLIT_YT_INCIDENT = IT_YT_I_INCIDENTIT_YT_QUANTITY = IT_YT_I_QUANTITYIT_HDR_MSG = IT_HDR_I_MSG. 

f.  Report-6- Review of quality and yield trends of API (Finished ) stage of product

This report has 3 sections and the data will be extracted using the function module from the Z-

table. The data extraction will be similar to that of the report-5 but this will be for the finished

 product (API product type). The data will be extracted on the basis of the Product number, Plantand the review period.

  Critical parameters trend

  Quality trend and Yield trend

For the Quality trend and the Yield trend graphs will be displayed as per the data extracted using

the function module ZQM_CTO_ARR_9016

IT_YT_BPR_mat_unique[] = IT_YT_ALL_BPR[]. sort IT_YT_BPR_mat_unique by matnr. delete ADJACENT DUPLICATES FROM IT_YT_BPR_mat_unique COMPARING matnr. loop at IT_YT_BPR_mat_unique into wa_yt_bpr_mat_unique. it_quantity[] = IT_YT_ALL_BPR[]. delete it_quantity where matnr ne wa_yt_bpr_mat_unique-matnr . "it_quantity contain 1 matnr quntity records 

it_incident[] = it_yt_all_inc[]. delete it_incident WHERE matnr ne wa_yt_bpr_mat_unique-matnr. "it_incident contain 1 matnr quntity records 

it_quantity_bpr[] = it_quantity[]. SORT it_quantity_bpr by FORM_NUM. delete ADJACENT DUPLICATES FROM it_quantity_bpr COMPARING FORM_NUM. 

"contain unique bpr number  loop at it_quantity_bpr into wa_quantity_bpr. 

Page 23: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 23/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 23 of 62

it_quantity_charg[] = it_quantity[]. delete it_quantity_charg WHERE FORM_NUM ne wa_quantity_bpr-FORM_NUM. 

"->start counter for next internal table and work area . 

lv_total_review = 0. lv_serial_no = 0. lv_serial_no2 = 0. lv_outside_p3s = 0 . lv_outside_m3s = 0 . lv_total_review = 0. lv_fails_yield_limit = 0 . lv_devition = 0 . 

LOOP AT it_quantity_charg INTO wa_quantity_charg. 

lv_serial_no = lv_serial_no + 1. wa_yt_quantity-serial_no = lv_serial_no . wa_yt_quantity-matnr = wa_quantity_bpr-matnr. wa_yt_quantity-bpr_ref_no = wa_quantity_bpr-form_num. wa_yt_quantity-batch_no = wa_quantity_charg-charg. wa_yt_quantity-quantity = wa_quantity_charg-

menge. "HERE MEINS REQUIRED TO CHANGE IN KG  lv_unit = wa_quantity_charg-meins. 

APPEND wa_yt_quantity TO it_yt_quantity_temp. " it will contain data f or only 1 bpr  

**->populate Details of Yield deviation batches: 

LOOP AT it_incident INTO wa_incident WHERE charg = wa_quantity_charg-charg. "l00p 

MOVE wa_incident-qmnum TO lv_name. CALL FUNCTION 'READ_TEXT' 

EXPORTING * CLIENT = SY-MANDT  

id = 'LTQM' language = 'E' name = lv_nameobject = 'QMEL' 

TABLES 

lines = it_linesEXCEPTIONS 

id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. 

IF sy-subrc <> 0. * Implement suitable error handling here 

ENDIF. 

LOOP AT it_lines INTO wa_lines WHERE tdline IS NOT INITIAL. 

Page 24: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 24/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 24 of 62

IF lv_start_line IS INITIAL. IF wa_lines-tdline CS 'Description of incident'. 

lv_start_line = 'X'. ENDIF. 

ELSE. 

IF wa_lines-tdline CS 'Immediate Correction done'. EXIT. 

ELSE. CONCATENATE lv_desc wa_lines-

tdline INTO lv_desc SEPARATED BY space. ENDIF. 

ENDIF. ENDLOOP. 

" lv_total_review = lv_total_review + 1. lv_serial_no2 = lv_serial_no2 + 1. wa_yt_incident-serial_no = lv_serial_no2. wa_yt_incident-batch_no = wa_incident-charg. 

wa_yt_incident-incident_no = wa_incident-qmnum. wa_yt_incident-incident_date = wa_incident-erdat. wa_yt_incident-incident_desc = lv_desc. wa_yt_incident-batch_status = wa_incident-

kurztext. wa_yt_incident-stat = wa_incident-stat. wa_yt_incident-matnr = wa_incident-matnr. wa_yt_incident-bpr_ref_no = wa_quantity_charg-

form_num. 

APPEND wa_yt_incident TO IT_YT_INCIDENT. 

CLEAR:wa_incident,wa_yt_incident. 

ENDLOOP. " CLEAR: WA_QUANTITY,wa_yt_quantity,wa_incident,wa_quantity_charg. 

ENDLOOP. 

g.  Report-7- Review of Bio burden on product

This report will capture the test result of Bio burden product in terms of the Product number, Plant

and year,.

Function module will be used to extract the value of the MIC from the inspection lot for the given

 batch of the material and will calculate necessary mean, sigma and deviation along with the

graphical trend.

"FM FOR BIO-BURDEN  

CALL FUNCTION 'ZQM_CTO_ARR_9013' EXPORTING 

bulk_api = lv_bulkwerks = lv_werkszyear = lv_yeararr_mat_type = 'ARR' insp_lot_origin = '89' insp_type = 'ZBD' 

TABLES it_mat_all = it_mat_b_all

* IT_CPP_ALL =  

it_qt_all = it_qt_b_all

Page 25: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 25/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 25 of 62

* IT_YT_ALL =  * IT_CPP_BPR =  * IT_YT_BPR =  

it_qyt = it_b_qyt. "MATNR 

"QUALITY  CALL FUNCTION 'ZQM_CTO_ARR_9014' 

EXPORTING bulk_api = lv_bulkwerks = lv_werkszyear = lv_yeararr_mat_type = 'ARR' insp_lot_origin = '89' insp_type = 'ZBD' 

TABLES * it_mat_all = it_mat_B_all 

it_qt_mat_all = it_qt_b_allit_qt_mic_hdr = it_qt_mic_b_hdr

it_qt_mic_value = it_qt_mic_b_valueit_qt_mic_mean = it_qt_mic_b_mean.

This report works similar to Report 3 , 5 and 6.

h.  Report-8- Review of OOS and OOT results

This report will have two section one for OOS result and another for OOT result. All the data will

 be again extracted using function module from the standard Z-table and will be store in the internal

table.

  For OOS result- The data will be extracted considering the code group as OOS_ZBD

  For OOT result- The data will be extracted considering the code group as QN_LAB01

LOGIC for OOS:SELECT 

qmnumoos_nomatnrerdatstatchargkurztextFROM zqm_cto_arr_0651INTO TABLE it_oos

WHERE bulk_api EQ bulk_api "200000239 AND werks EQ werks "1003 AND zyear EQ zyear "2013 

* AND fegrp EQ 'OOS-ZBD' AND fegrp NE 'S009' 

* AND ( qmgrp EQ 'QN-OOS01' OR qmgrp EQ 'CTO-OOS' ) AND ( arr_mat_type eq 'INT' OR arr_mat_type EQ 'ARR' ). 

CLEAR wa_pack. * IF it_oos IS NOT INITIAL. 

SELECT *FROM zqm_cto_arr_0151INTO TABLE it_makt

FOR ALL ENTRIES IN it_oos

Page 26: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 26/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 26 of 62

WHERE bulk_api EQ it_oos-matnr. IF sy-subrc IS INITIAL. 

LOOP AT it_oos ASSIGNING <fs_it_oos>. READ TABLE it_makt INTO wa_makt

WITH KEY bulk_api = <fs_it_oos>-matnr. 

IF sy-subrc IS INITIAL. <fs_it_oos>-maktx = wa_makt-in_housecode_api. CLEAR wa_makt. 

ENDIF. ENDLOOP. 

ENDIF. SELECT *

FROM zqm_cto_arr_capaINTO TABLE it_capaFOR ALL ENTRIES IN it_oosWHERE matnr EQ it_oos-matnrAND zyear = zyearAND werks = werks

AND copa_source EQ 'OOS' AND arr_mat_type EQ 'INT' OR arr_mat_type EQ 'ARR'. 

lv_counter = 1. lv_serial_no = 1. SORT it_oos BY matnr. it_oos1[] = it_oos[]. DELETE ADJACENT DUPLICATES FROM it_oos1 COMPARING matnr. LOOP AT it_oos1 INTO wa_oos1. 

LOOP AT it_oos INTO wa_oosWHERE matnr EQ wa_oos1-matnr. READ TABLE it_makt INTO wa_makt WITH KEY bulk_api = wa_oos-matnr. REFRESH it_lines. 

* MOVE wa_oos-notif_no TO lv_name. * MOVE wa_oos-oos_no TO lv_name. 

CONCATENATE WERKS wa_oos-oos_no INTO lv_name SEPARATED BY '_'. CALL FUNCTION 'READ_TEXT' 

EXPORTING CLIENT = SY-MANDTid = 'LTQM' language = 'E' name = lv_nameobject = 'QMEL' 

TABLES lines = it_lines

EXCEPTIONS 

id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. 

IF sy-subrc <> 0. "Implement suitable error handling here 

ENDIF. CLEAR lv_name. LOOP AT it_lines INTO wa_lines. 

IF ( sy-tabix <> 1 AND sy-tabix <> 2 ) AND ( wa_lines-

Page 27: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 27/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 27 of 62

tdline IS NOT INITIAL ). shift wa_lines-tdline LEFT DELETING LEADING '*'. CONCATENATE lv_desc wa_lines-

tdline INTO lv_desc SEPARATED BY space. ELSE. 

CONCATENATE lv_desc wa_lines-tdline INTO lv_desc SEPARATED BY space. "Addded on 10/9/2014 

ENDIF. ENDLOOP. 

wa_oos-description = lv_desc. CLEAR lv_desc. SPLIT wa_makt-in_housecode_api AT '(' INTO lv_str_code lv_str_des. 

* wa_oos_oot-notif_no = wa_oos-notif_no. wa_oos_oot-notif_no = wa_oos-OOS_NO. wa_oos_oot-batch_no = wa_oos-batch_no. wa_oos_oot-reporting_date = wa_oos-reporting_date. wa_oos_oot-batch_stat = wa_oos-batch_stat. 

wa_oos_oot-investigation_stat = wa_oos-investigation_stat. 

wa_oos_oot-description = wa_oos-description. wa_oos_oot-serial_no = lv_serial_no.

CASE lv_counter. WHEN 1. 

READ TABLE it_capa INTO wa_capaWITH KEY matnr = wa_oos-matnr. lv_capa_v1 = wa_capa-capa_raised. lv_capa_v2 = wa_capa-capa_closed. lv_capa_v3 = wa_capa-capa_open. lv_capa_v4 = wa_capa-capa_exc_closed. lv_capa_v5 = wa_capa-capa_exc_open. 

CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'  EXPORTING 

input = wa_oos-matnrIMPORTING 

output = wa_oos-matnr. CONCATENATE wa_oos-matnr lv_str_code INTO wa_oos_01-pr_stage_code SEPARATED BY space. IF wa_oos_oot-investigation_stat EQ 'Closed' OR wa_oos_oot-

investigation_stat EQ 'CLOSED'. lv_u_eval = lv_u_eval + 1. 

ELSEIF wa_oos_oot-investigation_stat EQ 'Open' OR wa_oos_oot-investigation_stat EQ 'OPEN'. 

lv_rejected = lv_rejected + 1. 

ENDIF. CONCATENATE lv_total_d lv_total INTO lv_desc1_s. CONCATENATE lv_tot lv_u_eval INTO lv_desc2_s. CONCATENATE lv_tot_d lv_rejected INTO lv_desc3_s. CONCATENATE lv_capa_d1 lv_capa_v1 INTO lv_capa_c1. CONCATENATE lv_capa_d2 lv_capa_v2 INTO lv_capa_c2. CONCATENATE lv_capa_d3 lv_capa_v3 INTO lv_capa_c3. CONCATENATE lv_capa_d4 lv_capa_v4 INTO lv_capa_c4. CONCATENATE lv_capa_d5 lv_capa_v5 INTO lv_capa_c5. CONCATENATE lv_desc1_s lv_desc2_s lv_desc3_slv_capa_c1 lv_capa_c2 lv_capa_c3 lv_capa_c4 lv_capa_c5 INTO wa_

oos_01-sys_msg SEPARATED BY newline. APPEND wa_oos_oot TO it_oos_01 .

Page 28: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 28/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 28 of 62

LOGIC FOR OOT:SELECT 

qmnumoos_nomatnr

erdatstatchargkurztextFROM zqm_cto_arr_0651INTO TABLE it_oosWHERE bulk_api EQ bulk_api "200000239 AND werks EQ werks "1003 AND zyear EQ zyear "2013 

* AND fegrp EQ 'OOS-ZBD' AND fegrp EQ 'S009' 

* AND ( qmgrp EQ 'QN-OOS01' OR qmgrp EQ 'CTO-OOS' ) AND ( arr_mat_type eq 'INT' OR arr_mat_type EQ 'ARR' ). 

IF it_oos IS NOT INITIAL. SELECT *

FROM zqm_cto_arr_0151INTO TABLE it_maktFOR ALL ENTRIES IN it_oosWHERE bulk_api EQ it_oos-matnr. 

IF sy-subrc IS INITIAL. LOOP AT it_oos ASSIGNING <fs_it_oos>. 

READ TABLE it_makt INTO wa_maktWITH KEY bulk_api = <fs_it_oos>-matnr. 

IF sy-subrc IS INITIAL. <fs_it_oos>-maktx = wa_makt-

in_housecode_api. 

CLEAR wa_makt. ENDIF. 

ENDLOOP. ENDIF. SELECT *FROM zqm_cto_arr_capaINTO TABLE it_capaFOR ALL ENTRIES IN it_oosWHERE matnr EQ it_oos-matnrAND zyear = zyearAND werks = werksAND copa_source EQ 'OOT' AND arr_mat_type EQ 'INT' OR arr_mat_type EQ 'ARR'. 

lv_counter = 1. lv_serial_no = 1. SORT it_oos BY matnr. it_oos1[] = it_oos[]. DELETE ADJACENT DUPLICATES FROM it_oos1 COMPARING matnr. LOOP AT it_oos1 INTO wa_oos1. 

LOOP AT it_oos INTO wa_oosWHERE matnr EQ wa_oos1-matnr. READ TABLE it_makt INTO wa_makt WITH KEY bulk_api = wa_oos-matnr. REFRESH it_lines. 

* MOVE wa_oos-oos_no TO lv_name. CONCATENATE WERKS wa_oos-oos_no INTO lv_name SEPARATED BY '_'. 

CALL FUNCTION 'READ_TEXT' 

Page 29: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 29/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 29 of 62

EXPORTING * CLIENT = SY-MANDT  

id = 'LTQM' language = 'E' name = lv_name

object = 'QMEL' TABLES 

lines = it_linesEXCEPTIONS 

id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. 

IF sy-subrc <> 0. 

* Implement suitable error handling here ENDIF. CLEAR lv_name. LOOP AT it_lines INTO wa_lines. 

IF ( sy-tabix <> 1 AND sy-tabix <> 2 ) AND ( wa_lines-tdline IS NOT INITIAL ). 

shift wa_lines-tdline LEFT DELETING LEADING '*'. CONCATENATE lv_desc wa_lines-

tdline INTO lv_desc SEPARATED BY space. ELSE. CONCATENATE lv_desc wa_lines-

tdline INTO lv_desc SEPARATED BY space. "Addded on 15/10/2014 ENDIF. 

ENDLOOP. wa_oos-description = lv_desc. CLEAR lv_desc. SPLIT wa_makt-in_housecode_api AT '(' INTO lv_str_code lv_str_des. 

* wa_oos_oot-notif_no = wa_oos-notif_no. wa_oos_oot-notif_no = wa_oos-OOS_NO. wa_oos_oot-batch_no = wa_oos-batch_no. wa_oos_oot-reporting_date = wa_oos-reporting_date. wa_oos_oot-batch_stat = wa_oos-batch_stat. wa_oos_oot-investigation_stat = wa_oos-

investigation_stat. wa_oos_oot-description = wa_oos-description. wa_oos_oot-serial_no = lv_serial_no. 

CASE lv_counter. WHEN 1. 

READ TABLE it_capa INTO wa_capaWITH KEY matnr = wa_oos-matnr. lv_capa_v1 = wa_capa-capa_raised. lv_capa_v2 = wa_capa-capa_closed. lv_capa_v3 = wa_capa-capa_open. lv_capa_v4 = wa_capa-capa_exc_closed. lv_capa_v5 = wa_capa-capa_exc_open. CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'  

EXPORTING input = wa_oos-matnr

IMPORTING 

output = wa_oos-matnr. 

Page 30: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 30/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 30 of 62

CONCATENATE wa_oos-matnr lv_str_code INTO wa_oot_01-pr_stage_code SEPARATED BY space. IF wa_oos_oot-investigation_stat EQ 'CLOSED' OR wa_oos_oot-

investigation_stat EQ 'Closed'. lv_u_eval = lv_u_eval + 1. 

ELSEIF wa_oos_oot-investigation_stat EQ 'OPEN'. lv_rejected = lv_rejected + 1. 

ENDIF. CONCATENATE lv_total_d lv_total INTO lv_desc1_s. CONCATENATE lv_tot lv_u_eval INTO lv_desc2_s. CONCATENATE lv_tot_d lv_rejected INTO lv_desc3_s. CONCATENATE lv_capa_d1 lv_capa_v1 INTO lv_capa_c1. CONCATENATE lv_capa_d2 lv_capa_v2 INTO lv_capa_c2. CONCATENATE lv_capa_d3 lv_capa_v3 INTO lv_capa_c3. CONCATENATE lv_capa_d4 lv_capa_v4 INTO lv_capa_c4. CONCATENATE lv_capa_d5 lv_capa_v5 INTO lv_capa_c5. CONCATENATE lv_desc1_s lv_desc2_s lv_desc3_slv_capa_c1 lv_capa_c2 lv_capa_c3 lv_capa_c4 lv_capa_c5 INTO wa_

oot_01-sys_msg SEPARATED BY newline. APPEND wa_oos_oot TO it_oot_01 . 

i.  Report-9- Review of Re process and Rework

This report will extract the data on the basis of the Re process and Rework order type. Function

module will be used to extract the data on the basis of Product number, plant and review period

from the Z-table which is already populated with the data by report.

  For re process review result will be obtained considering the order type as ZRP1

  For re work review result will be obtained considering the order type as ZRW1

  The data for both the above order type will be populated considering the condition that

the status of result recording for the given processes will have the status as rejected.SELECT * FROM 

zqm_cto_arr_0251INTO CORRESPONDING FIELDS OF TABLE it_rprwWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werksAND dauat EQ 'ZRP1'. 

* IF sy-subrc IS INITIAL. 

SELECT *FROM zqm_cto_arr_0151INTO TABLE it_makt1

FOR ALL ENTRIES IN it_rprwWHERE bulk_api = it_rprw-matnr. 

SELECT "CHANGED ON 30/10/2014 to fetch vcode prueflosmatnrchargvcodekurztextFROM zqm_cto_arr_0452INTO CORRESPONDING FIELDS OF TABLE it_rejFOR ALL ENTRIES IN it_rprwWHERE matnr = it_rprw-matnr

AND charg = it_rprw-charg. 

Page 31: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 31/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 31 of 62

* AND vcode EQ 'REJ'. 

SELECT prueflos vcode VBEWERTUNG FROM qaveINTO TABLE it_qave

FOR ALL ENTRIES IN it_rejWHERE vcode = it_rej-vcodeand prueflos = it_rej-prueflos. 

* LOOP AT it_rprw INTO wa_rprw. * wa_rp_rw-material_no = wa_rprw-matnr. * SPLIT wa_rprw-maktx AT '(' INTO  * lv_str_code * lv_str_des. * wa_rp_rw-in_housecode = lv_str_code. * wa_rp_rw-tot_rp_batches = wa_rprw-batch_count. * wa_rp_rw-tot_rp_quan = wa_rprw-menge. * wa_rp_rw-meins = wa_rprw-meins. 

* COLLECT wa_rp_rw INTO it_rp_rw. * ENDLOOP. 

LOOP AT it_rprw INTO wa_rprw. READ TABLE it_rp_rw INTO wa_rp_rw

WITH KEY material_no = wa_rprw-matnr. READ TABLE it_makt1 INTO wa_makt WITH KEY bom_component = wa_rprw-

matnr. IF sy-subrc EQ 0. 

wa_rp_rw-material_no = wa_rprw-matnr. SPLIT wa_makt-in_housecode_api AT '(' INTO 

lv_str_codelv_str_des. 

wa_rp_rw-in_housecode = lv_str_code. wa_rp_rw-tot_rp_batches = wa_rprw-batch_count. wa_rp_rw-tot_rp_quan = wa_rprw-menge. wa_rp_rw-meins = wa_rprw-meins. append wa_rp_rw to it_rp_rw. 

else. wa_rp_rw-tot_rp_batches = wa_rp_rw-

tot_rp_batches + wa_rprw-batch_count. wa_rp_rw-tot_rp_quan = wa_rp_rw-

tot_rp_quan + wa_rprw-menge. LOOP AT it_rp_rw into wa_rp_rw2 WHERE material_no = wa_rprw-matnr. 

wa_rp_rw2-tot_rp_batches = wa_rp_rw-tot_rp_batches. wa_rp_rw2-tot_rp_quan = wa_rp_rw-tot_rp_quan. 

modify it_rp_rw from wa_rp_rw2. ENDLOOP. 

ENDIF. ENDLOOP. 

LOOP AT it_qave INTO wa_qave WHERE VBEWERTUNG = 'R' . LOOP AT IT_REJ INTO WA_REJ WHERE prueflos = wa_qave-prueflos . 

MOVE wa_rej-charg TO lv_charg. CONCATENATE lv_desc ',' lv_charg INTO lv_desc. 

ENDLOOP. 

ENDLOOP. * LOOP AT it_rej INTO wa_rej WHERE vcode EQ 'REJ'. "COMMENTED ON 30/10/2

014 

Page 32: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 32/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 32 of 62

* MOVE wa_rej-charg TO lv_charg. * CONCATENATE lv_desc ',' lv_charg INTO lv_desc. * ENDLOOP. 

CONCATENATE lv_total_d lv_desc INTO lv_desc1_s SEPARATED BY space. * ENDIF. 

REFRESH: it_rprw, it_rej, it_makt1, IT_QAVE. 

CLEAR: wa_rp_rw, wa_rprw, wa_rej, lv_str_code, lv_str_des, lv_desc, lv_rejected, wa_makt. 

lv_desc = 0. SELECT * FROM zqm_cto_arr_0251INTO CORRESPONDING FIELDS OF TABLE it_rprwWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werksAND dauat EQ 'ZRW1'. 

* IF sy-subrc IS INITIAL. "COMMENTED ON 25/8/2014 SELECT *

FROM zqm_cto_arr_0151

INTO TABLE it_makt1FOR ALL ENTRIES IN it_rprwWHERE bulk_api = it_rprw-matnr. 

SELECT matnrchargvcodekurztextFROM zqm_cto_arr_0452INTO CORRESPONDING FIELDS OF TABLE it_rejFOR ALL ENTRIES IN it_rprwWHERE matnr = it_rprw-matnrAND charg = it_rprw-charg. 

* AND vcode EQ 'REJ'. SELECT prueflos vcode VBEWERTUNG FROM qave

INTO TABLE it_qaveFOR ALL ENTRIES IN it_rejWHERE vcode = it_rej-vcodeAND prueflos = it_rej-prueflos. 

LOOP AT it_rprw INTO wa_rprw. * wa_rp_rw1-material_no = wa_rprw-matnr. * SPLIT wa_rprw-maktx AT '(' INTO  * lv_str_code * lv_str_des. * wa_rp_rw1-in_housecode = lv_str_code. 

* wa_rp_rw1-tot_rw_batches = wa_rprw-batch_count. 

Page 33: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 33/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 33 of 62

* wa_rp_rw1-tot_rw_quan = wa_rprw-menge. * wa_rp_rw1-rw_uom = wa_rprw-meins. * COLLECT wa_rp_rw1 INTO it_rp_rw1. 

READ TABLE it_rp_rw INTO wa_rp_rwWITH KEY material_no = wa_rprw-matnr. 

READ TABLE it_makt1 INTO wa_makt WITH KEY bom_component = wa_rprw-matnr. "CHANGED ON 21/7/2014 

IF sy-subrc eq 0. "end of changes wa_rp_rw-material_no = wa_rprw-matnr. 

SPLIT wa_makt-in_housecode_api AT '(' INTO lv_str_codelv_str_des. 

wa_rp_rw-in_housecode = wa_makt-in_housecode_api. "lv_str_code. 

wa_rp_rw-tot_rw_batches = wa_rprw-batch_count. wa_rp_rw-tot_rw_quan = wa_rprw-menge. wa_rp_rw-meins = wa_rprw-meins. append wa_rp_rw to it_rp_rw. 

else. wa_rp_rw-tot_rw_batches = wa_rp_rw-

tot_rw_batches + wa_rprw-batch_count. wa_rp_rw-tot_rw_quan = wa_rp_rw-

tot_rw_quan + wa_rprw-menge. LOOP AT it_rp_rw into wa_rp_rw2 WHERE material_no = wa_rprw-matnr. 

wa_rp_rw2-tot_rw_batches = wa_rp_rw-tot_rw_batches. wa_rp_rw2-tot_rw_quan = wa_rp_rw-tot_rw_quan. modify it_rp_rw from wa_rp_rw2. 

ENDLOOP. ENDIF. 

ENDLOOP. 

h. Report-10- Review of Incidents

This report will extract the data on the basis of Product number, plant and the review period.

Function module will be used to extract all the field of the given internal table from the report

ZNOTIF_LOG_REPORT. The data will be extracted on the basis of the notification of type F3Which will be generated by the report.

SELECT * FROM zqm_cto_arr_0652INTO TABLE it_incidentWHERE bulk_api EQ bulk_api "200000011 AND werks EQ werks "1001 AND zyear EQ zyear. "2013 

IF sy-subrc IS INITIAL. 

SELECT SINGLE *FROM zqm_cto_arr_capaINTO wa_capaWHERE bulk_api = bulk_apiAND zyear = zyearAND werks = werksAND copa_source EQ 'INCIDENT'. 

lv_capa_v1 = wa_capa-capa_raised. lv_capa_v2 = wa_capa-capa_closed. lv_capa_v3 = wa_capa-capa_open. 

lv_capa_v4 = wa_capa-capa_exc_closed. 

Page 34: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 34/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 34 of 62

lv_capa_v5 = wa_capa-capa_exc_open. 

LOOP AT it_incident INTO wa_incident. MOVE wa_incident-qmnum TO lv_name. CALL FUNCTION 'READ_TEXT' 

EXPORTING * CLIENT = SY-MANDT  

id = 'LTQM' language = 'E' name = lv_nameobject = 'QMEL' 

TABLES lines = it_lines

EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 

object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. 

IF sy-subrc <> 0. * Implement suitable error handling here 

ENDIF. LOOP AT it_lines INTO wa_lines WHERE tdline IS NOT INITIAL. 

IF lv_start_line IS INITIAL. IF wa_lines-tdline CS 'Description of incident:'. 

lv_start_line = 'X'. ENDIF. 

ELSE. 

IF wa_lines-tdline CS 'Immediate Correction done:'. EXIT. 

ELSE. shift wa_lines-tdline LEFT DELETING LEADING '*'. CONCATENATE lv_descwa_lines-tdlineINTO lv_desc. "SEPARATED BY space. 

ENDIF. ENDIF. 

ENDLOOP. 

lv_serial_no = lv_serial_no + 1. 

wa_rev_incident-serial_no = lv_serial_no. wa_rev_incident-matnr = wa_incident-matnr. wa_rev_incident-batch_no = wa_incident-charg. wa_rev_incident-incident_no = wa_incident-qmnum. wa_rev_incident-reporting_date = wa_incident-erdat. wa_rev_incident-incident_desc = lv_desc. wa_rev_incident-investigation_stat = wa_incident-

stat."wa_incident-kurztext wa_rev_incident-root_cause = wa_incident-

zidenti_desc."wa_incident-zrident_desc. lv_total = lv_serial_no. 

* IF wa_rev_incident-

investigation_stat = 'Closed' or wa_rev_incident-

Page 35: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 35/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 35 of 62

investigation_stat = 'CLOSED'. lv_u_eval = lv_u_eval + 1. 

* ELSEIF wa_rev_incident-investigation_stat = 'Reject'."COMMENTED ON 10/8/2014 

ELSEIF wa_rev_incident-

investigation_stat = 'Open' or wa_rev_incident-investigation_stat = 'OPEN'. lv_rejected = lv_rejected + 1. 

ENDIF. APPEND wa_rev_incident TO it_rev_incident. CLEAR wa_rev_incident. CLEAR lv_desc. CLEAR lv_start_line. 

ENDLOOP. "to fetch Previous year incident 

CLEAR : lv_approved,lv_total1. 

SELECT SINGLE * from ZQM_CTO_ARR_0666 INTO wa_cto_arr_0666WHERE bulk_api = bulk_api

and zyear = zyearand werks = werksand sec_name = 'INCIDENT'. 

i.  Report-11- Review of change controls

CAPA proposed is also the incident which will be extracted in this report for given product

 Number, plant and year. Function module will be used to extract the data from the Z-table for

which the CAPA source should be incident. The structure of the report is similar to that of Report

10.

The report will extract on the basis of the following

  All the F3 Notification product specific with code group QN-CC01

  Show only those notification if the task CO02 is completed

  All the fields of the given report will be extracted on the basis of above conditions.SELECT *

FROM zqm_cto_arr_0655INTO CORRESPONDING FIELDS OF TABLE it_chng_ctrlWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werk EQ werks. 

IF sy-subrc IS INITIAL. 

SELECT SINGLE *FROM zqm_cto_arr_capaINTO wa_capaWHERE bulk_api = bulk_apiAND zyear = zyearAND werks = werksAND copa_source EQ 'CHANGE CON'. 

lv_capa_v1 = wa_capa-capa_exc_closed_out. lv_capa_v2 = wa_capa-capa_exc_open_out. 

LOOP AT it_chng_ctrl INTO wa_chng_ctrl. 

MOVE wa_chng_ctrl-qmnum TO lv_name. 

Page 36: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 36/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 36 of 62

CALL FUNCTION 'READ_TEXT' EXPORTING 

* CLIENT = SY-MANDT  id = 'LTQM' language = 'E' 

name = lv_nameobject = 'QMEL' 

TABLES lines = it_lines

EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. 

IF sy-subrc <> 0. * Implement suitable error handling here 

ENDIF. LOOP AT it_lines INTO wa_lines WHERE tdline IS NOT INITIAL. 

IF lv_start_line IS INITIAL. IF wa_lines-tdline CS 'Proposed'. "'Proposed Change:'. 

lv_start_line = 'X'. ENDIF. 

ELSE. IF wa_lines-tdline CS 'Justification for change:'. 

EXIT. ELSE. 

shift wa_lines-tdline LEFT DELETING LEADING '*'. 

CONCATENATE lv_descwa_lines-tdlineINTO lv_desc. "SEPARATED BY space. 

ENDIF. ENDIF. 

ENDLOOP. 

lv_serial_no = lv_serial_no + 1. wa_change_ctrl-serial_no = lv_serial_no. wa_change_ctrl-matnr = wa_chng_ctrl-matnr. wa_change_ctrl-initi_dt = wa_chng_ctrl-qmdat. wa_change_ctrl-notif_no = wa_chng_ctrl-qmnum. 

wa_change_ctrl-change_type = wa_chng_ctrl-kurztext1. wa_change_ctrl-change_req_in = wa_chng_ctrl-kurztext2. wa_change_ctrl-change_cat = wa_chng_ctrl-kurztext3. wa_change_ctrl-closure_stat = wa_chng_ctrl-stat. wa_change_ctrl-change_desc = lv_desc. lv_total = lv_serial_no. IF wa_change_ctrl-closure_stat = 'CLOSED' or wa_change_ctrl-

closure_stat = 'Closed' . lv_u_eval = lv_u_eval + 1. 

ELSEIF wa_change_ctrl-closure_stat = 'OPEN' or wa_change_ctrl-closure_stat = 'Open'. 

lv_rejected = lv_rejected + 1. ENDIF. 

APPEND wa_change_ctrl TO it_change_ctrl. 

Page 37: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 37/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 37 of 62

CLEAR lv_desc. CLEAR wa_change_ctrl. CLEAR lv_start_line. 

ENDLOOP. 

SELECT SINGLE * from ZQM_CTO_ARR_0666 INTO wa_cto_arr_0666WHERE bulk_api = bulk_apiand zyear = zyearand werks = werksand sec_name = 'CC'. 

 j.  Report 12- Stability study

This report will be extracted on the basis of product number, Plant and review year of the given

material number. The data will be extracted using the function module from the Z-table which will

 be already populated by data using report.

The report will have three sections and the data for the given field will be further extracted on the

 basis of following conditions.

  Accelerated Stability study- this is done on the basis of storage condition-0003 or 0006

  Long term Stability study- this is done on the basis of storage condition based on 0001,0004, 0005 and 0008.

  Intermediate stability studies- this is done on the basis of storage condition 0002

  All the above data will be fetched on the basis of temperature as the characteristics

LOGIC FOR ACCELERATED STABILITY STUDY:SELECT *

FROM zqm_cto_arr_0669INTO TABLE it_stabilityWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werksAND ( stabicon EQ '0003' OR stabicon EQ '0006' ).

LOGIC FOR LONG TERM STABILITY STUDY:SELECT *

FROM zqm_cto_arr_0669INTO TABLE it_stabilityWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werksAND ( stabicon EQ '0001' OR stabicon EQ '0004' 

OR stabicon EQ '0005' OR stabicon EQ '0008' ). 

LOGIC FOR INTERMEDIATE STABILITY STUDY:SELECT *

FROM zqm_cto_arr_0669INTO TABLE it_stabilityWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werksAND stabicon EQ '0002'. 

k.  Report 13- Review of customer complaints, ROG and Recalls

Page 38: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 38/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 38 of 62

Report will use the function module to extract the data from Z-table already populated with data

using report. The extraction of the data will be done on the basis of the Product number, plant and

the review year, the status of the customer complaint should be closed.

On the basis of following conditions the data will be populated.

  Customer complaints from 35 series to be taken into account

   Notification type will be YA

  2 Series material to be captured in notification

  Multiple batch no to come, separated by comma

  Multiple batches can be seen as assigned objects

CUSTOMER COMPLAINTS:SELECT * FROM zqm_cto_arr_0658

INTO TABLE it_cust_comWHERE bulk_api EQ bulk_apiAND werks EQ werks

AND zyear EQ zyear. 

* IF sy-subrc IS INITIAL. REFRESH it_lines. LOOP AT it_cust_com INTO wa_cust_com. 

IF ( wa_cust_com-zzdate_of_compl LE e_start_date AND wa_cust_com-stat EQ 'CLOSED' ). 

lv_approved = lv_approved + 1. ENDIF. MOVE wa_cust_com-qmnum TO lv_name. CALL FUNCTION 'READ_TEXT' 

EXPORTING * CLIENT = SY-MANDT  

id = 'LTQM' language = 'E' name = lv_nameobject = 'QMEL' 

TABLES lines = it_lines

EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. 

IF sy-subrc <> 0. * Implement suitable error handling here 

ENDIF. LOOP AT it_lines INTO wa_lines WHERE tdline IS NOT INITIAL. 

IF ( sy-tabix <> 1 and wa_lines-tdline is not initial ). shift wa_lines-tdline LEFT DELETING LEADING '*'. CONCATENATE lv_desc wa_lines-

tdline INTO lv_desc ."SEPARATED BY space. ENDIF. 

ENDLOOP. if it_lines IS INITIAL. 

SELECT SINGLE qmtxt from qmel INTO lv_desc

WHERE qmnum = lv_name. 

Page 39: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 39/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 39 of 62

endif. lv_serial_no = lv_serial_no + 1. wa_cust_complaint-serial_no = lv_serial_no. wa_cust_complaint-receipt_date = wa_cust_com-

zzdate_of_compl. wa_cust_complaint-cust_nam = wa_cust_com-name1. wa_cust_complaint-complaint_no = wa_cust_com-qmnum. wa_cust_complaint-batch_no = wa_cust_com-batchnum1. wa_cust_complaint-closure_dat = wa_cust_com-erldat. wa_cust_complaint-complaint_des = lv_desc. wa_cust_complaint-conclusion = wa_cust_com-conclusion. lv_total = lv_serial_no. IF wa_cust_com-stat = 'CLOSED'. 

lv_u_eval = lv_u_eval + 1. ELSEIF wa_cust_com-stat = 'OPEN'. 

lv_rejected = lv_rejected + 1. ENDIF. 

APPEND wa_cust_complaint TO it_cust_complaint. CLEAR lv_desc. CLEAR lv_start_line. 

ENDLOOP.

RETURNED GOODS:SELECT 

qmnum

chargzdatercust_nameaction_takenstatFROM zqm_cto_arr_0659INTO TABLE it_ret_goodsWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werk EQ werks. 

* IF sy-subrc IS INITIAL. LOOP AT it_ret_goods INTO wa_return. 

REFRESH it_lines. CONCATENATE wa_return-report_no 'ZE01' INTO lv_name. CALL FUNCTION 'READ_TEXT' 

EXPORTING client = sy-mandtid = 'ZROG' language = 'E' name = lv_nameobject = 'ZQM_ROG' 

TABLES lines = it_lines

EXCEPTIONS id = 1 

language = 2 

Page 40: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 40/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 40 of 62

name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 

OTHERS = 8. IF sy-subrc <> 0. 

* Implement suitable error handling here ENDIF. LOOP AT it_lines INTO wa_lines. 

IF wa_lines-tdline IS NOT INITIAL . CONCATENATE lv_desc wa_lines-

tdline INTO lv_desc SEPARATED BY space. ENDIF. 

ENDLOOP. CLEAR wa_lines. lv_serial_no = lv_serial_no + 1. wa_return-return_reason = lv_desc. 

wa_return-serial_no = lv_serial_no. lv_total = lv_serial_no. IF wa_return-closure_stat = 'CLOSED'. 

lv_u_eval = lv_u_eval + 1. ELSEIF wa_return-closure_stat = 'OPEN'. 

lv_rejected = lv_rejected + 1. ENDIF. MODIFY it_ret_goods FROM wa_return. CLEAR lv_name. CLEAR lv_desc. 

ENDLOOP.

RECALLS:

SELECT zzcust_namezzreport_nocharginitiation_daterecall_reasonaction_takenstatusFROM zqm_cto_arr_2051INTO TABLE it_recallsWHERE bulk_api EQ bulk_apiAND werks EQ werksAND zyear EQ zyear. 

l.  Report 14- Multiple batches can be seen as assigned objects

Report will be having two sections and function module will extract the data from two different z-

table from SAP already populated with the data by report forms.

  Summary of Process validation- for this section data will be extracted on the basis of

validation type process validation.

  Summary of cleaning validations- for this section data will be extracted on the basis of

validation type cleaning validation.

PROCESS VALIDATION:SELECT *

FROM zqm_cto_arr_0664

Page 41: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 41/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 41 of 62

INTO CORRESPONDING FIELDS OF TABLE it_p_validWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werks

* AND zzvalid_type EQ 'Process Validation' 

AND ZZSUB_SYSTEM EQ 'PROCESS VALIDATION' AND ( postp EQ 'INT' OR postp EQ 'ARR'). 

IF sy-subrc IS INITIAL. LOOP AT it_p_valid INTO wa_p_valid. 

lv_serial_no = lv_serial_no + 1. wa_pro_valid-serial_no = lv_serial_no. wa_pro_valid-protocol_approval_date = wa_p_valid-

zzprotocol_approval_date. wa_pro_valid-protocol_no = wa_p_valid-

zzprotocol. wa_pro_valid-valid_type = wa_p_valid-

zzvalid_type. 

wa_pro_valid-reason_init = wa_p_valid-zzreason_init. 

wa_pro_valid-valid_batch_no = wa_p_valid-zzbatch. wa_pro_valid-stat = wa_p_valid-stat. lv_total = lv_serial_no. IF wa_pro_valid-stat = 'CLOSED'or wa_pro_valid-stat = 'Closed'. 

lv_u_eval = lv_u_eval + 1. ELSEIF wa_pro_valid-stat = 'OPEN' or wa_pro_valid-

stat = 'Open' or wa_pro_valid-stat = 'Cancel'. lv_rejected = lv_rejected + 1. 

ENDIF. APPEND wa_pro_valid TO it_pro_valid. 

ENDLOOP.

CLEANING VALIDATION:SELECT *

FROM zqm_cto_arr_0664INTO CORRESPONDING FIELDS OF TABLE it_c_validWHERE bulk_api EQ bulk_apiAND zyear EQ zyearAND werks EQ werks

* AND zzvalid_type EQ 'Cleaning Validation' AND ZZSUB_SYSTEM EQ 'CLEANING VALIDATION' AND ( postp EQ 'INT' OR postp EQ 'ARR'). 

IF sy-subrc IS INITIAL. LOOP AT it_c_valid INTO wa_c_valid. 

lv_serial_no = lv_serial_no + 1. wa_cle_valid-serial_no = lv_serial_no. wa_cle_valid-protocol_approval_date = wa_c_valid-

zzprotocol_approval_date. wa_cle_valid-protocol_no = wa_c_valid-

zzprotocol. wa_cle_valid-valid_type = wa_c_valid-

zzvalid_type. wa_cle_valid-reason_init = wa_c_valid-

zzreason_init. wa_cle_valid-valid_batch_no = wa_c_valid-zzbatch. 

wa_cle_valid-stat = wa_c_valid-stat. 

Page 42: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 42/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 42 of 62

lv_total = lv_serial_no. IF wa_c_valid-stat = 'CLOSED' OR wa_c_valid-stat = 'Closed'. 

lv_u_eval = lv_u_eval + 1. ELSEIF wa_c_valid-stat = 'OPEN' or wa_c_valid-

stat = 'Open' or wa_c_valid-stat = 'open'. 

lv_rejected = lv_rejected + 1. ENDIF. APPEND wa_cle_valid TO it_cle_valid. 

ENDLOOP. 

m.  Report 15- Regulatory filing status

This report will be extracted using the function module from the Z-table on the basis of Bulk API

 product, plant and review year.SELECT 

filing_dateagency_namefiling_type

current_statusFROM zqm_cto_arr_2052INTO TABLE it_regulatoryWHERE bulk_api EQ bulk_apiAND werks EQ werksAND zyear EQ zyear.

n.  Report 16- Review of retained samples( Finished products)

This report will be extracted using the function module from the Z-table on the basis of Bulk API

 product, plant and review year.

SELECT charghsdatzzdatezobserzsamplzremar

FROM zqm_cto_arr_0661INTO CORRESPONDING FIELDS OF TABLE it_reserve_samplWHERE bulk_api = bulk_apiAND werks = werksAND zyear = zyear. 

o.  Report 17- Review of Last ARR

This report will be final review report which be extracted on the basis of following

  Compare QMEL table and Z-QMEL table for

  Source notification field of QMEL table equals source notification table Z-

QMEL.

  Material number of QMEL table = Bulk API of our input

   Notification type = Z3

  ARR type should be equal to product

Page 43: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 43/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 43 of 62

By above condition source notification will be fetched. The source notification so obtained will be

 passed to QMSM table with condition that the task in the notification is with 40 and task 40 will be

completed.

SELECT 

b~qmnum a~aedatINTO TABLE it_qmnumdatFROM qmel AS aINNER JOIN zqm_cto_qmel AS bON a~qmnum = b~qmnumWHERE a~matnr = bulk_apiAND a~qmart EQ 'Z3' AND b~arr_type EQ 'PRODUCT' AND b~werks = werksAND b~arr_year = zyear. 

sort it_qmnumdat by aedat DESCENDING. 

* DELETE it_qmnumdat FROM 2. 

READ TABLE it_qmnumdat INTO wa_qmnumdat INDEX 1. SELECT 

erldatFROM qmsmINTO TABLE it_last_arr_dateWHERE qmnum = wa_qmnumdat-qmnum

* AND mncod EQ '040'. AND mncod EQ '060'. 

SORT it_last_arr_date by erldat DESCENDING. * delete it_last_arr_date FROM 2. 

READ TABLE it_last_arr_date INTO wa_last_arr_date INDEX 1. wa_last_arr-apprv_dt_last_arr = wa_last_arr_date-erldat.

SELECT *FROM zqm_cto_arr_0671INTO TABLE it_last_arr1WHERE bulk_api = bulk_apiAND zyear = zyearAND werks = werks. 

IF sy-subrc IS INITIAL. LOOP AT it_last_arr1 INTO wa_last_arr1. 

lv_serial_no = lv_serial_no + 1. wa_last_arri-

proposed_capa = wa_last_arr1-capa_long. wa_last_arri-

capa_compl_dt = wa_last_arr1-task_compl_date. wa_last_arri-

status = wa_last_arr1-stat. wa_last_arri-

serial_no = lv_serial_no. if wa_last_arr-apprv_dt_last_arr is INITIAL. 

wa_last_arr-apprv_dt_last_arr = wa_last_arr1-INITIAL_TIMELINE. 

endif. APPEND wa_last_arri TO it_last_arr. 

ENDLOOP. 

Page 44: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 44/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 44 of 62

  All these 19 different reports are broadly classified into two major categories.

  Report with static column- where the data is fixed and there is no dynamic changes in data.

  Report with dynamic columns - This is the case where we have MICs in reports. Since there

are different number of MIC s applicable to different material .So the number of columns

should get dynamically picked up from SAP

3.2 Function 2  – Viewing and modification of report using Web dynpro

  Objective  –  The function will helps to trigger notification of type Z3 where task will be assigned to responsible person. Using the given task the responsible person can access the UWL or Web Dynpro screen to view,

comment and modify some fields in the different reports whose data has already been extracted using the firstfunctionality. 

  Details of Use  –  This function is used to get access to all the 19 reports whose data has been extracted using the

first functionality for given material within given reviewing period. The whole functions will be realized using

the workflow and Web Dynpro screen by the responsible person.

Web dynpro screen and the Workflow is given below.

Workflow Id :WS92000316

  A notification Z3 will be triggered with initial task 10 assigned to the given person responsible. This

will reach to the person using workflow. The user can access the report using the Web dypro

corresponding to the given Task 10.

Flowing are the functionality of the Web dynpro screen for task 10 as given below:

  The user will receive all the details of the material in the web dynpro screen and will have the

 provision of manually uploading of the data. This include report number 13 (regulatory filings

report) and report number 15 (recall report).

  To Create a Webdynpro Application which Displays The Program which needs to be uploaded

manually.

  To navigate from webdynpro to t-code and upload the data manually.

  User Uploads data manually for these reports and complete this task.

Page 45: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 45/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 45 of 62

  TASK 10 INITIAL SCREEN :

Page 46: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 46/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 46 of 62

For all the tasks from 20 to 60 following functionality is coded in Web dynpro screen.

  Dynamic Table has to be created which fetches all the sections and it will be represented in

the form of button to the user.

  Each button should trigger its respective PDF

  User comments should be captured in a long text.

  User clicks on button to view its respective PDF and saves the entered comments in the PDF.

Page 47: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 47/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 47 of 62

  Save ARR- this is the final step where all the report should be there in one document. This will be

included in the task number 70 in same notification number generated.

  Once tasks 60 above gets completed by the concern person, then Save ARR tasks (tasks 70 )

will get triggered automatically from the same notification to the concern person.

  Create t-code which merges all the above said sections(Various PDF) into one PDF

  Correct Numbering of the document

  Webdynpro application with a button which calls this t-code and save the final ARR PDF.

  Upload the final ARR PDF from webdynpro application

  User will be navigated to t-code from webdynpro and he should save the final ARR. Upload

the same from webdynpro.

Page 48: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 48/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 48 of 62

The final PDF is obtained through Report ‘ZQM_CTO_ARR_PRODUCT’. 

Page 49: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 49/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 49 of 62

AT SELECTION-SCREEN OUTPUT. IF p_assemb = abap_false

OR cl_fp_feature_test=>is_available( iv_connection = p_conniv_feature = cl_fp_feature_test=>gc_assemble_stitch ) 

= abap_false. 

CLEAR p_stitch. p_repeat = 1. 

* LOOP AT SCREEN. * IF screen-group1 = 'STI'. * screen-active = 0. * MODIFY SCREEN. * ENDIF. * ENDLOOP. 

ENDIF. 

*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_conn. PERFORM value_help_for_destination USING 'P_CONN'. 

START-OF-SELECTION. 

Page 50: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 50/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 50 of 62

DATA :wa_zqm_cto_qmel TYPE zqm_cto_qmel. 

If strlen( notif_no ) ne 12. CONCATENATE '000' notif_no INTO notif_no. 

ENDIF. 

SELECT SINGLE * FROM zqm_cto_qmel INTO wa_zqm_cto_qmelWHERE qmnum = notif_no. 

lv_bulk = wa_zqm_cto_qmel-matnr . lv_werks = wa_zqm_cto_qmel-arr_werks. lv_year = wa_zqm_cto_qmel-arr_year. IF strlen( lv_bulk ) ne '18'. 

CONCATENATE '000000000' lv_bulk INTO lv_bulk. ENDIF. lv_bulk1 = lv_bulk+9(9). lv_year1 = lv_year. lv_werks1 = lv_werks. 

gs_outputparams-assemble = 'M'. 

IF p_assemb = abap_true. IF p_stitch = abap_true

AND cl_fp_feature_test=>is_available( iv_connection = p_conniv_feature = cl_fp_feature_test=>gc_assemble_stitch ) 

= abap_true. gs_outputparams-assemble = 'S'. 

ELSE. gs_outputparams-assemble = abap_true. 

ENDIF. ENDIF. 

***************************** **$$ CALL FORM NAME AND FM $$ 

***************************** TRY. 

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' EXPORTING 

i_name = gc_form_topIMPORTING 

e_funcname = gv_fm_name_top. CATCH cx_fp_api_repository cx_fp_api_usage cx_fp_api_internal. 

MESSAGE ID 'FPAPIGENERIC' TYPE 'E' NUMBER '000' WITH gc_form_1. ENDTRY. 

TRY. CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' 

EXPORTING i_name = gc_form_1

IMPORTING e_funcname = gv_fm_name_r1. 

CATCH cx_fp_api_repository cx_fp_api_usage cx_fp_api_internal. MESSAGE ID 'FPAPIGENERIC' TYPE 'E' NUMBER '000' WITH gc_form_1. 

ENDTRY. 

TRY. CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' EXPORTING 

i_name = gc_form_2

IMPORTING 

Page 51: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 51/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 51 of 62

e_funcname = gv_fm_name_r2. CATCH cx_fp_api_repository cx_fp_api_usage cx_fp_api_internal. 

MESSAGE ID 'FPAPIGENERIC' TYPE 'E' NUMBER '000' WITH gc_form_1. ENDTRY.

****************************************<  **$$TO GET PAGE NO $$ ****************************************  * gs_docparams-FILLABLE = 'X'. * Set output parameters and open spool job. 

gs_outputparams-dest = 'LP01'. gs_outputparams-nodialog = abap_true. gs_outputparams-getpdf = 'M'. gs_outputparams-getpdl = 'X'. gs_outputparams-connection = p_conn. gs_outputparams-bumode = p_bum. 

"This job open-close is used to fetch the total no of Pages Alone.............. 

CALL FUNCTION 'FP_JOB_OPEN' CHANGING 

ie_outputparams = gs_outputparamsEXCEPTIONS 

cancel = 1 usage_error = 2 system_error = 3 internal_error = 4 OTHERS = 5. 

IF sy-subrc IS NOT INITIAL. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. 

*TASKCODE_main-comments = '02'. taskcode_main-comments = '70'. "to determine total no of Pages wa_pr_hdr_top = wa_pr_hdr. "fUNCTION MODULE FOR OTHER SECTIONS  CALL FUNCTION gv_fm_name_top "pdf 1 

EXPORTING /1bcdwb/docparams = gs_docparams

* lv_page =  

it_compiled = it_compiledit_reviewed = it_reviewedit_approved = it_approvedwa_pr_hdr_top = wa_pr_hdr_topWA_TOC_P = WA_TOC_PTASKCODE_TOP = TASKCODE_TOP

IMPORTING /1bcdwb/formoutput = gs_output

EXCEPTIONS usage_error = 1 system_error = 2 internal_error = 3 

OTHERS = 4. 

Page 52: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 52/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 52 of 62

IF sy-subrc IS INITIAL. ENDIF.

* Close spool job. 

CALL FUNCTION 'FP_JOB_CLOSE' "modify till here IMPORTING 

e_result = gs_joboutputEXCEPTIONS 

usage_error = 1 system_error = 2 internal_error = 3 OTHERS = 4. 

IF sy-subrc IS INITIAL. ENDIF.

gs_outputparams-nodialog = abap_true. gs_outputparams-getpdf = 'M'. 

gs_outputparams-getpdl = 'M'. gs_outputparams-connection = p_conn. gs_outputparams-bumode = p_bum. CALL FUNCTION 'FP_JOB_OPEN' 

CHANGING ie_outputparams = gs_outputparams

EXCEPTIONS cancel = 1 usage_error = 2 system_error = 3 internal_error = 4 OTHERS = 5. 

IF sy-subrc IS NOT INITIAL. 

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 

ENDIF. 

wa_pr_hdr_top-tot_no = total_no_pages. CALL FUNCTION gv_fm_name_top

EXPORTING /1bcdwb/docparams = gs_docparams

* lv_page =  it_compiled = it_compiledit_reviewed = it_reviewedit_approved = it_approved

wa_pr_hdr_top = wa_pr_hdr_topWA_TOC_P = WA_TOC_PTASKCODE_TOP = TASKCODE_TOP

IMPORTING /1bcdwb/formoutput = gs_output

EXCEPTIONS usage_error = 1 system_error = 2 internal_error = 3 OTHERS = 4. 

IF sy-subrc IS INITIAL. PERFORM retrieve_pdf_table USING gv_index gs_output-pages

CHANGING gt_result. 

ELSE. 

Page 53: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 53/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 53 of 62

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 

ENDIF.

CALL FUNCTION gv_fm_name_r19EXPORTING 

/1bcdwb/docparams = gs_docparamsRECOMMENDATIONS = WA_RECOMMENDATIONStaskcode_19 = taskcode_19wa_pr_hdr_r19 = wa_pr_hdr_r19

IMPORTING /1bcdwb/formoutput = gs_output

EXCEPTIONS usage_error = 1 system_error = 2 internal_error = 3 OTHERS = 4. 

IF sy-subrc IS INITIAL. PERFORM retrieve_pdf_table USING gv_index gs_output-pages

CHANGING gt_result. ELSE. 

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 

ENDIF. 

* Close spool job. CALL FUNCTION 'FP_JOB_CLOSE' 

IMPORTING e_result = gs_joboutput

EXCEPTIONS 

usage_error = 1 system_error = 2 internal_error = 3 OTHERS = 4. 

IF sy-subrc IS INITIAL. PERFORM retrieve_pdf_table USING gv_index

gs_output-pagesCHANGING gt_result. 

ELSE. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. 

INCLUDE fp_spool_constants. "#EC INCL_OK  DATA ls_result TYPE gty_result. DATA lv_file TYPE fpfile. DATA lv_sep TYPE c. DATA lt_data TYPE tsfixml. DATA lv_rc TYPE sysubrc. 

* IF p_ucomm = '&IC1'. READ TABLE gt_result INDEX 1 INTO ls_result. 

CALL METHOD cl_gui_frontend_services=>get_temp_directoryCHANGING 

temp_dir = lv_file

Page 54: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 54/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 54 of 62

EXCEPTIONS cntl_error = 1 error_no_gui = 2 not_supported_by_gui = 3 OTHERS = 4. 

IF sy-subrc IS NOT INITIAL. MESSAGE ID 'ED' TYPE 'E' NUMBER '256'. 

ENDIF. CALL METHOD cl_gui_cfw=>flush

EXCEPTIONS cntl_system_error = 1 cntl_error = 2 OTHERS = 3. 

IF sy-subrc IS NOT INITIAL. MESSAGE ID 'ED' TYPE 'E' NUMBER '256'. 

ENDIF. 

lv_file = 'C:\Users\kumarabi\Desktop'. 

* lv_file = 'C:\Users\alamn\Desktop'. 

CALL METHOD cl_gui_frontend_services=>get_file_separatorCHANGING 

file_separator = lv_sepEXCEPTIONS 

cntl_error = 1 error_no_gui = 2 not_supported_by_gui = 3 OTHERS = 4. 

IF sy-subrc IS NOT INITIAL. MESSAGE ID 'ED' TYPE 'E' NUMBER '256'. 

ENDIF. CONCATENATE lv_file lv_sep sy-repid c_file_ext_pdf INTO lv_file. CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' 

EXPORTING buffer = ls_result-content

TABLES binary_tab = lt_data. 

CALL METHOD cl_gui_frontend_services=>gui_downloadEXPORTING 

bin_filesize = xstrlen( ls_result-content ) filename = lv_filefiletype = 'BIN' 

CHANGING 

data_tab = lt_dataEXCEPTIONS 

file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 

dp_error_send = 12 

Page 55: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 55/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 55 of 62

dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 

dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 not_supported_by_gui = 22 error_no_gui = 23 OTHERS = 24. 

IF sy-subrc IS NOT INITIAL. MESSAGE ID 'ED' TYPE 'E' NUMBER '256'. 

ENDIF. 

CALL METHOD cl_gui_frontend_services=>executeEXPORTING 

document = lv_filesynchronous = 'X' 

EXCEPTIONS cntl_error = 1 error_no_gui = 2 bad_parameter = 3 file_not_found = 4 path_not_found = 5 file_extension_unknown = 6 error_execute_failed = 7 synchronous_failed = 8 not_supported_by_gui = 9 OTHERS = 10. 

IF sy-subrc IS NOT INITIAL. MESSAGE ID 'ED' TYPE 'I' NUMBER '256'. 

ENDIF. 

* CALL METHOD cl_gui_frontend_services=>file_delete * EXPORTING  * filename = lv_file * CHANGING  * rc = lv_rc * EXCEPTIONS  * file_delete_failed = 1 * cntl_error = 2 * error_no_gui = 3 

* file_not_found = 4 * access_denied = 5 * unknown_error = 6  * not_supported_by_gui = 7  * wrong_parameter = 8 * OTHERS = 9. * IF sy-subrc IS NOT INITIAL. * MESSAGE ID 'ED' TYPE 'E' NUMBER '256'. * ENDIF. 

*&---------------------------------------------------------------------*  

*& Form retrieve_pdf_table 

Page 56: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 56/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 56 of 62

*&---------------------------------------------------------------------*  * Retrieve table with PDF documents from forms-processing  * run-time environment. *----------------------------------------------------------------------*  * -->P_INDEX index from the loop over the customer table 

* -->P_PAGES total page count of a bundle * <--P_PDF_TAB table to which the PDF documents are appended  *----------------------------------------------------------------------*  FORM retrieve_pdf_table USING value(p_index) TYPE syindex

value(p_pages) TYPE fppagecountCHANGING p_pdf_tab TYPE gty_result_tab. 

DATA lt_pdf_table TYPE tfpcontent. DATA ls_result TYPE gty_result. 

CALL FUNCTION 'FP_GET_PDF_TABLE' IMPORTING 

e_pdf_table = lt_pdf_table. 

LOOP AT lt_pdf_table INTO ls_result-content. MOVE p_index TO ls_result-index. GET TIME. MOVE sy-uzeit TO ls_result-time. ls_result-size = xstrlen( ls_result-content ). IF sy-tabix = lines( lt_pdf_table ). 

ls_result-pages = p_pages. ENDIF. INSERT ls_result INTO TABLE p_pdf_tab. 

ENDLOOP. 

ENDFORM. "retrieve_pdf_table

On Executing the report, the user has to select ADS RFC DESTINATION as shown below and pass the

notification number .

Page 57: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 57/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 57 of 62

Page 58: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 58/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 58 of 62

  Inputs / Outputs  –  here input has to be given by the user and the program will used to extract the data from

Data base and generate the PDF report. 

  Performance –  This development does not affect the performance of the system.  

Page 59: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 59/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 59 of 62

4. Data

Data will be available in the production system which are combination of transactional data and the master data. The data

is mandatory.

Page 60: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 60/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 60 of 62

5. Interfaces

 Not Applicable

6. Non-functional Attributes

 Not Applicable

7. Environment

SAP ECC

8. Glossary

Acronyms Description

1

2

9. References

This Functional Specification was developed in accordance with following procedures:

Document ID Description of the Document

1

2

Page 61: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 61/62

Corporate Centre 

Technical Specification

Title: Technical Specifications for Annual Review Report for Material

Project ID 8000056898 Document ID TS-8000056898 Status :

Department IT BPE Version 1.0 Page 61 of 62

Revision History

Version#

Revised by Revised on(DD/MM/YYYY)

Reason for change

1.0 Rupak Hazra 27/11/2014 New Document

Page 62: 2 Ts Arr-product

8/20/2019 2 Ts Arr-product

http://slidepdf.com/reader/full/2-ts-arr-product 62/62