Skip to Content
author's profile photo Former Member
Former Member

small problem

Hi to all,

according to my report...i have compared the <b>prices</b> of SALES and PURCHASES...

So every material have different sales orders...with different prices...

here problem is........purchase price comparing with all the sales orders....means repeating.....(only one purchase order for a particular material...but it is showing with all the sales orders..repeatedly)....finally in the result the total purchase netprice is wrong....

may be my select query is wrong...can u check once...

select VBAP~matnr

VBAK~VTWEG

VBAK~VKORG

VBAK~KUNNR

VBAK~AUART

VBAP~AUDAT

VBAP~NETPR

VBAP~ARKTX

VBAP~VRKME

VBAP~WAERK

VBAP~NETWR

VBAP~vbeln

VBAK~BSTNK

vbap~kwmeng

vbak~bstdk

VBAP~AUFNR

into corresponding fields of table mylist from VBAP

inner join VBAK

on VBAPVBELN = VBAKVBELN

where VBAK~kunnr in s_kunn1

and VBAP~AUDAT in s_AUDAT

and VBAP~MATNR in s_MATNR

and VBAK~AUART in s_AUART

and VBAK~VTWEG in s_VTWEG

and VBAP~AUFNR in s_AUFNR

and VBAK~VKORG in s_VKORG.

loop at mylist.

CLEAR: EINA, EIPA.

select single INFNR from eina into eina-infnr where MATNR =

mylist-matnr.

mylist-matnr1 = eina-matnr.

select single PREIS from eipa into eipa-preis where infnr = eina-infnr.

mylist-PREIS = eipa-preis.

select single EBELN from eipa into eipa-EBELN where infnr = eina-infnr.

mylist-EBELN = eipa-EBELN.

select single BEDAT from eipa into eipa-BEDAT where infnr = eina-infnr.

mylist-BEDAT = eipa-BEDAT.

mylist-PREDI = mylist-NETPR - mylist-PREIS.

modify mylist.

endloop.

raju.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2005 at 12:14 AM

    Hi Raju,

    I have not thoroughly gone through your code but what i can immediately make out is that you have not cleared your internal table in loop. This might be a possible reason for values getting replicated.

    Just add-

    modify mylist.

    ****Added code *****

    clear mylist.

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

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2005 at 01:19 AM

    Hi Raju,

    Values are not repaeting in my opinion. Please add VBELN and POSNR to your table then you can recognise they are belongs to different documents.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2005 at 05:58 AM

    I don't think clearing is a problem....

    as Murthy said , if you add vbeln posnr then you can see the difference...

    though they are looking like duplicates but they are attached to different sales order,item...

    please try to add vbeln,posnr to mylist and check ....

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.