Application Development and Automation 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: 
Read only

ABAP Program slow for user

buddhika_krishantha
Active Participant
0 Likes
1,021

Hi All,

I made a report to display profitability of company.I used AUFK, COEP, COBK,  SETLEAF tables.

My problem is when I run the program it's running perfectly.

But when end user run the report its not running.

After he execute the report its never ends.

Thank you,

Buddhika Krishantha

1 ACCEPTED SOLUTION
Read only

buddhika_krishantha
Active Participant
0 Likes
960

Finally solved.

I used HRGPBS_ORDERGROUP_GETDETAIL FM to fill data to IT_HIERARCHYVALUE table.

In that FM, there is a authorization object K_AUFK_SET.

User hasn't access for that authorization object.

Informed basis guy to add authorization object to user ant it solved.

Thank you everyone for your help.Your suggestions are valuable.

7 REPLIES 7
Read only

rajkumarnarasimman
Active Contributor
0 Likes
960

Hi Krishantha,

I hope the problem may be in loop statments(LOOP, While etc.,). Kindly check in debug mode, whether the loop statements are executing continuously without ending.

For Example

LOOP AT IT_FINAL INTO WA_FINAL.

---

---

APPEND WA_FINAL TO IT_FINAL.

CLEAR WA_FINAL.

ENDLOOP.

In the above code, we are appending the same internal table within the same loop, in such case, the program never ends, we have to terminate the program externally.

Regards

Rajkumar Narasimman.

Read only

0 Likes
960

But the thing is when I run the program it's running perfectly.

problem occurs only user runs the program.

Read only

0 Likes
960

Ask them to save the variant they use and run under it using SAT.

Maybe they use different filters/parameters than your tests and you have to fix some accesses to DB/internal tables.

Without knowing the code, it's pretty impossible give you THE answer.

Read only

0 Likes
960

Hi Simone,

I pass the same parameters which user passed.I got the report.(I have full access).

I checked using ST05.

when user runs following code never ends.For me it only has 99 records.

LOOP AT IT_INTERNAL_ODRS.
     select SETNAME from SETLEAF
       into LV_SETNAME
       where  SETCLASS = '0106' and SUBCLASS in S_KOKRS and

               VALFROM  = IT_INTERNAL_ODRS-prctr.
     ENDSELECT.
     IT_INTERNAL_ODRS-PRGRP = LV_SETNAME.
     MODIFY IT_INTERNAL_ODRS TRANSPORTING PRGRP.
   ENDLOOP.

Thank you.

Read only

0 Likes
960

First of all, avoid for sure the construct

     LOOP

          SELECT

          ENDSELECT

     ENDLOOP

My suggestion is


TYPES: BEGIN OF ty_leaf,

              setname TYPE setleaf-setname,

              valfrom   TYPE setleaf-valfrom,

          END OF ty_leaf.

DATA: gt_leaf TYPE TABLE OF ty_leaf.

FIELDS-SYMBOLS: <f_leaf> TYPE ty_leaf,

                              <f_int> like line of IT_INTERNAL_ODRS.

SELECT setname valfrom INTO TABLE GT_LEAF from SEATLEAF where  SETCLASS = '0106' and SUBCLASS in S_KOKRS.


SORT gt_leaf by VALFROM.

LOOP AT it_internal_odrs ASSIGNING <f_int>.

READ TABLE gt_leaf ASSIGNING <f_leaf> WITH KEY valfrom = <f_int>-prctr.

check sy-subrc = 0.

<f_int>-PRGRP = <f_leaf>-setname.


ENDLOOP.

Even more, if PRCTR is the first field of your IT_INTERNAL_ODRS, you can use AT NEW... to read just 1 time for each prctr table GT_LEAF and then update massively the other records.

As i stated, working just on one or two pieces of code is not the best way to improve performances.

Read only

0 Likes
960

Hi Buddhika ,

It would be better if you use select single instead of select endselect.

Use the code as below:

LOOP AT IT_INTERNAL_ODRS.
     select single SETNAME from SETLEAF
       into LV_SETNAME
       where  SETCLASS = '0106' and SUBCLASS in S_KOKRS and

               VALFROM  = IT_INTERNAL_ODRS-prctr.


     IT_INTERNAL_ODRS-PRGRP = LV_SETNAME.
     MODIFY IT_INTERNAL_ODRS TRANSPORTING PRGRP.
   ENDLOOP.


regards


Yogendra

Read only

buddhika_krishantha
Active Participant
0 Likes
961

Finally solved.

I used HRGPBS_ORDERGROUP_GETDETAIL FM to fill data to IT_HIERARCHYVALUE table.

In that FM, there is a authorization object K_AUFK_SET.

User hasn't access for that authorization object.

Informed basis guy to add authorization object to user ant it solved.

Thank you everyone for your help.Your suggestions are valuable.