Skip to Content
author's profile photo Former Member
Former Member

performance issue

Hi All,

Can any please comment on the below coding, I have a report which takes avery long time to execute, I am using field symbols,

Loop at i_tab ASSIGNING <fs_ekbe>.

APPEND INITIAL LINE TO i_tab2 ASSIGNING <fs_ebeln>.

<fs_ebeln>-ebeln = <fs_ekbe>-ebeln.

<fs_ebeln>-ebelp = <fs_ekbe>-ebelp.

ENDLOOP.

Is this good enough or wats the best alternative.

Many thanks

Soyunee.

Add a comment
10|10000 characters needed characters exceeded

Related questions

8 Answers

  • Posted on Jun 13, 2008 at 08:13 AM

    Are you sure this is the code that takes so long to execute?

    If not, do a SE30 runtime analysis first.

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2008 at 08:18 AM

    Hi!

    If I were you, I'll make this modification first:

    break-point.

    Loop at i_tab ASSIGNING -ebelp.

    ENDLOOP.

    break-point.

    Press F8 when the program is reaching the first break-point.

    If the part of the program has finished within 1 second, there is nothing to with it.

    Regards

    Tamá

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2008 at 08:22 AM

    Hi.

    1.Should be working fine(Not sure about the logic)

    2.check with the number of entries in i_tab ,while Looping

    3.check the ekbe selection,try to restrict,say date range

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2008 at 08:58 AM

    Hi,

    I dont think it shud create any problems .Please rn ur code thru SE30 n ST05, to find which other part is comsuimg time.

    regards,

    madhu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 15, 2008 at 01:17 AM

    Hi,

    Weather ur using new debugger or old debugger.

    Try to use the new debugger for executing the field symbols or seach hepl scenarios.

    Regards

    krishna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 02:09 PM

    Hi,

    See the basic reason is that field symbols are not preferred if append is to be used as append works better with work areas.

    Field symbols are best used if we are supposed to modify an internal table,which is done using field symbols .

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      in other words, it is not the best solution. Better would be this:

      CLEAR wa2.

      LOOP AT i_tab INTO wa.

      wa2-ebeln = wa-ebeln.

      wa2-ebelp = wa-ebelp.

      APPEND wa2 TO i_tab2.

      ENDLOOP.

      But as always, benchmark it on your system. Use GET RUN TIME FIELD to measure run time.

      DATA: t1 TYPE i,

      t2 TYPE i,

      dt TYPE i.

      GET RUN TIME FIELD t1.

      ...

      place your code here

      ...

      GET RUN TIME FIELD t2.

      dt = t2 - t1.

      WRITE: / 'Runtime: ', dt, 'µs'.

      Best regards

      Ralph

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 11:59 AM

    hii,

    looping into a field symbol is not suggestible.

    declare the field symbols as type any and the try.

    reward if helpful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 11:31 PM

    Hi Soyunee,

    Your coding looks good. Any ASSIGN clause does have a lot of overhead. Try it with a more conventional technique and use a structure for your appended table i_tab2:

    DATA: wa_tab2 like i_tab2.
    
    Loop at i_tab ASSIGNING <fs_ekbe>.
      CLEAR: wa_tab2.
      CHECK: <fs_ekbe>-ebeln <> 0 and <fs_ekbe>-ebelp <> 0.
      wa_tab2-ebeln = <fs_ekbe>-ebeln.
      wa_tab2-ebelp = <fs_ekbe>-ebelp.
      APPEND wa_tab2 TO i_tab2.
    ENDLOOP.

    Try it!

    Heinz

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.