Skip to Content
-3

question on improving the performance of the report IH01 which is copied to custom

Apr 26 at 08:36 AM

73

avatar image

Hi Experts,

We have copied the standard IH01 report to custom, can you please let me know how to improve the performance for this report.

Thanks,

balu

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Matthew Billingham
Apr 26 at 12:53 PM
4

Copying a standard SAP program is always dangerous and in my 20+ years working in SAP, I've never encountered a situation where it was actually needed. My best answer to your performance problems with this report is:

go to support.sap.com and search for notes. If there are none, then raise a message.

If you've copied the program and now it has performance problems because of your addition, it would still be safer to make your additions directly to the standard.

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi Apr 26 at 08:58 AM
1

Did you already execute some trace of IH01 execution (SAT, SE30, ST05) in this case do it, then analyze steps with longer duration. (Only duplicate standard report when no database action or code enhancement can resolve your problem)

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi,

Yes I already executed the trace and I want one clarification regarding this query in HDB system

can we replace the below queries with a single query where IFLO is a database view. SELECT tplnr tplma FROM iflo INTO TABLE lt_tplma FOR ALL ENTRIES IN lt_tplnrtab WHERE tplnr EQ lt_tplnrtab-tplnr. IF sy-subrc IS INITIAL. SORT lt_tplma BY tplnr. * Fetching pltxt tplma values from iflo table SELECT tplnr pltxt tplma FROM iflo INTO TABLE lt_pltxt1 FOR ALL ENTRIES IN lt_tplma WHERE tplnr EQ lt_tplma-tplma. IF sy-subrc IS INITIAL. SORT lt_pltxt1 BY tplnr. * Fetching pltxt values from iflo table SELECT tplnr pltxt FROM iflo INTO TABLE lt_pltxt FOR ALL ENTRIES IN lt_pltxt1 WHERE tplnr EQ lt_pltxt1-tplma. IF sy-subrc IS INITIAL. SORT lt_pltxt BY tplnr. ENDIF. ENDIF. ENDIF. ENDIF. thanks, balu

0
Balakrishna t Krishna

Of course, but you don't really need a view, do you?

You could easily

  • Merge the 3 SELECT statements into one with some LEFT JOIN (and using alias such as 'FROM IFLO as FL1 JOIN IFLO as FL2...' to identify the tables with same name.
  • Define a new internal table to receive the result respecting order of fields.
  • Either adapt the following statements to use this table or rebuild the original 3 internal tables in a single LOOP. Use a sorted type table and some AT statements in the LOOP.

0

Hi Raymond,

thanks for your reply . if we observe the three selects the output of one select is the input for other select . In that case how can we join all those three . can you be more precise or snippet of code can help.

thanks,

balu

0
Rajkumar Narasimman May 03 at 05:58 AM
-2

Hi.

"we observe the three selects the output of one select is the input for other select

All the three selects represents same fields and values fetched from same table, only input selection table varies in FOR ALL ENTRIES keyword. Create one internal table(IT_TAB) and merge all existing internal tables lt_tplnrtab, lt_tplma & t_pltxt1 as shown below.

"Merge all internal table
APPEND LINES OF lt_tplnrtab TO it_tab.
APPEND LINES OF lt_tplma TO it_tab.
APPEND LINES OF lt_pltxt1 TO it_tab.

"Delete duplicate values
SORT it_tab BY tplnr.
DELETE ADJACENT DUPLICATES FROM it_tab COMPARING tplnr.

"Fetching pltxt tplma values from iflo table
 SELECT tplnr 
 pltxt 
 tplma 
 FROM iflo 
 INTO TABLE lt_iflo 
 FOR ALL ENTRIES IN it_tab
 WHERE tplnr EQ it_tab-tplma.
 IF sy-subrc IS INITIAL.
 SORT lt_iflo BY tplnr.
 ENDIF. 

Regards

Rajkumar Narasimman

Show 4 Share
10 |10000 characters needed characters left characters exceeded

How do you know what is in the OP's code? They only said a program was copied but haven't provided any information on what exactly was changed. Or even when the program was copied. Standard program might have as well changed since then, as Matthew suggested. This question can't really be answered as is IMHO other than just to say "don't do this".

Update: ah, just noticed OP posted the code in the comments to another question. Didn't see it until expanded the comments, sorry. How I hate the stupid answer/comment concept, ugh...

1

Hi,

Can you provide a solution or a process that the 3 selects can be combined , please watch the selects carefully the output of one select is passed as input to the other and the IFLO table is basically a view.

thanks

0
Balakrishna t Krishna

What have you tried so far to resolve this? Sorry but based on the comments it seems the expectation is that someone just gives you the code to copy-paste. If you have a specific technical issue then we can help but your comments so far read like you haven't even tried anything.

Read ABAP documentation, see what all the different SELECT options are there, then think how they could be used and try making a change. Raymond already mentioned LEFT JOIN. There is also subquery, for example. It's all in the documentation. It's also not clear what other code is there in the program and why you even arrived at such algorithm / design. Many times the problem is really not in the code fragment that is being shared here.

When you post "I've tried A and it didn't work because of B, then I tried X but it didn't work because of Y" people would be much more responsive and would be able to help you better than if you just ask "here is a problem, give me a solution". We can help you do your job but not do it for you, sorry. I hope you understand the difference.

0

Hi,

No problem, Do you have any solution for this please.

thanks

0