Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Database View

Former Member
0 Likes
659

Hi Friends,

Can we created calculated fields in a view.

Can we create field in a view using function module.

Please suggest ...

Pankaj

6 REPLIES 6
Read only

Former Member
0 Likes
613

If you mean to say that you want to update a field at runtime based on the values of the other fields value in the same row, then that is not possible. Also you cannot create a view using function module. Anyways, why would anyone want to do it?

- Guru

Reward points for helpful answers

Read only

0 Likes
613

Hi Guru,

I will give u my exact requirement.

I have created database view from table imrg and selected the field counter reading ( CNTRR ) . This field is of FLTP type. I want to show the value in this field in decimal.

I have debuged sap program where they have used FM FLTP_CHAR_CONVERSION_FROM_SI to display data in decimal.

My query is can I create field using above FM so that I could a display data in decimal.

Pankaj

Read only

0 Likes
613

This is nothing but conversion routine for that field. If you look at the properties of the data element/domain of the field you will find the conversino routine it uses. If you use the same conversion routine in the data element of the table you will not have this problem.

In the data emement of the field, use FLTP_CHAR_CONVERSION_FROM_SI as the conversion routine and your problem will be solved.

- Guru

Reward points for helpful answers

Read only

0 Likes
613

Thanks Guru,

In IMRG table for field CNTRR the datael ement is IMRC_READG

and in domain the conversion rutin is blank.

the value in field of type FLTP e is 2.2680000000000000E+05 where as it should appear as 63 in view .

pankaj

Read only

0 Likes
613

Hi Guru,

which conversion rutin should i use.

Thanks

Pankaj

Read only

0 Likes
613

Not sure which one you have to use as your requirement is very specific.

- Guru

Reward points for helpful answers