‎2007 Jun 25 6:23 AM
Hi friends please explain this code . what exactly assign statement do .
CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.
ASSIGN (l_lines_name) TO <lines>.
‎2007 Jun 25 6:26 AM
Hi
The statement is assigning the <b>content of l_lines_names</b> to <b> field-symbol <lines>.</b>
l_lines_name is containing the name G_<value of p_tc_name>_LINES.
Regards
Raj
‎2007 Jun 25 6:28 AM
hi,
after geetting concatenate the whole wil lbe sent to <lines>.
‎2007 Jun 25 6:32 AM
Hi Prajwal,
ASSIGN statement is used to assign values to any field symbol youu are using in your code.
After the assign statement here value in the variable L_LINES_NAME will be available in the field-symbol <LINES>.
Thanks and Regards,
Kunjal Patel
‎2007 Jun 25 6:34 AM
Hi
CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.
ASSIGN (l_lines_name) TO <lines>.
Basicall ASSIGN statement will make the field symbol to point a Data Object.
But We can Pass the Data Object name Directly (Static ASSIGN)
Eg:
data : VAR1 TYPE I VALUE 10.
FIELD-SYMBOLS <FS1> TYPE I.
ASSIGN VAR1 TO <FS1>.
WRITE <FS1>.
And..
We can Pass the Data Object name in a Variable (Dynamic ASSIGN)
Eg:
data : VAR1 TYPE I VALUE 10.
data : fieldname(10) type c .
FIELD-SYMBOLS <FS1> TYPE I.
fieldname = 'VAR1'.
ASSIGN (FIELDNAME) TO <FS1>.
WRITE <FS1>.
In this case the data object to which the field symbol should point will be determined at runtime.
Hope You will get it.
Regards.
‎2007 Jun 25 6:46 AM
Hi,
normally,assign will move the contents of one variable to another.
where in case of field symbols.the value u r replacing also be assigned by another value.
other wise it will give error as field-symbol not assigned.
data:var1(10) value 'var2'.
data:var2(10) value 'var3'.
data:var3(10) value 'var4'.
data:var4(10) value 'output'.
field-symbols:<fs> type any.
field-symbols:<fs1> type any.
field-symbols:<fs2> type any.
assign (var1) to <fs>.
assign (<fs>) to <fs1>.
assign (<fs1>) to <fs2>.
write:/ <fs>, / <fs1>,/ <fs2>.
<b>reward if helpful</b>
rgds,
bharat.