Application Development 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: 

How to get value of a field which holds system variable sy-xxxxx

Former Member
0 Kudos

Hi

I Have one scenario, in which i will get the system variables as the value of the variable (sy-datum or sy-datlo).

"w_variable will have the vaue sy-datum, fetched from a table."

I need to pass the exact system value to another variable.

How can we do this.

Thanks in Advance,

Regards,

Baburaj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

then use

option 1

data: v_variable type sy-datum,

v_old_variable type sy-datum.

v_variable = v_old_variable

this assignment will move the contents as it is to the new variable.

option 2

if you want to convert it to system specific format,

create variable of char 10 & use WRITE TO

data : v_date(10) type c,

w_variable type sy-datum.

write w_variable to v_date.

Message was edited by: Srikanth Kidambi

4 REPLIES 4

Former Member
0 Kudos

Hi,

field-symbols: <fs>.

DATA: v_variable type char30.

v_variable = 'SY-DATUM'.

ASSIGN (v_variable) TO <fs>.

write: / <fs>.

I Hope this what you are looking for..

THanks,

Naren

Message was edited by: Narendran Muthukumaran

Former Member
0 Kudos

Hi Naren,

Hope it sounds good.

I will check tomorrow and update your reward points.

Thanks for your inputs.

Regards,

Baburaj

Former Member
0 Kudos

then use

option 1

data: v_variable type sy-datum,

v_old_variable type sy-datum.

v_variable = v_old_variable

this assignment will move the contents as it is to the new variable.

option 2

if you want to convert it to system specific format,

create variable of char 10 & use WRITE TO

data : v_date(10) type c,

w_variable type sy-datum.

write w_variable to v_date.

Message was edited by: Srikanth Kidambi

Former Member
0 Kudos

This is the same question as Please close both once answered.