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: 

Updating multiple defect details in QM01 by using BDC

Former Member
0 Kudos


Hi all,

I need to store multiple defect items in one single notification. When i am trying to store one defect details it is working fine. Since production date and reference engine number are not in the BAPIs I went for BDC.

For creating notification i am getting all the details in one internal table.  My code is like as below.

LOOP AT IT_ENGINE_DEF_NOTIF INTO wa_engine_def_notif.

  WRITE sy-datum to wk_date DD/MM/YYYY.

  wk_tabix = sy-tabix.

  AT END OF prdline_code.

    READ TABLE it_engine_def_notif INTO wa_engine_def_notif INDEX wk_tabix.
    IF sy-subrc = 0.
        perform populate_bdc_tab using:
     '1' 'SAPLIQS0' '0200',
     ' ' 'BDC_CURSOR' 'RIWO00-QMART',
     ' ' 'BDC_OKCODE' '/00',
     ' ' 'RIWO00-QMART' 'FE',
     '1' 'SAPLIQS0' '7200',
     ' ' 'BDC_OKCODE' '=10\TAB10',
     ' ' 'RQM00-MATNR'  wa_engine_def_notif-matnr,
     ' ' 'RQM00-MAWERK' wa_engine_def_notif-werks,

     ' ' 'VIQMEL-PRODDAT' wk_date,
     ' ' 'VIQMEL-DEVICEID' wa_engine_def_notif-shiftname,
     ' ' 'VIQMEL-REFNUM' wa_engine_def_notif-engno,
     ' ' 'VIQMEL-ARBPLWERK' wa_engine_def_notif-werks,
     ' ' 'RQM00-ARBPL' wa_engine_def_notif-prdline,
     ' ' 'VIQMEL-QMGRP' 'QSHIFTCD',
     ' ' 'VIQMEL-QMCOD' wa_engine_def_notif-shift,
     ' ' 'RQM02-PARNR_VERA' wa_engine_def_notif-pernr.
*     ' ' 'RQM02-NAME_VERA' empname.
    ENDIF.

  ENDAT.

     perform populate_bdc_tab using:
        '1' 'SAPLIQS0' '7204',
        ' ' 'BDC_OKCODE' '/00',
        ' ' 'BDC_CURSOR' 'VIQMFE-OTGRP(wk_tabix)',
        ' ' 'VIQMFE-FEGRP(wk_tabix)' wa_engine_def_notif-fegrp_x,
        ' ' 'VIQMFE-FECOD(wk_tabix)' wa_engine_def_notif-fecod_x,
        ' ' 'VIQMFE-OTGRP(wk_tabix)' wa_engine_def_notif-fegrp,
        ' ' 'VIQMFE-OTEIL(wk_tabix)' wa_engine_def_notif-fecod.

ENDLOOP.
       perform populate_bdc_tab  using:
        '1' 'SAPLIQS0' '7204',
        ' ' 'BDC_OKCODE' '=BUCH'.

       perform populate_bdc_tab using:
        '1' 'SAPLIQS0' '7204',
        ' ' 'BDC_OKCODE' '=20\TAB01',
        ' ' 'BDC_CURSOR' 'VIQMEL-QMNUM'.
*  ENDLOOP.
call transaction 'QM01' using bdc_tab mode 'A' update 'S' MESSAGES INTO mestab.

The values are filling in work area. But notification number is not creating. In the initial screen itself i am facing difficulty. Can any one give me the solution.

Thanks in Advance

CK

7 REPLIES 7

archanapawar
Contributor
0 Kudos

Hi CK,

Did you check your BDC in foreground/Error mode whether you are getting some message where your BDC is getting stopped.

0 Kudos

Hi Archana,

In my code, after the loop when the CALL TRANSACTION 'QM01' is called it is directly coming to the QM01 intial screen. i am running the code in Error mode

0 Kudos

yes it should come to QM01. So, what error you are facing?

0 Kudos

Eventhough i entered correct and sufficiect details notification number is not creating

0 Kudos

Can you post screenshot of your first screen after entering the details? you above comment won't help to resolve your issue.

0 Kudos

my internal table contains two rows. In which Production line, material no., date, shift, shift name, employee no. are same for the both entries. but defect location and defect are different. these two details should be stored in QM01 items tabs as two rows.

What i have did in my code means I have used AT END OF concept. After the loop gets over the below screen is coming

0 Kudos

So, its working correct, your call transaction is working, but you are not passing parameters to your QM01, so how it will create notification for you?

Have you done correct recoding in SHDB? I guess, you have not converted the recording into code correctly. You need to work on your code.

In this screen you need to pass Notification type and then enter OK_CODE as '/00'.