2006 Dec 05 5:14 PM
Hi,
Please help with these two questions:
1. what is the difference between 'Move x to y' and 'write x to y' ?
I want to assigen a sales order (along with leading zeroes) to a character field using 'Write to' type,,but after assigning, the leading zeroes are missing.
2. What can I do so that I should be able to use 'Write to' as well as leading zeroes not missing?
Thanks in advance,
I appreciate,
Krishen
2006 Dec 05 5:17 PM
Hi,
Basically both commands will do the same, however with "WRITE TO" conversion routines are used and it's possible to use edit masks:
See the following example:
REPORT ztest.
data: test1(10) type c,
test2(10) type c.
START-OF-SELECTION.
move sy-datum to test1.
write sy-datum to test2.
write :/ 'With MOVE :', test1.
write :/ 'With WRITE:', test2.Output:
With MOVE : 20050726
With WRITE: 07/26/2005
Hope this will help.
Regards,
Ferry Lianto
Hi,
Please help with these two questions:
1. what is the difference between 'Move x to y' and 'write x to y' ?
I want to assigen a sales order (along with leading zeroes) to a character field using 'Write to' type,,but after assigning, the leading zeroes are missing.
2. What can I do so that I should be able to use 'Write to' as well as leading zeroes not missing?
Thanks in advance,
I appreciate,
Krishen
2006 Dec 05 5:16 PM
Hi,
Why don't you use CONVERSION_EXIT_ALPHA_INPUT
eg:
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_Sales1 " having value without 0s
IMPORTING
OUTPUT = v_sales2. " this will have Sales order as per SAP.
Hope this helps.
Manish
Message was edited by:
Manish Kumar
2006 Dec 05 5:17 PM
Hi,
Basically both commands will do the same, however with "WRITE TO" conversion routines are used and it's possible to use edit masks:
See the following example:
REPORT ztest.
data: test1(10) type c,
test2(10) type c.
START-OF-SELECTION.
move sy-datum to test1.
write sy-datum to test2.
write :/ 'With MOVE :', test1.
write :/ 'With WRITE:', test2.Output:
With MOVE : 20050726
With WRITE: 07/26/2005
Hope this will help.
Regards,
Ferry Lianto
2006 Dec 05 5:20 PM
Hi,
1) 'Move to ' is just to move the number characters from the source to target...
'Write to' will trigger the conversion routines based on the data type of the source..
For example..
DATA: V_VBELN TYPE VBELN VALUE '0010001234'.
DATA: V_TARGET(10).
WRITE: V_VBELN TO V_TARGET.
The conversion routine in the data type VBELN is triggered..The conversion routine will remove the leading zeroes..
2) If you want leading zeroes use MOVE TO..
Thanks,
Naren
2006 Dec 05 5:36 PM
Thanks to you all!
I am actually writing a subroutine for a sapscript.
I want to use 'Write to' because I need to assign a variable var_vbeln like this in a subroutine:
WRITE: temp_zvbeln TO output_table-value.
When I put breakpoint to see the value, it is going to dump. However, with out breakpoint, I could print the sapscript.
Please give your input reg. the above.
Thanks.
2006 Dec 05 5:39 PM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |