‎2008 Dec 02 12:03 PM
Hi,
My requirement is:
We have to generate a batch number in such a way that
the first character should be the last digit of the current date
the second character should be the month identifier(1-9 from Jan to sept and for the rest Oct-A Nov-B and Dec-C)
the third character should be the day identifier(for dates 1-9,its 1,2..9 and for the rest consecutive dates starting frm a,b,...v)
Please help me how to achive this.
‎2008 Dec 02 12:59 PM
Hello
pointer type i.
if day LE 9.
third_character = day.
else.
pointer = day - 10.
third_character = SY-ABCDE+pointer(1).
endif.
‎2008 Dec 02 12:13 PM
Hi
You can use SPLIT or OFFSET key words to get what you want
for further info go through the KEY word documentaion where examples are provided
Regards
Ramchander Rao.k
‎2008 Dec 02 12:16 PM
Hi,
Just declare a string variable which stores the batch number. Declare 3 more variable to store all other information. And then concatenate all variables to get a unique batch number.
Implement this logic. Hope this will be helpful for you.
Thanks
Nitesh
‎2008 Dec 02 12:19 PM
That is okay...but i want to know the logic how to increment the numbers and continue with the alphabets progressing...Since for the days, we need to go on from A to V, how to implement that?
Edited by: Aish S on Dec 2, 2008 1:21 PM
‎2008 Dec 02 12:18 PM
Hi
U can do this by using Character String Operations on DATE and based on value use IFELSE control statement.
like ur DATE is 20081202 then
if date+6(2) = 01.
c3 = 1.
elseif date+6(2) = 02.
endif.
but this is simple way , u can find some more optamize way.
Regards
Sachin
‎2008 Dec 02 12:25 PM
‎2008 Dec 02 12:45 PM
If we use the case statement, for the dates from 10 to 31st, case statemnt would be very lengthy.Is there any other possible way for this?
‎2008 Dec 02 12:59 PM
Hello
pointer type i.
if day LE 9.
third_character = day.
else.
pointer = day - 10.
third_character = SY-ABCDE+pointer(1).
endif.
‎2008 Dec 03 4:39 AM
‎2008 Dec 02 12:59 PM
Hi,
I think you will have to go for case only. No other go.
Thanks
Nitesh