‎2006 Nov 27 3:37 PM
hi
help me in this issue
g_netdt = g_fbdt + fbit
g_netdt is dat format and g_fbdt is also dat format and fbit is of char 3
when i am adding like this
g_netdt = 2005/05/29 + 25 days
it is givving a dump like unable to interup the number 2005/05/29.
thanks in advance
kiran kumar.
‎2006 Nov 27 3:39 PM
Convert g_fbdt into internal format using CONVERSION* function module and then add.
Regards,
Ravi
Note - Please mark all the helpful answers
‎2006 Nov 27 3:40 PM
Hi
All fields you use in the sum have to be a number, so check how you have defined them:
DATA: G_NETDT LIKE SY-DATUM,
G_FBDT LIKE SY.DATUM.
DATA: FBIT(3) TYPE N.
G_NETDT = G_FBDT + FBIT.
Max
‎2006 Nov 27 3:41 PM
HI,
I have writen this program in my system, and this is working fine foe me.
data: g_netdt type sy-datum.
data: g_netdt123 type sy-datum.
g_netdt123 = '2005/05/29'.
g_netdt = g_netdt123 + 25 .
write:/ g_netdt.
‎2006 Nov 27 3:56 PM
hi,
date is coming but see the date it si some 26.01.0001
this should not be .
thanks in advacne
kiran kumar
‎2006 Nov 27 4:09 PM
U have to convert the format date before calculating the sum, try to use fm CONVERSION_EXIT_PDATE_INPUT
Max
‎2006 Nov 27 4:30 PM
You don't want the . at all? or you want a '/' instead?
If you want the internal format of the date,
then you should go for:
CONVERT_DATE_TO_INTERNAL
dataL datab(8).
call function 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = '01.01.2006'
IMPORTING
date_internal = datab.
write:/ datab.
If you want a '/' instead of . then you should use the date mask:
write: sy-datum date mask 'DD/MM/YYYY'.
Regards,
Ravi
‎2006 Nov 27 3:45 PM
data: new_date(10) type c.
data: new_year(4) type c.
data: new_month(4) type c.
data: new_day(4) type c.
new_date = g_netdt.
TRANSLATE new_date USING '/'. " Remove slashes
CONDENSE new_date NO-GAPS.
new_date = new_date + 25.
new_year = new_date(4).
new_month = new_date+4(2).
new_day = new_date+6(2).
concatenate new_year new_month new_day into new_date separated by '/'.
Warren
‎2006 Nov 27 3:54 PM
gave the solution in the prev post ,, seems u did not executed all teh options ..
anyway check this ..
regards,
vijay.
note YYYYMMDD is systems internal format ..
if ur giving the i/p convert it to this format first of all before adding .
convert the date to system compatible format ..
using function modules ..
data : g_netdt like sy-datum ,
g_fbdt like sy-datum value '20060529'.
data : fbit type i value 25.
g_netdt = g_fbdt + fbit.
write:/ g_netdt.Message was edited by:
vijay k