2014 Sep 25 5:42 PM
DATA: LT_VBFA TYPE STANDARD TABLE OF VBFA WITH HEADER LINE.
LT_VBFA-VBELN = '0086152431'.
LT_VBFA-POSNN = 10.
APPEND LT_VBFA.
LT_VBFA-POSNN = 20.
APPEND LT_VBFA.
LT_VBFA-POSNN = 30.
APPEND LT_VBFA.
LT_VBFA-POSNN = 40.
APPEND LT_VBFA.
LT_VBFA-POSNN = 50.
APPEND LT_VBFA.
LT_VBFA-POSNN = 60.
APPEND LT_VBFA.
select * into corresponding fields of table lt_vbfa
from vbfa
for all entries in lt_vbfa
where vbeln = lt_vbfa-vbeln and posnn = lt_vbfa-posnn and
VBTYP_V = 'C'.
Dear: all.
in the prd system,i used t-code 'SE30‘ ,test the performance of vbfa with previous code
i Excute the code a few times,the Runtime is about 2,300,000 microseconds, that is about 2 seconds
but actually, from i click the button "mesure runtime" , to the system show how much time spend, at least 2~3 Minutes gone
why?
should i create a index for vbfa using vbeln posnn and vbtyp_v?
2014 Sep 26 12:02 PM
Actually there is no delivered index on VBFA with key VBELN and POSNN (*), but primary keys start with VBELV and POSNV. So preceeding document is used to search for the subsequent document.
You could create an index BUT there are usually other solutions, depending on actual type of documents, you shoud access an other table, replacing a wrong SELECT vbelv FROM vbfa WHERE vbeln with either
SELECT vgbel FROM lips WHERE vbeln
SELECT vgbel FROM vbrp WHERE vbeln
SELECT aubel FROM vbrp WHERE vbeln
There is a reference note 185530 - Performance: Customer developments in SD
Regards
Raymond
(*) Business function JMPS_MODIF 'Media: Modifications Media Product Sales' contain such index, but not sure it is activated.
2014 Sep 25 5:58 PM
Regards,
Philip
2014 Sep 26 11:04 AM
this is supported by abap
1. using condition in lt_vbfa to fetch data
2. move the result into lv_vbfa
2014 Sep 25 7:25 PM
Hello,
While using For All entries statement, SAP will break down your entries in this section to a number 5 as default and will query the database that time of times.
for e.g if you have 1000 data in ur table, system will query the database 1000/5 times.
solution for this would be using range instead of for all entries.
it will fetch the data with only one database call.
2014 Sep 26 11:03 AM
yes, it is easy to get what you said using st05, "for e.g if you have 1000 data in ur table, system will query the database 1000/5 times."
my question is why the system report runtime is 2 seconds while the actually time spend to excute the code in se30 is 3 minutes
2014 Sep 26 11:22 AM
Regards,
Philip.
2014 Sep 26 11:16 AM
Hi,
Please check your code!
- why you are reading and using the lt_vbfa in code. It is not required and remove the statement.
- Are you really looking for all fields in VBFA...try to avoid * and use required fields.
- You are already using the secondary index!
Check your code once again and there are FM's are available to read VBFA , please check.
BG,
Kiran
2014 Sep 26 2:05 PM
2014 Sep 26 12:02 PM
Actually there is no delivered index on VBFA with key VBELN and POSNN (*), but primary keys start with VBELV and POSNV. So preceeding document is used to search for the subsequent document.
You could create an index BUT there are usually other solutions, depending on actual type of documents, you shoud access an other table, replacing a wrong SELECT vbelv FROM vbfa WHERE vbeln with either
SELECT vgbel FROM lips WHERE vbeln
SELECT vgbel FROM vbrp WHERE vbeln
SELECT aubel FROM vbrp WHERE vbeln
There is a reference note 185530 - Performance: Customer developments in SD
Regards
Raymond
(*) Business function JMPS_MODIF 'Media: Modifications Media Product Sales' contain such index, but not sure it is activated.
2014 Sep 26 12:07 PM
2014 Sep 26 2:25 PM
yes i created a secondary index to solve the performance of reading vbfa
and i also considered your solution before i asked the question
but the first doc is accounting document,then to business document,
such as sales doc, trading doc, even purchase doc.
if using this solution, i have to know where every accounting doc come from,
and what kind of document to be counted,
too much business sense involved, i need a sd consultant to help me
maybe, someday in the future,we will recheck the logic of this report, and overwrite it
Thanks~