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

How to convert Customized HANA view to CDS View?

$
0
0

Hi,

 

I have created a customized HANA View as per the requirement and fetched in Fiori. Now SAP says all the Calculation views to be converted to CDS Views.

 

  • I got to know the procedure, First we need to convert Customized HANA View to External View and consume external view in CDS. I am very new to CDS  so please someone elaborate how to convert HANA View to external view and how to consume in CDS?

 

 

Thanks in Advance

Nagarjuna



Hi Gurus

$
0
0

I am working as ABAP Consultant , i heard that HANA will be the feature, weather i have to learn ABAP for HANA or HANA Development to boost my Carrier . Please give a clear picture .

Multiplying two decimals in ABAP CDS View

$
0
0

Hi,

in the select list of an ABAP CDS view I am trying to multiply to decimal values ( price * quantity ) - this leads to the error message:

 

Maximum accuracy 31 as DEC exceeded by an arithmetic expression

 

I tried to cast price and quantity to FLTP before the multiplication. At design time I'm getting warnings (Decimal places are corrected to 16), but the view wouldn't acitvate.

 

How can I perform a simple multiplication of two decimal fields? I am on ABAP 7.4 SP12.

 

Thanks,

Marek

Variable in SQL ABAP Managed Database Procedure

$
0
0

Dear all

 

I have a question regarding the use of a variable in an ABAP Managed Database Procedure.

 

The following method I implemented into a class:

 

Capture.PNG

 

How can I now insert a variable for the string 'YES' ?

 

I tried declaring a constant:

 

Capture.PNG

 

But I cannot use

 

... WHERE a.giftsyesorno = lc_yes;

 

Is there a solution for this problem? I would really like to use variables in the SQL syntax in the method.

 

 

Best regards

 

Thomas Bretonnet

Problem with cl_salv_gui_table_ida

$
0
0

Hello,

 

I'm using the new ALV 'cl_salv_gui_table_ida' combined with a Core Data Service. I've activated the toolbar text search and enabled the search for a plenty of columns:

 

    go_alv_display->field_catalog( )->enable_text_search( 'NAME1' ).

    go_alv_display->field_catalog( )->enable_text_search( 'ORT01' ).

    go_alv_display->field_catalog( )->enable_text_search( 'PSTLZ' ).

    go_alv_display->field_catalog( )->enable_text_search( 'INFNR' ).

    go_alv_display->field_catalog( )->enable_text_search( 'LIFNR' ).

    go_alv_display->field_catalog( )->enable_text_search( 'LIFNR_2' ).

    go_alv_display->field_catalog( )->enable_text_search( 'MAKTX' ).

    go_alv_display->field_catalog( )->enable_text_search( 'SMTP_ADDR' ).

    go_alv_display->field_catalog( )->enable_text_search( 'ORT02' ).

 

The search is working for the fields NAME01, ORT01, PSTLZ, MAKTX, ORT02, The other columns don't work in the search.

 

I've checked the coding and found out that the search_scope is just filled with the working columns.

 

Class: CL_SADL_ABQI

Method: _GET_SEARCH_SCOPE

 

But I couldn't find the coding where the scope is filled.

 

Thx for your help!

Frank

Consumption of ABAP CDS view in BW

$
0
0

Hi colleagues,

We have an ABAP CDS view with key figures. When using @Analytics.dataCategory: #CUBE annotation, the transient query gets created but the key figures are not getting included in the infoprovider. How do i solve this?

RE: SAP HANA CERTIFICATION

$
0
0

hi all,

 

Im planning to do certification in SAP HANA. iam sap abap consultant with 2.8 years of experience. I want to do HANA certification. Can anyone please guide me .

 

i have surfed net & found some certifications require ABAP / Netweaver certification.

 

Im not certified in SAP ABAP.

 

Can you help me pl.

how to use views of hana trial account in ABAP system

$
0
0

Der All,

 

is that possible to use views(attribute,analytic and calculation views) of HANA trial account in sap ABAP system.

 

if 'YES' please provide me the proper documentation.

 

 

Thanks and Regards

 

Ashwin M V


IDA alv aggregation of different units/currencies is not possible

$
0
0

Hi,

 

when i try to collect quantities in ida ALV, it gives an error message "aggregation of different units/currencies is not possible"

 

do you have any idea?

 

1.png

ODATA annotation for ABAP CDS views with input parameter

$
0
0

Hello All,

 

I have created an ABAP CDS view with input parameters and I am using Odata.publish:true annotation to generate odata service. Now when i see the metadata of the service, I found 2 entities. One for input parameter and the other for ABAP CDS view with input parameter as a common field in both entities. Now when i try to fetch the data using "/entitySet1?$expand=navigationProperty(inputParameter='parameterValue')", it does not give me any data. I tried to debug and i found that input parameter is being passed as initial value. Any help here would great. The system that is used has NW 750 SP02.

 

Thanks and Best Regards,

Govind

IN SAP HANA ,AFTER CREATING INFO VIEWS,HOW IT IS ARRIVE THE END USER?

$
0
0

Hello gurus.....

 

i am new for sap hana....i have one doubt that,

after creating information views in sap hana db,how the enduser access that info views?

 

is end user will use bobi tools?

 

 

 

Thanks in advance

HOW TO USE SELECT-OPTION IN AMDP

$
0
0

HI,

 

Could any one please let me know how to use select-option in AMDP .I have seen the post on scn and tried to apply but it gives me syntax error.same code in abap is not giving syntax error.

 

  SELECT MATNR, SPMON, SUM( MZUBB) AS MZUBB,  SUM( WZUBB ) AS WZUBB,

                       SUM( MGVBR) AS MGVBR, SUM( WGVBR) AS WGVBR,

                       SUM( MAGBB) AS  MAGBB, SUM( WAGBB ) AS WAGBB,WERKS

                       FROM S031

                       WHERE (IV_WHERE_CLAUSE)

                       GROUP BY MATNR,SPMON,WERKS;

 

here where clause is dynamic generated by class and method.

it says incorrect syntax near group by.i am writing this code inside AMDP implementation.

 

or else can anyone give step by step process to handle select option in amdp and consume it in our existing abap report.

 

also in my system i am not able to find cl_shdb_seltab? is there any alternative to this? please give full steps to acheive this..

CTS+ in HANA with authentication method Assertion tickets

$
0
0

Hello all,

 

We have configured CTS+ between our two SAP hana systems Dev and qa using our production solman system (7.1 SP12).

 

Now in our dev system Lifecycle manager, in CTS destination when I use authentication method as User id and password, it works fine but when I open transport organizer from LCM it asks for user and password for solman system, SSO doesn't work.

 

Hence I have enabled SAP assertion ticket method so that we can have SSO between Development HANA system and solution manager system.But after enabling Assertion method, Test CTS connection gives error.

 

When I try to test HTTP destination from http://host:port/sap/hana/xs/lm/test/desttester, it gives me user unauthorized
error.

 

 

 

 

For assertion tickets, I have already created a trust store for
assertion tickets in Dev HANA system , exported the HANA dev certificate and saved in solman system STRUSTSSO2. I have also set saplogontickettruststore parameter in dev hana system.I am testing CTS+ with my id in hana dev system and it is already present in solman system with all relevant authorization.

 

Please suggest.

 

Thanks
Rohit

Amdp internal table structure

$
0
0

Hello,

 

Is it possible to pass dynamic internal tables to amdp? My requirement is to pick 6 fields from the internal table.The 6 fields will be constant but the structure of the internal table can vary based on user selection i.e it can have 20 fields in one case and 15 the next time.I am not able to define an internal table with type any in amdp.I guess we need to use a table type only but am not sure how to declare in this case.

 

Thanks,

Prem

Rewriting Native SQL to Open SQL in HANA DB Migration

$
0
0

1. Native SQL is connecting to other DB Servers(MDM/BW….) and fetching data from tables not in R/3. How to handle in HANA.


 


2.Views/table which are not present in R/3 but available in oracle DB. Would these be created automatically after migration or CDS views should be      created  manually ? To handle this, do we need to create local/dictionary structures/tables manually ?

 

3. Please explain the below native SQL code as SUM-ROOT in where is not populated anywhere in the code.Also how to rewrite for HANA DB.

Capture.JPG


SELECT with WHERE on parameterized CDS View

$
0
0

Hi,

      I am looking for information on performance implications when a parameterized CDS View is queries using OPENSQL with WHERE Clause. Suppose, if we have a CDS View as

 

define view Ztest

          with parameters p_a : s_type

          from ztable1 as t1 join

                    ztable2  as t2

                    on t1.f1 = t2.f1

                    and t2.a = $parameters.p_a {

         

t1.f1,

t2.f2,

t2.f3,

t1.f4,

t1.f5          // field used to be filtered by select option

}

 

and if we query this from OPENSQL as follows:

DATA(lv_a) = '0001'.

SELECT f1, f2, f3, f4

          FROM Ztest( p_a = @lv_a )

          WHERE   f5 in s_f5.                         " Query Q

 

Now my understanding is that if it were a simple CDS View (i.e. without parameters) I believe the where condition would have been pushed down while creation the execution plan for the query Q. Is it correct? Please correct me if I am wrong here.

 

But in case of parameterized view, since it is saved as a table function inside the DB, so I believe that this function will be called first when the query Q is executed and once we have the result returned from the table function, WHERE clause will be applied after that. Is my understanding correct here?

 

I need to know this as I am trying this approach in a couple of my objects and need to understand this. If it is going to be heavy on performance, can you please suggest me what could be the possible other way to achieve this with CDS. I want to keep AMDP as last resort. The reason why I am going with parameterized approach is because I am reusing it. I know that we can't pass select options to the CDS View and that's why I am using in WHERE clause of OPENSQL.

 

Thanks!

Issue with Association in CDS view

$
0
0

Hi Friends,

 

Need some help with association in CDS view.

 

I am trying to convert the below join ddl using association. But getting error "Table b unknown or shadowed by an alias" at line number 47. Please help, what mistake I am making here.

 

@AbapCatalog.sqlViewName: 'ZTRM_BOOK'
@AbapCatalog.compiler.CompareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Flight Booking Data'
define view Ztrm_Book_DDL as select from sbook as a
join spfli as b on
a.carrid = b.carrid and                   a.connid = b.connid
join scarr as c on a.carrid = c.carrid
join sairport as d on b.airpfrom = d.id
join sairport as e on b.airpto = e.id
{    a.carrid as carrid,    a.connid as connid,    fldate,    bookid,    passname,    forcuram,    b.airpfrom,    d.name as airportfrom,    cityfrom,    countryfr,    airpto,    e.name as airportto,    countryto,    cityto,    carrname,    url,    class,    loccuram,    loccurkey,    order_date,    agencynum    
}
---------------------------------------------------------------------------------------------------------------------------------------------------------
@AbapCatalog.sqlViewName: 'ZTRM_BOOK'
@AbapCatalog.compiler.CompareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Flight Booking Data'
define view Ztrm_Book_DDL as select from sbook as a
association [1] to spfli as b    on a.carrid = b.carrid and       a.connid = b.connid
association [1] to scarr as c
on a.carrid = c.carrid      
association [1] to SAIRPORT as d
on b.airpfrom = d.id //Table b unknown or shadowed by an alias
association [1] to sairport as e
on b.airpto = e.id     
{    a.carrid as carrid,    a.connid as connid,    fldate,    bookid,    passname,    forcuram,    b.airpfrom,    d.name as airportfrom,    cityfrom,    countryfr,    airpto,    e.name as airportto,    countryto,    cityto,    carrname,    url,    class,    loccuram,    loccurkey,    order_date,    agencynum  //  _association_name // Make association public  
}

Abap Query Call function

$
0
0

Hi Experts,

 

I want to ask how to link Sales text of material master in ABAP Query, I already have "Read_Text" call function for script.

Please guide me from where i have to pick ABAP code of call function and how to update it in info set of query.

 

 

Given is my whole call function abap code. kindly teach me step by step process update call function.

 

 

************************************************

 

FUNCTION READ_TEXT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(CLIENT) LIKE  SY-MANDT DEFAULT SY-MANDT
*"     VALUE(ID) LIKE  THEAD-TDID
*"     VALUE(LANGUAGE) LIKE  THEAD-TDSPRAS
*"     VALUE(NAME) LIKE  THEAD-TDNAME
*"     VALUE(OBJECT) LIKE  THEAD-TDOBJECT
*"     VALUE(ARCHIVE_HANDLE) LIKE  SY-TABIX DEFAULT 0
*"     VALUE(LOCAL_CAT) DEFAULT SPACE
*"  EXPORTING
*"     VALUE(HEADER) LIKE  THEAD STRUCTURE  THEAD
*"     VALUE(OLD_LINE_COUNTER) TYPE  THEAD-TDTXTLINES
*"  TABLES
*"      LINES STRUCTURE  TLINE
*"  EXCEPTIONS
*"      ID
*"      LANGUAGE
*"      NAME
*"      NOT_FOUND
*"      OBJECT
*"      REFERENCE_CHECK
*"      WRONG_ACCESS_TO_ARCHIVE
*"----------------------------------------------------------------------
" B20K074874 ... READ_TEXT resolves references in CATALOG
"                with READ_REFERENCE_LINES
"                resolve references for texts created with COPY_TEXTS
" B20K024363 ... Replace SY-TFILL with DESCRIBE
" B20K023213 ... Optimizing Performance with referenced texts
" B20K019187 ... New module COPY_TEXTS
" B20K019113 ... Process non-SAPscript texts
*-----------------------------------------------------------------------
DATA THEADER LIKE THEAD.
DATA STXH_WA LIKE STXH.
DATA NEWTEXT LIKE BOOLEAN.
DATA L_LANGUAGE(2).                         " for two char language code


*...Prüfen ob vom Archiv gelesen werden soll............................
IF ARCHIVE_HANDLE > 0.
   CALL FUNCTION   'TEXT_READ_ARCHIVE_OBJECT'
          EXPORTING  ARCHIVE_HANDLE          = ARCHIVE_HANDLE
                     ID                      = ID
                     LANGUAGE                = LANGUAGE
                     NAME                    = NAME
                     OBJECT                  = OBJECT
                     CLIENT                  = CLIENT
          IMPORTING  HEADER                  = HEADER
          TABLES     LINES                   = LINES
          EXCEPTIONS NOT_FOUND               = 1
                     WRONG_ACCESS_TO_ARCHIVE = 2.
   CASE SY-SUBRC.
   WHEN 1. MESSAGE E600 WITH NAME ID LANGUAGE RAISING NOT_FOUND.
   WHEN 2. MESSAGE A020 RAISING WRONG_ACCESS_TO_ARCHIVE.
   ENDCASE.
   EXIT.
ENDIF.

*...Initialisierung.....................................................
NEWTEXT   = FALSE.
REFERENCE = FALSE.

*...Pruefen Aufrufparameter.............................................
PERFORM CHECK_KEY USING OBJECT NAME ID LANGUAGE.
perform check_catalog_local using local_cat.
*...Text aus Textmemory lesen...........................................
IF TTXOB-TDSAVEMODE = SAVEMODE_POSTING.
   PERFORM IMPORT_CATALOG.
   if client = sy-mandt.
   PERFORM READ_CATALOG USING OBJECT NAME ID LANGUAGE.
   IF SY-SUBRC = 0.
     CASE CATALOG-FUNCTION.
*     text will be deleted
       WHEN FUNCTION_DELETE.
         REFRESH LINES. CLEAR LINES.
         CALL FUNCTION  'SAPSCRIPT_MESSAGE_DEF'
                  EXPORTING NO = 600
                            V1 = NAME
                            V2 = ID
                            V3 = LANGUAGE.
         MESSAGE E600 WITH NAME ID LANGUAGE RAISING NOT_FOUND.
*     text will be created new
       WHEN FUNCTION_INSERT.
         CLEAR THEADER. REFRESH LINES.                        "B20K074874
         IMPORT THEAD TO THEADER                              "
                TLINE TO LINES                                "
           FROM MEMORY ID MEMORY_ID.                          "
         HEADER        = THEADER.                             "
         HEADER-TDNAME = CATALOG-TDNAME.                      "
         PERFORM READ_REFERENCE_LINES TABLES LINES            "
                                      USING CLIENT            "
                                            HEADER.           "
         DESCRIBE TABLE LINES LINES HEADER-TDTXTLINES.        "
*     text will be updated
       WHEN FUNCTION_UPDATE.
         CLEAR THEADER. REFRESH LINES.                        "B20K074874
         IMPORT THEAD TO THEADER                              "
                TLINE TO LINES                                "
           FROM MEMORY ID MEMORY_ID.                          "
         HEADER = THEADER.                                    "
         PERFORM READ_REFERENCE_LINES TABLES LINES            "
                                      USING CLIENT            "
                                            HEADER.           "
         DESCRIBE TABLE LINES LINES HEADER-TDTXTLINES.        "
*     text will be copied from other DB text at COMMIT_TEXT
       WHEN FUNCTION_COPY.
         PERFORM IMPORT_COPY_CATALOG.
         READ TABLE COPY_CATALOG INDEX CATALOG-COPYINDEX.
         IF SY-SUBRC = 0.
           HEADER-TDOBJECT  = CATALOG-TDOBJECT.
           HEADER-TDNAME    = CATALOG-TDNAME.
           HEADER-TDID      = CATALOG-TDID.
           HEADER-TDSPRAS   = CATALOG-TDSPRAS.
           THEADER-TDOBJECT = COPY_CATALOG-TDOBJECT.
           THEADER-TDNAME   = COPY_CATALOG-TDNAME.
           THEADER-TDID     = COPY_CATALOG-TDID.
           THEADER-TDSPRAS  = COPY_CATALOG-TDSPRAS.
           PERFORM BUILD_COPY_HEADER USING HEADER
                                           THEADER
                                           FUNCTION_COPY.
           IF THEADER-TDREFOBJ = SPACE AND                    "B20K074874
              THEADER-TDREFID  = SPACE AND                    "
              THEADER-TDREFNAME = SPACE.                      "
             PERFORM READ_TEXTLINES TABLES LINES              "
                                    USING  THEADER            "
                                           SY-MANDT.          "
           ELSE.                                              "
             PERFORM READ_REFTEXT_LINES TABLES LINES          "
                                        USING  THEADER        "
                                               SY-MANDT.      "
           ENDIF.
           header-tdtxtlines = theader-tdtxtlines.
         ENDIF.
*     text will be updated from other DB text at COMMIT_TEXT
       WHEN FUNCTION_COPYUPDATE.
         PERFORM IMPORT_COPY_CATALOG.
         READ TABLE COPY_CATALOG INDEX CATALOG-COPYINDEX.
         IF SY-SUBRC = 0.
           SELECT SINGLE * FROM STXH INTO STXH_WA
             WHERE TDOBJECT = CATALOG-TDOBJECT
               AND TDNAME   = CATALOG-TDNAME
               AND TDID     = CATALOG-TDID
               AND TDSPRAS  = CATALOG-TDSPRAS.
           CHECK SY-SUBRC = 0.
           MOVE-CORRESPONDING STXH_WA TO HEADER.
           THEADER-TDOBJECT = COPY_CATALOG-TDOBJECT.
           THEADER-TDNAME   = COPY_CATALOG-TDNAME.
           THEADER-TDID     = COPY_CATALOG-TDID.
           THEADER-TDSPRAS  = COPY_CATALOG-TDSPRAS.
           PERFORM BUILD_COPY_HEADER USING HEADER
                                           THEADER
                                           FUNCTION_COPYUPDATE.
           IF THEADER-TDREFOBJ = SPACE AND                    "B20K074874
              THEADER-TDREFID  = SPACE AND                    "
              THEADER-TDREFNAME = SPACE.                      "
             PERFORM READ_TEXTLINES TABLES LINES              "
                                    USING  THEADER            "
                                           SY-MANDT.          "
           ELSE.                                              "
             PERFORM READ_REFTEXT_LINES TABLES LINES          "
                                        USING  THEADER        "
                                               SY-MANDT.      "
           ENDIF.
           header-tdtxtlines = theader-tdtxtlines.
         ENDIF.
*     no action is performed since text was created and deleted
       WHEN FUNCTION_NONE.
         REFRESH LINES. CLEAR LINES.
         CALL FUNCTION  'SAPSCRIPT_MESSAGE_DEF'
                  EXPORTING NO = 600
                            V1 = NAME
                            V2 = ID
                            V3 = LANGUAGE.
         MESSAGE E600 WITH NAME ID LANGUAGE RAISING NOT_FOUND.
     ENDCASE.
   ELSE.
     NEWTEXT = TRUE.
   ENDIF.
   else.
      newtext = true.
   endif.
ENDIF.

*...Text aus Textdatei lesen............................................
IF TTXOB-TDSAVEMODE = SAVEMODE_DIALOG OR NEWTEXT = TRUE.
   SELECT SINGLE * FROM STXH CLIENT SPECIFIED
      WHERE MANDT    = CLIENT
        AND TDOBJECT = OBJECT
        AND TDNAME   = NAME
        AND TDID     = ID
        AND TDSPRAS  = LANGUAGE.
   IF SY-SUBRC > 0.
     WRITE LANGUAGE TO L_LANGUAGE(2).
     CALL FUNCTION  'SAPSCRIPT_MESSAGE_DEF'
             EXPORTING NO = 600
                       V1 = NAME
                       V2 = ID
                       V3 = L_LANGUAGE.
     MESSAGE E600 WITH NAME ID LANGUAGE RAISING NOT_FOUND.
   ELSE.
     MOVE-CORRESPONDING STXH TO HEADER.
     OLD_LINE_COUNTER = HEADER-TDTXTLINES.
     IF STXH-TDREF = TRUE.
       PERFORM READ_REFTEXT_LINES TABLES LINES
                                   USING  HEADER
                                          CLIENT.
     ELSE.
       PERFORM READ_TEXTLINES TABLES LINES
                               USING  HEADER
                                      CLIENT.
       IF SY-SUBRC > 0.
         REFRESH LINES. CLEAR LINES.
       ENDIF.
     ENDIF.
   ENDIF.
ENDIF.

*...Ausgabeparameter setzen.............................................
if header-tdtexttype is initial.   " just for ITF
   HEADER-TDLINESIZE = TTXOB-TDLINESIZE.
endif.

ENDFUNCTION.

* read LINES of a reference text found in CATALOG            "B20K074874
* returns SY-SUBRC = 0 if found
FORM READ_REFERENCE_LINES TABLES LINES STRUCTURE TLINE
                           USING CLIENT
                                 VALUE(HEADER) LIKE THEAD.
STATICS: TEXT_IN_CATALOG LIKE BOOLEAN.

TEXT_IN_CATALOG = TRUE.
PERFORM CHECK_REFERENCE USING HEADER-TDREFOBJ            "sets REFERENCE
                               HEADER-TDREFNAME
                               HEADER-TDREFID.
IF REFERENCE = FALSE.
   EXIT.
ENDIF.
* resolve reference chain in CATALOG
WHILE REFERENCE = TRUE AND TEXT_IN_CATALOG = TRUE.
   PERFORM READ_CATALOG USING HEADER-TDREFOBJ
                              HEADER-TDREFNAME
                              HEADER-TDREFID
                              HEADER-TDSPRAS.
   IF SY-SUBRC = 0.
*   read header from MEMORY
     CASE CATALOG-FUNCTION.
*     text will be deleted
       WHEN FUNCTION_DELETE.
         MESSAGE E610 WITH CATALOG-TDOBJECT
                           CATALOG-TDID
                           CATALOG-TDNAME
                           CATALOG-TDSPRAS
           RAISING REFERENCE_CHECK.
*     text will be created new
       WHEN FUNCTION_INSERT.
         IMPORT THEAD TO HEADER
                TLINE TO LINES
           FROM MEMORY ID MEMORY_ID.
         PERFORM CHECK_REFERENCE USING HEADER-TDREFOBJ   "sets REFERENCE
                                       HEADER-TDREFNAME
                                       HEADER-TDREFID.
*     text will be updated
       WHEN FUNCTION_UPDATE.
         IMPORT THEAD TO HEADER
                TLINE TO LINES
           FROM MEMORY ID MEMORY_ID.
         PERFORM CHECK_REFERENCE USING HEADER-TDREFOBJ   "sets REFERENCE
                                       HEADER-TDREFNAME
                                       HEADER-TDREFID.
*     text will be copied from DB text at COMMIT_TEXT
       WHEN FUNCTION_COPY.          "COPY_TEXTS copies from DB
         TEXT_IN_CATALOG = FALSE.
       WHEN FUNCTION_COPYUPDATE.    "COPY_TEXTS copies from DB
         TEXT_IN_CATALOG = FALSE.
       WHEN FUNCTION_NONE.          "read from DB
         TEXT_IN_CATALOG = FALSE.
     ENDCASE.
   ELSE.
     TEXT_IN_CATALOG = FALSE.
   ENDIF.
ENDWHILE.
IF REFERENCE = TRUE.
   REFRESH LINES.
* read text from DB?
   IF TEXT_IN_CATALOG = FALSE.
     PERFORM READ_REFTEXT_LINES TABLES LINES
                                USING  HEADER
                                       CLIENT.
*
   ENDIF.
ELSE.
* LINES have been filled by IMPORT ....
ENDIF.
ENDFORM.

***************************************************************************************************************

 

Regards,

Qamber Abbas

Try to remove append structure but blocked by CDS view dictornary objects

$
0
0

Hi Experts,

 

I’m currently busy with a new project where we moved our existing ECC (SAP Retail) system from a Oracle database to a SAP HANA Primary database. Nobody on our team are very familiar with the SAP HANA database or the new functionality. We are all learning as we go.

 

One of our requirements are to rip out some of our custom code. While doing that I came across a problem that I don’t know how to solve and I was wondering if there are someone out there that might have a solution.

 

We are currently on ECC 6, Release 7.4 Service Pack 12

 

One of the objects I had to remove was an append structure to table RSEG.  The append structure consisted of only one zz field.

 

I did a where use on the append structure. It was not used.

I did a where use on the actual field within the append structure.  It was still not used.

 

I deleted the append structure in SE11.  It did not complain about being used anywhere.  It then tried to adjust the database table RSEG, but could not activate the changes because it encountered some errors.  It said it was used in 2 SAP standard CDS Views.

 

The exact message was: ‘Field RSEG-ZZSIN is still being used as a view field in view CDS_IV_ITEMS’

 

The 2 SAP Standard CDS views (DDL Source) are:

• CDS_IV_ITEMS

• CDS_IV_ITEMS_P

 

Both CDS views (DDL source) are using the RSEG table as the main table and have multiple associations(joins) to other tables, but the field is not specified, in other words it is a Select *.

 

I believe this is a chicken and egg situation.  DDL source is activated and it then generates a Dictionary object in SE11 using table RSEG as base.  Database table RSEG cannot fix the database because it sees 2 dictionary objects that are using the field.

 

So my question is, how to I fix it?

How do I get RSEG table sorted out and then re-generates the DDL source / CDS View Dictionary object?

 

Are there a new Transaction code that I should use?

Are you aware of any OSS notes that will fix this?.

 

Any suggestions will be most welcome.

 

Kind Regards,

Sanet Pienaar

AMDP: SQLSCRIPT message: return type mismatch error

$
0
0

Dear Colleagues,

 

I am getting the mismatch error for the AMDP that I am trying to write.

Can you help me here?

 

Error Message:

SQLSCRIPT message: return type mismatch: GT_DTAB2[ PLTYP:NVARCHAR(2) VBELN:NVARCHAR(10) FKDAT:NVARCHAR(8) KNUMV:NVARCHAR(10) FKART:NVARCHAR(4) KDGRP:NVARCHAR(2) MVGR3:NVARCHAR(3) POSNR:NVARCHAR(6) AUBEL:NVARCHAR(10) FKIMG:DECIMAL(13,3) ZZAM

 

 

AMDP Code stack

 

CLASS zcl_get_itab_value DEFINITION  PUBLIC  FINAL  CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
TYPES: BEGIN OF ty_dtab1,        pltyp    TYPE vbrk-pltyp,        kunnr    TYPE vbpa-kunnr,        mvgr3    TYPE vbrp-mvgr3,        zzamatkl TYPE vbrp-zzamatkl,        matnr    TYPE vbrp-matnr,        arktx    TYPE vbrp-arktx,        kondm    TYPE vbrp-kondm,        auart    TYPE vbak-auart,        vbeln    TYPE vbrk-vbeln,        posnr    TYPE vbrp-posnr,        aubel    TYPE vbrp-aubel,        fkdat    TYPE vbrk-fkdat,        fkart    TYPE vbrk-fkart,        fkimg    TYPE vbrp-fkimg,        knumv    TYPE vbak-knumv,        werks    TYPE vbrp-werks,       END OF ty_dtab1.
TYPES gt_dtab1 TYPE STANDARD TABLE OF ty_dtab1.
CLASS-METHODS GET_DTAB_DATA_SAMPLE      IMPORTING          VALUE(gv_value) TYPE mandt      EXPORTING          VALUE(gt_dtab2) TYPE gt_dtab1.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_get_itab_value IMPLEMENTATION.  METHOD get_dtab_data_sample  by database procedure for hdb language  SQLSCRIPT OPTIONS READ-ONLY USING VBRP VBRK VBAK VBPA.    gt_dtab2 = SELECT T1."PLTYP", T1."VBELN", T1."FKDAT",    T1."KNUMV",                      T1."FKART", T1."KDGRP", T2."MVGR3",    T2."POSNR",                      T2."AUBEL", T2."FKIMG", T2."ZZAMATKL", T2."MATNR",                      T2."ARKTX", T2."WERKS", T2."KONDM",    T3."AUART",                      T2."VKBUR", T4."KUNNR"                 FROM "VBRP" AS T2                INNER JOIN "VBRK" AS T1                   ON T1."VBELN" = T2."VBELN"                INNER JOIN "VBAK" AS T3                   ON T2."AUBEL" = T3."VBELN"                INNER JOIN "VBPA" AS T4                   ON T4."VBELN" = T2."VBELN"                WHERE T1."FKART" IN ('F2','RE','S1','S2','ZS','ZVAT','RVAT','ZIFR')                  AND T1."VKORG" = 'IN01';  ENDMETHOD.
ENDCLASS.

Appreciate your time and inputs.

Thank you.

 

Warm Regards,

Harshad Mishrikotkar.

Viewing all 831 articles
Browse latest View live


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