Skip to Content
0
Former Member
Jul 20, 2010 at 02:39 PM

How to fetch Billing Document Number

18 Views

Hi All,

i have Sold to party (kunnr), from this i need to find Billing document number and the corresponding Ship to party.

i have used

SELECT vbeln FROM vbpa INTO TABLE gt_vbeln

WHERE PARVW = 'WE' AND

kunnr = p_kunnr.

if gt_vbeln is NOT INITIAL.

SELECT KUNNR FROM vbpa

INTO TABLE gt_kunnr

FOR ALL ENTRIES IN gt_vbeln

WHERE vbeln = gt_vbeln-vbeln AND

PARVW = 'AG'.

DELETE ADJACENT DUPLICATES FROM gt_kunnr COMPARING ALL FIELDS.

ENDIF.

the first select query is taking long time n it is going for dump, please suggest me the solution.

Regards,

Kumar