Skip to Content
0
Former Member
Apr 01, 2009 at 03:39 PM

Avoiding runtime error

29 Views

Hi gurus!

I have added few fields to the copy of a standard program mb51 . In DEV it runs fine

as the amount of data is less , but when I moved it to QAT it keeps on running and

goes to rntime error. Is theer a way to minimise the runtime in my extar code added

so that it dosent go into runtime . Any suggestions ?

select mblnr
         mjahr
         xblnr
  from   mkpf
  into   table i_mkpf
  for    all entries in list[]
  where  mblnr = list-mblnr
  and    mjahr = list-mjahr.

  loop at i_mkpf into s_mkpf.
    move s_mkpf-xblnr to s_xblnr-xblnr.
    append s_xblnr to i_xblnr.
    clear s_mkpf.
  endloop.

  select vbeln
        posnr
        vgbel
        vgpos
  from   lips
  into   table i_lips
  for    all entries in i_xblnr
  where  vbeln = i_xblnr-xblnr.

  select vbeln
         posnr
         parvw
         kunnr
  from   vbpa
  into   table i_vbpa
  for    all entries in i_lips
  where  vbeln = i_lips-vgbel.

  select vbeln
         kunnr
  from   vbak
  into   table i_vbak
  for    all entries in i_lips
  where  vbeln = i_lips-vgbel.

  select vbeln
         posnr
         zzeubcd
         mvgr1
  from   vbap
  into   table i_vbap
  for    all entries in i_vbak
  where  vbeln = i_vbak-vbeln.

  select kunnr
         name1
         oipbl
  from   kna1
  into   table i_kna1.

  select pblnr
         kunnr
         parfn
  from   oifbbp1
  into   table i_oifbbp1
  for    all entries in i_kna1
  where  pblnr = i_kna1-oipbl.
  loop at list.
v_tabix = sy-tabix.
    read table i_mkpf into s_mkpf with key mblnr = list-mblnr
  mjahr = list-mjahr.

    read table i_lips into s_lips with key vbeln = s_mkpf-xblnr.

    read table i_vbap into s_vbap with key vbeln = s_lips-vgbel
                                           posnr = s_lips-vgpos.
    if sy-subrc = 0.
      list-zzeubcd = s_vbap-zzeubcd.
      list-mvgr1   = s_vbap-mvgr1.
    endif.
    read table i_vbpa into s_vbpa with key vbeln = s_lips-vgbel
                                           parvw = 'WE'.

    read table i_kna1 into s_kna1 with key kunnr = s_vbpa-kunnr.
    if sy-subrc  = 0.
      list-shi_nam = s_kna1-name1.
      list-oipbl = s_kna1-oipbl.
    endif.
    if sy-subrc  = 0.
    endif.
    read table i_oifbbp1 into s_oifbbp1 with key pblnr = s_kna1-oipbl
                                                parfn = 'ZFAC'.
    if sy-subrc = 0.
      list-par_id   = s_oifbbp1-kunnr.
      list-parfn   = s_oifbbp1-parfn.
    endif.

    read table i_kna1 into s_kna1 with key kunnr = s_oifbbp1-kunnr.
    if sy-subrc  = 0.
      list-par_nam = s_kna1-name1.
    endif.

    modify list index v_tabix transporting zzeubcd
                                            mvgr1
                                            shi_nam
                                            parfn
                                            par_id
                                            par_nam
                                            oipbl.

    clear : s_mkpf,
            s_lips,
            s_vbpa,
            s_kna1,
            s_vbap,
            s_vbak,
            s_oifbbp1.
  endloop.
endform.                    " ADD_NEW_FIELDS

.