• No results found

Data

In document 2 Ts Arr-product (Page 13-60)

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_response type

cl_http_response exporting

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 = 'imag e/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/zte st_pk'

'/image1.bmp' into l_image_url1.

cl_http_server=>server_cache_upload( url = l_image_url1 response = l_cach

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_endian character_set = 'utf-8' ).

p_ixml_doc->set_encoding( l_encoding ).

* empty result table refresh p_html.

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-extension = 'href="http://www.sap.com"'.

append line to data.

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

append line to data.

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

append line to data.

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

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

append line to data.

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

append line to data.

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

append line to data.

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.

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

* 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

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 the combination 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

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_0551

INTO CORRESPONDING FIELDS OF TABLE IT_RAW WHERE

BULK_API EQ BULK_API AND WERKS EQ WERKS

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

* 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-MATNR IMPORTING

OUTPUT = WA_RAW-MATNR.

CONCATENATE WA_RAW-MATNR '(' WA_MAKT-IN_HOUSECODE_API ')' INTO WA_RAW_MAT-MATNR_DES.

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 ( VENDOR_STATUS = 'Rejected vendor' OR WA_RAW_MAT-VENDOR_STATUS = 'Blocked vendor' ).

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.

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

INTO CORRESPONDING FIELDS OF TABLE IT_PACK WHERE

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.

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 (

VENDOR_STATUS = 'Rejected vendor' OR

WA_PACK_MAT-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

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. The intermediate 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'

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_TYPE TABLES

* it_mat_all = it_mat_K_all IT_QT_MAT_ALL = IT_QT_K_ALL_I IT_QT_MIC_HDR = IT_QT_MIC_K_HDR_I IT_QT_MIC_VALUE = IT_QT_MIC_K_VALUE_I IT_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_BULK WERKS = LV_WERKS ZYEAR = LV_YEAR TABLES

IT_MAT_ALL = IT_MAT_I_ALL IT_YT_ALL_BPR = IT_YT_I_BPR IT_YT_ALL_INC = IT_YT_I_ALL IT_YT_INCIDENT = IT_YT_I_INCIDENT IT_YT_QUANTITY = IT_YT_I_QUANTITY IT_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, Plant and 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 wa_yt_bpr_mat_unique-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.

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_char g-charg. "l00p

MOVE wa_incident-qmnum TO lv_name.

CALL FUNCTION 'READ_TEXT' EXPORTING

* CLIENT = SY-MANDT id = 'LTQM' language = 'E' name = lv_name object = '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.

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_bulk werks = lv_werks zyear = lv_year arr_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

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_bulk werks = lv_werks zyear = lv_year arr_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_all it_qt_mic_hdr = it_qt_mic_b_hdr it_qt_mic_value = it_qt_mic_b_value it_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 qmnum oos_no matnr erdat stat charg kurztext

FROM zqm_cto_arr_0651 INTO 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_0151 INTO TABLE it_makt

FOR ALL ENTRIES IN it_oos

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

DELETE ADJACENT DUPLICATES FROM it_oos1 COMPARING matnr.

LOOP AT it_oos1 INTO wa_oos1.

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

CALL FUNCTION 'READ_TEXT'

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

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

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

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.

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

CALL FUNCTION 'READ_TEXT'

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

* Implement suitable error handling here ENDIF. 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.

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

lv_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

APPEND wa_oos_oot TO it_oot_01 . i. Report-9- Review of Re process and Rework

In document 2 Ts Arr-product (Page 13-60)

Related documents