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

how to practice with ABAP Development Tools on Eclipse

$
0
0

Hello All,

 

I was checking all through SCN if I could get some way out to practice with ADT - the tool and the new features of programming with ABAP.

 

But could only see the CAL and AWS way where I need to pay for the hosting charges.

 

As far as I remember there was a Trial Developer Edition of AS ABAP 7.03 which was compatible to run with ADT, but could not find that standalone download of the AS ABAP on SCN.

 

So my question in short is :

 

Is there any way to practice with the ABAP on Eclipse for free ie. by having some standalone AS ABAP installed on local system ?

 

 

Thanks in advance,

Rahul


Error while accessing HANA-Database

$
0
0

Hi all,

 

I try to access the HANA-database (installed as secondary database).

The table is replicated in HANA and I have created a program in ERP with the following procedure:

 

SELECT * FROM [table]

                 CONNECTION ('HANADB')

                 INTO lt_table.

 

HANADB is the database connection name for HANA (table DBCON).

By running the program I become the following error:

 

Dump.jpg

 

The file "dbhdbslib.dll" is already in the folder "C:\usr\sap\IS0\DVEBMGS00\exe\". Any idea what is missing?

 

Thx for help, mlf.

How to Call HANA Procedure in ABAP

$
0
0

Hi Everyone,

 

I am new to ABAP

I have created a procedure in HANA that accepts two input parameters and outputs a table
I am using HANA as a Secondary Database
How can I call this procedure in my ABAP program?

 

Regards,

Vivek

module pool screen validation

$
0
0

Hi all..

this is fiels

    MATNR,  

    MAKTX.      

    ZVFROM ,DATE.  

    ZVTO_DATE  .

   ZVCREATED_ON.           

   ZVCREATED_BY.       

   ZVCHANGED_ON.

   ZVCHANGED_BY .

using table control  in module pool

When user clicks the INSERT button, Fields MATNR,  ZVFROM_DATE and ZVTO_DATE will be input fields, it will accept the values. Other columns should be in display mode.


Regards.

     RAM

SWLT tool static check finding is showing unexpected results

$
0
0

I am using SWLT transaction to find some static checks in code to optimize db queries. After getting static check it shows some loops and some method calls but when on double clicking that loop its not showing loop in code rather it shows an if-else statement.

Enforce Authorizations for SADL-Based Applications

$
0
0

SADL (Service Adaptation Definition Language) enables fast read access to data for scenarios on mobile and desktop applications based on HANA by means of a query push-down. As part of the query push-down, all users' input is collected through consumer APIs and used to configure the request for the database. Specifically, the authorization enforcement in this process is interposed between query specification by application or end user and data retrieval from the database. This document provides a detailed guide on how to use the SAP authorizations in your SADL-based applications.

View this SAP How-to Guide

Fine-Tune the Execution of SADL-Based Gateway Services

$
0
0

SADL (Service Adaptation Definition Language) enables fast read access to data for scenarios on mobile and desktop applications based on HANA, by means of a query push-down. As part of the query push-down, the user's input and the application parameters are collected through consumer APIs and used to configure the request for the database. The SADL engine adds the resulting restriction to the condition for the database select (WHERE-clause). This document provides a detailed guide on how to use the query options in order to parameterize and fine-tune the execution of your SADL-based SAP Gateway Services.

View this SAP How-to Guide

Tutorial: How to Configure Fuzzy Search in Search Help using CDS View

$
0
0

What's in this document


This document describes how to configure Fuzzy Search in Search Help using CDS Views for ABAP. This feature is available in SAP NetWeaver 7.4 SP5 and higher.

 

Scenario

    The objective of this document is show, how easy it is to configure fuzzy search in Search Help ABAP Object with zero coding.

    SAP HANA allows fast search access to character based columns. Fuzzy Search is a fast and fault-tolerant search feature for SAP HANA. A fuzzy search returns records even if the search term contains additional or missing characters or other types of spelling errors. That can be very helpful in F4 Search Helps or duplicate checks.

    The traditional way of implementing the fuzzy search logic in Search Help mandates implementing a function module and assigning the same as Search Help Exit of the Search Help. The fuzzy search logic of course should then be implemented using Native SQL [ADBC] since it is a HANA specific feature. However, from SAP NetWeaver AS ABAP 7.4 SP05 onwards, Search Help Dictionary Object provides an additional option – Enhanced Options – where you can configure fuzzy search options [like accuracy value, cross column options etc.]. This eliminates the need of implementing function module to achieve in such scenarios.

 

Technical Background Information

Search Help

    Search helps can be used to assign an input help (F4 help) to screen fields. The user can display the list of all possible input values for a screen field with the input help.

    There are several types of Search help such as:

  • Elementary search helps: This type implements a search path for determining the possible entries.
  • Collective search helps: This type contains several elementary search helps. A collective search help therefore provides several alternative search paths for possible entries.
  • Append search helps: This type can be used to enhance collective search helps delivered by SAP with customer-specific search paths without requiring a modification.

 

Core Data Services (CDS) for ABAP

    Core Data Services (CDS) enhanceSQL to allow defining and consuming semantically rich data models, thereby improving consumption, performance and interoperability. CDS simplifies and harmonizes the way you define and consume your data models, regardless of the consumption technology. CDS in ABAP provides you with a data definition language (DDL) for defining semantically rich database tables/views (CDS entities) and user-defined types in the database.

    For several years for now, it is possible to define views in the ABAP Dictionary, but these views are quite restricted. For example, you can only define inner join for database views. Outer joins are available only for help and maintenance views. However, it is not possible to perform aggregations in views or define nested views. With ABAP 7.4 SP05, a new editor is available to define views directly in the Eclipse-based ABAP development environment. With this Source-based editor you can define CDS entities, which can be consumed in ABAP programs using Open SQL.

    The CDS View building provides another way of code pushdown using features that are similar as in Open SQL. With CDS View building it is possible to define:

  1. Projections, aggregations, and groupings
  2. Use expressions (like CASE), SQL built-in functions
  3. UNION and UNION ALL and non-equi INNER JOINs

    Nesting of Views with associations between the View entities (associations can be consumed in the WHERE clause as well as in expression in Open SQL queries).

 

Data Model

    Before getting started, you must generate data related to Enterprise Procurement Model (EPM). You can use the transaction SEPM_DG_OIA to generate
the data for EPM model. For more information about EPM, see http://scn.sap.com/docs/DOC-31458

    For creating search help, use the CDS view SEPM_CDS_OPEN_INVOICE_REDUCED. The ABAP view name of this CDS view is EPMAPPS_CDS_OIR.
This CDS view is part of the package S_EPM_OIA_APPS_PROVIDER. This CDS View fetches all the Open Sales Orderssales orders whose payment is
yet to be made by the Buyers. Buyer Name, Dunning Level, Overdue Invoice Amount, Currency are some of the details retrieved for each of the Sales Order.
Below is the structure of the CDS view [SEPMAPPS_CDS_OIR].

  1. SO_ID
  2. COMPANY_NAME
  3. CURRENT_DUNNING_LEVEL
  4. DUNLEV_LANGU
  5. DUNLEV_DESCR
  6. CURRENCY_CODE
  7. GROSS_AMOUNT

 

Step-by-Step Procedure

    The steps to implement fuzzy search logic in CDS view [SEPMAPPS_CDS_OIR] using “Enhanced Options“ in Search Help are described below:

  1. Create a Search Help [ZH_EPM_OIA_SO] using the SE11 transaction. Make sure it is an Elementary Search Help.
  2. Enter the name of the CDS view name [SEPMAPPS_CDS_OIR] in "Selection method" input field.
  3. Use the "Enhanced Options" section to configure the fuzzy search options [Refer screenshot given in step 4].
  4. Create Search help parameters such as SO_ID and COMPANY_NAME and mark them as importing parameter, if you want to search for both company_name and so_id. You can also mark both the parameters as exporting parameters, if you want to display both, company_name and so_id, as output of the fuzzy search as shown in the snapshot below. oia_fuzzy.png
  5. Currently, the SE11 transaction does not support enhanced options in the test mode. You need to test them in a normal screen or by using a report with the type-ahead API. Attached is the source for the report, ZDSH_DYNAMIC_TYPE_AHEAD_SHLP, to test the search Help.
  6. Execute the report ZDSH_DYNAMIC_TYPE_AHEAD_SHLP created in step 5 above.
  7. Enter the following: ZH_EPM_OIA_SO in the PA_SHLP field, * in the PA_FLD field and the search string "oi" in the PA_REQ field and click on the  Execute button.

    oia_fuzzy1.png

  8. Fuzzy search displays the type-ahead for the search string “oi”.

oia_fuzzy_results.png.jpg


Note: Enhanced Options available in Search Help work only with DDIC tables and CDS view. Currently, Enhanced Options does not support the usage of external view.


How to convert a timestamp to date/time in CDS View?

$
0
0

Dear experts,

 

I would like to convert a timestamp to a date and time within a CDS view.

This is what I tried to do:

 

Cast (Cast(<timestamp> as abap.dec(8,0)) as abap.dats) as <date>

 

I also thought about first converting the timestamp into a plain numerical character, then using substring and then casting it to abap.dats. Then its giving me an error that says: "dec can't be converted into numc".

 

The above written code also throws an error - "function not allowed/ no cast within a cast".

It is quite nasty not being able to write a cast within a cast - how else am i supposed to achieve a date here?

 

I am looking forward to have your answers!

 

Thanks and BR

Anja

Video Tutorials about ABAP for SAP HANA

$
0
0

This page provides a collection of video tutorials about ABAP for SAP HANA developement based on SAP NetWeaver AS ABAP 7.4 (and higher). More information, guides and tutorials can be found here: http://scn.sap.com/docs/DOC-35518.

 

 

ABAP for SAP HANA Reference Scenario - Overview

This video gives a brief overview of the demo application Open Items Analysis (OIA) which is intended to provide developers with how-tos around the native ABAP consumption of the new powerful HANA-related capabilities introduced with SAP NetWeaver 7.4 powered by SAP HANA. It shows how to access and used the delivered ABAP and HANA developement entities.
Access the video here.

 

Implementing ABAP Managed Database Procedures on SAP HANA (New)

This tutorial demonstrates how to implement an ABAP Managed Database Procedures (AMDP) on SAP HANA, based on SAP NetWeaver AS ABAP 7.4 Support Package 5.

Previously watch the video "Introduction into ABAP Managed Database Procedures on SAP HANA".

 

 

Debugging ABAP Managed Procedures on SAP HANA(New)

This tutorial demonstrates how to debug an ABAP Managed Database Procedure on SAP HANA, based on SAP NetWeaver AS ABAP 7.4, Support Package 5.

 

Building Core Data Services Views in ABAP on SAP HANA (New)

This tutorial demonstrates how to build Core Data Services (CDS) views in ABAP on SAP HANA, based on SAP NetWeaver AS ABAP 7.4 Support Package 5.

Previously watch the video "Introduction into Advanced View Building in ABAP on SAP HANA".

 

 

Investigating Custom Code with the SQL Performance Tuning Worklist (New)

This tutorial shortly demonstrates how to investigate custom code optimization for SAP HANA using the SQL Performance Tuning Worklist (SWLT), based on SAP NetWeraver AS ABAP 7.0, Support Package 05.

 

Consuming native SAP HANA procedures in ABAP

In this video tutorial, we see how to use database procedure proxies to  natively consume SAP HANA procedures in ABAP in order to build a quick "Top and Flop" customer list.

For more information on this topic, please visit the SCN document.

 

Consuming native SAP HANA Views in ABAP

In this video tutorial, we see how to use external views to natively consume SAP HANA views in ABAP.

For more information on this topic, please visit the SCN document.

 

 

Using the HANA Transport Container

In this video tutorial, we see how to transport ABAP and SAP HANA content using the HANA Transport Container.

For more information on this topic, please visit the SCN document.

Implement and consume your first ABAP Managed Database Procedure on HANA

$
0
0

This tutorial demonstrates how to use the new the "Top-Down"-approach for consuming HANA procedures provided by means of ABAP Managed Database Procedures delivered with SAP NetWeaver AS ABAP 7.4, Support Package 5.

You'll be guided in a step-by-step manner over the creation, implementation and consumption of an ABAP Managed Database Procedure (AMDP) on HANA.

 

For  a quick and comprehensive introduction into the ABAP Managed Database Procedures, read the Introduction into AMDP written by Jens Weiler and also check the ABAP Development Tools Help (menu entry Help > Help Content). Information, guides and tutorials about the development of ABAP for SAP HANAapplications - meaning applications built out of ABAP and HANA development entities-, visit our SCN Page.

 

Note that the purpose of this tutorial is not to introduce the SQLScript programming language. You will find more infomation on that topic in the SAP HANA SQLScript Reference.

 

 

Prerequisites

  • SAP NetWeaver AS ABAP 7.4 Support Package 5 (or higher) running on SAP HANA
  • SAP HANA Appliance Software SPS 05 (or higher)
  • SAP HANA DB SQLScript V2.0 (or higher)
  • ABAP Development Tools for SAP NetWeaver (version 2.19)

 

Tutorial Objectives

After completing this tutorial, you will be able to:

  • Declare an AMDP class
  • Declare an AMDP method
  • Implement an AMDP method
  • Consume an AMDP method in ABAP

 

Use Case Description

The Account Receivables accountant of your company want to be able to display the so-called top and flop customers in regards to their payment ability based on the gross amount of the open invoices.

The company accountant should be able to select how many customers have to be displayed per category and due to the regular update of the business data, the categorization have to be executed on-the-fly. Millions of open item invoices are typically processed in such tasks.

 

More information about the Open Items Analysis reference scenario underlying this use case is available under http://scn.sap.com/docs/DOC-41248.

 

Procedure Overview

ProcedureOverview.png

 

Step-by-Step Procedure

Step 1: Create an AMDP Class

 

In this step, you will create a regular global class and then mark it as AMDP class by specifying the tag interface for the SAP HANA database platform.

  1. Start the ABAP Development Tools (aka ABAP in Eclipse) - or your SAP HANA Studio - and open the ABAP perspective by selecting menu entry Window > Open perspective > Others…, and choosing the ABAP entry  in the appearing dialog box.

     

  2. Go to your ABAP project in the Project Explorer and create a new class in the package of your choice by selecting the context menu entry New… > ABAP Class

     

  3. Maintain the required information (e.g. ZCL_OIA_TOPANDFLOP as name and “EPM OIA: Best and Worst Customers” as description) and click on Next.
    Select a transport request if required and confirm the creation dialog.
    Step1_3.png

     

  4. Now go to the class definition and insert following line directly after PUBLIC SECTION:
          INTERFACESif_amdp_marker_hdb.

     

  5. Save.
    Toolbar_Save.png

    You've just created your first AMDP class!

Step 2: Declare an AMDP Method

 

You will now declare the method get_top_and_flop which will be implemented as AMDP method later on. This method has an importing parameter for specifying the number of customers to be retrieved for each category (top and flop), and two exporting parameters getting for the two requested result sets.

 

Info: An AMDP class can contain both regular ABAP methods and AMDP methods. An AMDP is declared like a regular static method or instance method in any visibility section. An AMDP method cannot be identified as such in the declaration part of the class. Nevertheless, the parameter interface of an AMDP method has to fulfill specific prerequisites. For example the parameters must be declared using VALUE for pass by value  and return values cannot be declared using RETURNING.

 

Before going ahead with the method definition, we first have to defined the type of the result sets.

 

  1. Define the two types ty_bupa_selection and tt_bupa_selection in the PUBLIC SECTION of the class definition - With ty_bupa_selection defining the table line of our return set, and tt_bupa_selection defining the type of the returned tables.
    For that just copy the below coding after the interface declaration done in the previous steps:

    TYPES:
      BEGIN OF ty_bupa_selection,
        company_name TYPE c LENGTH 80,
        gross_amount TYPE p LENGTH 8 DECIMALS 2,
      END OF ty_bupa_selection.

    TYPES:
      tt_bupa_selection TYPE STANDARD TABLE OF ty_bupa_selection WITH EMPTY KEY.

     

  2. Now define the public static method get_top_and_flop.
    Just copy and pase the coding below directly after the type definitions in the public section:

    CLASS-METHODS get_top_and_flop
      IMPORTING
        VALUE(iv_number) TYPE i
      EXPORTING
        VALUE(et_top)    TYPE tt_bupa_selection
        VALUE(et_flop)  TYPE tt_bupa_selection.

     

  3. An error will be displayed in the editor due to the missing method implementation. Just use the Quick Fix (Ctrl+1) function “Add implementation for get_top_and_flop” to quickly solved this issue.

     

  4. Save your AMDP class.

 

Step 3: Implement the AMDP Method

You will now implement a relatively simple SQLScript-based AMDP method, which retrieves the best and worst customers depending on the gross amount of open invoices.

 

 

Info: Whether a method is implemented as ABAP or as AMDP method is not decided in the class definition, but rather in the class implementation.

An AMDP method is indicated as an AMDP method in the implementation part of the class using the addition BY DATABASE PROCEDURE of the statement METHOD. At the same time, the database platform where the method is used and the programming language used to implement the method are respectively specified with the additions FOR and LANGUAGE. Further additions are available.

 

  1. Mark the method implementation as an AMDP method.
    Go to the class definition and enhance the method with the required additions as displayed below:

    METHODget_top_and_flopBY DATABASE PROCEDURE
                              FOR HDB
                              LANGUAGE SQLSCRIPT
                              OPTIONS  READ-ONLY
                              USING snwd_so_i snwd_so snwd_bpa.

    ENDMETHOD.

    The compiler now knows, that the implementation of the method get_top_and_flop of the class ZCL_OIA_TOPANDFLOP is an SQLScript-based AMDP for the HANA database platform.The addition USING contains the name of the DDIC tables which will be used in the implementation.

     

  2. Now implement the database procedure by copying the SQLScript source below

    --retrieve the best customers
    et_top = selecttop :iv_number bp.company_name as company_name, sum(soi.gross_amount) as gross_amount
              from snwd_so_i as soi
              inner join snwd_so  as so on so.node_key = soi.parent_key
              inner join snwd_bpa as bp on bp.node_key = so.buyer_guid
              group by company_name
              order by gross_amount desc;
    --retrieve the worst customers
    et_flop =selecttop :iv_number bp.company_name as company_name, sum(soi.gross_amount) as gross_amount
              from snwd_so_i as soi
                inner join snwd_so  as so on so.node_key = soi.parent_key
                inner join snwd_bpa as bp on bp.node_key = so.buyer_guid
                group by company_name
                order by gross_amount asc;

    Note: The purpose of this tutorial is not to introduce the SQLScript programming language or to demonstrate how complex the logic of a database procedure can be. The above procedure implements a relatively simple data-intensive function, but of course very complex logic (making even use of the advanced HANA features and functions such as data mining and predictive analysis) can be implemented.

    Info: In order to quickly visualize whether a class contains AMDP methods and where, it is recommended to set a different background color for embedded languages – such as native SQL and SQLScript.
    To achieve this, go to the ADT menu entry Windows > Preferences and select the path General > Appearance > Color and Fonts > ABAP > Syntax Coloring > Embedded Languages (background color) and set the background color of your choice.

  3. Save and activate your AMDP class.

    You're now ready to test your AMDP method!
    AMDP_Class.png

 

Step 4: Create an ABAP Report consuming the AMDP method

We will now create and implement a simple ABAP report which call the AMDP method and display the result sets on the screen.

 

Info: An AMDP method is called like any other method in ABAP Objects. This requires, however, that the central database of the current AS ABAP is managed by the database system for which the AMDP method is implemented - meaning SAP HANA in our case. If not, a runtime error is produced. Detailed analysis of such error can be done using the tools of the ABAP Dump Analysis (ST22).

 

  1. Create the ABAP program ZR_OIA_TOPANDFLOP.
    Select the package of your choice, right-click on it and choose context menu entry New > ABAP Program.

    Enter the required information (name, a description - e.g. “Retrieve and Display Sales Order with Open Days and BuPa Data”-) and press Next.

    Select a transport request if required and press Finish to confirm the creation dialog.

     

  2. Now implement the report.
    For this purpose, just copy & paste the source code below into the ABAP editor.

    PARAMETER pnumber TYPE i DEFAULT10.

    DATA: lv_number TYPE  i.

    * set the value of the procedure input parameter

    lv_number = pnumber.
    * call  AMDP methods
    zcl_oia_top_and_flop=>get_top_and_flop(
                    EXPORTING iv_number = lv_number
                    IMPORTING et_top =data(lt_top)
                              et_flop =data(lt_flop) ).
    * display the returned itab with TOP customers

    WRITE:/ 'Best customers:'COLOR COL_POSITIVE.
    LOOP AT lt_top ASSIGNING FIELD-SYMBOL(<f>).
      WRITE:/<f>-company_name , <f>-gross_amount.
    ENDLOOP.
    * display the returned itab with FLOP customers

    ULINE.
    WRITE: ' Worst customers:' COLOR COL_NEGATIVE.
    LOOP AT lt_flop ASSIGNING FIELD-SYMBOL(<g>).
      WRITE:/<g>-company_name , <g>-gross_amount .
    ENDLOOP.

     

  3. Save and activate your test report.

     

  4. You can now run the report (press F8) and see the result of your effort.
    Step4_4.png

Summary

Congratulations! You have just experienced how easy it is to implement an SQLScript-based AMDP and consume it in ABAP.

 

Regarding the transport aspect, AMDP classes are transported similarly to regular ABAP classes using the standard ABAP transport mechanism. No HANA artifacts have to be transported. This means that the HANA transport container and the HANA delivery units are not involved in this process.

 

You can have a look at video tutorials demonstrating how to create an AMDP and how to debug an AMDP here.

 

Tipp:As direct comparison to this "Top-Down"-approach, you can have a look at another step-by-step tutorial showing the "Bottom-Up"-approach for consuming the same HANA database procedures using an ABAP database procedure proxy.

 

Related Content

Transfer of ABAP Coding to SAP HANA - ATC check variants

$
0
0

Hi experts,

 

I have a question concerning the availability of the check variants for ATC that support the migration of custom code to SAP HANA:

The two variants available in the NW 7.40 are PERFORMANCE_DB and FUNCTIONAL_DB for the HANA specific static checks.

 

Unfortunatly these variants are not available in our system (NW 7.31 SP07 with kernel 7.21). I found one note that contains the downport of the check variant FUNCTIONAL_DB but somehow did not succeed to find out if there exists a corresponding note for the variant PERFORMANCE_DB or if the availability of the variant is restricted to certain SP.


Information on this topic is appreciated


Cheers

Christian

Error creating ABAP Project in SAP HANA Studio: Logon to system A4H failed.

$
0
0

Hi Experts,

 

I have created instances from the SAP Application Server ABAP 7.4 SP5 incl. Business Warehouse on SAP HANA 1.0 SP7 [Developer Edition] free trial solution, as it is described in documentation. As I cannot log on to the Frontend instance (posted a separate question for this) I have tried to reach the servers from my laptop directly. But I cannot create ABAP Project in SAP HANA Studio. While it is trying to connect to SAP, the following message can be seen: Retrieving compatibility information from back-end system, and then the result is an error message: Logon to system A4H failed (Connection to system "A4H" is currently not available). Then in the event details among others there is the following line : (102) JCO_ERROR_COMMUNICATION: Connect from SAP gateway to RFC server failed..... timeout during allocate...

I have a 64-bit Windows 7 version with the required DLLs VS2010. 


What I have done so far:

First I have created an instance with the Public options, but I faced the error above. Then I have created a new instance as a Corporate Network. The result is: I can logon to Open VPN client, I can ping the server.  I can logon into the system on OS level , both systems are running. I can logon to SAP with SAPGUI.  On AWS I have opened all ports for this instance. Then I updated my JAVA, I uninstalled version 7.2 of HANA client and Studio and installed the 7.0 version. Just for a test, I have also switched off Firewall and the AntiVirus program, still nothing. I can reach the HANA DB from the HANA Studio. I have also tried with other laptop running a 32-bit Windows, and faced the same problem. From this laptop I am able to create an ABAP project in another SAP BW System (this one is not in AWS cloud). 

I would really appreciate some help.

 

Thanks,

Andrea

Authority Check on DatabaseConnection for HANA

$
0
0

Hi,

we are setting up our configuration for HANA.

We want to make a Package within HANA for each functional domain. We also want to make separate connections to HANA (as secondary database) for each functional domain (Finance, Logistics, HR, ...) in DBCOCKPIT. But we want to control which application/user uses which connection; We don't want FI to use the HR-connection.

Am I right when I think we might use authorization object S_DBCON to accomplish this?

Thanks.

Kris

Under the HANA hood of an ABAP Managed Database Procedure

$
0
0

Hi All, I've been looking into ABAP managed database procedures for HANA recently and decided to take a look at what's actually created under the hood in the HANA database when an AMDP is created.

 

I created a small test class in our CRM on HANA system with a method to read a couple of columns from the crmd_orderadm_h table using sqlscript. The method takes one input parameter IV_OBJECT_ID and has one export parameter ET_ORDER.

 

class ZCL_TEST_AMDP definition  public  final  create public .
public section.    interfaces IF_AMDP_MARKER_HDB.    types:        begin of ty_order,            object_id TYPE crmd_orderadm_h-object_id,            description TYPE crmd_orderadm_h-description,        end of ty_order,        tt_order TYPE STANDARD TABLE OF ty_order.    methods get_orders_sql        IMPORTING VALUE(iv_object_id) TYPE crmd_orderadm_h-object_id        EXPORTING VALUE(et_order) TYPE tt_order.
protected section.
private section.
ENDCLASS.
CLASS ZCL_TEST_AMDP IMPLEMENTATION.    method get_orders_sql        by database procedure        for hdb        language sqlscript        using crmd_orderadm_h.      et_order = select object_id, description from crmd_orderadm_h where object_id = iv_object_id;    endmethod.
ENDCLASS.

 

So pretty simple class. My expectation was that in HANA I would see a SQLScript procedure object and a Table Type object for the et_order parameter. What I did find was a bit different.

 

First of all it created 2 SQLScript procedures:

- a stub wrapper type procedure

- a main procedure called by the above stub procedure

 

It also created:

- a temporary table for the output data

- a view for the referenced table

 

The stub procedure seems to follow the naming convention of CLASSNAME=>METHODNAME#stub#DATETIME.

As you can see the definition includes only the input parameter that was defined in the class method. The export parameter is not specified in the definition.

In the body of the procedure it calls the main procedure and returns the output to the ET_ORDER parameter.

 

create procedure  "ZCL_TEST_AMDP=>GET_ORDERS_SQL#stub#20140318165936"
(  in    "IV_OBJECT_ID" NVARCHAR (000010)
)
language sqlscript sql security invoker  as begin  call "ZCL_TEST_AMDP=>GET_ORDERS_SQL" (    "IV_OBJECT_ID" => :IV_OBJECT_ID ,    "ET_ORDER" => :ET_ORDER  );  select * from :ET_ORDER;
end;

 

The main procedure follows the naming convention CLASSNAME=>METHODNAME

It specifies the input param IV_OBJECT_ID and the output param ET_ORDER with the type as the newly created temporary table ZCL_TEST_AMDP=>GET_ORDERS_SQL=>ET_ORDER#tft

 

In the body of the procedure it then reads from a newly created view ZCL_TEST_AMDP=>CRMD_ORDERADM_H#covw instead of directly from the table CRMD_ORDERADM_H.

ZCL_T

create procedure  "ZCL_TEST_AMDP=>GET_ORDERS_SQL"
(  in    "IV_OBJECT_ID" NVARCHAR (000010),  out   "ET_ORDER" "ZCL_TEST_AMDP=>GET_ORDERS_SQL=>ET_ORDER#tft"
)
language sqlscript  sql security invoker                            as begin      et_order = select object_id, description from "ZCL_TEST_AMDP=>CRMD_ORDERADM_H#covw" where object_id = iv_object_id;
end;

 

ZCL_TEST_AMDP=>GET_ORDERS_SQL=>ET_ORDER#tft is defined as a global temporary table with the columns mapping to the columns of the ET_ORDER param.

Pic1.PNG

 

Pic2.PNG

 

 

ZCL_TEST_AMDP=>CRMD_ORDERADM_H#covw is a view based on the CRMD_ORDERADM_H table. Here is the create statement:

 

CREATE VIEW "SAPSR3"."ZCL_TEST_AMDP=>CRMD_ORDERADM_H#covw" ( "CLIENT",  "GUID",  "OBJECT_ID",  "PROCESS_TYPE",  "POSTING_DATE",  "DESCRIPTION",  "DESCR_LANGUAGE",  "LOGICAL_SYSTEM",  "CRM_RELEASE",  "SCENARIO",  "TEMPLATE_TYPE",  "CREATED_AT",  "CREATED_BY",  "CHANGED_AT",  "CHANGED_BY",  "HEAD_CHANGED_AT",  "ORDERADM_H_DUMMY",  "INPUT_CHANNEL",  "BTX_CLASS",  "AUTH_SCOPE",  "OBJECT_TYPE",  "ARCHIVING_FLAG",  "DESCRIPTION_UC",  "OBJECT_ID_OK",  "VERIFY_DATE",  "CRM_CHANGED_AT",  "POSTPROCESS_AT" ) AS select  "CLIENT" ,  "GUID" ,  "OBJECT_ID" ,  "PROCESS_TYPE" ,  "POSTING_DATE" ,  "DESCRIPTION" ,  "DESCR_LANGUAGE" ,  "LOGICAL_SYSTEM" ,  "CRM_RELEASE" ,  "SCENARIO" ,  "TEMPLATE_TYPE" ,  "CREATED_AT" ,  "CREATED_BY" ,  "CHANGED_AT" ,  "CHANGED_BY" ,  "HEAD_CHANGED_AT" ,  "ORDERADM_H_DUMMY" ,  "INPUT_CHANNEL" ,  "BTX_CLASS" ,  "AUTH_SCOPE" ,  "OBJECT_TYPE" ,  "ARCHIVING_FLAG" ,  "DESCRIPTION_UC" ,  "OBJECT_ID_OK" ,  "VERIFY_DATE" ,  "CRM_CHANGED_AT" ,  "POSTPROCESS_AT"
from "CRMD_ORDERADM_H";

So in all 4 new objects were created:

- Procedure ZCL_TEST_AMDP=>GET_ORDERS_SQL

- Procedure ZCL_TEST_AMDP=>GET_ORDERS_SQL#stub#20140318165936

- Temporary table ZCL_TEST_AMDP=>GET_ORDERS_SQL=>ET_ORDER#tft

- View ZCL_TEST_AMDP=>CRMD_ORDERADM_H#covw

 

I can kinda understand the reasoning behind the temp table in order to easily map to an ABAP internal table but unsure of the purpose or logic for a) the stub procedure and b) the view for the table that's referenced. Maybe some SAP internal dev folks might have some insight here....just to satisfy my curiosity!


Changes to existing Reports,Dictionary objects when we migrate DataBase to SAP HANA

$
0
0

Hi Experts,

 

           Can you please let me know the changes that effect to existing ABAP Dictionary objects, Reports, MPP etc... that we build by using ABAP if we migrate our underlying database to SAP HANA from any RDBMS.

 

                       Thanks in advance.

 

Regards,

Sandeep Rajanala

Video Tutorials: How to model FPM applications and Gateway Services based on Business Entities (via SADL)

$
0
0

What's in this document

 

This document explains how, using the tools available since SAP NetWeaver 7.40 SP5, you can quickly with ease model end-to-end FPM application and Gateway Service based on Business Entities via SADL.

 

How to Create FPM Application consuming CDS View using Application Creation Tool (ACT)

This 3-part series demonstrate how to create a Floorplan Manager (FPM) application consuming a Core Data Services (CDS) View using the Application Creation Tool (ACT). The how-to guide with a step-by-step procedure will be soon available.

 

Part I

The first part of this video tutorial series gives a short introduction on the concepts -- ACT, CDS, and also briefly explains the application scenario that will be developed as part of the full series.

 

Part II

The second part of this video tutorial series demonstrates how to create an FPM aplication with a Search Component and a Result List Component with two charts to visualize data, all using ACT.

 

Part III

The third part of this video tutorial series demonstrates how to use the Flexible UI Designer (FLUID) to enhance the configurations created in the previous part of the series thereby enhancing the application.

 

 

How to Model a Gateway Service based on Business Entities via SADL


This video tutorial demonstrates how to model a Gateway Service based on Business Entities via SADL. The data model of the service is based on an External View, exposed from SAP HANA View. The how-to guide with a step-by-step approach will be soon available.

Tables in HANA / ABAP

$
0
0

Hi,

 

I have a question about the synchronization of tables between ABAP and HANA. When I create an se11 table in my ABAP on HANA trial system, the table is visible in the HANA studio schema SAPHANAABAP.

When I create a table in the HANA studio (same schema) , this table is not visible in the ABAP se11. Are these tables only exposed by procedures that are consumed in ABAP ?

Using ABAP FM in hana enviroment

$
0
0

Hi Experts,

I am quite beginner to HANA,while reading about the process of creating procedures(ABAP) in HANA,this comes in my mind that can we call FM of abap in hana procedures?If we can, then BAPI's can also be called in hana procedures?

Generate DB Procedure Proxies

$
0
0

Hello colleagues,

 

is it possible to generate/create DB procedure proxies dynamically within ABAP?

So we know the DB procedure name and want to create a DB procedure proxy dynamically in ABAP.

 

Regards

André

Viewing all 831 articles
Browse latest View live


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