‎2008 May 28 11:44 AM
Hi,
can anyone tell me regarding this:
if the date is 5/5/2008 - the output should be 05/05/2008, means 0 should be concatenated in month and date.
else if date is 5/12/2008 - the output should be 05/12/2008
means 0 should be concatenated only in front of 5.
please help.
‎2008 May 28 11:46 AM
Hello.
Don't use concatenate. Do like this:
DATA: l_date TYPE char10.
WRITE sy-datum TO l_date DD/MM/YYYY.
Best regards.
Valter Oliveira.
‎2008 May 28 11:46 AM
Hello.
Don't use concatenate. Do like this:
DATA: l_date TYPE char10.
WRITE sy-datum TO l_date DD/MM/YYYY.
Best regards.
Valter Oliveira.
‎2008 May 28 11:49 AM
i need to use concatenate as there are 4 fields with date and with different date format.
‎2008 May 28 12:29 PM
Hello.
Put here your code here for us to help.
However, you can use variables like var(2) TYPE N to store them always as 01, 02, ... it's another way.
Best regards.
Valter Oliveira.
‎2008 May 28 12:33 PM
Hi,
You can declare the variable of type sy-datum, adding leading zero will automatically taken care by the system.
Thanks,
Sriram Ponna.
‎2008 May 28 12:41 PM
Hi,
I cant get your requirement clearly. Anyway I give you some solution below:
1. Declare the variable of TYPE SY-DATUM, so that automatically concatenate zero in front.
OR
2. You need to declare one variable as STRING and assign the input date to the string and split it at '/' then store date and month in two other variables and check those two variables are less than 10. If so then concatenate '0' in front else leave as it and finally concatenate as per your requirement.
Regards,
Raghu