<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Avoiding runtime error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440743#M1247809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;run it in background or run using sm30 and then evaluate the time. I am sure batabase effort will be more than ABAP effort.. joining two tables is ok .. try using join table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Apr 2009 19:00:45 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2009-04-01T19:00:45Z</dc:date>
    <item>
      <title>Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440733#M1247799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added few fields to the copy of a standard program mb51 . In DEV it runs fine &lt;/P&gt;&lt;P&gt;as the amount of data is less , but when I moved it to QAT it keeps on running and &lt;/P&gt;&lt;P&gt;goes to rntime error. Is theer a way to minimise the runtime in my extar code added &lt;/P&gt;&lt;P&gt;so that it dosent go into runtime . Any suggestions ?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 15:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440733#M1247799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440734#M1247800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort all the table you are reading , with the keys you are using and use binary search addition in read table syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 15:45:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440734#M1247800</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-01T15:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440735#M1247801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did the sorting by key fields and added binary search , but that has eliminated some of my ourputs , ie the few fields that I was getting populated with values vansihed when i added the sorting and binary search.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 15:57:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440735#M1247801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T15:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440736#M1247802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;they might have not washed off , but might be settled on the bottom as sort default is taken as ascending..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make sure the sort field of table and the read table keys are same.... binary search is very particular on these.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 15:59:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440736#M1247802</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-01T15:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440737#M1247803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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.
 
IF NOT i_xblnr[] IS INITIAL.
  select vbeln
        posnr
        vgbel
        vgpos
  from   lips
  into   table i_lips
  for    all entries in i_xblnr
  where  vbeln = i_xblnr-xblnr.
IF SY-SUBRC EQ 0.
  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.
IF SY-SUBRC EQ 0.
  select vbeln
         posnr
         zzeubcd
         mvgr1
  from   vbap
  into   table i_vbap
  for    all entries in i_vbak
  where  vbeln = i_vbak-vbeln.
ENDIF.

ENDIF.

ENDIF. 


  select kunnr
         name1
         oipbl
  from   kna1
  into   table i_kna1.
 IF SY_SUBRC EQ 0.
  select pblnr
         kunnr
         parfn
  from   oifbbp1
  into   table i_oifbbp1
  for    all entries in i_kna1
  where  pblnr = i_kna1-oipbl.
ENDIF.
SORT TABLE i_mkpf  BY  mblnr   mjahr .
SORT TABLE i_lips  BY  vbeln .
SORT TABLE I_VBAP BY VBELN POSNR.
SORT TABLE I_VBPA BY VBELN PARVW.
SORT TABLE I_KNA1 BY KUNNR.
SORT TABLE i_oifbbp1 BY pblnr Parfn.
  loop at list.
   v_tabix = sy-tabix.
    CLEAR s_mkpf.
    read table i_mkpf into s_mkpf with key mblnr = list-mblnr
  mjahr = list-mjahr  BINARY SEARCH.
   
CLEAR s_lips.
    read table i_lips into s_lips with key vbeln = s_mkpf-xblnr BINARY SEARCH.
 
 CLEAR s_VBAP.
    read table i_vbap into s_vbap with key vbeln = s_lips-vgbel
                                           posnr = s_lips-vgpos BINARY SEARCH.
    if sy-subrc = 0.
      list-zzeubcd = s_vbap-zzeubcd.
      list-mvgr1   = s_vbap-mvgr1.
    endif.
CLEAR s_vbpa.
    read table i_vbpa into s_vbpa with key vbeln = s_lips-vgbel
                                           parvw = 'WE' BINARY SEARCH.
 
CLEAR s_kna1.
    read table i_kna1 into s_kna1 with key kunnr = s_vbpa-kunnr BINARY SEARCH.
    if sy-subrc  = 0.
      list-shi_nam = s_kna1-name1.
      list-oipbl = s_kna1-oipbl.
    endif.
    if sy-subrc  = 0.
    endif.
Clear i_oifbbp1.
    read table i_oifbbp1 into s_oifbbp1 with key pblnr = s_kna1-oipbl
                                                parfn = 'ZFAC' BINARY SEARCH.
    if sy-subrc = 0.
      list-par_id   = s_oifbbp1-kunnr.
      list-parfn   = s_oifbbp1-parfn.
    endif.
 CLEAR s_kna1.
    read table i_kna1 into s_kna1 with key kunnr = s_oifbbp1-kunnr BINARY SEARCH.
    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&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 16:08:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440737#M1247803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T16:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440738#M1247804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes , I beleiev they are the same and when I remove the binary search the correct display comes in , but I am still concerned with teh time it is taking in DEV itself  as I dont see much difference from before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 16:10:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440738#M1247804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T16:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440739#M1247805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or is theer something that can be done with teh select and read statements to optimize the time .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 16:12:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440739#M1247805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T16:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440740#M1247806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avinash!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I applied your code still what happens is that the partner id and partner name for a particluar slection that I am making vansihes off , as to initially it was appearing without sort and binary search. I wonder how is it vansihing when sort and binary serach applied.Time taken is also sort of not much difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 16:18:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440740#M1247806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T16:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440741#M1247807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;field-symbols: &amp;lt;fs&amp;gt; like line of list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at list assingning &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;read....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;fs&amp;gt;- field = lv_field....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with this you can remove the modify and transporting at the end...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are dealing with big table vbak, vbap, MKPF etc... it ill take some time... try to use all the keys of the tables you are using..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 17:35:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440741#M1247807</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-01T17:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440742#M1247808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes tahts right I am using big tables  but to extract the relevant records i needed them . I tried doing it the way mentioned but the time taken it almost teh same to run the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 18:52:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440742#M1247808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T18:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440743#M1247809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;run it in background or run using sm30 and then evaluate the time. I am sure batabase effort will be more than ABAP effort.. joining two tables is ok .. try using join table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 19:00:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440743#M1247809</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-01T19:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440744#M1247810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will it be ok to join so many tables together , wont it miss out on records for the table? &lt;/P&gt;&lt;P&gt;I mean I am not sure how will I join those tables to extarct the same data as I am getting now&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 19:35:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440744#M1247810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T19:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440745#M1247811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this link to find out [how to join table|http://www.sapdb.info/wp-content/uploads/2008/05/sqvi.pdf] and find out relations between tables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 19:41:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-runtime-error/m-p/5440745#M1247811</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-01T19:41:10Z</dc:date>
    </item>
  </channel>
</rss>

