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

storing in variable

Former Member
0 Likes
849

Hi,

I want to store a date with * in internal table variable.

i.e.10.12.2005 means

10.12.2005*

likethis.

and display like

same 10.12.2005*

how it's possible

Thanks,

Regards,

Nandha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
762

Hi nandha,

1. If u want to STORE in internal table variable,

then the variable of type sy-datum,

won't be of any help.

2. For this u need

Var1(11) type c.

10 - for date (10.12.2005)

1 - for *

3. NEXT IMPORTANT THING :

to put data in the field.

use

WRITE sy-datum to VAR1.

Do not use VAR1 = sy-datum.

Because WRITE will write in format of 10.12.2005

where as simply assignin will do 20051210.

4. After wards u just write logic

for concatenating * to the field.

U can also use :

VAR+10(1) = '*'.

Hope it helps.

regards,

amit m.

Message was edited by: Amit Mittal

Message was edited by: Amit Mittal

5 REPLIES 5
Read only

Former Member
0 Likes
762

Hi,

data v_date(11) type c.

Concatenate sy-datum and '*' into v_date with no space.

Thanks.

If this helps u reward with points.

Read only

Former Member
0 Likes
762

if it is a char variable then you can concatenate the * to the date.

date(11) chars.

concatenate date '*' into date.

Read only

Former Member
0 Likes
762

Hi Nanda,

Declare a variable with type of char and length of 11.

concatenate the date and '*' into that variable which solves ur problem.

Regards,

Sudhakar.

Read only

Former Member
0 Likes
763

Hi nandha,

1. If u want to STORE in internal table variable,

then the variable of type sy-datum,

won't be of any help.

2. For this u need

Var1(11) type c.

10 - for date (10.12.2005)

1 - for *

3. NEXT IMPORTANT THING :

to put data in the field.

use

WRITE sy-datum to VAR1.

Do not use VAR1 = sy-datum.

Because WRITE will write in format of 10.12.2005

where as simply assignin will do 20051210.

4. After wards u just write logic

for concatenating * to the field.

U can also use :

VAR+10(1) = '*'.

Hope it helps.

regards,

amit m.

Message was edited by: Amit Mittal

Message was edited by: Amit Mittal

Read only

Former Member
0 Likes
762

Hi nandha,

I think there is no single statement to do this.

You can fetch the data from the table into internal table. Then you can loop through it and manually you can append * at the end of each date field.

To do this you will have to define the date field type as character.