Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Page 1 of 3
Welcome, Guest
Login
Register
Getting Started
Newsletters
Store
Solutions
Services & Support
About SCN
Downloads
Industries
Training & Education
Partnership
Developer Center
Lines of Business
University Alliances
Events & Webinars
Innovation
http://wiki.sdn.sap.com/wiki/display/Snippets/Sample+Code+BAPI_INSPOPER_RECO... 6/7/2013
Page 2 of 3
= pa_insp
inspoper
= pa_inso
read_insppoints
= 'X'
read_char_requirements
=''
read_char_results
= 'X'
read_sample_results
= 'X'
read_single_results
= 'X'
read_chars_with_classes
=''
=''
char_filter_no
= '1'
max_insppoints
= 100
insppoint_from
=0
handheld_application
=''
IMPORTING
operation
= l_operation
return
= return
TABLES
insppoints
= l_inspoints
char_results
= l_char_results
sample_results
= l_sample_results
single_results
= l_single_results.
.
*BREAK-POINT.
*get unit text and unit iso code
CALL FUNCTION 'QIBP_GET_OPERATION'
EXPORTING
i_insp_lot
= pa_insp
i_insp_lot_operation = pa_inso
IMPORTING
e_qapo
= l_qapo
e_qals
= l_qals
EXCEPTIONS
wrong_inspection_lot = 1
wrong_operation
=2
operation_not_unique = 3.
*get upper limit or below limit from PLMK table
SELECT SINGLE merknr toleranzob toleranzun INTO CORRESPONDING FIELDS OF l_range FROM
plmk WHERE plnty = l_qapo-plnty AND
plnnr = l_qapo-plnnr AND
plnkn = l_qapo-pplnkn AND
merknr = pa_insc.
MOVE l_range-toleranzob TO l_up.
MOVE l_range-toleranzun TO l_dw .
LOOP AT l_sample_results INTO l_sample_result WHERE inspchar = pa_insc.
l_sample_result-mean_value = pa_valu.
IF ( l_sample_result-inspchar = l_range-merknr ).
IF pa_valu > l_up.
l_sample_result-evaluated = 'X'.
l_sample_result-closed = ' '.
l_sample_result-evaluation = 'R'.
elseif pa_valu < l_dw .
l_sample_result-evaluated = 'X'.
l_sample_result-closed = ' '.
l_sample_result-evaluation = 'R'.
ELSE.
l_sample_result-evaluated = 'X'.
l_sample_result-closed = ' '.
l_sample_result-evaluation = 'A'.
ENDIF.
ENDIF.
APPEND l_sample_result TO l_sample_results_new.
ENDLOOP.
*take unit and text and iso code measurement from table master uom.
SELECT SINGLE a~msehi a~isocode b~msehl INTO l_type FROM t006 AS a
INNER JOIN t006a AS b ON a~msehi = b~msehi WHERE a~msehi = l_qals-mengeneinh
AND b~spras = sy-langu.
*tentukan inpection lot bila tidak ada otomatis buat inspection lot
IF sy-subrc = 0.
* l_inspoint-insppoint = '000001'.
l_inspoint-insppoint = pa_inst.
l_inspoint-insplot = pa_insp.
http://wiki.sdn.sap.com/wiki/display/Snippets/Sample+Code+BAPI_INSPOPER_RECO... 6/7/2013
Page 3 of 3
l_inspoint-inspoper = pa_inso.
l_inspoint-userc1 = pa_inst.
* l_inspoint-userc1 = '000000000000000001'.
l_inspoint-unit = l_type-unit.
l_inspoint-unitc = l_type-unitc.
l_inspoint-unitt = l_type-unitt.
ENDIF.
BREAK-POINT.
CALL FUNCTION 'BAPI_INSPOPER_RECORDRESULTS'
EXPORTING
insplot
inspoper
insppointdata
= pa_insp
= pa_inso
= l_inspoint
IMPORTING
return
= return
TABLES
* char_results
sample_results
= l_char_resultsnew
= l_sample_results_new
* single_results
returntable
= l_single_results
= l_return.
Labels
abap
Comments (1)
Follow SCN
Contact Us
SAP Help Portal
Privacy
Terms of Use
Legal Disclosure
Copyright
http://wiki.sdn.sap.com/wiki/display/Snippets/Sample+Code+BAPI_INSPOPER_RECO... 6/7/2013