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

Creating views

0 Likes
864

Good afternoon, people of the forum ...

You see, I have the following problem:

I'm in SE11 transaction for creating views from multiple tables ...

How I can do to get part of a field of a table in a view?

For example:

If one of the input tables of my view is the table KNA1 (Customer Master), I would like one of the target fields of the view to have the transportation zone (KNA1-LZONE), but only the part that goes from position 1 to position 4 of the field ... ie if the field has the value '010406 ', I just want to get the value '0104' in the target field of my view ...

It is possible to do this??

Thanks

5 REPLIES 5
Read only

Sandra_Rossi
Active Contributor
0 Likes
792

You can't. Why do you need a view, a SELECT in your ABAP program will achieve the same (but you definitely can't make this kind of operation on fields in Open SQL).

Read only

0 Likes
792

Well, I wanted to create a view because the ABAP program works with a lot of data and tables... and it began to become slow.

Besides It has dynamic selects, so it's not that easy to modify.

If y can't get part of the field, I guess I'll get the complete field in the view an then work with it in my ABAP Program...

Read only

0 Likes
792

Performance between a view and an open sql are exactly the same, because database executes a view as if it was an SQL query (it doesn't store anything about views). Don't be confused when SAP says to use existing views because they are known to be performing: it's just because the join (for example) has been already tested, so it's best to use something already tested than risking to do a "bad" select.

Read only

Former Member
0 Likes
792

I am not sure what you are trying to achieve from the view .. But to answer to your Question related to Pattern.. You can have this by using maintenance view .

1. Maintenance view can allow you to show position 1 to position 4 of the field by modifying the screen . ( play with Flow logic ).

2. you can also provide the selection condition in maintenance view.

This can be achieved in select statement if the result of the columns are specified explicitly to target fields. You can specify the result in the list of elementary data objects.

System ; ECC6.

ex: data : lw_kunnr(3) type c.

data : lw_name type kna1-name1.

select SINGLE kunnr Name1 into (lw_kunnr, lw_name ) from kna1 where

kunnr =

'0000009999'.

write : lw_kunnr, lw_name.

result :

000 SWISS XXXXXXXXXXXXXXX

-


Read only

0 Likes
792

Thanks for your answers but I finally decided to get the requested characters in the ABAP Program

Thanks anyway...