cancel
Showing results for 
Search instead for 
Did you mean: 

List of open Sales order in a plant.

Former Member
0 Kudos

Hi,

I need to pick up all the sales order for one particular plant with all open status (which do not have any delivery document)

I want to write a SQL qurrey can any one help me with logic pla how to join and which fields will help me to get that open orders data.

Thanks,

T.Nishanth

Accepted Solutions (1)

Accepted Solutions (1)

former_member184555
Active Contributor
0 Kudos

Hi

Please follow the below process to add plant in the further selection criteria of VA05.

Goto IMG - Sales & Distribution - Sales - Lists - Define Selection Criteria - execute

In the screen - goto New Entries and add the following details..

1. Program Name - SAPMV75A

2. TRG (Transaction Group) - 0

3. Display Group - K

4. Event - SELK

5. It - 8

6. Field Name - WERKS

Enter the details and save the changes. Goto VA05 and you can see the field PLANT in the Fur Sel Criteria.

Thanks,

Ravi

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Use table VBBE (standard index with werk) with VBTYP = 'C' (not index on this field).

VBBE : individual requirement

VBBS : collective requirement

This table is smaller than VBAP (or VBAPMA).

Regards,

Lionel

Former Member
0 Kudos

select * from vbap client specified into table ivbap

where mandt = sy-mandt and

werks = 'Plant'.

itvbap[ ] = ivbap[ ].

loop at ivbap.

select single * from vbfa client specified

where mandt = sy-mandt and

vbelv = ivbap-vbeln.

if sy-subrc eq 0.

delete itvbap where vbeln = ivbap-vbeln.

endif.

endloop.

Now , the resultant itvbap will have open orders.

saravanan

Edited by: k saravanan on May 14, 2008 11:17 AM

Former Member
0 Kudos

Further to my earlier thread , please ensure that VBAP has got index on plant , if not create one index and transport .

saravanan

former_member183879
Active Contributor
0 Kudos

Hi,

Find out the list of open orders by fetching the details of VBAK-VBELN where

VBUK-VBELN = VBAK-VBELN and VBUK-LFSTK equals A(Not yet processed)

Once all the VBAK-VBELN is fetched.

SELECT VBAP-VBELN where

VBAP-VBELN = VBAK-VBELN(which we have got already)

and VBAP-WERKS = desired plant number

Hope this helps.

You can reward if this helps you

former_member184555
Active Contributor
0 Kudos

Hi

you can add plant in the further selection criteria in VA05. Then you can search for open orders in that particular plant.

You can do this customisation in IMG-SD-Lists-Update...(next to update partnerindex)

Thanks,

Ravi