2006 Aug 10 8:06 AM
Hi All,
I had a requirement to move character to Quantity type field.can any body help me how to move character type field to Quantity type field of length 13, decimal 3 ?
Thanks & Regards,
Anil.
Hi All,
I had a requirement to move character to Quantity type field.can any body help me how to move character type field to Quantity type field of length 13, decimal 3 ?
Thanks & Regards,
Anil.
2006 Aug 10 8:09 AM
Hello,
In the domain of a particular field, check the 'output length' ( Definition tab )value. hope this helps.
Best regards, Murugesh AS
2006 Aug 10 8:10 AM
Hi Anil ,
I think 'WRITE' statement will do the job .
e.g . write <char> to <quant> .
Hope this helps .
Regards ,
Shounak M
2006 Aug 10 8:16 AM
Hello,
Conversion of Char (type c) to Qty (type p) is not possible. If you try to move it, it will give an error like: unbale_to_interpret_as_number.
Regards,
Naimesh
2006 Aug 10 9:22 AM
Hei Anil,
do extacly what you said:
move C to Q
Don't use WRITE if the destination is a P.
If C contains not only numbers a dump occurs for sure.
2006 Aug 10 9:23 AM
Try and use the pack command...
PACK l_char to l_qty.
Regards
Anurag
2006 Aug 10 9:31 AM
Hi,
if you want to convert the character to amount then you can use the FM <b>HRCM_STRING_TO_AMOUNT_CONVERT</b>
regards
vijay
2006 Aug 10 9:40 AM
in this case, WRITE TO will not work, as you are sending CHAR value to a numeric field.
here is the logic i followed to overcome the (user settings of comma(,) and DOT(.))
DATA : V_WEIGHT TYPE LTAP-BRGEW,
V_WT_CHAR(21) TYPE C.
assume you have weight value in a CHAR field.
v_WT_CHAR = '21,987.258'.
here your requirement is to push this value to a weight field.for that follow this,
REPLACE ALL OCCURRENCES OF ',' IN V_WT_CHAR WITH ''.
REPLACE ALL OCCURRENCES OF '.' IN V_WT_CHAR WITH ''.
CONDENSE V_WT_CHAR.
MOVE V_WT_CHAR TO V_WEIGHT.
V_WEIGHT = V_WEIGHT / 1000.
now your V_WEIGHT will have value '21987.258' (as it stores in INTERNAL format)
Check this& let me know,is this working for you ?
Regards
Srikanth
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |