2014 Oct 17 6:48 AM
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
2014 Oct 17 10:54 AM
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.
2014 Oct 17 7:01 AM
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.
2014 Oct 17 7:38 AM
But the thing is when I run the program it's running perfectly.
problem occurs only user runs the program.
2014 Oct 17 8:09 AM
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.
2014 Oct 17 9:27 AM
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.
2014 Oct 17 9:48 AM
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.
2014 Oct 17 10:13 AM
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
2014 Oct 17 10:54 AM
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.