cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI for QE11

Former Member
0 Kudos

Please let me know a BAPI for QE11

Prad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

BAPI in QE11

QIBP_INSPCHAR_SETRESULT

QIBP_INSPOPER_RECORDRESULTS2

BAPI_INSPCHAR_SETRESULT

BAPI_INSPOPER_RECORDRESULTS

regards

Srinivas

Former Member
0 Kudos

Hi Srinivas,

Thanks Very much.

Regards,

Prd

Answers (1)

Answers (1)

Former Member
0 Kudos

&----


*& Report ZTEST4

*&

&----


*& Assign Result for characteristic and create inspection point

*& Created by : Rachmad Kurniawan

*& Company Jogja Global Technology - www.jogjaglobaltech.com

&----


REPORT ztest4.

DATA : l_return LIKE bapiret2 OCCURS 0,

return LIKE bapiret2.

DATA : l_single_result LIKE bapi2045d4 ,

l_single_results LIKE bapi2045d4 OCCURS 0 WITH HEADER LINE.

DATA : l_char_results LIKE bapi2045d2 OCCURS 0,

l_char_resultsnew LIKE bapi2045d2 OCCURS 0,

l_char_result LIKE bapi2045d2,

l_sample_results LIKE bapi2045d3 OCCURS 0,

l_sample_results_new LIKE bapi2045d3 OCCURS 0,

l_sample_result LIKE bapi2045d3,

l_operation LIKE bapi2045l2.

DATA : l_inspoint LIKE bapi2045l4,

l_inspoints LIKE bapi2045l4 OCCURS 0 WITH HEADER LINE,

l_inspointsnew LIKE bapi2045l4 OCCURS 0 WITH HEADER LINE.

*DATA : lv_insplot LIKE bapi2045l2-insplot VALUE '030000000811',

  • lv_insoper LIKE bapi2045l2-inspoper VALUE '0030'.

DATA : l_qapo LIKE qapo,

l_qals LIKE qals.

DATA : BEGIN OF l_type,

unit(3) TYPE c,

unitc(3) TYPE c,

unitt(20) TYPE c,

END OF l_type.

DATA : BEGIN OF l_range,

merknr TYPE qmerknrp, "inspchar

toleranzob TYPE qtolob, "upper limit

toleranzun TYPE qtolun, "belowe limit

END OF l_range.

DATA : l_up TYPE p DECIMALS 2,

l_dw TYPE p DECIMALS 2.

SELECTION-SCREEN BEGIN OF BLOCK insplot WITH FRAME TITLE text-010.

PARAMETERS : pa_insp TYPE bapi2045l2-insplot DEFAULT '030000000811' OBLIGATORY,

pa_inso TYPE bapi2045l2-inspoper DEFAULT '0030' OBLIGATORY.

SKIP.

PARAMETERS : pa_inst(6) TYPE n.

SELECTION-SCREEN END OF BLOCK insplot.

SELECTION-SCREEN BEGIN OF BLOCK inspchar WITH FRAME TITLE text-020.

PARAMETERS : pa_insc(4) TYPE n OBLIGATORY,

pa_valu(22) OBLIGATORY.

SELECTION-SCREEN END OF BLOCK inspchar.

CALL FUNCTION 'BAPI_INSPOPER_GETDETAIL'

EXPORTING

insplot = 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 = ' '

read_chars_without_recording = ' '

res_org = ' '

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 amsehi aisocode b~msehl INTO l_type FROM t006 AS a

INNER JOIN t006a AS b ON amsehi = bmsehi 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.

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 = pa_insp

inspoper = pa_inso

insppointdata = l_inspoint

IMPORTING

return = return

TABLES

  • char_results = l_char_resultsnew

sample_results = l_sample_results_new

  • single_results = l_single_results

returntable = l_return.

*for quantity value gunakan sample result

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = ' '.