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

Help me on VBFA table

Former Member
0 Likes
1,506

Hi Guru's,

Please tell how to improve performance of this query..this query makes performance issue on my program

SELECT vbelv

posnv

vbeln

posnn

rfmng

FROM vbfa

INTO TABLE i_sditem2

FOR ALL ENTRIES IN i_sales_p

WHERE vbelv EQ i_sales_p-vbeln

AND posnv EQ i_sales_p-posnr

AND vbtyp_n EQ 'J'.

otherwise how to use function module for this query..

Regards

P.Senthil Kumar.

8 REPLIES 8
Read only

former_member195383
Active Contributor
0 Likes
1,357

Use the not initial check as given below. If this check is not used,

the select query will fetch huge no. of records, when there is no entry in

i_sales_p table

if not i_sales_p[] is initial.

SELECT vbelv

posnv

vbeln

posnn

rfmng

FROM vbfa

INTO TABLE i_sditem2

FOR ALL ENTRIES IN i_sales_p

WHERE vbelv EQ i_sales_p-vbeln

AND posnv EQ i_sales_p-posnr

AND vbtyp_n EQ 'J'.

endif.

Read only

0 Likes
1,357

Hi Rudra Prasanna,

Not initial check is already done it in my Query..

is it has any function module for accessing VBFA table based on my where condition.???

i checked some function module it has single input..

Regards

P.Senthil Kumar

Read only

Former Member
0 Likes
1,357

Hi,

The number of entries in i_sales_p is not known and may be too much in numbers, so try reducing entries in i_sales_p by refining the where conditions for i_sales_p.

Hopefully, this will improve performance of your query.

Regards,

Ibrar.

Read only

Former Member
0 Likes
1,357

hi,

order of fields in selection and whare condition is correct, so there is problem in query.

make sure your internal table is sorted.

or try these FM's

READ_VBFA

SD_VBFA_ARRAY_READ_VBELV

SD_VBFA_READ_WITH_VBELV

SD_VBFA_SELECT

SD_VBFA_SINGLE_READ

SD_VBFA_TRANSFER_TO_BUFFER

i hopr these may increse ur query performance

pradeep

Read only

Former Member
0 Likes
1,357

Hi,

You can use following statement:-

If not i_sales_p[] is Initial.

SELECT vbelv

posnv

vbeln

posnn

rfmng

FROM vbfa

INTO TABLE i_sditem2

FOR ALL ENTRIES IN i_sales_p

WHERE vbelv EQ i_sales_p-vbeln

AND posnv EQ i_sales_p-posnr.

EndIf.

Then you can filter out entries depending upon Document category of subsequent document which is VBTYP_N.

Delete i_sditem2 where vbtyp_n NE 'J'.

Hope this works for you........

Thanks..........

Read only

Former Member
0 Likes
1,357

Hi,

Try this:

1) Try to use all primary keys in WHERE clause... if not possible use only vbelv and posnv.

After selection delete the entries which are not requried as per VBTYP_N.

2) Select all primary keys when u r using for all entries....

Kiran

Read only

former_member195383
Active Contributor
0 Likes
1,357

make sure that i_sales_p has no duplicate entries. If so, then sort and delete adjacent duplicates

from i_sales_p[] .

Read only

Former Member
0 Likes
1,357

Hi Kumar,

Use Secondary index in Table VBFA for the Field vbtyp_n.

This will ultimately increase performance.

Procedure.

Goto-->se11

table : vbfa.

in application toolbar Press on INDEXES button,

Create new Z index by giving field as vbtyp_n.

Regards,

Rama Krishna.