cancel
Showing results for 
Search instead for 
Did you mean: 

How to Compare the Delivery date in sales order and Select that Largest future Delivery date?

Former Member
0 Kudos

Hi ,

How to compare the Delivery date in Sales Order and How to select the Largest Future Delivery date?

Issue: I want to Select the largest Future Delivery date for Creating Outbound Delivery.

In My sales Order i having 4 more line items each line times having different Delivery date.

To create Complete delivery in one day, i need to select Largest Delivery date from sales Order.

How can i Select the Largest Delivery Date from sales order.

Help me to resolve this issue.

Thanks

Sankar P.

Accepted Solutions (0)

Answers (1)

Answers (1)

ravi_lanjewar
Contributor
0 Kudos

Below mention logic is only for single sales order multiple item. For multiple sales order item you have to make necessary changes in logic.

Before using the logic please make the necessory data declaration in the program...

loop at sales_order  assigning <fs_cur>.

   if <fs_prv> is assign.

      if <fs_cur>-date > <fs_prv>-date.

        larg_date = <fs_cur>-date.

      endif.

   else.

       larg_date = <fs_cur>-date.

   endif.

endloop.

"Compare last item which miss to check in loop.

if sy-subrc eq 0.

      if <fs_cur>-date > <fs_prv>-date. 

        larg_date = <fs_cur>-date.

      endif.

endif.