‎2006 Sep 14 1:06 PM
hi to all,
help me in this issue,
i am having run date &mhnk-ausdt& i want the date after seven days of this date it should be printed in dunning letters how can i do this.
thanks in advance.
kiran kumar
‎2006 Sep 14 1:50 PM
Hello,
Please check the following code,the requirement is same.
DATA: p_day LIKE sy-datum ,
p_day1(10) TYPE c.
DATA: BEGIN OF i_factory_calendars OCCURS 0.
INCLUDE STRUCTURE vtbfcal.
DATA: END OF i_factory_calendars.
*Current date
p_day = sy-datum.
i_factory_calendars-ident = 'Z3'.
APPEND i_factory_calendars.
DO 5 TIMES.
p_day = p_day + 1.
CALL FUNCTION 'DATE_CONVERT_TO_WORKINGDAY'
EXPORTING
date = p_day
direction = '+'
IMPORTING
workingday = p_day
TABLES
factory_calendars = i_factory_calendars.
ENDDO.
MOVE p_day TO p_day1.
CALL FUNCTION 'CONVERSION_EXIT_D3DAT_OUTPUT'
EXPORTING
input = p_day1
IMPORTING
output = p_day1.
READ TABLE out_par WITH KEY 'L_DATE'.
CHECK sy-subrc = 0.
out_par-value = p_day1.
MODIFY out_par INDEX sy-tabix.
ENDFORM. "extract_date
*calculate date form dunning form.
FORM extract_date1 TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy. "03
DATA: p_day LIKE sy-datum ,
p_day1(10) TYPE c.
DATA: BEGIN OF i_factory_calendars OCCURS 0.
INCLUDE STRUCTURE vtbfcal.
DATA: END OF i_factory_calendars.
*Current date
p_day = sy-datum.
i_factory_calendars-ident = 'Z3'.
APPEND i_factory_calendars.
DO 3 TIMES.
p_day = p_day + 1.
CALL FUNCTION 'DATE_CONVERT_TO_WORKINGDAY'
EXPORTING
date = p_day
direction = '+'
IMPORTING
workingday = p_day
TABLES
factory_calendars = i_factory_calendars.
ENDDO.
MOVE p_day TO p_day1.
CALL FUNCTION 'CONVERSION_EXIT_D3DAT_OUTPUT'
EXPORTING
input = p_day1
IMPORTING
output = p_day1.
READ TABLE out_par WITH KEY 'L_DATE'.
CHECK sy-subrc = 0.
out_par-value = p_day1.
MODIFY out_par INDEX sy-tabix.
Regards,
‎2006 Sep 14 1:08 PM
‎2006 Sep 14 1:09 PM
take that into one variable
/: l_date = &mhnk-ausdt&.
/: l_date = l_date + 7.
check out but not sure
‎2006 Sep 14 1:11 PM
hi
it is in scripts, ineed the date in this format 14th sep 2006.
‎2006 Sep 14 1:28 PM
Hi Kiran,
Use DATE MASK to set date format in scripts.
<b>/: SET DATE MASK = 'LD MMM YYYY'
/: &V_DATE&</b>
To tunn off this format,
/: SET DATE MASK = ''
To know more about DATE MASK, just browse this link
http://help.sap.com/saphelp_47x200/helpdata/en/d1/803508454211d189710000e8322d00/frameset.htm
Thanks,
Vinay
‎2006 Sep 14 2:09 PM
Hi Kiran,
v_Date = ur_date + 7.
use 'MONTH_NAMES_GET' FM for getting the month name.
read table with the month(v_date+2(2)).
-Anu.
‎2006 Sep 14 1:50 PM
Hello,
Please check the following code,the requirement is same.
DATA: p_day LIKE sy-datum ,
p_day1(10) TYPE c.
DATA: BEGIN OF i_factory_calendars OCCURS 0.
INCLUDE STRUCTURE vtbfcal.
DATA: END OF i_factory_calendars.
*Current date
p_day = sy-datum.
i_factory_calendars-ident = 'Z3'.
APPEND i_factory_calendars.
DO 5 TIMES.
p_day = p_day + 1.
CALL FUNCTION 'DATE_CONVERT_TO_WORKINGDAY'
EXPORTING
date = p_day
direction = '+'
IMPORTING
workingday = p_day
TABLES
factory_calendars = i_factory_calendars.
ENDDO.
MOVE p_day TO p_day1.
CALL FUNCTION 'CONVERSION_EXIT_D3DAT_OUTPUT'
EXPORTING
input = p_day1
IMPORTING
output = p_day1.
READ TABLE out_par WITH KEY 'L_DATE'.
CHECK sy-subrc = 0.
out_par-value = p_day1.
MODIFY out_par INDEX sy-tabix.
ENDFORM. "extract_date
*calculate date form dunning form.
FORM extract_date1 TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy. "03
DATA: p_day LIKE sy-datum ,
p_day1(10) TYPE c.
DATA: BEGIN OF i_factory_calendars OCCURS 0.
INCLUDE STRUCTURE vtbfcal.
DATA: END OF i_factory_calendars.
*Current date
p_day = sy-datum.
i_factory_calendars-ident = 'Z3'.
APPEND i_factory_calendars.
DO 3 TIMES.
p_day = p_day + 1.
CALL FUNCTION 'DATE_CONVERT_TO_WORKINGDAY'
EXPORTING
date = p_day
direction = '+'
IMPORTING
workingday = p_day
TABLES
factory_calendars = i_factory_calendars.
ENDDO.
MOVE p_day TO p_day1.
CALL FUNCTION 'CONVERSION_EXIT_D3DAT_OUTPUT'
EXPORTING
input = p_day1
IMPORTING
output = p_day1.
READ TABLE out_par WITH KEY 'L_DATE'.
CHECK sy-subrc = 0.
out_par-value = p_day1.
MODIFY out_par INDEX sy-tabix.
Regards,
‎2006 Sep 14 2:17 PM
tables : mhnk.
data : v_Date like mhnk-ausdt,
it_months like T247 occurs 0 with header line,
v_index like sy-index.
start-of-selection.
v_date = '20060101'.
v_Date = v_date + 7.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
month_names = it_months
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
v_index = v_date+4(2).
read table it_months index v_index.
write:/ v_Date6(2), 'th', it_months-ktx, v_date0(4).