‎2008 Jul 30 8:51 AM
Hi,
i have a requirement .... in that I should add a variable which is declared as type N to the sy-datum ....so that I shud get the next corresponding date
for example
sy-datum + num = the next corresponding date.
where num is of type N and value = 1.
but in this i am not getting the correct value for date , instead of some junk value i am getting.
pls let me know of what type i shud declare the variable num to get the corresponding value for date after adition.
regards
Saravan
‎2008 Jul 30 8:52 AM
‎2008 Jul 30 8:56 AM
‎2008 Jul 30 8:53 AM
Num should be of type I
or U can directly add 1 to the date ..
‎2008 Jul 30 8:56 AM
‎2008 Jul 30 9:01 AM
The following works perfectly ..
data : v_date like sy-datum.
data : v_i type i value 1..
v_date = sy-datum.
v_date = v_date + v_i.
write 😕 v_date.
‎2008 Jul 30 8:59 AM
Hi,
Check this sample code,
PARAMETERS:
p_date TYPE sy-datum.
DATA:
w_date TYPE sy-datum,
w_var TYPE i VALUE 1.
w_date = p_date + w_var.
WRITE: w_date.or
PARAMETERS:
p_date TYPE sy-datum.
DATA:
w_date TYPE sy-datum.
w_date = p_date + 1 .
WRITE: w_date.Regards
Adil
‎2008 Jul 30 8:59 AM
Hi,
Do like this
REPORT z_sdn.
PARAMETERS:
p_date TYPE sy-datum.
DATA:
w_num(2) TYPE n VALUE '1',
w_num1 TYPE i.
START-OF-SELECTION.
w_num1 = w_num.
p_date = p_date + w_num1.
WRITE:
p_date.
Regards
Abhijeet
‎2008 Jul 30 8:59 AM
Hi Saravan,
Try to execute this code.
Data :
num type sy-datum.
w_num+6(1) = sy-datum+6(1).
write w_num.You will be getting the appropriate answer.
Please mark your threads as questions. Then it will be encouraging and you will get more post.
For this ---- when you are posting the question there is a check box " Mark this thread as question " you have to check this box
Regards,
Swapna.