‎2009 Sep 25 9:08 AM
Hi all.
I am reading internal table which has been created by upload of excel. the amount field in the excel was in two format one was '2552.09' and other was '2552' when i transfer to betrg feild it is correct for '2552.09' but for '2552' is '25.52' .
How i can resolve this. It may be 25.00 or 25 as value in excel but i need that sould be same as 25.00 in betrg field
pls suggest me a solution
Thanks
‎2009 Sep 25 10:02 AM
Hi
When you are reading betrg value from excel, move it into char format betrg field in your internal table then you create a function module and convert it into required format like ( decimal notation formats )
N.NNN,NN
N,NNN.NN
N NNN NNN,NN
and also provide this decimal notation foarmt in selection screen, at that time of data upload based on decimal notation and delimiter, convert it into required format in that function module. once the data is converted required format move the betrg field it into your actual internal table.
Regards
Karthik
‎2009 Sep 25 9:41 AM
Hi,
Before moving it to betrg field , move it to type p varaible with decimals 2 and then move it to betrg.
‎2009 Sep 25 9:52 AM
loop at the table which you have uploaded from excel,
and pass the amount fields to field of type p decimals 2
then you pass this p field to betrg .
endloop
‎2009 Sep 25 10:25 AM
i tried to covert it in temp type p decimals 2 . but there also value 567 became 5.67 but i want it should be 567.00 ..
pls suggest something
thanks
‎2009 Sep 25 9:54 AM
Hi, <li>Define BETRG field in Internal table with type C length 18, then upload. Thanks Venkat.O
‎2009 Sep 25 10:02 AM
Hi
When you are reading betrg value from excel, move it into char format betrg field in your internal table then you create a function module and convert it into required format like ( decimal notation formats )
N.NNN,NN
N,NNN.NN
N NNN NNN,NN
and also provide this decimal notation foarmt in selection screen, at that time of data upload based on decimal notation and delimiter, convert it into required format in that function module. once the data is converted required format move the betrg field it into your actual internal table.
Regards
Karthik
‎2009 Sep 25 10:23 AM
i didnt understant how to impliment wht you said . My problem has not resolved yet
‎2009 Sep 25 10:28 AM
ajay,
you would be using some FM to upload data to some internal table. in this internal table, define fields as strings or char type data.
define a temp variable of type P decimals 2.
then when you pass the internal table to some other final table, for the amount field,
first pass it to the temp variable. then pass this temp variable to the actual field of type betrg.
data: p1 type i value '576',
p2 type p DECIMALS 2,
p3 TYPE betrg.
"p3 from p2 and p2 from p1
p3 = p2 = p1.
WRITE / : p1, p2 , p3.
‎2009 Sep 25 10:31 AM
field in internal table is of betrg type. but its not working for them if the value is absolut. it converts 2456 into 24.56 .
‎2009 Sep 25 10:35 AM
‎2009 Sep 25 10:36 AM
Thanks Saumyaprakash.
it_data TYPE STANDARD TABLE OF alsmex_tabline,
data : l_amt_text(20) type c .
data : l_betrg type pa0009-betrg.
fM i m using is 'ALSM_EXCEL_TO_INTERNAL_TABLE'
LOOP AT it_data INTO wa_data.
CASE wa_data-col.
WHEN '0015'.
l_amt_text = wa_data-value.
REPLACE ',' in l_amt_text WITH ''.
CONDENSE l_amt_text .
break 259411 .
l_betrg = l_amt_text .
this is sample pice of my code whicj is not working
‎2009 Sep 25 10:38 AM
hello Ajay
Move your field into char type then covert it into required format for that create a function module use decimal notation and separtor for identifaition which format you wants to convert
Regards
Karthik
‎2009 Sep 25 10:42 AM
‎2009 Sep 25 11:22 AM
put a break point where you are assigning it to the l_betrg and see both values