07-20-2010 3:39 PM
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
07-20-2010 3:46 PM
Hi Kumar,
Notice that PARVW domain has a Conversion Routine. May be yo need to "pass" WE value though it before executing the SELECT clause.
Also you may develop an index with the requiered fields. For me it's not the best option, I'm not "good friend" of developing lots of indexes, but may be in your case it helps.
I hope it helps.
Kind regards,
Marcela.
07-20-2010 3:50 PM
This should not be a problem.
Unless you are calling this in some sort of LOOP??
Rob
07-20-2010 3:54 PM
07-20-2010 4:12 PM
Table VBPA has an index on PARVW and KUNNR, so it shouldn't cause a problem if you are doing a single SELECT.
Are you sure this isn't in a routine that is called inside a LOOP?
How many records should be returned?
Have you run ST05 against this?
Rob
07-20-2010 4:46 PM
Hi Kumar,
I will recommend with the below solution:
1. Select vbeln from vbrk...gt_vbeln
where kunag = sold-to-party.
2. if gt_vbeln[] is not initial.
Select from vbpa...
for all entries in gt_vbeln
where vbeln = gt_vbeln-vbeln
and parvw = 'WE'. "Ship to party
endif.
If you have any qn / concern on the above soln, please let me know.
Regards,
Selva K.
Edited by: Selvakumar Krishnan on Jul 20, 2010 9:21 PM
07-28-2010 3:44 PM
07-28-2010 3:59 PM
Moderator message - When closing old threads, there is no need to add a comment. Adding a pasted answer like "Answered" only brings old threads to the top of the forum list and pushes current ones down. If you do add a comment, please indicate just how the problem was resolved. Additionally, if you assign po1nts to helpful answers, that will encourage people to help with your next problem. Rob