Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

QP01 Inspection Plan Charecteristics....

Former Member
0 Kudos
218

Hi all,

I am uploading QP01 Inspection plan, in that inspection charecteristics after 16th row the data is not inserting and giving errors, i use entry RQPAS-ENTRY_ACT..

not usable Can any one send me right way to upload more than 16 Inspection charecteristics...

thanks...

4 REPLIES 4

Former Member
0 Kudos
66

Hi all,

plz can one send me the solution.....for this

thanks....

0 Kudos
66

what are the fields you are taken for inspection plan characterstics

former_member609120
Contributor
0 Kudos
66

FORM F_START_BDC .

DATA : LV_FNAM(20) TYPE C, " Concatenated field name

LV_IDX1(3) TYPE N VALUE 1, " Index For Table Control 1

LV_IDX2(3) TYPE N VALUE 1, " Index For Table Control 2

LV_GOTO(4) TYPE N , " Index for GoTo Line No incase of Page Down

LV_PG(3) TYPE N VALUE 1, " Index for Page No

LV_IDX(3) TYPE N VALUE 1.

IF ITST_TABDATA[] IS INITIAL.

MESSAGE E000. " If Inspection Plan exists for all items in file, show error message

ENDIF.

LOOP AT ITST_TABDATA INTO WA_TABDATA.

LV_IDX2 = '1'.

CLEAR ITST_BDCDATA.

REFRESH ITST_BDCDATA.

GV_YEAR = SY-DATUM+0(4).

GV_MNTH = SY-DATUM+4(2).

GV_DATE = SY-DATUM+6(2).

CONCATENATE GV_DATE '.' GV_MNTH '.' GV_YEAR INTO GV_DATUM.

PERFORM BDC_DYNPRO USING 'SAPLCPDI' '8010'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RC27M-MATNR'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'RC27M-MATNR'

WA_TABDATA-MATNR. " 'kiz0006c'

PERFORM BDC_FIELD USING 'RC27M-WERKS'

WA_TABDATA-WERKS. " 'B001'

PERFORM BDC_FIELD USING 'RC271-PLNNR'

WA_TABDATA-PLNNR. " 60000000-99999999

PERFORM BDC_FIELD USING 'RC271-STTAG'

GV_DATUM. " '16.01.2008'

IF WA_TABDATA-KTEXT <> SPACE.

PERFORM BDC_FIELD USING 'PLKOD-KTEXT'

WA_TABDATA-KTEXT. " 'ZOLMITRIPTAN STAGE C1111'

ENDIF.

PERFORM BDC_FIELD USING 'PLKOD-VERWE'

WA_TABDATA-VERWE. " '5'

PERFORM BDC_FIELD USING 'PLKOD-STATU'

WA_TABDATA-STATU. " '4'

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLKOD-QPRZIEHVER'.

PERFORM BDC_FIELD USING 'PLKOD-SLWBEZ'

WA_TABDATA-SLWBEZ. " '200'

PERFORM BDC_FIELD USING 'PLKOD-QPRZIEHVER'

WA_TABDATA-QPRZIEHVER. " 'ACTIVE'

PERFORM BDC_DYNPRO USING 'SAPLCPDA' '1200'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=VOUE'.

LOOP AT ITST_TABCTRL1 INTO WA_TABCTRL1 WHERE MATNR = WA_TABDATA-MATNR

AND WERKS = WA_TABDATA-WERKS

AND PLNNR = WA_TABDATA-PLNNR.

ON CHANGE OF WA_TABCTRL1-MATNR OR WA_TABCTRL1-WERKS OR WA_TABCTRL1-PLNNR.

PERFORM BDC_DYNPRO USING 'SAPLCPDI' '1400'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLPOD-LTXA1(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

CONCATENATE 'PLPOD-ARBPL(' LV_IDX1 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL1-ARBPL. " 'qc01'

CONCATENATE 'PLPOD-STEUS(' LV_IDX1 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL1-STEUS. " 'qm01'

CONCATENATE 'PLPOD-LTXA1(' LV_IDX1 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL1-LTXA1. " 'opearation1'

PERFORM BDC_DYNPRO USING 'SAPLCPDI' '1400'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLPOD-VORNR(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=QMUE'.

PERFORM BDC_FIELD USING 'RC27X-ENTRY_ACT'

'1'.

PERFORM BDC_FIELD USING 'RC27X-FLG_SEL(01)'

'X'.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-STELLEN(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

LOOP AT ITST_TABCTRL2 INTO WA_TABCTRL2 WHERE MATNR = WA_TABCTRL1-MATNR AND

WERKS = WA_TABCTRL1-WERKS AND

PLNNR = WA_TABCTRL1-PLNNR.

  • AND ARBPL = WA_TABCTRL1-ARBPL AND

  • STEUS = WA_TABCTRL1-STEUS.

LV_GOTO = LV_PG * 140. " For Page Down on Second Table Control

IF LV_IDX2 >= 14.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RQPAS-AB_MKNR'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'RQPAS-AB_MKNR'

LV_GOTO .

LV_IDX2 = 2.

LV_PG = LV_PG + 1.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

ELSE.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-STELLEN(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

ENDIF.

CONCATENATE 'PLMKB-VERWMERKM(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-VERWMERKM. " 'MIC00001'/ ' MIC00050'

IF WA_TABCTRL2-PMETHODE <> SPACE.

CONCATENATE 'PLMKB-PMETHODE(' LV_IDX2')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-PMETHODE. " 'met00001'

  • CONCATENATE 'PLMKB-PMTVERSION(' LV_IDX2 ')' INTO LV_FNAM.

  • PERFORM BDC_FIELD USING LV_FNAM

  • WA_TABCTRL2-PMTVERSION. " '1'

CONCATENATE 'PLMKB-STICHPRVER(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-STICHPRVER." 'APIFX1'

CONCATENATE 'PLMKB-PRUEFEINH(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-PRUEFEINH. " '20'

CONCATENATE 'PLMKB-PROBEMGEH(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-PROBEMGEH. " 'G'

IF WA_TABCTRL2-STELLEN <> SPACE.

CONCATENATE 'PLMKB-STELLEN(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-STELLEN." '2'

ENDIF.

IF WA_TABCTRL2-MASSEINHSW <> SPACE.

CONCATENATE 'RQPAS-MASSEINHSW(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-MASSEINHSW. " '%'

ENDIF.

IF WA_TABCTRL2-SOLLWERT <> SPACE.

CONCATENATE 'QFLTP-SOLLWERT(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-SOLLWERT." '10'

ENDIF.

IF WA_TABCTRL2-TOLERANZUN <> SPACE.

CONCATENATE 'QFLTP-TOLERANZUN(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-TOLERANZUN." '5'

ENDIF.

IF WA_TABCTRL2-TOLERANZOB <> SPACE.

CONCATENATE 'QFLTP-TOLERANZOB(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-TOLERANZOB." '15'

ENDIF.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '1501'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENT1'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-VERWMERKM'.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '1502'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENT1'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-PMETHODE'.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '1502'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENT1'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-PMETHODE'.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.

CONCATENATE 'PLMKB-MERKNR('LV_IDX2')' INTO LV_FNAM.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

LV_FNAM.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=QMAM'.

PERFORM BDC_FIELD USING 'RQPAS-ENTRY_ACT'

'1'.

IF LV_IDX2 = 1. " If only one entry then select it

CONCATENATE 'RQPAS-SEL_FLG('LV_IDX2')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

'X'.

ELSE.

LV_IDX = LV_IDX2 - 1. " Deselect previous entry and select current one

CONCATENATE 'RQPAS-SEL_FLG('LV_IDX')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

''.

CONCATENATE 'RQPAS-SEL_FLG('LV_IDX2')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

'X'.

ENDIF.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0160'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=QMBW'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-QERGDATH'.

PERFORM BDC_FIELD USING 'PLMKB-QERGDATH'

'01'. " Quality Certificate

ELSE.

  • CONCATENATE 'PLMKB-PMTVERSION(' LV_IDX2 ')' INTO LV_FNAM.

  • PERFORM BDC_FIELD USING LV_FNAM

  • WA_TABCTRL2-PMTVERSION. " '1'

CONCATENATE 'PLMKB-STICHPRVER(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-STICHPRVER." 'APIFX1'

CONCATENATE 'PLMKB-PRUEFEINH(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-PRUEFEINH. " '20'

CONCATENATE 'PLMKB-PROBEMGEH(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-PROBEMGEH. " 'G'

IF WA_TABCTRL2-STELLEN <> SPACE.

CONCATENATE 'PLMKB-STELLEN(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-STELLEN." '2'

ENDIF.

IF WA_TABCTRL2-MASSEINHSW <> SPACE.

CONCATENATE 'RQPAS-MASSEINHSW(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-MASSEINHSW. " '%'

ENDIF.

IF WA_TABCTRL2-SOLLWERT <> SPACE.

CONCATENATE 'QFLTP-SOLLWERT(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-SOLLWERT." '10'

ENDIF.

IF WA_TABCTRL2-TOLERANZUN <> SPACE.

CONCATENATE 'QFLTP-TOLERANZUN(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-TOLERANZUN." '5'

ENDIF.

IF WA_TABCTRL2-TOLERANZOB <> SPACE.

CONCATENATE 'QFLTP-TOLERANZOB(' LV_IDX2 ')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

WA_TABCTRL2-TOLERANZOB." '15'

ENDIF.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '1501'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENT1'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-QMTB_WERKS'.

PERFORM BDC_FIELD USING 'PLMKB-VERWMERKM'

WA_TABCTRL2-VERWMERKM.

PERFORM BDC_FIELD USING 'PLMKB-QPMK_WERKS'

WA_TABCTRL2-WERKS.

PERFORM BDC_FIELD USING 'PLMKB-QMTB_WERKS'

''.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.

CONCATENATE 'PLMKB-MERKNR('LV_IDX2')' INTO LV_FNAM.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

LV_FNAM.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=QMAM'.

PERFORM BDC_FIELD USING 'RQPAS-ENTRY_ACT'

'1'.

IF LV_IDX2 = 1. " If first entry select it

CONCATENATE 'RQPAS-SEL_FLG('LV_IDX2')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

'X'.

ELSE.

LV_IDX = LV_IDX2 - 1. " Deselect Previous entry ans select current one

CONCATENATE 'RQPAS-SEL_FLG('LV_IDX')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

''.

CONCATENATE 'RQPAS-SEL_FLG('LV_IDX2')' INTO LV_FNAM.

PERFORM BDC_FIELD USING LV_FNAM

'X'.

ENDIF.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0160'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=QMBW'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PLMKB-QERGDATH'.

PERFORM BDC_FIELD USING 'PLMKB-QERGDATH'

'01'. " Previous Inspection Lot

ENDIF.

LV_IDX2 = LV_IDX2 + 1.

ENDLOOP.

ENDON.

ENDLOOP.

PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RQPAS-ENTRY_ACT'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=QMBU'.

PERFORM BDC_FIELD USING 'RQPAS-ENTRY_ACT'

'1'.

CALL TRANSACTION C_QP01 USING ITST_BDCDATA

MODE C_A UPDATE C_S

MESSAGES INTO ITST_MSGTAB. "#EC CI_CALLTA

ENDLOOP.

ENDFORM. " F_START_BDC

0 Kudos
66

Hi

U can try my code which uses BAPI for uploading QM inspection plans...

[Click here to see the program with template and sample data....|https://wiki.sdn.sap.com/wiki/display/Snippets/ABAPProgramtouploadQMInspectionPlanUsingBAPI]

Revert back if u have any doubts.

Regards

KArthik D