‎2007 Mar 23 5:33 PM
Hi Experts,
Can you please send me the difference between the<b> write and write to</b> ...
thanks in advance
Santosh
‎2007 Mar 23 5:38 PM
write: / w_str --> the values in the variable is displayed on the list
write 'hello' to w_str --> the value gets passed to the string.
Generally you WRITE TO a variable to use the formatting options. Press F1 on WRITE & you will know a lot more.
~Suresh
‎2007 Mar 24 1:09 AM
Suresh,
write to w_str
does not work if str is defined as type STRING.
A great disadvantage!.
Regards,
Clemens
‎2007 Mar 23 5:38 PM
WRITE is to simply write out to the screen where WRITE TO will be used when you want to move a value from one variable to another, yet take advantage of the implicit formatting options that a WRITE command provides. MOVE will not provide you with such features.
‎2007 Mar 23 9:39 PM
WRITE will display any text/variable on the list.
ex: write 'Hello'.
WRITE TO will assign the contents of one variable to another variable, and in the output display format.
ex: write abc to xyz.
Hope I am clear
Regards.
‎2007 Mar 23 9:42 PM
Hi,
Write -> write the results as a list-output.
Write to -> writes the results into a workarea and can be moved into an internal table. You can use all formatting options in these two stmts.
Regards
Subramanian
‎2007 Mar 24 1:19 AM
‎2007 Mar 24 2:42 AM
Write w_str. * This writes the value in w_str to list..
Write w_str to w_str1. * This writes the value in w_str to w_str1 variable.
The WRITE TO statement always checks the settings in the users master record. These specify, for example, whether the decimal point appears as a period (.) or a comma (,). You can also use all of the formatting options available with the WRITE statement, apart from UNDER and NO-GAP.
This statement converts the contents of a data object <f1> to type C, and places the string in the variable <f2>. The data type of <f1> must be convertible into a character field; if it is not, a syntax or runtime error occurs.
Write to is mainly used to apply the user master settings to the date and p type variables ( the date format and decimal format )
For example, if you write a date using the WRITE TO, it will apply the user specific formatting.
20061224 -> 12/24/2006
Also if writing type P fields.
1234.00 -> 1,234.00
reward helpful answers...
sai ramesh