Skip to Content
0
Former Member
Dec 11, 2007 at 01:26 PM

How to retrieve Del. No. using MBLNR

15 Views

Hi Guyz..

One quick Qn !

I have MBLNR in my I_MSEG, now I want to retrieve Del. doc. no. using MBLNR. Now I tried to select VBELV as Del doc. using VBELN as subsequent doc. from VBFA table. I am using FOR ALL ENTRIES in ITAB,

The prob is the select on VBFA takes 5 mins for 5 record in I_MSEG.

So how can I make this select fast or , what alternative I can use.

here the code is

**********************************

SELECT mblnr

line_id

matnr

charg

FROM mseg

INTO TABLE i_mseg

WHERE matnr IN s_matnr

AND charg IN s_charg.

IF NOT i_mseg[] IS INITIAL.

SELECT vbelv

vbeln

vbtyp_v

vbtyp_n

INTO TABLE i_vbfa

FROM vbfa

FOR ALL ENTRIES IN i_mseg

WHERE vbeln = i_mseg-mblnr

AND posnn = i_mseg-line_id

AND vbtyp_n = 'R'

AND vbtyp_v = 'J'.

**************************************

please help !

Thanks

Jaif