abap - selecting in 4 tables with conditions -


i need select vbeln likp , have select vbeln has been marked 'c' in vbuk. , likp-vbeln(delivery) have search/select carrier in vekp , after searching carrier have search/select shiptype table. have table 7 fields, in code below im selecting deliveries dont know how add condition in vbuk table because dont need select vbuk. thanks. code below:

select likp~vbeln      tab~shiptype      vekp~carrier      vekp~service      count( distinct vekp~shipment )      sum( vekp~packagecount )      sum( vekp~rate ) vekp   inner join tab   on tab~carrier = vekp~carrier inner join likp   on vekp~delivery = likp~vbeln itab   likp~erdat in so_date ,         vekp~delivery = likp~vbeln ,         vekp~carrier = tab~code         group vbeln shiptype carrier service. 

you don't need select table in order join on it, add vbuk join.

i notice haven't included clause, needed when use field-list.

something like:

select likp~vbeln  tab~shiptype  vekp~carrier  vekp~service  count( distinct vekp~shipment )  sum( vekp~packagecount )  sum( vekp~rate )  (field1, fied2, etc)                    "<=== change1 vekp inner join tab   on tab~carrier = vekp~carrier inner join likp   on vekp~delivery = likp~vbeln itab inner join vbuk                              "<=== change2   on likp~vbeln = vbuk~vbeln likp~erdat in so_date ,     vekp~delivery = likp~vbeln ,     vekp~carrier = tab~code ,     vbuk~fieldtocheck = 'c'                  "<=== change3 group vbeln shiptype carrier service. 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -