Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Select quries

Former Member
0 Likes
544

In my report i have selection screen like below

Purchasing Document

Supplying Site

Receiving Site

Created on

Delivery

Delivery Date

Billing Document

Billing date

Purchasing Doc. Type

now from Delivery , Delivery Date and Billing Doc i want to fire qurie how to do that ?

below is my select quries which i did for P.O, Suppling site , receiving site. and Created on date.

SELECT ebeln bsart aedat lifnr

FROM ekko

INTO TABLE it_ekko

WHERE ebeln IN pr_ebeln

AND lifnr IN pr_lifnr

AND aedat IN pr_aedat

AND bsart = pr_basrt.

IF it_ekko IS NOT INITIAL.

SELECT ebeln ebelp aedat txz01 matnr menge meins

FROM ekpo

INTO TABLE it_ekpo

FOR ALL ENTRIES IN it_ekko

WHERE ebeln = it_ekko-ebeln

AND werks IN pr_werks.

ENDIF.

IF it_ekpo IS NOT INITIAL.

SELECT vbeln posnr erdat lfimg meins vgbel " For Delivery

FROM lips

INTO TABLE it_lips

FOR ALL ENTRIES IN it_ekpo

WHERE vgbel = it_ekpo-ebeln.

ENDIF.

IF it_ekpo IS NOT INITIAL.

SELECT ebeln ebelp eindt " For Delivery Date EKET

FROM eket

INTO TABLE it_eket

FOR ALL ENTRIES IN it_ekpo

WHERE ebeln = it_ekpo-ebeln

AND ebelp = it_ekpo-ebelp.

ENDIF.

*" For Delivery Stock Transf

IF it_ekpo IS NOT INITIAL.

SELECT ebeln ebelp vgabe belnr bewtp budat menge

FROM ekbe INTO TABLE it_ekbe_del

FOR ALL ENTRIES IN it_ekpo

WHERE ebeln = it_ekpo-ebeln

AND ebelp = it_ekpo-ebelp

AND vgabe = '8'

AND bewtp = 'L'. " DlNt

*F o r G o o d s R e c e i p t.... GR

SELECT ebeln ebelp vgabe belnr bewtp budat menge

FROM ekbe

INTO TABLE it_ekbe_e

FOR ALL ENTRIES IN it_ekpo

WHERE ebeln = it_ekpo-ebeln

AND ebelp = it_ekpo-ebelp

AND vgabe = '1'

AND bewtp = 'E'. " F O R GR

*F o r I n v o i c e R e c e i p t.... IR

SELECT ebeln ebelp vgabe belnr bewtp budat menge

FROM ekbe

INTO TABLE it_ekbe_q

FOR ALL ENTRIES IN it_ekpo

WHERE ebeln = it_ekpo-ebeln

AND ebelp = it_ekpo-ebelp

AND vgabe = '2'

AND bewtp = 'Q'.

  • " F O R G I

SELECT ebeln ebelp vgabe belnr bewtp budat menge xblnr

FROM ekbe

INTO TABLE it_ekbe_u

FOR ALL ENTRIES IN it_ekpo

WHERE ebeln = it_ekpo-ebeln

AND ebelp = it_ekpo-ebelp

AND bewtp = 'U'. " F O R G I

ENDIF.

*************point is assured***********

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
522

Hi Jim,

You can select all deliveries from LIPS where VGBEL <> space and VGTYP = 'V' (Purchase Order).

Regards,

John.

Hi Jim,

You can select all deliveries from LIPS where VGBEL <> space and VGTYP = 'V' (Purchase Order).

Regards,

John.

2 REPLIES 2
Read only

Former Member
0 Likes
523

Hi Jim,

You can select all deliveries from LIPS where VGBEL <> space and VGTYP = 'V' (Purchase Order).

Regards,

John.

Read only

Former Member
0 Likes
522

HI dear,

As you have mentioned from Delivery , Delivery Date and Billing Doc i want to fire qurie how to do that ?

Just write

Select a b c( fields)

from table name

into target area

where A in s_delevery

and B in Billing document.

however if you ar eusiong entries from above table u can also use " For all entries in itab."

Select a b c( fields)

from table name

into target area

For all entries in itab

where C = itab-c

and A in s_delevery

and B in Billing document.

Don know if this is wat u wanted..

But in case of any clarification u can call me @9881191759

.please amrk q as answered and reward if my soltn helps you!!!

Regards,

Neeraj