Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

date

Former Member
0 Likes
727

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.

8 REPLIES 8
Read only

Former Member
0 Likes
701

Convert g_fbdt into internal format using CONVERSION* function module and then add.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
701

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

Read only

Former Member
0 Likes
701

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.

Read only

0 Likes
701

hi,

date is coming but see the date it si some 26.01.0001

this should not be .

thanks in advacne

kiran kumar

Read only

0 Likes
701

U have to convert the format date before calculating the sum, try to use fm CONVERSION_EXIT_PDATE_INPUT

Max

Read only

0 Likes
701

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

Read only

Former Member
0 Likes
701

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

Read only

Former Member
0 Likes
701

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