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

Handling of SELECT-OPTIONS parameters within AMDP

$
0
0

The ABAP Managed Database Procedures (AMDP) framework provides the higher level of integration of the advanced HANA capabilities into ABAP applications. It allows creating and managing SQLScript-based DB procedures from the ABAP platform by using so called AMDP methods.


One difficulty faced by developers when working with AMDPs is the handling of SELECT-OPTIONS parameters (selection tables or range tables). The present blog will exactly tackle that topic.


Simply explained, the handling of SELECT-OPTIONS parameters in the context of AMDPs requires two steps:

  1. Conversion of the selection tables into an SQL WHERE clause using method CL_SHDB_SELTAB=>COMBINE_SELTABS( )
  2. Handling of dynamic WHERE clauses within the AMDP method using the function APPLY_FILTER

 

Step 1: Conversion of SELECT-OPTIONS parameters into an SQL WHERE clause

For those of you who have been generating dynamic WHERE clauses till now using the class CL_LIB_SELTAB: Do no longer use it again and if possible even replace such calls (as explained below) in your existing code!

 

The new class CL_SHDB_SELTAB - especially its static method COMBINE_SELTABS( )- shall be used for this purpose instead. It provides a comfortable coverage of the conversion functionality for SAP HANA (refer to SAP Note 2124672SMP login required). This conversion routine includes checks for SQL injections during the conversion of the selection tables into an SQL WHERE clause.

 

Here is a simple demo report showing how to convert the SELECT-OPTIONS parameters into a WHERE clause:

amdp_select_options_01.png


As shown above, you just have to pass an internal table (defined here using the new value operator VALUE) filled with as many SELECT-OPTIONS parameters as required by your scenario. The name of the relevant field (NAME) and of the data reference to the corresponding SELECT-OPTIONS table (DREF) is required for each entry. In case of relevance, it is recommended to specify the exporting parameter IV_CLIENT_FIELD with 'CLIENT' or 'MANDT' (depending on the related table field name) to ensure the addition of the client filter to the WHERE clause.

 

The method returns the dynamic WHERE condition as a string which can then be passed to the AMDP method. Let’s now go to the next step.

 

Step 2: Handling of dynamic WHERE clauses within the AMDP method

What needs to be done is very simple: The SQLScript statement APPLY_FILTER is used to apply the selection criteria to the relevant dataset which can be a database table/view, a HANA view (except Analytical view) or an intermediate table variable.

 

Below you can see a code simple showing how to apply the dynamic WHERE clause in both cases; directly on a data source (table or view) [CASE 1] or on an intermediate dataset (table variable) [CASE 2].

amdp_select_options_023.png

The APPLY_FILTER function expects two parameters. The first one is the dataset to which you want to apply the filter and the second one is the generated WHERE clause which is passed as a string argument. Find more information about the APPLY_FILTER function in the SAP HANA SQLScript reference.

 

 

Summary:

  1. Static method COMBINE_SELTABS( ) of the new class CL_SHDB_SELTAB shall be used for the conversion of SELECT-OPTIONS parameters (selection tables or range tables) into an SQL WHERE clause when running on HANA DB.
    • The optional parameter IV_CLIENT should be specified with 'CLIENT' or 'MANDT') when applicable
    • This class implementation is provided for HDB (refer to SAP Note 2124672SMP login required)
  2. The class CL_LIB_SELTAB and its methods are obsolete
  3. Use the SQLScript function APPLY_FILTER to apply the selection criteria to the selected data in the AMDP
    • The function can be applied on database tables/views, HANA views (except Analytical views) or table variables


That's it... bye!


Insert, Update, Modify table using AMDP

$
0
0

Hi All,

 

Can it is possible to insert, update,modify tables using AMDP?

If yes then example code would be helpful for me.

 

 

- Thanks,

   Amit

ABAP for SAP HANA Reference Scenario - Video Tutorials

$
0
0

getting_started_bw.pngTutorials_bw.pngSupport_Packages_bw.pngVideos_co.png


This page provides a collection of video tutorials about ABAP for SAP HANA developements based on SAP NetWeaver AS ABAP 7.4 (and beyond). You can find more videos in the different playlists of the ABAP channel on Youtube.

 

 

Video Tutorials based on AS ABAP 7.4 SP08 (New)

 

AMDP

Modification-free enhancement of AMDP using BAdIs

 

ABAP CDS

 

 

Definition of CDS views
with input parameters

Modification-free enhancement
of  CDS Views

>

 

Others (Enhanced Search help, ABAP Channels, ...)

Enhanced Search help with Type-Ahead and Fuzzy Search

Working with ABAP Push
Channels (APC)

Working with ABAP Messaging
Channels (AMC)

Implementing collaboration scenarios using ABAP Channels (APC & AMC)

 

Video Tutorials based on AS ABAP 7.4 SP05

ABAP Managed Database Procedures (AMDP)

AMDP allow the implementation of data-intensive and complex application logic in the database. They are currently only supported for SAP HANA database and the SQLScript language.

 

Overview of ABAP Managed
Database Procedure on SAP HANA

Implementation of AMDP on SAP HANA based on AS ABAP SP05

Debugging of AMDP on SAP HANA based on AS ABAP SP05

How to extend an AMDP in a modification-free manner with AMDP BAdI

ABAP Core Data Services (CDS)

Introduction into advanced view building with CDS in ABAP

Building CDS views in ABAP on SAP HANA


ALV with IDA & Enhanced Search Help

SAP List Viewer with Integrated Data Access

Search Help Objects with Type-ahead and Full Text Fuzzy Search

 

 

Performance Tooling

Find optimizable Custom Code with the SQL Performance Tuning Worklist

 

 

Video Tutorials based on AS ABAP 7.4 SP02

Using native HANA procedures in ABAP (Related SCN document)

Using native HANA Views in ABAP

(Related SCN document)

Using the HANA Transport Container

(Related SCN document)

 


Back to the top

SAP HANA: Modify From Table

$
0
0

Hi Experts,

 

We are upgrading to HANA and facing below mentioned issue.

 

1. When we Run SCI we get DB Operation for Modify statement, but not getting any resolution for this. Please refer Image1.jpg

2. Please refer Image2.JPG for Code.

 

Please help us on this issue ASAP.

*** ERROR => Connect to database failed, rc=1, rcSQL=10 SQLERRTEXT : invalid username or password "

$
0
0

Hello,

 

We have SAP SLT system on SAP HANA DB(1.0 SPS 9 revision 93) . It is distributed system.

 

Yesterday while taking restart of system we are unable to connect Db with R3trans -d  RC12.

trans.log is giving error "*** ERROR => Connect to database failed, rc=1, rcSQL=10. SQLERRTEXT : invalid username or password "

 

Kindly help to solve as I am very new to HANA DB.

 

 

trans.log

 

4 ETW000 R3trans version 6.25 (release 742 - 11.02.15 - 14:06:42).

 

4 ETW000 unicode enabled version

 

4 ETW000 ===============================================

 

4 ETW000

 

4 ETW000 date&time   : 03.04.2015 - 05:35:31

 

4 ETW000 control file: <no ctrlfile>

 

4 ETW000 R3trans was called as follows: R3trans -d

 

4 ETW000  trace at level 2 opened for a given file pointer

 

4 ETW000  [     dev trc,00000]  Fri Apr  3 05:35:31 2015                                                 124  0.000124

 

4 ETW000  [     dev trc,00000]  db_con_init called                                                        17  0.000141

 

4 ETW000  [     dev trc,00000]  set_use_ext_con_info(): usage of ssfs switched off (rsdb/ssfs_connect=0)

 

4 ETW000                                                                                                  51  0.000192

 

4 ETW000  [     dev trc,00000]  determine_block_commit: no con_hdl found as blocked for con_name = R/3

 

4 ETW000                                                                                                  19  0.000211

 

4 ETW000  [     dev trc,00000]  create_con (con_name=R/3)                                                 16  0.000227

 

4 ETW000  [     dev trc,00000]  Loading DB library '/usr/sap/SLT/SYS/exe/run/dbhdbslib.so' ...            33  0.000260

 

4 ETW000  [     dev trc,00000]  DlLoadLib() success: dlopen("/usr/sap/SLT/SYS/exe/run/dbhdbslib.so"), hdl 0, count 1, addr 2065de0

 

4 ETW000                                                                                                6278  0.006538

 

4 ETW000  [     dev trc,00000]  Library '/usr/sap/SLT/SYS/exe/run/dbhdbslib.so' loaded                    14  0.006552

 

4 ETW000  [     dev trc,00000]  function DbSlExpFuns loaded from library /usr/sap/SLT/SYS/exe/run/dbhdbslib.so

 

4 ETW000                                                                                                  18  0.006570

 

4 ETW000  [     dev trc,00000]  Version of '/usr/sap/SLT/SYS/exe/run/dbhdbslib.so' is "742.06", patchlevel (0.38)

 

4 ETW000                                                                                                  86  0.006656

 

4 ETW000  [     dev trc,00000]  function dsql_db_init loaded from library /usr/sap/SLT/SYS/exe/run/dbhdbslib.so

 

4 ETW000                                                                                                  16  0.006672

 

4 ETW000  [     dev trc,00000]  function dbdd_exp_funs loaded from library /usr/sap/SLT/SYS/exe/run/dbhdbslib.so

 

4 ETW000                                                                                                  34  0.006706

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    23  0.006729

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=-1,command=39,arg_p=(nil))                       13  0.006742

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    16  0.006758

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=-1,command=10,arg_p=7fff553bba30)                12  0.006770

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    11  0.006781

 

4 ETW000  [     dev trc,00000]  New connection 0 created                                                  10  0.006791

 

4 ETW000  [     dev trc,00000]  0: name = R/3, con_id = -000000001, state = DISCONNECTED, tx = NO , bc = NO , oc = 000, hc = NO , perm = YES, reco = NO , info = NO , timeout = 000, con_max = 255, con_opt = 255, occ = NO , prog =

 

4 ETW000                                                                                                  27  0.006818

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=-1,command=10,arg_p=1896960)                     19  0.006837

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    11  0.006848

 

4 ETW000  [     dev trc,00000]  db_con_connect (con_name=R/3)                                             10  0.006858

 

4 ETW000  [     dev trc,00000]  determine_block_commit: no con_hdl found as blocked for con_name = R/3

 

4 ETW000                                                                                                  20  0.006878

 

4 ETW000  [     dev trc,00000]  find_con_by_name found the following connection:                          10  0.006888

 

4 ETW000  [     dev trc,00000]  0: name = R/3, con_id = 000000000, state = DISCONNECTED, tx = NO , bc = NO , oc = 000, hc = NO , perm = YES, reco = NO , info = NO , timeout = 000, con_max = 255, con_opt = 255, occ = NO , prog =

 

4 ETW000                                                                                                  19  0.006907

 

4 ETW000  [     dev trc,00000]  { DbSlHDBConnect(con_info_p=(nil))                                        37  0.006944

 

4 ETW000  [     dev trc,00000]  DBHDBSLIB : version 742.06, patch 0.038 (Make PL 0.100)                   18  0.006962

 

4 ETW000  [     dev trc,00000]  HDB shared library (dbhdbslib) patchlevels (last 10)                      17  0.006979

 

4 ETW000  [     dev trc,00000]    (0.038) Close all result sets (note 2124493)                            12  0.006991

 

4 ETW000  [     dev trc,00000]    (0.038) Initialization of deferred LOB writing for ZDO changed (note 2106186)

 

4 ETW000                                                                                                  17  0.007008

 

4 ETW000  [     dev trc,00000]    (0.032) DBSL supports deferred lob writing with HANA SP9 (note 2106186)

 

4 ETW000                                                                                                  21  0.007029

 

4 ETW000  [     dev trc,00000]    (0.031) Read last SQL message after the connection is closed (note 2104804)

 

4 ETW000                                                                                                  20  0.007049

 

4 ETW000  [     dev trc,00000]    (0.031) Check Enable_Select_Into_Scalar_UDF before the ALTER call (note 2105480)

 

4 ETW000                                                                                                  31  0.007080

 

4 ETW000  [     dev trc,00000]    (0.029) Certain SAP applications hang for several minutes (note 888312)

 

4 ETW000                                                                                                  21  0.007101

 

4 ETW000  [     dev trc,00000]    (0.029) Structure DBSL_CA initialized (note 2094457)                    15  0.007116

 

4 ETW000  [     dev trc,00000]    (0.027) Data aging for the service connection (note 2090613)            23  0.007139

 

4 ETW000  [     dev trc,00000]    (0.026) Use prepared statements for R3szchk (note 1952609)              14  0.007153

 

4 ETW000  [     dev trc,00000]    (0.025) Use bulk fetch on a result set of a procedure call (note 2082661)

 

4 ETW000                                                                                                  20  0.007173

 

4 ETW000  [     dev trc,00000]                                                                             9  0.007182

 

4 ETW000  [     dev trc,00000]   -> init()                                                                19  0.007201

 

4 ETW000  [     dev trc,00000]    STATEMENT_CACHE_SIZE = 1000                                             40  0.007241

 

4 ETW000  [     dev trc,00000]   -> init()                                                               866  0.008107

 

4 ETW000  [     dev trc,00000]   -> loadClientRuntime()                                                   20  0.008127

 

4 ETW000  [     dev trc,00000]  Loading SQLDBC client runtime ...                                         11  0.008138

 

4 ETW000  [     dev trc,00000]  SQLDBC Module  : /usr/sap/SLT/hdbclient/libSQLDBCHDB.so                 8256  0.016394

 

4 ETW000  [     dev trc,00000]  SQLDBC Runtime : libSQLDBCHDB 1.00.82.00 Build 0394270-1510               59  0.016453

 

4 ETW000  [     dev trc,00000]  SQLDBC client runtime is 1.00.82.00.0394270                               31  0.016484

 

4 ETW000  [     dev trc,00000]   -> quiesceConnection()                                                   14  0.016498

 

4 ETW000  [     dev trc,00000]   -> getNewConnection()                                                    12  0.016510

 

4 ETW000  [     dev trc,00000]   <- getNewConnection(con_hdl=0)                                           66  0.016576

 

4 ETW000  [     dev trc,00000]   -> checkEnvironment(con_hdl=0)                                           20  0.016596

 

4 ETW000  [     dev trc,00000]   -> connect(con_info_p=(nil))                                             31  0.016627

 

4 ETW000  [     dev trc,00000]  Try to connect via secure store (DEFAULT) on connection 0 ...             43  0.016670

 

4 ETW000  [dbhdbsql.cpp,00000]  *** ERROR => Connect to database failed, rc=1, rcSQL=10                 7276  0.023946

 

4 ETW000  [     dev trc,00000]  SQLCODE    : 10                                                           26  0.023972

 

4 ETW000  [     dev trc,00000]  SQLERRTEXT : invalid username or password                                 13  0.023985

 

4 ETW000  [     dev trc,00000]   -> SetSdbDbslCA(errcode=10)                                              16  0.024001

 

4 ETW000  [     dev trc,00000]   -> freeConnection(con_hdl=0)                                             19  0.024020

 

4 ETW000  [     dev trc,00000]     close all opened locators of connection 0                              13  0.024033

 

4 ETW000  [     dev trc,00000]  } DbSlHDBConnect(rc=99)                                                   45  0.024078

 

4 ETW000  [    dblink  ,00000]  ***LOG BY2=>sql error 10     performing CON                               55  0.024133

 

4 ETW000  [    dblink  ,00000]  ***LOG BY0=>invalid username or password                                  14  0.024147

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=0,command=41,arg_p=d774d8)                       41  0.024188

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    25  0.024213

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=0,command=14,arg_p=7fff553b2420)                 14  0.024227

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    11  0.024238

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=0,command=50,arg_p=7fff553b2438)                 12  0.024250

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    14  0.024264

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=0,command=13,arg_p=7fff553b2390)                 28  0.024292

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    13  0.024305

 

4 ETW000  [     dev trc,00000]  { DbSlHDBControl(con_hdl=0,command=52,arg_p=7fff553b23e0)                 12  0.024317

 

4 ETW000  [     dev trc,00000]  } DbSlHDBControl(rc=0)                                                    11  0.024328

 

2EETW169 no connect possible: "DBMS = HDB                              ---  SERVER = '' PORT = ''"

 

4 ETW000  [     dev trc,00000]  release memory of the SIBU buffers                                        67  0.024395

 

4 ETW000  [     dev trc,00000]  release memory of the STATEMENT CACHE                                     13  0.024408

what is the difference between HANA code and ABAP Code

$
0
0

Hi Expects,

 

I have lot of confusion with ABAP and HANA.

 

My customer was using HANA database in SAP. when i login that system its allowing to written ABAP code.  Its working fine.

 

My doubt is,

HANA is only database server or its having some other coding technique like ABAP?.

 

its have separate coding means, SAP is complete ABAP code then how the HANA code will work

 

Regards

Karthikeyan K

ABAP Managed Database Procedure- Data Preview

$
0
0

What is AMDP ?

 

ABAP managed database procedure is a simple ABAP class method containing database-specific procedure coding. The code within the method is pushed to the database layer and executed within the database. Thus significant performance improvements of data-intensive processes can be achieved by code push-down from the application server to the database server. This reduces the number of data transfers and the amount of transferred data between both servers.

 

Need for AMDP

 

With SAP NetWeaver 7.40 SP02 AS ABAP, there is a possibility to access so-called Stored Database Procedures defined in SAP HANA via Database Procedure Proxies from the ABAP application server. From a technical point of view, a stored procedure is written in SQLScript in SAP HANA and the corresponding database procedure proxy (or proxies) can be generated in the ABAP server based on the interface definition of the database procedure (Bottom-Up approach). The call of the procedure proxy in ABAP triggers the procedure execution in SAP HANA. On the other side, the disadvantage of having a mix of ABAP coding and database-specific coding is that they are managed by different lifecycle management tools (ABAP and HANA), which need to be synchronized manually.

In contrast to this Bottom-Up approach, a Top-Down approach solves these synchronization issues, because the database procedure coding is embedded within ABAP code, which is managed by the ABAP lifecycle management tools and is executed at runtime on the database. Several technical realizations with ABAP Database Connectivity (ADBC) and EXEC SQL are available since a longer time, but they are not feasible to use in case of more complex scripts. With SAP NetWeaver 7.40 SP05 AS ABAP there is a new way available to implement database procedures within the ABAP stack as so-called ABAP Managed Database Procedures (AMDP). The procedure coding is implemented directly in method container defined in a global ABAP class. Therefore, the corresponding method needs to be marked as AMDP method in the implementation part of the class and the method body contains database-specific script language coding like SQLScript instead of ABAP code, which is also checked regarding syntactical correctness during implementation. Based on the script coding, a database procedure is generated within SAP HANA once the new or changed AMDP method is executed in the ABAP system (not at compile time).This allows the reuse of the ABAP transport infrastructure for these database procedures, which do not need to be transported via the SAP HANA transport infrastructure.

 

From a technical point of view, AMDP methods have to be implemented in ABAP in Eclipse development tool, exclusively. Furthermore, for each AMDP method exactly one database procedure is generated in the database. This allows for the protection of AMDP methods against unauthorized usage based on the ABAP package concept as for any other classical ABAP method. This is not possible for SAP HANA stored procedures, because several database procedure proxies can be created on the ABAP side to access a particular stored procedure.

 

Creating AMDP method

A class method can only be implemented as AMDP, if some prerequisites are fulfilled in the class definition as well as in the class implementation part as depicted in the following figures.

amdp1.jpg

amdp2.jpg

Thus an ABAP developer can write database procedure directly in an ABAP class and call of the procedure is call of the class method i.e., execution of AMDP method.

 

Syntax enhancement explanation:

• OPTIONS: The optional addition declares database specific options for a database procedure. Currently we support only the read-only option, which is mapped to the "reads sql data" security privilege.

• USING: All database objects that are used inside the method body, must be declared in advance. This declaration is needed for database tables, views, and other database procedures.

• Language: Currently SQLScript is supported but in future support for other languages of HANA (e.g, LLANG) or of other DB vendors is possible.

code.jpg

Step 2: Executing the AMDP method in the ABAP class. Right-click the AMDP method in the Project Explorer or in the Outline view. Select the Data Preview option from the context menu. Currently public AMDP methods support the Data Preview feature.

amdp3.jpg

Step 3: An editor appears with an editable section between two non-editable sections. Non-Editable section contains the method signature definition. The editable area where code (glue code) for creation of constructor can be defined by the user. The exporting parameter values can also be changed in this section. The syntactic check for the code is done through the check button at the top of the editor.

amdp4.jpg

Step 4: Change the exporting parameter value to 100.(It specifies the number of records to be fetched in this case).Press the Execute button on the toolbar or right-click on the editor area and select Execute from the context menu.

amdp5.jpg

The preview tool is a simple tool to quickly see the results of the glue code after execution. The generated glue code would not have the complete code for object creation in case of AMDP classes with complex constructor signatures (with object references and deep structures). Nevertheless, we do not wish to restrict the usage to only static methods but rather expect the developer to fill in the appropriate object instantiation calls in the free-style glue code editor.

 

Related links:Introduction to AMDP

                       Use of Secondary Database Connection when calling AMDP methods

                       New ABAP for HANA features in SAP NW 7.4SP08

                       Exploring AMDP

SQLScript error in AMDP

$
0
0

Hello,

 

please guide me with below error,

 

 

  METHOD TEST_CEFUNC BY DATABASE PROCEDURE

                         FOR HDB

                         LANGUAGE SQLSCRIPT

                         options READ-ONLY

                         USING VBAK VBAP.

                        

LT_VBAK = CE_COLUMN_TABLE("VBAK");

LT_VBAP = CE_COLUMN_TABLE("VBAP");

                        

ET__DATA = CE_JOIN (:LT_VBAK,:LT_VBAP,["VBELN"],["VBELN","AUGRU","NETWR","BSTNK","KUNNR","POSNR","MATNR","KWMENG"]);

 

ENDMETHOD.

 

 

SQLSCRIPT message: Parameter must be a valid column table name: ZCL_TEST_1=>VBAK#covw  

 

 

Why am i getting above SQLScript error? I am using HANA database system and VBAK/VBAP are column based tables.


Cross Schema AMDP Class Transport

$
0
0

Hello Experts,

 

We are tying to implement AMDP based developments which contains multiple  schema tables and we are pointing by giving schema name i.e. DV.MARA. Its working fine  but at the  time of transportation we need to change the schema name to DP.MARA(production schema DP).

 

During transportation we are getting below error.

 

ZCL_AMDP====================CI does not exist on the database with version

 

Expert advice/help would be appreciated.

 

-Amol Samte

Reading PM Characteristic Values on SAP Hana

$
0
0

Are there any updated SAP functions or Classes to read PM characteristic values?

 

Currently we are using  BAPI_CLASS_GET_CHARACTERISTICS  and  BAPI_OBJCL_GETCLASSES.  This is very inefficient on a Hana database as characteristics are read for each separate object in stead of all required objects at the same time.

 

Obviously we can write our own methods to read this data, but our preference is to use SAP standard where possible.

Error in CDS View

$
0
0

In my program I am fetching a certain type of inbound IDOC which in 53 status and updating my custom table, for which I have written a select query which executes perfectly but gives me an error while executing as a DDL source.

 

Select Query in Program: -

 

Program.jpg

 

DDL Source: -

 


DDL Source1.jpg

 

Error:- Preceding INT2 field cannot be a key field.

 

Even though I haven't declare INT2 field as a key field, the view which is being created (after commenting field sdata) is considering that. Please help me fix this issue.

 

Table.jpg

Write to ERP Tables on HANA DB using SQL script

$
0
0

Hello All,

 

We are using HANA as our primary database for ABAP system and trying to feed the data to ABAP tables using SQL script and experiencing authorization errors . Please see below for more details.

 

Scenario.

I am getting no authorised error when i try to write some data to Z* tables using SQL script in HANA studio.But I am able to create new tables in the same schema.

query error.JPG

 

As shown above Query1: SAPSR1 is the schema which contains underline ABAP tables. ZGSA is existing table and now i am trying to insert new rows into it.

 

Query 2&3: Creating new tables in SAPSR1 works fine.

 

Can you please suggest me whether it is right approach or i need to have RFC to update these table from some other tool/app?.

 

Thanks in advance,

Naresh

Reg: ABAP application on HANA CLOUD PLATFORM HCP

$
0
0

Hi,

I am new to ABAP for HANA, i would like to develop a small abap application or Workflow and deploy on the HANA cloud platform ,HCP Is it possible? If possible could you please give your valuable suggestions.

At the same time, do we need to develop the abap applications on HCP or we need to develop it on eclipse and deploy it on Hana cloud platform.

 

Regards,

Raju

Is there a (supported) way of migrating regular ERP IDES system to HANA for use of Simple Finance?

$
0
0

We have installed a SAP ERP IDES system but we'd like to try out Simple Finance. We could do a fresh install of ERP but we like the demo data included in IDES system. Is there a simple SAP supported way of migrating our system (or data to be precise)?

CAR 2.0 external view /POSDW/V_MAT

$
0
0

Hello,

 

our car 2.0 system (client 100) doesn't display in se11 any entries for ABAP external view /POSDW/V_MAT. The external view is already active. The client for the data in the HANA are different from the client 100 of our car system. Is there any option to display the results of any clients?

 

Thank you!


How to Figure Type of HANA View in ABAP?

$
0
0

Hi,

 

Is there a way in ABAP to find out (by looking up some table or calling an FM/method) the type of a HANA view? I have an ABAP system that has a HANA database. Views of different types (calculation, attribute, analytic) have been created in HANA. In my ABAP code, I have the name of the view from which I want to find out the type of the view. Any ideas?

 

Thanks,

Akshat

Query on CDS Views and AMDPs

$
0
0


Hello,

 

I have few basic questions on CDS views and AMDPs:

 

1. How do we identify the potential candidates in existing code where CDS views or AMDPs can/should be used for code-push down? Are there any recommendations?

 

2. Should CDS views or AMDPs be used only for cases where we have data intensive calculations or they can be used as alternative to performance optimization techniques like to replace scenarios where multiple SELECTs or JOINs are used etc.?

 

3. A CDS view internally can also contains a SELECT statement with JOINs. How does this help improve performance? I can just write the same SELECT in a CDS view and it will improve performance because the processing is at DB level? Is that a valid argument?

 

Best Regards,

Mohit

How to read the hierarchy data from the same table using loop in AMDP method

$
0
0

Hi All,

 

We have a requirement to get the top partner from BUT050 table.

Here the Top parent is nothing but the top most in the hierarchy of the partners from BUT050.

 

Example:

For partner 1234 (BUT050-PARTNER1) there is partner 3523(BUT050-PARTNER2) one level above

For partner 3523(BUT050-PARTNER1)  there is partner 4544 (BUT050-PARTNER2) last level .

 

so in this case for the partner 1234 the Top parent is 4544 .

 

I have created AMDP Procedure method to get the top-parnet and below given is the logic implemented in AMDP method.

Here i have implemented a recursive logic with the WHILE loop to get the top most hierarchy partner from the same table BUT050

 

IV_Parent is the input partner and ev_top_parent is the output value.

 

AMDP Procedure Method:

    DECLARE lv_date VARCHAR(8) := TO_VARCHAR (current_date, 'YYYYMMDD');

    DECLARE found INT := 1;

 

          iv_partner1 =  SELECT partner1 FROM but050

                          WHERE partner2 = iv_partner

                          AND reltyp = :iv_hierarchy

                          AND date_to >=  :lv_date

                          AND date_from <= :lv_date;

 

     WHILE found <> 0  do

 

       select partner1 into ev_top_parent from :iv_partner1;

                       iv_partner1 =  SELECT partner1 FROM but050

                       WHERE partner2 in ( select partner1 from :iv_partner1 where partner1 is not null)

                       AND reltyp = 'ZBP004'

                       AND date_to >= :lv_date

                       AND date_from <= :lv_date;

       select COUNT ( partner1 ) INTO found FROM :IV_PARTNER1;

    END WHILE;

 

This method is working fine, but here it is only taking one single partner and getting the top parent as output.

 

Now i would like to convert this mehtod so as to accept n number of partners (not one single partner) as input and should process each partner to get the top parent.

 

Could anyone guide me how can i handle the given AMDP method further so as to work some how it is within another loop from other AMDP method.

Thanks.

 

Regards,

Laxman.P

error while launching HANA studio

$
0
0

Hi,

 

i have recently updated my HANA studio to latest release as provided in Download Object 51048744_1.

 

i think it is HANA studio 2.0 release 95.

 

after i installed, i am getting the attached error while launching HANA studio.

 

any suggestions on how to fix this?

 

my desktop OS : windows 8.1 x86_64

CDS CURRENCY CONVERSION (ABAP on HANA)

$
0
0

Hi All,

 

I'v tested CDS with currency conversion versus the classical approach with the function module for currency converion on application layer (CONVERT_AMOUNT_TO_CURRENCY). The classical approach seemed to be much faster, so I started testing.

 

Please find attached the objects used for testin:

  • y_cds_test_currconv.txt -> Simple ABAP report with both options
  • Y_CDS_TEST_CURRCONV.txt -> The CDS view

 

I test on a system with AS ABAP 7.4 SP8 + HANA SP 8 and also AS ABAP 7.4 SP8 + HANA SP 9.

 

There's actually an OSS, but the it's refering to Oracle DB and not HANA DB (2067294).

 

Native SQL statment (tracing done with ST05)

 

SETSCHEMA"SAPMDE";

SELECT

   "CARRID",

   "CONNID",

   "FLDATE",

   "SOURCE_PRICE",

   "SOURCE_CURRENCY",

   "TARGET_AMOUNT",

   "TARGET_CURRENCY"

  FROM

    "YTESTCUR" ( "TO_CURRENCY" => 'EUR' ,

                              "EXC_DATE" => '20150427' ) "YTESTCUR"

  WHERE

    "MANDT" = '100'


Result

native_sql.gif

 

Change the CDS and replace the CURRENCY_CONVERSOIN by table field PRICE. (to check if the slow performance is cause by the currency conversion function)
cds_change.jpg

Result run native SQL statement:

cds_change_result.jpg

 

I have also run the SAP HANA Plan Visualizer, refer the next screenshots.

 

visualizer1.jpg

 

visualizer2.jpg

visualizer3.jpg

 

It seems to me that the currency conversion has some performance issue. Has anybody experienced the same and maybe found a solution?

 

One final remark: for testing you need to have data in FLIGHT model. (Go to SE38 and run SAPBC_DATA_GENERATOR to generate data)

 

Thanks in advance.

 

Best Regards,

 

Bart

Viewing all 831 articles
Browse latest View live


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