Netdue date alteration with next working day

Hi,
I have one report for Accounts Receivables .
In this when net due date falls on holiday, i need to shift this "net due date"  to a next working day.
I have one FM "DATE_CONVERT_TO_FACTORYDATE" which i can use for the purpose.
As a input to this FM we need to give Factory calendar ID which is an attribute to Infoobject 0PLANT.
Unfortunately i do not have 0PLANT in my datamodel. But i do have 0COMP_CODE in my datamodel.
As i do not have any link between Factory calendar ID and 0COMP_CODE i am searching for an appropriate solution so that i could use this FM to shift net due date to Next working if the net due date is an holiday.
Any Ideas?

Simran
I am not sure if we can get a direct link from 0plant to 0comp_code, but you can enhance the master data of the 0company code to add the factory caledar and load them manually into 0plant.
Let me know if this helps..
Regards,
Avinash

Similar Messages

  • Billing date of 2nd/4th saturday getting pushed to next working day.

    whenever my client trying to create bill of service order, bills on 2nd/4th saturday, the billing date is getting pushed to next working day. I checked their calender, they have maintained 2nd/4th saturday as holiday in holiday calender. However the validity is only till 2009. But the bills are getting still getting pushed. Am not too keen on using validation, please help.

    Hi,
    Are they creating invoices thru back ground ( using batch job ) ? in this case in the holiday calendar 2n'd and 4'th saturday is holiday, so the system is proposing new work day. you have to check all the three calendars once again let me know.
    Thanks,
    Chandu.

  • Function  in param, start_date & number , return sums next working day

    Hi Friends,
    I need a funtion which can take in parameters as start_date and number , sum them as new date and return new_start_date as workind day.
    Suppose '15-SEP-2009' + 6 should return 23-SEP-2009 as new date.
    Basically the sum of date and number should return next working day (excluding saturday,sunday).
    e.g '15-SEP-2009' + 6 =21-SEP-2009 , but it includes saturday and sunday , so it should return 23-SEP-2009.
    Thanks
    Niren

    Hi, Niren,
    The first respondent gave a better function for testing for work days (Monday through Friday). If there's a bug with Saturdays, I'm sure that can fixed. Also,that function depends on your NLS settings. If that's an issue for you, that can be fixed, too. The idea that there are 5 work days in any 7 consecutive days will cut down the execution time considerable.
    A function like I suggested would be useful if you had to consider holidays as well as weekends.
    Here's an untested example:
    CREATE OR REPLACE FUNCTION  work_days_away
    (      in_start_date         DATE
    ,      in_day_cnt         NUMBER
    RETURN     DATE
    DETERMINISTIC
    IS
         IF  in_start_date - TRUNC (in_start_date, 'IW') >= 5
         OR  is_holiday (in_start_date)
         THEN
              RETURN  work_days_away ( in_start_date + 1
                               , in_day_cnt
         ELSIF  in_day_cnt >= 1
         THEN
              RETURN  work_days_away ( in_start_date + 1
                               , in_day_cnt    - 1
         ELSE
              RETURN  in_start_date;
         END IF;
    END     work_days_away;This use the date format 'IW', which does not depend on NLS settings, rather than 'D', which does.

  • Calculate next working day in future

    Hi,
    I hope somebody of you could help me here. I have the requirement to find the next working day 2 days after the visit. I need to join two tables which have an N to N relation.
    This is the first source table tbl_cust with customer and visiting day:
    customer_id    Name     visit_day       company_id
    1                   Tobias    27.08.2011  100
    2                   Hans      30.08.2011  100
    3                   Lars       27.08.2011   200
    4                   Dave      29.08.2011   200The second table tbl_comp_days includes the days where the different companies work:
    company_id  company_day    working_day (yes/no)
    100             27.08.2011       no
    100             28.08.2011       no
    100             29.08.2011       yes
    100             30.08.2011       yes
    100             31.08.2011       yes
    100             01.09.2011       yes
    200             27.08.2011       yes
    200             28.08.2011       yes
    200             29.08.2011       no
    200             30.08.2011       yes
    200             31.08.2011       yes
    200             01.09.2011       yesNow I want to calculate the second next work of the company joined with the customer visit_day
    Means: tbl_cust.visit_day + 2
    when tbl_comp_days.working_day is yes
    if tbl_cust.visit_day is not a working day find the next possible working day + 2 working days
    Output example:
    customer_id    Name     visit_day       visit_day_plus_2
    1                   Tobias    27.08.2011  31.08.2011
    2                   Hans      30.08.2011  01.09.2011
    3                   Lars       27.08.2011   30.08.2011
    4                   Dave       29.08.2011   01.09.2011Thanks for your help
    Tobias

    Hi, Tobias,
    Here's one way:
    WITH     got_r_num    AS
         SELECT     c.customer_id, c.name, c.visit_day, d.company_day  AS visit_day_plus_2
         ,     ROW_NUMBER () OVER ( PARTITION BY  c.customer_id
                                   ORDER BY          d.company_day
                           )         AS r_num
         FROM    tbl_cust       c
         JOIN     tbl_comp_days  d  ON   c.company_id  = d.company_id
                                 AND  c.visit_day   < d.company_day
                          AND  c.visit_day   >= d.company_day + 10     -- See note
         WHERE   d.working_day       = 'yes'
    SELECT     customer_id, name, visit_day, visit_day_plus_2
    FROM     got_r_num
    WHERE     r_num     = 2
    ;If you'd post CREATE TABLE and INSERT statements for the sample data, then I could test it.
    The last join condition ( c.visit_day >= d.company_day + 10) isn't strictly necessary. Depending on the size of the company_day table, it may make execution faster, by limiting the join to days soon after visit_day, rather than any time after visit_day. As I wrote it, it assumes that there will always be at least 2 working days in any period of 10 consecutive days. (In my company, there are always at least 2 working days in a period of 5 consecutive days.) You cam change the "magic number" 10 to anything else, or you can omit that condition altogether.
    Edited by: Frank Kulash on Aug 23, 2011 10:49 AM
    Added note.

  • Date calculations based on working days

    I need to add date calculations to a worksheet to show the time elapsed between two actions.
    Just a straightforward subtraction works fine, but what I really need to be able to do is calculate the number of working days between the two point (as something taking 5 days over Christmas with the 2 bank holidays is different equivalent to something taking 3 days in a normal week)
    At the moment I'm exporting the data into excel for analysis of this, but would really like to be able to do it in Disco so that the end users can go straight to the report using viewer, rather than having to do the conversion for them.
    Is this possible?
    Cheers

    Hi,
    Every thing is possible, the Q is how complicated is it....
    My suggestion is to create a table with all the dates of the non-working days for ex:
    create a table with all the MON-THURSDAYS, union to this table the holidays you know of such as christmas and so on.
    After getting this table you can create a function that returns the number of working days between 1 date to another by subtracting the days exists in this table.
    I started with that, you are more then welcome to get ahead with it and let us know what happened...
    create table holiday
    D_date date,
    d_day varchar2(20)
    create or replace procedure holiday_proc is
    d_date date;
    begin
    d_date := trunc(sysdate);
    while d_date<'01-jan-2010'
    loop
    if to_char(trunc(d_date),'Day') not in ('Saturday ','Sunday ') then
    INSERT INTO Holiday (d_date,d_day)
    (select trunc(d_date),to_char(trunc(d_date),'Day') from dual);
    end if;
    d_date := d_date+1;
    end loop;
    commit;
    end holiday_proc;

  • Function Module for Date/ Time difference in Working Days

    Hi all,
    Are there any function modules which will calculate the difference between a date AND time, but in working days?
    I can use the FIMA_DAYS_BETWEEN_TWO_DATES_2 FM for the dates, but I need to include times in this as well.
    This is for situations where the 'starting date' is a non-working day, and the 'end date' is a working day.  In this situation I need to take all the hours and minutes into account, which happened on the working day.  To give an example -
    Start date:  04.07.2010 (Sunday - Non working day)
    Start time:  21:12:36
    End date:  05.07.2010 (Monday - Working day)
    End time:  04:47:24
    I realise there is a Time option in this function module, but when I test it, it doesn't seem to be returning the desired results (returns 0 for days and time).  I am using '5' as the I_STGMETH and 'GB' as the I_SKALID. 
    I need a calcuation which will return the time, post midnight on the working day - in this example, 4 hours, 47 minutes (seconds are optional!).
    Can anyone help? - can I still use FIMA_DAYS_BETWEEN_TWO_DATES_2 but with different parameters?
    Thanks
    Mischa
    Edited by: Mischa Gulseven on Jul 20, 2010 10:40 AM

    Hi,
    Thanks but this FM does not seem to account for working days.
    For example, if I use:
    DATE1                           04.07.2010  (non working day)
    TIME1                           04:00:00
    DATE2                           05.07.2010   (working day)
    TIME2                           21:00:00
    It will give the following results -
    DATEDIFF                                                      1
    TIMEDIFF                                                     17
    EARLIEST                        1
    I don't want to account for the non-working day so the result I actually want would be to calculate from midnight on 05.07 to 21:00 on 05.07 which should be 21 hours.
    I suspect I probably need to include the STGMETH and the factory calendar somewhere in the FM?
    Does such a FM exist, or could anyone help me with some ABAP for this?
    thanks
    Mischa

  • FM for Holiday & Next Working day

    HI All,
    Please suggest any  single FM, which can give the current day is Holiday or not. If, Yes, the what is the next working day for a Facorty calender ID.
    Both validation should be happend in a single FM.
    Thanks & Regards,
    Prabhakar.
    Moderator message: FAQ, please search for previous discussions of this topic.
    Edited by: Thomas Zloch on Apr 18, 2011 6:13 PM

    hi ,
    Pls check this FM
    CALL FUNCTION 'BKK_CHECK_HOLIDAY'
            EXPORTING
              i_date            = wf_cntdt
              i_calendar1       = 'B1'
            IMPORTING
              e_x_no_workingday = wf_holi.
    *get actual working days upto report date.
      it_act_work_days-dat_from  = w_date-low.
      it_act_work_days-dat_to    = w_date-high.
      APPEND it_act_work_days.
    *calculate actual working days.
      CALL FUNCTION 'WFCS_FCAL_WDAYS_GET_S'
        EXPORTING
          pi_time_interval = it_act_work_days
          pi_fcalid        = 'B1'
        IMPORTING
          pe_wdays         = wf_actdays.
    regards
    Deepak.
    Edited by: Deepak Dhamat on Apr 18, 2011 12:31 PM

  • Delivery Date should propose only working days (Excluding weekends and holidays

    Hello All
    I have one requirement here, where delivery dates should propose only working days and it should not allow to add weekends and holidays during the creation of sales order.
    I would like to know if there are any standard settings to be done in plant or shiping point?
    Kindly need all your input on this
    Thanks
    Naveen

    Hello All
    Same calendar has already been assigned in shipping point,plant and sales org and also in the calendar holidays been maintained, even though when we create a sales order it will accept weekends and holidays
    Thanks

  • URGENT: Add Non-working day value to the next working day

    Hello expertz!
    I have a requirement were i need to shift the values of the non-working days to the next working day. The report allready works, showing only the values for the working days, but for example if i have the amount of 100 on 06.12.2009 (saturday) i want that this value is added to the amount of 09.12.2009, which is the next working day.
    Does anybody knows a solution to do this? Is this possible in BEx?
    Please advise if you think this is not possible.
    Thanks for the help.
    Nuno

    Hi Anil,
    I really appreciate your suggestion, but i'm still not getting the point. How to store the value of the non-working day in a variable and then add it where? Can you please clarify?
    Thank you very much for your help.
    Nuno

  • I need FM calc. days/months/years between 2 dates but computes the work day

    I need FM calc. days/months/years between 2 dates but computes the work day.
    someone knows ?

    Hi,
    The FM is 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    Check the following example:
    DATA: EDAYS   LIKE VTBBEWE-ATAGE,
          EMONTHS LIKE VTBBEWE-ATAGE,
          EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
                TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
      I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.
    Regards,
    Bhaskar

  • Sales Order : Calcul delivery date with only working days

    HI,
    When I create sale order, the delivery date is calculed with the number of days mentionned in type of sale document. SAP add this number of days into the day's date.
    Is it possible to calculate this delivery date only with working days in the corporate calendar ???
    Thank's

    HI
    Delivery date in the Sales order will be calculated the calender only basedon the Transportation lead time and Pick/Pack time and excluding the holidays
    Please cross the same in your instance
    Regards,
    Ram.

  • Current Workday SAP EXIT variable not aligned with correct work days

    Hello,
    I am trying to use the Current Workday variable within a report so that the data will only be refreshed when the calendar day is Monday - Friday. Users look at this report every day, but when they get the report on Monday we would like for the date to be restricted to the previous Friday, and then switch back to Monday's date when they view the report on Tuesday. In order to do this we have placed the Current Workday variable from the Calendar Date characteristic with an offset of negative 1, but it is showing Sunday's date when they look at the report on Monday.
    My questions are:
    -Does this variable use the factory calendar that can define the work days?
    -If so, which Factory calendar does it use? I have gone to the Tcode SCAL but I can see there are many different factory calendars and I have no idea which calendar this variable pertains to. I have also transferred the global settings for the factory calendar from the source system, and I see no change within the variable.
    -How can I see the program name behind this SAP Exit variable? My thinking is that I could at least look at the code to see if perhaps I can find out the factory calendar ID the variable refers to from there.
    Any help on this would be greatly appreciated! Until this is fixed I have to manually adjust this report every Monday and Tuesday morning!! Not ideal.

    Hi Kelly,
    I am not sure whether this can be done by an SAP Exit variable.
    But you may try this using a Customer exit variable by using the Function module DATE_COMPUTE_DAY.
    The function module "DATE_COMPUTE_DAY" will return the day by 1 to 7 when you input date.
    Monday : System will return value = 1
    Tuesday : System will return value = 2
    Wednesday : System will return value = 3
    Thursday : System will return value = 4
    Friday : System will return value = 5
    Saturday : System will return value = 6
    Sunday : System will return value = 7
    So input sy-datum to this FM and find the number of day. If it is Monday, the number will be 1.
    If output is 1, then offset date by -3 to that of Friday, else offset by -1 to previous day.
    Hope this helps,
    Regards,
    Hari

  • How to set the payment Due date calculation as per working days.

    how to make changes in the vendor Payment terms so that while calculating the Payment due date as per Payment terms, system calculates it based on Working Days & not the Calender days ?
    Help is much appriciated.
    Thank you,
    Amit

    Hi,
    This is the standard settings by SAP, normally we couldn't change it to working day.
    Good luck
    Tao

  • Schedule line confirmation on next working day

    Hi,
    For a sales org, (IE93) in a sales order if we request delivery on 25.12.2009 (Xmas day), APO availability check is performed and it is confirming on the next/prior working day.
    But in case of other sales org(GB93) it is confirming on the same day(on Xmas itself, which is a holiday)..
    We want the same control for GB93 also.. Any idea?
    Regards,
    Mayil

    Hi,
    Check the Factory calender Assignmene for these two COMPANY CODES, PLANT, in OVR3
    I believe the Factory calender is different for these two Organisational Units.
    Check the Factory calender settings in OVR3 transaction code
    Please revert back if you need further details
    thanks,
    santosh

  • Identifying the date as holiday or working day

    hi
    if a date is given then how to find, that day is holiday or working day.
    plz reply soon.
    regards
    kq

    Hi..
    You can find it by calling the FM <b>DAY_ATTRIBUTES_GET </b>
    DAY_ATTRIBUTES_GET : Return useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuesday), whether the day is a holiday, and more.
    reward if Helpful.

Maybe you are looking for