07-07-2006 1:09 PM
Hi,
How to convert QUAN and CURR types to C ...because i m using these values in concatenate statement..
Thanks in advance
07-07-2006 4:45 PM
u can use the standard function module to convert Quan to CURR... i think the FM is.. conv_quan_To_XXX
sap has provided many standard FM for conversions..
this may help you ...
07-07-2006 1:10 PM
Hi,
Just declare another variable of type c and same length as that of currency type.
Then u move this currency field to character variable.
Hope this helps..
Cheers,
Simha.
07-07-2006 1:14 PM
Use the write statement to move the conetents of these fields into a type c field of appropriAte length.
Regards,
ravi
07-07-2006 1:16 PM
Hi,
As Simha has already mentioned tht take a variable of type c and move contents of quantity to variable...
This will surely work...
Regards.
Seema.
07-07-2006 1:19 PM
Hi,
Use <b>Write</b> statement with its Option like currency to move contents to destination field of type c.
Regds,
Akshay
07-07-2006 1:42 PM
Hi,
You can do it using WRITE..TO or MOVE statement.
When to use which depends on your requirement.
This is what SAP Documentation says.
If the target field has type C, you must decide between MOVE and WRITE TO. The MOVE statement is intended for assignments within a program, and it generates a standard display that is compatible with the source type. This can be converted back into the original value using MOVE again, as long as it was not truncated in the assignment. For this reason, the period (.) is always used as the decimal sign, and dates cannot be converted, regardless of the user defaults.
You use the WRITE TO statement to generate a readable ('external') display for the value of the source field. The target field is usually displayed on a screen or in a list, after further processing if necessary. Unlike MOVE, WRITE TO has several formatting options, which, for some data types, are user-defined. A conversion exit may be called implicitly.
For More Info press F1 on <b>MOVE</b>
Consider this code.
REPORT zarun_2.
DATA : quan TYPE marc-bstrf,
curr TYPE marc-losfx,
* Calculate the Length of the Table Field Initially referring the Dataelement
cquan(17) TYPE c, "BSTRF QUAN 13(Length) + 3(No of Decimals) + Decimal point
ccurr(14) TYPE c. "LOSFX CURR 11(Length) + 2(No of Decimals) + Decimal point
quan = '123456.564'.
curr = '123.50'.
WRITE : /'Before Conversion ',
'QUAN:', quan,
'CURR:', curr.
MOVE quan TO cquan.
MOVE curr TO ccurr.
WRITE : /'Conversion using MOVE ',
'QUAN:', cquan,
'CURR:', ccurr.
WRITE quan TO cquan.
WRITE curr TO ccurr.
WRITE : /'Conversion using WRITE ',
'QUAN:', cquan,
'CURR:', ccurr.
Regards,
Arun Sambargi.
07-07-2006 4:12 PM
07-07-2006 4:18 PM
Hi,
Can u specify how are you concatenating or wats the problem.
A sample code will be helpful .
Regards,
Arun S.
07-07-2006 4:50 PM
Declare a variable of length xx type c. xx is the output length that is there in the attributes of the domain of the currency/quantity field that you are looking at.
Then do a WRITE mycurrency/quantityfield TO mycharvariable CURRENCY/UNIT yyy where yyy is the currency key or quantity unit of measurement depending on which one you are working with. It is important that you use this to get the right number of decimals. You can also use the option NO-GROUPING to eliminate the thousands separator.
07-07-2006 4:45 PM
u can use the standard function module to convert Quan to CURR... i think the FM is.. conv_quan_To_XXX
sap has provided many standard FM for conversions..
this may help you ...