‎2008 Nov 24 12:32 PM
Hi,
I have a fiscal year period 2005004 in one s1( variable) and iam taking 004 in s2 , which is become 4 and llater iam adding 1 to 4 which means it become 5 but i wnat to add 00 to s2 how to do that.. eg
s1 = 2005004
s2 = s1+4(3) that means it is 004]
s2 = s2 + 1 it becomes 5 not 005
i wnat s2 should be 005 how to add 00 to s1 please if anyone can give me step that would be appreciable.
Thanks
‎2008 Nov 24 12:53 PM
data: s2(3) type n
s1 = 2005004
s2 = s1+4(3) that means it is 004
s2 = s2 + 1 it becomes 005
‎2008 Nov 24 12:34 PM
I f your variable is of type date then just add 1 to your variable
‎2008 Nov 24 12:40 PM
to give a perfect answer, would be great to know, what are the types of the variables.
until that:
CONCATENATE '00' s2 INTO s2.
‎2008 Nov 24 12:49 PM
Hi ,
I have used concatenate function but it retrieve 0 as the results but i want my out as 004.
Thanks.
‎2008 Nov 24 1:00 PM
as told, it is necessary to know, how did you declare the variables. And the bad display is on the screen? If yes, how did you display? WRITE, ALV...?
‎2008 Nov 24 12:40 PM
Hi,
Declare s2 as follows :
data s2(3) type n.
s2 = 4.
add 1 to s2.
write s2.
regards,
Advait
‎2008 Nov 24 12:52 PM
Hi,
Declare S2 as below;
DATA S2(3) type N.No need for any other change in the code.
This will solve your problem.
Regards
Karthik D
‎2008 Nov 24 12:53 PM
data: s2(3) type n
s1 = 2005004
s2 = s1+4(3) that means it is 004
s2 = s2 + 1 it becomes 005
‎2008 Nov 24 1:11 PM
As per your suggestion i declare s2 as s2(3) but the problem is
if the s1 is 2005005 in the next increment it is incrementing the 005 of year even though i specified replace s1+4(3) in s1 with s2.
Thanks adveit and amit..
i have given the marks Please could you tell me how to replavce the month only in the above stament even though it is +4(3) its taking year not month
Thanks
‎2008 Nov 24 1:20 PM
How did you declrae s1 ? and how do get the value 2005005 ?
Change
replace s1+4(3) in s1 with s2
to
replace s1+4(3) in s1+4(3) with s2
regards,
Advait
‎2008 Nov 24 1:31 PM
Thanks Advait, it is resolve but i have this statement in userexit..
read table I_T_VAR_RANGE into v_var_range
with key VNAM = 'ZFYPJM'
while is taking the variable but V_var_range is accepting the Between value and i_t_var_range does
i tried to check these table but it says it does not exit and it is not declare anywhere..
How to check this
I have allocated the points to you
Thanks
‎2008 Nov 24 1:33 PM
May be you can try;
s1+4(3) = s2.Regards
Karthik D
P.S.: Dont ask more than one question per thread, better open a new one.
Edited by: Karthik D on Nov 24, 2008 7:04 PM