03-14-2008 1:23 PM
Hi experts.
I have Character field in my program.
ex x(13).
This is acutally contains amount.
Now I need to update data base table using this field.
But data base table is WRBTR type.
It results me dump.
I tried using type N.but decimals are trunctaed.
I tired with type P results in dump.
I need to have extact values in Db table.
so that.I can sumup afterwards.
I cannot chnage the Char field in program.Becuase the field I am getting from interface file.
Kindly give me some solutions
Thanks
03-14-2008 1:27 PM
03-14-2008 1:29 PM
You have to first define a new field that matches your table field's data element.
data: l_amount like table_name-WRBTR.
l_amount = x. "ABAP engine automatically converts the data
Now, update the database table with l_amount.
03-14-2008 1:29 PM
Please look that char field v_x does not contain any ','(comas)
Look at below code .. this works fine for me ... (no dump)
data : v_data type WRBTR.
data : v_x(13) value '12345.67'.
move v_x to v_data.
write 😕 v_data.
03-14-2008 1:35 PM
Thanks for you anwer.
I have rewarded for you answer.
I have one more question.
I have commas to in that field.
Kindly tell me how to proceed
03-14-2008 1:38 PM
use ...
replace all occurrences of ',' in v_field with ' '.
condense v_field.
03-14-2008 1:53 PM
hi,
could you correct me on this.
replace all occurrances of ',' in amexbdcsav1-amount with ' '.
condense amexbdcsav1-amount.
thanks and Regards
03-14-2008 1:59 PM
amexbdcsav1-amount should be the character field ...
and not the amount field ...
replace all occurrences of ',' in amexbdcsav1-amount with ' '.
condense amexbdcsav1-amount.
after this use move ...
data : v_data type WRBTR.
data : v_x(13) value '12,345.67'.
replace all occurrences of ',' in v_x with ' '.
condense v_x.
move v_x to v_data.
03-14-2008 2:08 PM
yes it is caracter field.
But I am getting error when i am doing the sytax check.
occurrences of ',' in not expected.
Here is my code.
replace all occurrences of ',' in amexbdcsav1-amount with ' '.
condense amexbdcsav1-amount.
W_QUNT = amexbdcsav1-amount.
WA_ZAMEXTRAVEXP-WRBTR = W_QUNT.
Kindly help me.
Thanks and regards
03-14-2008 2:11 PM
Iam getting the o/p with the same statement ..
don't copy / paste .. type in manually ... this might work ...
replace all occurrences of ',' in v_x with ' '.
condense v_x.
03-14-2008 2:37 PM
hello,
I have typed manullay its not working with me.
I am in 4.6 will this make any difference.
03-14-2008 2:45 PM
03-14-2008 2:59 PM
how are you populating the character field with quantity ..
initially. RU getting the amount from any file ..
07-20-2011 9:07 AM