cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Rescheduling (V_V2) Sort order

Former Member
0 Kudos

Hello experts!

have a question on rescheduling sort order:

1) Date -> Sort item by date of creation - Does SAP will consider only date? Or time also considered?

2) Document number - Does SAP takes real document number? What will happen if my sales orders have different number ranges in the same plant? (ex. Range one starts from 46......01; Range two starts from 45.....01) Does that mean that my 46.....01 will be prioritized first?

Thank you for your answers!

Accepted Solutions (1)

Accepted Solutions (1)

former_member223981
Active Contributor
0 Kudos

1) Date -> Sort item by date of creation - Does SAP will consider only date? Or time also considered?

Only the date is considered. The sort is executed here:

SDV03V02 FORM XTAB_SORT

****************************************

IF p_schlv = 'X'.

When on schedule line level use additional sort-criterias.

  SORT xtab BY (LV_SORT1) (LV_SORT2) (LV_SORT3)

               (LV_SORT4) (LV_SORT5) eindt etenr.

ELSEIF p_itemlv = 'X'.

  SORT xtab BY (LV_SORT1) (LV_SORT2) (LV_SORT3)

               (LV_SORT4) (LV_SORT5).

ENDIF.

****************************************

As you can see, the system is sorted according to 5 fields - these are the 5 fields you see in the selection screen. And as the created time is not one of the fields, it will not be considered.

However, normally, the earlier created sales order will be a lower number than the later created sales order so it should then be sorted accorded to that number consider the following example that I just tested with:

- Stock is 0

- Sales Order 896 is created with creation date = 25.02.2014 & creation time 11:09:15. Confirmed quantity is 0

- GM posted. Now stock is 100.

- Sales Order 897 is created with creation date = 25.02.2014 & creation time 11:10:04. Confirmed quantity is 100.

I execute V_V2 with the following sort:

Document category               3


Delivery priority                      2
Date                                       1


Document number                 4
Document item                      5

So in this case, LV_SORT1 = "ERDAT". Both of the above orders have the same ERDAT (Creation Date in VBAK). LV_SORT2 = "LPRIO", LV_SORT3 = "SORT_DOCTYPE". All these values are the same for both orders. Then, LV_SORT4 - "VBELN". Here, the 2 orders differ and 896 is placed at the top of the sort table instead of 897.

SAP Note 1897242 describes a BADI where you can apply your own sort logic. This could be helpful for you.

Former Member
0 Kudos

Hi! and thanks) But that does not answer second question

former_member223981
Active Contributor
0 Kudos

Sorry, didnt have enough time this morning to check your 2nd question in detail.

2) Document number - Does SAP takes real document number? What will happen if my sales orders have different number ranges in the same plant? (ex. Range one starts from 46......01; Range two starts from 45.....01) Does that mean that my 46.....01 will be prioritized first?

The Plant is not considered in the SORT. The system will start with the documents beginning with 45. Then move upwards from there to 46. If you want documents with 46 to be processed first, then you should assign them a higher delivery priority and ensure that the sort priority for delivery priority is higher than for sales document.

The reason that VBELN is used as a sort criteria is explained in the last question in FAQ note 549064.

Hope this helps.

Answers (0)