Skip to Content
0
Former Member
Nov 29, 2005 at 08:12 AM

small problem

70 Views

Hi to all,

any one tell me that iam getting purchase order/netprice(purchase) for some material which is not having purchase order and purchase price.....can u help me to rectify the error.

TABLES: vbap,vbak, eipa, eina.

type-pools: slis.

data : BEGIN OF itabVBAK occurs 0,

VTWEG type vbak-vtweg, "distribution channel

VKORG type vbak-vkorg, "sales org

KUNNR type vbak-kunnr, "customer

AUART type vbak-auart, "sales docu type

MATNR type vbap-matnr, "material

AUDAT type vbap-audat, "sales docu date

NETPR type vbap-netpr, <b>"netprice sales</b>

ARKTX type vbap-arktx, "sales order item

VBELN type vbap-vbeln, <b>"sales order</b>

VRKME type vbap-vrkme, "sales unit

WAERK type vbap-waerk, "plant

NETWR type vbap-netwr, "netvalue

KWMENG type vbap-kwmeng, "quantity

PREIS type vbap-netpr, <b>"purchase netprice</b>

MATNR1 type vbap-MATNR, "material

INFNR type EIPA-INFNR, "record no

PREDI type VBAP-NETPR, "price diff(new field)

BEDAT type EIPA-BEDAT, "purchase docu date

EBELN type eipa-ebeln, <b>"purchase order</b>

end of itabvbak.

DATA: PREIS LIKE EIPA-PREIS ,

matnr1 like eina-matnr,

PREDI LIKE VBAP-NETPR,

EBELN like EIPA-EBELN,

BEDAT like EIPA-BEDAT.

&----


*& Form DATA_RETRIEVAL

&----


  • Retrieve data form VBAK table and populate itab it_VBAK

----


form data_retrieval.

data: ld_color(1) type C.

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

into corresponding fields of table itabvbak 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 VBAK~VKORG in s_VKORG.

loop at itabvbak.

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

itabvbak-matnr.

ITABVBAK-matnr1 = eina-matnr.

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

ITABVBAK-PREIS = eipa-preis.

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

ITABVBAK-EBELN = eipa-EBELN.

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

ITABVBAK-BEDAT = eipa-BEDAT.

ITABVBAK-PREDI = ITABVBAK-NETPR - ITABVBAK-PREIS.

modify itabvbak.

endloop.

endform. " DATA_RETRIEVAL

Thanks in advace.

raju.

Message was edited by: mpr raju