hi,
I have the following code.
DATA: FECHA LIKE SY-DATUM(6),
FECHA1 LIKE SY-DATUM.
fecha1 = sy-datum.
fecha = FECHA1(6) - 1.
The result is 200700.
This result not exist like year.month, this result is not the expected for me. What i need is 200612.
There are some functions or some idea to obtain what I need?
I would appreciate your help.
Regards,
Victoria
hi,
try CALCULATE_DATE
with month = -1
REPORT zforum117 .
PARAMETERS: date LIKE sy-datum DEFAULT sy-datum,
mth(4) default -1.
DATA: fecha LIKE sy-datum(6),
fecha1 LIKE sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = '0'
months = mth
start_date = date
IMPORTING
result_date = fecha1.
.
fecha = fecha1(6).
write: fecha.
A.
Message was edited by:
Andreas Mann
Use CCM_GO_BACK_MONTHS
*" IMPORTING
*" VALUE(CURRDATE) LIKE SY-DATUM
*" VALUE(BACKMONTHS) TYPE NUMC3
*" EXPORTING
*" VALUE(NEWDATE) LIKE SY-DATUM
regards
Add a comment