Quantcast
Channel: SCN : All Content - ABAP for SAP HANA
Viewing all 831 articles
Browse latest View live

Re : Open sql query.

$
0
0

Hi Folks,

 

I am currently listening the open sap videos for the abap on hana week3 .in that i wrote abap query modified with the enhancement of the sql statement

but my statement is showing syntax errors.

 

Please find the below query.

 

 

SELECT carrid

       connid

       fldate

       price

       currency

   FROM sflight

   INTO TABLE lt_sflight.

IF sy-subrc IS INITIAL.

  DESCRIBE TABLE lt_sflight LINES sy-tfill.

  WRITE : / sy-tfill.

ENDIF.

 

 

SELECT carrid,

       connid,

       fldate,

       price,

       currency

   from sflight

   into table @data(lt_sflight).



From the above query i am getting the below error.


"," is not allowed here since it contains an invalid character or it is

a keyword. (It might be possible to escape it using "!"). Or a space is

missing or there is one space too many.

 

I am using EHP7 with sp04 ides server.

 

 

 

Thanks in advance.

 

Regards,

Raghunadh Kodali.


'CX_SALV_DB_TABLE_NOT_SUPPORTED'

$
0
0

Hi everyone,

 

I am using HANA system with EHP7 for SAP ERP 6.0.

and successfully checked sample report SALV_IDA_DISPLAY_DATA_SIMPLE .

 

but with the same code when i try to display another Z table.

'CX_SALV_DB_TABLE_NOT_SUPPORTED' error is shown.


scn1.PNG


I have maintained table's technical attributes to Column store.


Please help me with this.

Do i need to provide any additional info?

Re : Open Sql query with case statement.

$
0
0

Hi ,


Currently I am looking into open sql statement in  abap for hana


I wrote the below query but in debugging the values are populated as below


SELECT carrid,

CASE carrid

        WHEN 'AC' THEN 'Canada Airlines'

        WHEN 'LH' THEN 'Lufthansa Airlines'

        ELSE carrid

        END AS carrier_name_long,

       SUM( sflight~price ) AS total_price

       FROM sflight

       GROUP BY carrid

       intotable @DATA(lt_result).

IF lt_result[] IS NOT INITIAL.

  DESCRIBE TABLE lt_result LINES sy-tfill.

  WRITE : /sy-tfill.

ENDIF.


Please find the attached screen shot

 

 

 

Thanks in advance.

 

Regards,

Raghunadh Kodali.

HANA ALV with IDA - Standard GUI Toolbar

$
0
0

Hi,

 

I need to add standard toolbar buttons like ABC analysis, Export, etc. in HANA ALV with IDA. It seems we can add custom buttons as per the below link. but could not add standard buttons.

 

UI Differences - SAP GUI - SAP Library

 

as you can see we are allowed only buttons as per below link.

 

http://help.sap.com/saphelp_nw74/helpdata/en/21/10b84e029d4581b4621e1c597e355e/content.htm?frameset=/en/3d/f06b8dc103483b8408ce287550898d/frameset.htm&current_toc=/en/55/632e5a2674454197c4518419f138dc/plain.htm&node_id=212

 

 

 

Does anyone have the experience with HANA ALV IDA and has same issue? (Or solution)

 

Thanks in advance.

 

Best Regards Priti

Sorting Order in SQL Queries

$
0
0

Hi Colleagues,

 

We notice difference in the output when executing the SELECT queries on traditional DB and HANA. We are using side car approach so we have both the databases.

 

    SELECT Query 1 without HANA

 

     SELECT * FROM

                     EKPO

          INTO   TABLE LT_EKPO

             FOR ALL ENTRIES IN LT_EKKO

    WHERE    ebeln = lt_ekko-ebeln

          AND   werks IN s_werks.

 

    SELECT Query 2 with HANA

 

     SELECT * FROM

                     EKPO

          connection (gv_dbcon)

          INTO   TABLE LT_EKPO

             FOR ALL ENTRIES IN LT_EKKO

    WHERE    ebeln = lt_ekko-ebeln

          AND   werks IN s_werks.

 

 

Both the queries give me the same result set, but with different order.

What could be the reason? and how this should be avoided.

Thank you.

 

Regards,

Harshad Mishrikotkar.

Multi-Select mode on ALV with IDA

$
0
0

I am trying to display a calculation view using ALV-IDA in ABAP and it comed up nicely. I have a requirement to select multiple rows of the ALV and perform some operation on click of a button. Does ALV-IDA doesn't support multiple row selection?

 

Regards,

Kevin

CAST in a UNION ALL

$
0
0

I'm using a UNION ALL in a CDS View but I'm having trouble matching up one of the fields in the projection list between the Select's. In the first Select, I have this: 

 

case

     when offer_level = '2' and decrep.decision = 'U' and decrep.reply = 'F' then count(*)

end as uf1

 

 

I'm not actually filling the field in the second Select from any tables but it seems that I need to add it into the projection list anyway, which I'm attempting to do with (I don't know how else to do it):

 

' ' as uf1

 

This throws up an error:

 

"View field UF1 (data element or type/length different in union)"

 

 

I've tried using CAST on the field in both Select's.It seems that I cannot use CAST on UF1 in the CASE statement. If I try to CAST the second one to an integer (which is what it looks like it needs to be) then, of course, I get an error saying I can't convert a char to an integer.

 

If I try to convert to numc, as follows:

 

cast( ' ' as abap.numc(5)) as uf1

 

Then I get this again:

 

"View field UF1 (data element or type/length different in union)"


So I'm stumped. Any ideas anyone?


Thanks,

Malcolm.

I am unable to debug HANA SQL script on AMDP

$
0
0

I have done the following by looking at various blogs and video's but I am still unable to debug the AMDP as it does not stop on the SAP procedure created for AMDP.

 

1) I have authorization for debug and execute on SAP<SYSID> schema

2) Authorization to attach the debugger to a SAP<SYSID> user session

3) I have set up a break point on the procedure which is created in SAP<SYSID> for the AMDP I created.

4) In debug perspective I have created a configuration for my SAP and HANA user for the HANA DB we are using and the debug thread is running for my procedure

6) When I call the program from ABAP perspective. I am able to debug on ABAP code which calls the AMDP but when executed the code never stops in the SQL Script.


my HANA version in SPS 7.


Can someone explain me if I am missing any step here.


Thanks

Nafran


Issue debuging an AMDP

$
0
0

I'm on HANA SPS7 and Netweaver 7.4 SP 7.

Did everything according to the tutorial Tutorial: How to Debug an ABAP Managed Database Procedure.

Granted the debug/execution authorization to the debug user, made the debug configuration and set the breakpoints in the corresponding catalog object.

But when I run the ABAP report (that calls my AMDP), the execution doesn't stop at my breakpoints.

I was able to step-into from my ABAP report method call to the first line of the AMDP catalog object, but I can't see my breakpoints in the debug perspective. And as stepping inside the AMDPs are not supported yet, I can't really debug it.

 

Am I doing something wrong here?

Please help.

 

SQL script.JPG

 

Debug Perspective.JPG

Unable to register gateway service (Odata)

$
0
0


Hi All,

We are on 7.4 sp 09, at the time of registering service I am not able to register the service.

If it is configuration related issues, just let me know what are the other prerequisite for better understanding and how to deal.

 

 

 

Gateway.JPG

 

 

-Amol S

Problem in using Native Sql with HANA

$
0
0

Hi,

 

I am fetching HANA views data using native sql in abap. I have observed a problem that sap is allowing only 29 execute sql commands statements in a row and gives dump for 30th query. My code is like below


  LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( CONN1).

  LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).



LOOP AT T_RANGE2 INTO WA_RANGE2.

       CONCATENATE 'INSERT INTO  VBELN_TEMP1 VALUES (' ''''WA_RANGE2'''' ')'  INTO LV_SQL_INS.

        TRY.

 

          LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL_INS ).

  

        CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.

             LV_TEXT = LX_SQL_EXC->GET_TEXT( ).

            MESSAGE LV_TEXT TYPE 'E'.

 

      ENDTRY.

ENDLOOP.

 

Here I am passing a value range to VBELN_TEMP1 table of HANA through a loop on T_RANGE2 internal tab.

It works fine till TABX 29 and gives exits the program on 30th iteration.

 

Please help if anyone has observed same problem and found solution on it.

 

Thanks,

Shriniwas

Training material

$
0
0

Dear All,

 

I am new in the world of sap hana.

 

Please let me know training material for SAP HANA ABAP developers

 

 

Thanks & Regards,

Rajshree Shinde

comparing fields in dynamic way inside CDS views

$
0
0

Hi,

I am working on a prototype where i have to compare few fields of a DB table to see if there is any different value in any one of them. The fields to be compared comes from another table and could differ at times. How do i achieve this in CDS views ?

For e.g.

I get 2 fields named dispo and dispr from t130f DB table. After this i have to make a select on marc by comparing these 2 fields to see if the value differs. Something like this:

    SELECT A~*

     from MARC as A

     INNER JOIN MARC as B

         on A~matnr = B~matnr

     WHERE A~matnr = 'W10_000_0000000057'

       and ( A~dispo <> B~dispo

       OR  A~dispr <> B~dispr ).


The condition in brackets would be kind of dynamic. Thanks a lot in advance.


Regards,

Ashish

CDS associations - please help

$
0
0

What is the purpose of the new 1: addition before a filter condition?

 

For illustration purposes, i've created a 1 to many association between Articles and Units of Measure.  (Tables MARA & MARM).  Then, I created another view to 'consume' the association.  No problem, but I get the following warning:  Association uoms can influence the cardinality of the resulting set.  (see exclamation marks in yellow triangles):

 

Untitled1.jpg

 

OK, fix that using the 1: addition, and the warning goes away:

 

Untitled2.jpg

 

 

My expectation now is a 1 to 1 association between Article and Units of Measure, but the result set is still 1 to many.  What then does the  1: addition mean?  

Untitled3.jpg

How are update/delete operations handled using insert only in HANA?

$
0
0

What is the exact way in which update/delete operations are handled in hana? I had read a blog where it was told that a delete flag will be set for the old data and it will still exist in the table..if it was so, don't we have to decompress the data so as to set the flag? Then the reason to implement the insert only is completely lost..Please explain as to how it exactly works.

 

 

 

 

Thanks in advance,

Priyanka


Re : Open Sql query with case statement.

$
0
0

Hi ,


Currently I am looking into open sql statement in  abap for hana


I wrote the below query but in debugging the values are populated as below


SELECT carrid,

CASE carrid

        WHEN 'AC' THEN 'Canada Airlines'

        WHEN 'LH' THEN 'Lufthansa Airlines'

        ELSE carrid

        END AS carrier_name_long,

       SUM( sflight~price ) AS total_price

       FROM sflight

       GROUP BY carrid

       intotable @DATA(lt_result).

IF lt_result[] IS NOT INITIAL.

  DESCRIBE TABLE lt_result LINES sy-tfill.

  WRITE : /sy-tfill.

ENDIF.


Please find the attached screen shot

 

 

 

Thanks in advance.

 

Regards,

Raghunadh Kodali.

Access to HANA via ADBC

$
0
0

Hi,

 

I'm evaluating a scenario where we use the HANA DB as kind of a central data repository for more than one ABAP-stack system. There is a blog post from Thomas Jung a while ago Developer's Journal: ABAP/HANA Connectivity via Secondary Database Connection to connect from an ABAP Netweaver system to a HANA database.

 

So the idea is just basically to have several SAP ABAP-stack systems, each of them have a secondary database connection maintained in DBAcockpit to the same central HANA DB. Then you can read and write to the HANA DB, either by OpenSQL, Native SQL or the ADBC classes.

 

Unfortunately, documentation on ADBC seems quite scarce. Some questions:

 

- How does the HANA DB behave, when there is more than one secondary connection from ABAP stack systems to the same DB? Is this possible at all? How are write locks on DB tables handled?

- Is it possible to use a HANA DB in the cloud? For evaluation purposes I would like to try to connect to a trial instance, but didn't succeed. Any hints on how to make the DB connection in DBAcockpit to hanatrial.ondemand.com work?

- If a DB connection to a HANA DB in the cloud is possible, how secure is the connection?

 

I know, too many intricate questions :-) Would already be grateful to have some help with at least one of them ...

 

/Joachim

CDS View vs Atribute view

$
0
0

Hello All,

 

I need to know is CDS view and Attribute view are co related and what is the difference between CDS view and Attribute view.

 

Please suggest.

 

LR Reddy.

CDS View with arithmetic CASE-Expression

$
0
0

Hey Experts,

 

i'm developing a CDS-View in ABAP for HANA and i need a CASE-Statement with an arithmetic expression in it.

 

CDS_CASE_WITH_ARITH.png

Error on above image is unexpected word "(".

I have also tried a few other ways like casting or subtracting in a between clause but nothing works.

 

Looking forward to your answers.

Simon

CAST operation in where clause in OPEN ABAP CDS

$
0
0

Hello,

 

Is there a possibility of doing cast operation or any arithmetic operation in the where clause of OPEN ABAP CDS view.

 

Thanks for the help,

Govind

Viewing all 831 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>