Questions tagged [amdp]

This tag is intended only for questions touching ABAP Managed Database Procedures (AMDP) technology both on ABAP and HANA stack.

AMDP (ABAP-Managed Database Procedures) (AMDP) is a new SAP data access framework based on Core Data Services (CDS) and HANA database, AMDP procedures are usually written in HANA SQLScript language. AMDP serves as a successor to previous SAP technologies for accessing DB amongst which are NativeSQL and ADBC.

SAP HANA is an in-memory column-oriented relational database management system developed and marketed by SAP SE.

19 questions
3
votes
1 answer

MONTHS_BETWEEN('2018-12-31', '2019-02-28') outputs 1?

Simply shown above, this has been causing inconsistencies with our data. I'm currently writing an AMDP Logic that makes use of the difference between the months of each records, but surprisingly, the function MONTHS_BETWEEN() is not consistent for…
3
votes
1 answer

Table totals to scalar variable in HANA

I'm currently working with writing database procedures for HANA via ABAP objects. I'd like to return a scalar value which is calculated from a selection rather than a table which the other developer would have to read from a table. I'd prefer that…
Bryan Abrams
  • 337
  • 1
  • 4
  • 16
2
votes
1 answer

Performance of AMDP vs HANA DB procedure?

As far as I know there is very little difference between the two except syntax. You have to use: CALL METHOD for AMDP CALL DATABASE PROCEDURE for HANA Procedure Is the AMDP performance affected by the fact it is run at ABAP Application Server? Can…
2
votes
1 answer

Calling SP throws "ABAP objects and DDIC objects must be declared in the METHOD statement"

I created a stored procedure in HANA and tried to call it through AMDP class. SP as below; PROCEDURE "SAPABAP1"."ATU.SF::TESTSPCALL" ( ) LANGUAGE SQLSCRIPT SQL SECURITY INVOKER READS SQL DATA AS BEGIN SELECT 1 FROM DUMMY; END; AMDP…
Dumi
  • 1,414
  • 4
  • 21
  • 41
2
votes
4 answers

SAP HANA SQL SCRIPT Select where in array

is there any possibility to use something like SELECT * FROM xy WHERE xy.field in :array; in SQL SCRIPT? Im using Abap Managed Datebase Procedures DECLARE arr NVARCHAR(5) ARRAY; IF i_where = '' THEN arr = ARRAY ('A1', 'A2', 'A3', 'A4', 'A5',…
1
vote
3 answers

AMDP selects false records contrary to OpenSQL

I am learning AMDP and I found out that the result obtained from this is very different from normal select query in ABAP AS. I am using below code in AMDP: ex_gt_data = select a.vbeln, a.kunnr, a.bukrs_vf, …
CoderW
  • 123
  • 3
  • 14
1
vote
2 answers

Extreme values within each group of dataset

I have an SQLScript query written in AMDP which creates two new columns source_contract and target_contract. RETURN SELECT client as client, pob_id as pob_id, dateto as change_to, datefrom as change_from, cast( cast( substring( cast(…
1
vote
2 answers

How to pass single-column table to AMDP method?

I need to pass a table with a single column to an AMDP method which throws the error, the other parameters go fine: TYPES: BEGIN OF s_so_i, parent_key TYPE snwd_so_i-parent_key, product_guid TYPE snwd_pd-node_key, …
András
  • 1,326
  • 4
  • 16
  • 26
1
vote
1 answer

How to return CHAR30 in AMDP?

I try to create an AMDP method that returns a single field that would be SNWD_COMPANY_NAME on the ABAP side. The documentation says only table types and elementary types can be returned. SNWD_COMPANY_NAME is not elementary, it is CHAR 80, but I…
András
  • 1,326
  • 4
  • 16
  • 26
1
vote
1 answer

Unique constraint violated exception: Error 301

I am getting Unique Constraint Violation error on direct update as well as standard ADSO while inserting 180k records. I am sure that all the records are unique for my composite primary key (Combination of 12 fields). I am inserting the data using…
Rajat
  • 85
  • 2
  • 7
0
votes
0 answers

hide last row of analytical table

When creating an analytical table with CDS Views where aggregation is used like this: @DefaultAggregation: #MIN the aggregation for that column shows up as the last line of the table. Is there a way of hiding it without doing it manually within the…
Ardit
  • 33
  • 7
0
votes
0 answers

Create Dynamic Query in SAP using Table Function

I am trying to create Dynamic SQL query using Table Function, so that it can be consumed in ABAP CDS views. For same I have developed an ABAP Class & defined a method "Get_data". CLASS-METHODS get_data FOR TABLE FUNCTION ztablefunction. I am…
Urvish
  • 29
  • 2
  • 11
0
votes
1 answer

How to do REDUCE calculation in AMDP method?

how can we achieve REDUCE like the below logic inside an AMDP method. lv_total = reduce tslxx9( init x type tslxx9 for lwa_out in lt_out where ( companycode = -bukrs and …
0
votes
1 answer

An SQL chalenge

I would like to solve this with pure SQL sentences in an AMDP method, I could solve this easily in ABAP, even in an AMDP method using loops, but as I said, I would like to solve this with SQL sentences, without use any kind of loops. Please take a…
Ronaldo
  • 21
  • 4
0
votes
2 answers

SAP HANA CX_AMDP_EXECUTION_FAILED Dump SQL code 339 Date SQL

I have a sqlscript inside an AMDP class. I get a dump on the following statement: sel1 = select mandt, equnr, ROW_NUMBER() OVER ( PARTITION BY equnr ORDER BY equnr, idate, itime, mdocm) as rnum, to_date(idate) as idate, …
1
2