‎2006 Nov 27 2:41 PM
hi help me in this issue
The actual date format is 2005/05/29
i need the date format as 05/29/2005
CONCATENATE L_ZFBDT5(3) L_ZFBDT8(2) '/' L_ZFBDT+0(4) INTO G_ZFBDT.
by concatenating this way iam getting like this 05/29/20 since g_zfbdt is of type dats 8 in length so is there any field of type 10 for date.
thanks in advance
kiran kumar
‎2006 Nov 27 2:44 PM
HI,
if you want the User format date,
then use this simple code
Data: Date(10) ,
date1 like sy-daum.
lets say your field is G_ZFBDT.
move G_ZFBDT to date1.
write date1 to date.
write:/ date.
so, here the date will contain the userformat (This code will support all the SAP date formats).
If you want to use your code,
then write in this way ..
CONCATENATE L_ZFBDT5(2) L_ZFBDT8(2) L_ZFBDT+0(4) INTO G_ZFBDT
SEPARETED BY '/'.
field G_ZFBDT should be length 10.
Regards
Sudheer
Message was edited by:
Sudheer Junnuthula
‎2006 Nov 27 2:42 PM
‎2006 Nov 27 2:43 PM
why dont u declare a variable of length 10
data : v_date(10).
CONCATENATE L_ZFBDT+5(3) L_ZFBDT+8(2) '/' L_ZFBDT+0(4) INTO v_date.
‎2006 Nov 27 2:44 PM
declare variables as V1, V2, V3.
V1 = L_ZFBDT+0(4).
V2 = L_ZFBDT+4(2) or 5(2).
V3 = L_ZFBDT+6(2) or 7(2).
Concatenate v2 v3 v1 into G_ZFBDT separated by '/'.
‎2006 Nov 27 2:44 PM
Hi,
make the field g_zfdbt to char of length 10 and it will work fine.
‎2006 Nov 27 2:44 PM
Hi,
U can do this...
Goto System menu->USer Profile->own data-> and select the date format u want in default values...
Sreedhar
‎2006 Nov 27 2:44 PM
HI,
if you want the User format date,
then use this simple code
Data: Date(10) ,
date1 like sy-daum.
lets say your field is G_ZFBDT.
move G_ZFBDT to date1.
write date1 to date.
write:/ date.
so, here the date will contain the userformat (This code will support all the SAP date formats).
If you want to use your code,
then write in this way ..
CONCATENATE L_ZFBDT5(2) L_ZFBDT8(2) L_ZFBDT+0(4) INTO G_ZFBDT
SEPARETED BY '/'.
field G_ZFBDT should be length 10.
Regards
Sudheer
Message was edited by:
Sudheer Junnuthula
‎2006 Nov 27 2:56 PM
hi but i need to add again this g_fbdt to days
like g_netdt = g_fbdt + 30
there it is getting dump as unable to interrupt 05/29/2005 as a number
how to proceed with it.
thanks in advance
kiran kumar
‎2006 Nov 27 3:00 PM
‎2006 Nov 27 2:48 PM
<b>Hi
Call FM
CONVERSION_EXIT_PDATE_OUTPUT by passing date directly
like
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
exporting
input = sy-datum
importing
output = out
Regs
Manas Ranjan Panda</b>
‎2006 Nov 27 2:51 PM
check this.
data : val1(10) type c,
date like sy-datum.
date = '20050529'.
write:/ date.
concatenate date+4(2) '/' date+6(2) '/' date+0(4) into val1.
write:/ val1.regards,
vijay
‎2006 Nov 27 2:59 PM
REPORT zex3 .
data: v_date like sy-datum,
v_datenew like sy-datum.
v_date = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = v_date "current date
days = 05 "days added
months = 00
SIGNUM = '+'
years = 00
IMPORTING
CALC_DATE = v_datenew. " new date
write:/'Current date', v_date,
'new date ', v_datenew.regards,
VIjy
‎2006 Nov 27 3:10 PM
we'll keep it this way ..
i will take val1 for display and date2 for the Functional module i/p ..
execute this ..
regards,
vijay
data : val1(10) type c,
date like sy-datum,
date2 like sy-datum,
v_datenew like sy-datum.
date = '20050529'.
write:/ date.
date2 = date.
concatenate date+4(2) '/' date+6(2) '/' date+0(4) into val1.
write:/ val1,
date2.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = date2
days = 05 "days added
months = 00
SIGNUM = '+'
years = 00
IMPORTING
CALC_DATE = v_datenew. " new date
write:/ 'Current date', date2,
'new date ', v_datenew.lets see if this is working for u kiran .
‎2006 Nov 27 3:13 PM
REPORT YCHATEST.
DATA : V_DATE(10) VALUE '25/05/2006',
V_DT LIKE SY-DATUM.
REPLACE ALL OCCURRENCES OF '/' IN V_DATE WITH SPACE.
CONDENSE V_DATE.
CONCATENATE V_DATE4(4) V_DATE2(2) V_DATE+0(2) INTO V_DATE.
V_DT = V_DATE.
V_DT = V_DT + 30.
WRITE : V_DT.
‎2006 Nov 27 3:23 PM
Hi
when iam adding
g_netdt = g_fbdt + fbit
=29/05/2005 +30
it is giving a wrong value
how to add it .
thanks in advacne
kiran kumar
‎2006 Nov 27 3:24 PM
pls check my previous post,
before u add change convert the date format to YYYYMMDD , then add