‎2012 Dec 13 7:23 AM
IF WA_BRS-WAERS <> 'INR'.
SPLIT WA_BRS-WRBTR AT '.' INTO WA_BRS-WRBTR LV_STR1.
TRANSLATE WA_BRS-WRBTR USING ', '.
CONDENSE WA_BRS-WRBTR NO-GAPS.
ENDIF.
******************************************* Explanation***********************************************
Here i need only a part before '.'
For example:
1055.50
I need only '1055' and '50' i will not be using anywhere in my program.
So here WA_BRS-WRBTR = '1055' and LV_STR1 = '50'.
While checking Extended Program Check it is showing,
No read access to LV_STR1.
Is there anyother keyword for getting only first part other than 'Split' ?
Thanks in advance.
Moderator Message: Basic ABAP syntax question - unmarked as question.
Message was edited by: Suhas Saha
‎2012 Dec 13 7:33 AM
As per SAP keyword help:
If there are not enough data objects result1 result2 ... to record all the segments, dobj is only separated until all the data objects result1 result2 ... have been assigned values, except for the last data object. The remaining content of dobj is assigned to the final data object, without being separted.
Did you check what happens if you don't write LV_STR1?
‎2012 Dec 13 8:40 AM
‎2012 Dec 13 7:36 AM
Hi,
use trunc( val ). option to get only integer part.
data: hello type wrbtr value '123.44'.
write: hello.
hello = trunc( hello ).
thanks.
‎2012 Dec 13 8:37 AM
I tried this Aswatha but its telling 'trunc' keyword is not there. Please reply ASAP.
‎2012 Dec 13 8:41 AM
Hey its not a key word but its a method you can directly use.
data: hello type wrbtr value '123.44'.
write: hello.
hello = trunc( hello ).
thanks.
its there just try executing this.
thanks.
‎2012 Dec 13 8:44 AM
‎2012 Dec 13 8:48 AM
Hey i think you are not giving space inside the call to it..
hello(space)=(space)trunc((space)hello(space)).
replace (space) by space here u should not give space between trunc and ( ... and you should give spaces between ( and hello and ).
check here
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3316358411d1829f0000e829fbfe/content.htm
‎2012 Dec 13 8:55 AM
‎2012 Dec 13 9:05 AM
‎2012 Dec 13 7:38 AM
Hi
Try moving that string to final internal table and do not dispaly it. (Do not prepare a fieldcat for that string)
Regards
‎2012 Dec 13 7:54 AM
Hello Arun,
Split should work. first of all you need to move value of wa_brs-wrbtr to character type field because SPLIT will work for characters not currency fields.
PFA the screenshot for your reference.
‎2012 Dec 13 8:39 AM
‎2012 Dec 13 8:48 AM
I am not getting what's your exact requirement. As per blog i understood that you need data before decimal place. So in my attached screenshot , you will get in lv_cnt using split. you can use your own variables for this.
sorry if i misunderstood your requirment.
regards,
Deepti
‎2012 Dec 13 8:56 AM
Hey its ok. My requirement is without using split keyword i should get first part i.e Integer part. Got it Now. Thanks Deepti 🙂
‎2012 Dec 13 9:10 AM
‎2012 Dec 13 9:42 AM
Hi Arun,
if u goto Attributes of program u just tick the check box 'Fixed point Arithmetic' and it will do rounding off the numeric values.So u will get the number before that '.'.
Regards,
Mangesh Sonawane.