on 03-03-2012 12:33 AM
Hi Guys,
I am getting Original GI Date as After deducting Transit time from Original Delivery Date.
But i want to fullfill the below requiremnt also.
the Original GI Date should be then the working day defined in the calendar of the shipping point. Thus if the calculation gives Original GI Date to be Sunday 4.3.2012 then it should changed to the closest previous working date which is Friday 2.3.2012 (calendar 'YT').
Any one help me how to execute the above requiremnt.
regards
reddy.
Hi,
Pass your GI date to below given FM, it will return you the day of the week.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
DATE = GI_DATE
IMPORTING
DAY = day_of_week_num
EXCEPTIONS
OTHERS = 8.
the value returned by this FM in day_of_week_num will be between 1 to 7, 1 representing Monday and 6 = Saturday and 7 = sunday.
Now if your working days are from monday to friday then simply check the value returned by this FM is it is 6 then you can subtract 1 for last friday or add 2 for next monday and in the same fashion if value returned is 7 then subtract 2 for last friday and add 1 for next monday in GI date.
For adding and subtracting value from GI date you can use FM RP_CALC_DATE_IN_INTERVAL. And if you need to check some settings related to Factory calander then you can use FM DATE_CONVERT_TO_FACTORYDATE.
Regards,
Durgesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.