2008 May 27 1:06 PM
Dear Friends,
I am very much new in the ABAP. Actually I worked last 8 years in the Oracle PL/SQL. Recently, my company implements SAP. The database is Oracle 10g. I would like to use my oracle experience in the project. But in everywhere I faced some problem.
I have created one Database view by the Native sql. Here I am giving you the code.
-
Create OR REPLACE view ZVMVSL_ALLTPORT
AS
SELECT T1.MVESSEL_NO, T1.MVESSEL_NAME, T1.SHIPPINGLINE, T2.MVOYAGENUMBER,
T2.TRANSHIPMENTA AS TPORT, T2.ETDTSHIPMENTA AS ETD_TPORT,
T3.MVESSEL_SRL_NO,
T3.PORTOFDISCHARGE POD, T3.ETAPORT
FROM ZSD_MOTHER_MST T1, ZSD_MOTHER_DTL T2, ZSD_MOTHER_VIA T3
WHERE T1.MANDT = T2.MANDT
AND T1.MVESSEL_NO = T2.MVESSEL_NO
AND T1.MVESSEL_NO = T3.MVESSEL_NO
AND T2.MVOYAGENUMBER = T3.MVOYAGENUMBER
AND T2.TRANSHIPMENTA <>' '
UNION
SELECT T1.MVESSEL_NO, T1.MVESSEL_NAME, T1.SHIPPINGLINE, T2.MVOYAGENUMBER,
T2.TRANSHIPMENTB AS TPORT, T2.ETDTSHIPMENTB AS ETD_TPORT,
T3.MVESSEL_SRL_NO,
T3.PORTOFDISCHARGE POD, T3.ETAPORT
FROM ZSD_MOTHER_MST T1, ZSD_MOTHER_DTL T2, ZSD_MOTHER_VIA T3
WHERE T1.MANDT = T2.MANDT
AND T1.MVESSEL_NO = T2.MVESSEL_NO
AND T1.MVESSEL_NO = T3.MVESSEL_NO
AND T2.MVOYAGENUMBER = T3.MVOYAGENUMBER
AND T2.TRANSHIPMENTB <>' '
-
This view i could not use from ABAP codes, ABAP/4 only identified by views which we would create from T-code se11. Now tell me how could I solve this issue. Because in this query i did some UNION which is not directly available in teh se11.
Please help me how to handle this situation. Because if I can use this sort of native sql views, I could solve lot of things in the development.
rgds
Farhad
Dear Friends,
I am very much new in the ABAP. Actually I worked last 8 years in the Oracle PL/SQL. Recently, my company implements SAP. The database is Oracle 10g. I would like to use my oracle experience in the project. But in everywhere I faced some problem.
I have created one Database view by the Native sql. Here I am giving you the code.
-
Create OR REPLACE view ZVMVSL_ALLTPORT
AS
SELECT T1.MVESSEL_NO, T1.MVESSEL_NAME, T1.SHIPPINGLINE, T2.MVOYAGENUMBER,
T2.TRANSHIPMENTA AS TPORT, T2.ETDTSHIPMENTA AS ETD_TPORT,
T3.MVESSEL_SRL_NO,
T3.PORTOFDISCHARGE POD, T3.ETAPORT
FROM ZSD_MOTHER_MST T1, ZSD_MOTHER_DTL T2, ZSD_MOTHER_VIA T3
WHERE T1.MANDT = T2.MANDT
AND T1.MVESSEL_NO = T2.MVESSEL_NO
AND T1.MVESSEL_NO = T3.MVESSEL_NO
AND T2.MVOYAGENUMBER = T3.MVOYAGENUMBER
AND T2.TRANSHIPMENTA <>' '
UNION
SELECT T1.MVESSEL_NO, T1.MVESSEL_NAME, T1.SHIPPINGLINE, T2.MVOYAGENUMBER,
T2.TRANSHIPMENTB AS TPORT, T2.ETDTSHIPMENTB AS ETD_TPORT,
T3.MVESSEL_SRL_NO,
T3.PORTOFDISCHARGE POD, T3.ETAPORT
FROM ZSD_MOTHER_MST T1, ZSD_MOTHER_DTL T2, ZSD_MOTHER_VIA T3
WHERE T1.MANDT = T2.MANDT
AND T1.MVESSEL_NO = T2.MVESSEL_NO
AND T1.MVESSEL_NO = T3.MVESSEL_NO
AND T2.MVOYAGENUMBER = T3.MVOYAGENUMBER
AND T2.TRANSHIPMENTB <>' '
-
This view i could not use from ABAP codes, ABAP/4 only identified by views which we would create from T-code se11. Now tell me how could I solve this issue. Because in this query i did some UNION which is not directly available in teh se11.
Please help me how to handle this situation. Because if I can use this sort of native sql views, I could solve lot of things in the development.
rgds
Farhad
2008 May 27 3:40 PM
If you have created a view in native SQL, and want to use it anyway, try querying it by using execute SQL statement from ABAP.
2009 May 03 7:08 AM
Dear Harish,
how can i populate one internal table by using a database view....as this was not been created by ABAP structure....rather it has been created by using execute SQL statement from ABAP.
please give me on example code for that.....
Rgds
Farhad
2009 May 04 11:43 AM
2009 May 05 8:11 AM
2008 May 27 3:52 PM
You are right UNION is not available as option when you create a view in SE11. You could solve this as follows:
- Create a view for the first query
- Create a second view for your second query
- In the coding do the following
select ........ from VIEW1
into table lt_table
where .........
select ....... from VIEW2
appending table lt_table
where .........
This would append the data selected in the second query to the data selected in the first query.
Hope that helps,
Michael
2009 May 05 1:32 PM
>
> This view i could not use from ABAP codes, ABAP/4 only identified by views which we would create from T-code se11. Now tell me how could I solve this issue. Because in this query i did some UNION which is not directly available in teh se11.
>
>
> Please help me how to handle this situation. Because if I can use this sort of native sql views, I could solve lot of things in the development.
>
> rgds
> Farhad
You can use real SQL to query non SE11 created database tables - look at the SAP help on EXEC SQL - but this is really not a good idea. For example, it is database specific which removes one of the 'advantages' of SAP ie that it is portable between different database platforms;using SAP's Open SQL should mean that if your company moves to eg SQL Server it shouldn't be necessary to doing any re-coding whereas anything you've done in Oracle SQL will have to be re-coded. There are also other disadvantages of using real SQL eg you don't get any help from the syntax checker and I think you would bypass the whole SAP security level - SAP security is defined at application level and not via database grants.
I would bet a reasonable amount of money that there is nothing that you can do in real SQL that you can't replicate in SAP's Open SQL . Ok the Open SQL solution might be a bit more convoluted and possibly less elegant but you can make it do the same thing. If you want to stick with Oracle then I guess you should look for a job that uses Oracle rather than SAP.
2009 May 06 9:24 AM
Christine Evans
your big essay doesnt mean to me anything.....I am a customer, I would like to use Oracle or any thing....that up to me......I don't need your suggession such as....
If you can give me the solution in ABAP, give me that....otherwise....dont misutilize our time......
Rgds
Farhad
2009 May 06 10:11 AM
>
> Christine Evans
>
> your big essay doesnt mean to me anything.....I am a customer, I would like to use Oracle or any thing....that up to me......I don't need your suggession such as....
>
> If you can give me the solution in ABAP, give me that....otherwise....dont misutilize our time......
>
> Rgds
> Farhad
Just trying to be helpful. If you have to work with SAP then the easiest and - more importantly - most easily maintainable way to do it is to use the SAP supplied tools rather than distorting a development to suit your own particular skills set.
By the way, I did provide the ABAP solution. In the first sentence. As did one of the earlier posts.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |