Age: 160 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Fri Jun 17, 2011 11:51 am Post subject: Link MSEG, MKPF and VBAK
Code:
( ( mseg AS p
INNER JOIN mkpf AS f ON p~mblnr = f~mblnr AND
p~mjahr = f~mjahr )
INNER JOIN vbak AS b ON b~vbeln = p~kdauf ).
or
Code:
SELECT DISTINCT mkpf~mblnr "mat doc number
mkpf~budat "posting date in doc
mkpf~xblnr "ref doc number
vbak~vbeln "sales order
vbak~auart "sales order type
vbak~vkorg "sales org
vbak~vtweg
vbak~spart
INTO CORRESPONDING FIELDS OF TABLE report_table
FROM mkpf AS mkpf
INNER JOIN lips AS lips ON lips~vbeln = mkpf~xblnr
INNER JOIN vbak AS vbak ON vbak~vbeln = lips~vgbel
INNER JOIN tvko AS tvko ON tvko~vkorg = vbak~vkorg
WHERE mkpf~budat IN s_budat
AND vbak~vbeln IN s_vbeln
AND vbak~vkorg IN s_vkorg
AND vbak~auart IN s_auart
AND vbak~vkorg IN s_vkorg
AND vbak~vtweg IN s_vtweg
AND vbak~spart IN s_spart
AND lips~lfimg > 0.
_________________ Молитва - это запрос разработчику на изменение кода программы.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.