cancel
Showing results for 
Search instead for 
Did you mean: 

how to find no of days in a factory calender using shipping point.

Former Member
0 Kudos

Hi,

In my Rreport two fields are there 'Requested date' and 'confirmed date'.

Requested date is featching from VBEP-EDATU field based on sales document and Sales Document Item. (Considering only first line item value)

Confirmed date is featchning from VBEP-EDATU field based on sales document (VBELN) Sales Document Item (POSNR) and Delivery Schedule Line Number (ETENR).

Now I need to find out no of days late.

I am populating this field like below:

If the requested date is later than or equal to the confirmed date, then the value in this column should be zero.

If the requested date is earlier than the confirmed date, use the factory calendar of the shipping point to calculate the number of days late.

Let me know you need more clarification.

Regards

Kiran.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

You can find the factory calendar attached to a delivering plant using the below logic


        SELECT SINGLE fabkl INTO lv_fcalid
          FROM t001w
            WHERE werks = vbap-werks.

Once you get the factory calendar id, you can input your calculated date and find out next working day in factory calendar using the function below


          CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
            EXPORTING
              correct_option          = '+'
              date                    = lv_input_date
              factory_calendar_id     = lv_fcalid
           IMPORTING
              date                    = lv_output_date
*             FACTORYDATE             =
*             WORKINGDAY_INDICATOR    =
           EXCEPTIONS
              calendar_buffer_not_loadable       = 1
              correct_option_invalid             = 2
              date_after_range                   = 3
              date_before_range                  = 4
              date_invalid                       = 5
              factory_calendar_not_found         = 6
              OTHERS                             = 7.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Kiran,

You are taking only VBEP - EDATU for calculating the difference between requested and confirmed date's ,instead of that go as

per below.

Requested delivery date is VBAK - VDATU and confirmed date is VBEP - EDATU, through this both table fields you can

calculate the margin day's and write the logic according to requirement.

Regards

Ram

Former Member
0 Kudos

You need to ask your abaper to write code via se38 to fulfill this requirement.