04-26-2018 9:36 AM
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
04-26-2018 1:53 PM
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.
04-26-2018 9:58 AM
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)
04-26-2018 12:12 PM
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
04-26-2018 12:26 PM
Of course, but you don't really need a view, do you?
You could easily
05-02-2018 3:37 PM
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
04-26-2018 1:53 PM
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.
05-03-2018 6:58 AM
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
05-03-2018 8:28 PM
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...
05-04-2018 11:33 AM
05-04-2018 11:52 AM
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
05-04-2018 3:45 PM
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.