跨国工厂的话,休息日历是不同的,所以需要t001w的fabkl这个字段来判断该工厂应用哪个工作日历。
Data: l_DATE TYPE SY-DATUM,
l_fabkl TYPE t001w-fabkl.
SELECT SINGLE fabkl INTO l_fabkl FROM t001w WHERE werks = p_werks
“当获取下一个工作日时,参数correct_option设为’+’ ,当获取上一个工作日时参数correct_option设为‘-’.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
correct_option = '+'
date = sy-datum
factory_calendar_id = l_fabkl
IMPORTING
date = L_DATE.