on 11-14-2007 3:34 PM
Hello,
Is there a function to convert date in the YYDDD format to YYYYMMDD ?
Thanks.
Hi
check the fun modules
CONVERT_DATE_TO_INTERN_FORMAT
CONVERT_DATE_TO_EXTERNAL
CONVERT_DATE_TO_INTERNAL
CONVERT_DATE_INPUT
CONVERT_DATE_BY_PERIOD_INPUT
CONVERT_DATE_BY_PERIOD_OUTPUT
Regards
Anji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stephen,
I don't think there is a generic SAP function to do this. You will have to write the code yourself.
Sorry......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the help guys.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
U can use something like this:
DATA: FIRST_DAY TYPE SY-DATUM,
MY_DAY TYPE SY-DATUM.
DATA JULIAN_DATE(5) TYPE N VALUE '07256'.
* Calculate first day:
FIRST_DAY(2) = '20'.
FIRST_DAY+2(2) = JULIAN_DATE(2).
FIRST_DAY+4(4) = '0101'.
MY_DAY = FIRST_DAY + JULIAN_DATE+2(3) - 1.
WRITE MY_DAY.
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't find any FM to convert this.
But I have tried to code it ... please look at the code you will have better idea.
REPORT ZTEST_NP.
PARAMETERS: P_JDATE(5) TYPE N DEFAULT '07030'.
DATA: P_DATE TYPE D,
L_YEAR TYPE N,
L_DATE TYPE D.
START-OF-SELECTION.
P_DATE+0(2) = '20'.
L_YEAR = P_JDATE+0(2) - 1.
P_DATE+2(2) = L_YEAR.
P_DATE+4(4) = '0000'.
L_DATE = P_DATE.
L_DATE+4(4) = '1231'.
P_DATE = L_DATE + P_JDATE+2(3).
WRITE: P_JDATE,
/ P_DATE. "<< P_date will be 20070130
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the standard program RFFORIG4 and form name CONVERT_DATE_TO_YYDDD
*----------------------------------------------------------------------*
* FORM CONVERT_DATE_TO_YYDDD *
*----------------------------------------------------------------------*
* Convert Type D Dates to _YYDDD Format *
*----------------------------------------------------------------------*
form convert_date_to_yyddd using upgb_dattyped upgb_datyyddd.
data: upgb_d08dataa type d,
upgb_n03dataa(3) type n.
move: upgb_dattyped to upgb_d08dataa,
'0101' to upgb_d08dataa+4(4).
upgb_n03dataa = 1 + upgb_dattyped - upgb_d08dataa.
write: space to upgb_datyyddd+0(1),
upgb_d08dataa+2(2) to upgb_datyyddd+1(2),
upgb_n03dataa to upgb_datyyddd+3(3).
* Check if the day is 1231:
if sy-datum+4 = '1231'.
write sy-datum+2(2) to upgb_datyyddd+1(2).
write '001' to upgb_datyyddd+3(3).
endif.
endform. "CONVERT_DATE_TO_YYDDD
a®
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.