Quantcast
Channel: SCN: Message List - ABAP for SAP HANA
Viewing all 2110 articles
Browse latest View live

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.

Re: AMDP: SQLSCRIPT message: return type mismatch error

$
0
0

Dear Harshad,

 

This type of error occurred when out table fields are mismatched.

 

The sequence of all fields from gt_tab2 should be same as ty_dtab1

 

 

-Amol S

Using BOPF Action in CDS View

$
0
0

Dear experts,

 

I have a question about using the BOPF Action in CDS view.

I wrote the following code:

 

 

@UI.lineItem:[{

position:50,

label:'Confrm',

type:#AS_DATAPOINT,


dataAction:'Z_PSO_BOPF_999:ACTION'

 

}]


key dpr.time_unit as time_unit, 

 

but it seems it does not work. Can somebody give me a hint how to make it work. Thank you.

Re: Using BOPF Action in CDS View

$
0
0

Hello Christian,

is the action (function import) exposed in the metadata document of your service?
Do you use SmartTemplate based UI?

Best regards

Tilmann

Getting error 'Unhandled event loop exception' during activation of Attribute/Calculation views in SAP HANA Studio

$
0
0

Dear all,

 

I'm getting error as 'Unhandled event loop exception' during activating Attribute/Calculation view in SAP HANA Studio.

 

Could you please help me to resolve this issue ?

 

Error is coming as follows(attached file also):

 

java.lang.NoSuchFieldError: CONNECTION_STATUS_KEY

  at com.sap.ndb.studio.dwb.tools.core.internal.destination.SapSystemDestination.getState(SapSystemDestination.java:159)

  at com.sap.ndb.studio.dwb.tools.core.internal.destination.SapSystemDestination.ensureLogon(SapSystemDestination.java:253)

  at com.sap.ndb.studio.dwb.tools.changetracking.providers.DestinationInfoProvider$DestinationInfo.<init>(DestinationInfoProvider.java:42)

  at com.sap.ndb.studio.dwb.tools.changetracking.providers.DestinationInfoProvider.<init>(DestinationInfoProvider.java:149)

  at com.sap.ndb.studio.dwb.tools.changetracking.providers.DestinationInfoProvider.getInstance(DestinationInfoProvider.java:158)

  at com.sap.ndb.studio.dwb.tools.changetracking.providers.ChangeTrackingProvider.getChangeInfo(ChangeTrackingProvider.java:70)

  at com.sap.ndb.studio.modeler.actions.ActivateAction.singleObjectActivationFromEditor(ActivateAction.java:719)

  at com.sap.ndb.studio.modeler.actions.ActivateAction$3$1.run(ActivateAction.java:562)

  at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)

  at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)

  at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734)

  at com.sap.ndb.studio.modeler.actions.ActivateAction$3.run(ActivateAction.java:557)

  at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)

  at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)

  at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)

  at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)

  at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

  at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)

  at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)

  at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)

  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)

  at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)

  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

  at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)

  at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)

  at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)

  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

  at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)

  at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

  at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)

  at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)

  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)

  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)

  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  at java.lang.reflect.Method.invoke(Method.java:483)

  at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)

  at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)

  at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

 

eclipse.buildId=unknown

java.version=1.8.0_20

java.vendor=SAP AG

BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

Command-line arguments:  -os win32 -ws win32 -arch x86_64

HANA and not fully qualified SELECT SINGLE statements - an issue?

$
0
0

As part of an upgrade from Oracle to HANA (ECC), we have checked all (used) custom programs using the Code Inspector using check variant FUNCTIONAL_DB to find possible HANA issues. Now, during functional testing, one specific issue pops up related to a SELECT SINGLE statement with an incompletely specified key. (SELECT SINGLE * FROM KNVV INTO WA_KNVV WHERE KUNNR = I_KUNNR). According to the tester, the row that is selected now is different from the expected one.

 

I have used the Code Inspector to check for all SELECT SINGLE statements with incomplete specified key and found a lot of them. However, SAP did not add this check to the variant FUNCTIONAL_DB, so I'm wondering if there really is a problem here.

 

So my questions are:

  1. Do all tables still have a primary index? I have performed a database object check for KNVV via SE11 and this says there is still a consistent index KNVV~0 so I presume these indices still exist.
  2. In general, if I perform SELECT SINGLE without using fully qualified primary key, will HANA still use the primary index (if for example the first keys are specified and the last key field isn't)
  3. Are there situations where a SELECT SINGLE without fully qualified key on a HANA database can return a different row from the table than on an Oracle or other non-HANA database?

 

I fully understand that the best solution is analyzing and changing these SELECT SINGLE statements, but for the moment I want to know if there actually is a real problem. If this is the case, I am going to add the check on SELECT SINGLE to my next HANA upgrade projects.

Re: HANA and not fully qualified SELECT SINGLE statements - an issue?

$
0
0

The existence of an primary key index does not imply that the index is being used by HANA.

When you do a SELECT SINGLE with an incomplete key, the database can deliver any of the matching records. Most databases use the primary key for access but HANA does not.


Re: HANA and not fully qualified SELECT SINGLE statements - an issue?

$
0
0

Thanks Thomas for your swift response.

 

In the mean time I have done some tests and found this to be the case. This means that for an impact analysis for HANA upgrades, this issue must also be taken into account. Actually, I think that this will have a large impact on the upgrade effort, because a lot of companies now (often without knowing this) are using a lot of these SELECT SINGLE statements that need to be rewritten.

 

So I think it would be useful to have this check as part of the FUNCTIONAL_DB inspection variant. 

Re: Other then ABAP, can CDS consumed by others reporting tools? e.g Bobj, Lumira

$
0
0

To work in the Lumira you need to connect it with Odata service.. I have done that and its working fine. Second option would be, you can have ODP (which  consumes the ABAP CDS) and fetch that with Lumira. I have not checked with Lumira but for AFO its working fine. expecting the same for Lumira too.

how to call amdp in another amdp

$
0
0

Hi all,

 

i have attached the code sample,please tell me how to handle this in AMDP .

 

 

Basically i have two performs .in one perform we are fetching some data and based on that data again we fetch another data in another perform.how to handle this in AMDP.

 

ALSO  if i have two internal table in ABAP report and i need to loop one internal table and read second internal table based on some condition how to handle this in AMDP?

 

please tell me step by step or provide me screenshots,because i am not very much comfortable to use AMDP

Re: HANA and not fully qualified SELECT SINGLE statements - an issue?

$
0
0

Please check if SAP Note 2251947 helps for your case.

Re: how to call amdp in another amdp

$
0
0

Hello Prashant,

 

there is already a blog which describes all necessary steps how you call an AMDP method from another AMDP method.

 

Call AMDP(ABAP Managed Database Procedure) Inside AMDP Method

 

 

Regarding your requirement to determine data within a loop over an internal table you should check if it is not better from a performance point of view to avoid such a nested construct.

 

Regards,

Florian

Re: how to call amdp in another amdp

$
0
0

Hi Florian,

 

can you suggest by seeing my code how i can write this code in AMDP because i need to do code optimization of abap programs in hana.

i

Re: how to call amdp in another amdp

$
0
0

Hi Prashant,

 

While migrating  ABAP code to HANA DB via AMDP you should have to understand behavior of open SQL/ABAP logic and later based on that we can able to convert it in native SQL.

 

Put left outer join on your base query.

For all entries is same as left outer join.

 

 

-Amol S    


Memory parameters for multi sid environment in HANA

$
0
0

Hello ,

 

Can you please suggest what are memory parameter we need to setup for multi-sid environment in HANA after installation ..rather than Global allocation Limit parameter( GAL)

 

In my non-prod appliance , I have five instances 3 - ECC 1- BPC 1- reporting system

 

Regards,

Sankara

Re: Using OData custom query options (URL parameters) in Gateway

$
0
0

Hi André,


is it planned to support custom query options in future? I think this feature would be very useful for many scenarios


Best regards,

Oliver

CDS views , partially overlapping data

$
0
0

Hello Experts,


     I am working with CDS views. I want to select specific row from several partially overlapping data,  for example.

Origin data:    

Field 1Field 2Field 3Field 4
1aaa111bbb111R1
1NULLbbb111R2
1aaa111NULLR3
1NULLNULLR4
2NULLbbb222R5
2aaa222NULLR6
2NULLNULLR7
3aaa333NULLR8
3NULLbbb333R9
4NULLbbb444R10
4NULLNULLR11
5NULLNULLR12

 

After select:

 

Field 1Field 2Field 3Field 4
1aaa111bbb111R1
2aaa222NULLR6
3aaa333NULLR8
4NULLbbb444R10
5NULLNULLR12


          Since cant use sub-query or "order by" clause, so..., How can I do.

CDS views , partially overlapping data

$
0
0

Hello Experts,


     I am working with CDS views. I want to select specific row from several partially overlapping data,  for example.

Origin data:    

Field 1Field 2Field 3Field 4
1aaa111bbb111R1
1NULLbbb111R2
1aaa111NULLR3
1NULLNULLR4
2NULLbbb222R5
2aaa222NULLR6
2NULLNULLR7
3aaa333NULLR8
3NULLbbb333R9
4NULLbbb444R10
4NULLNULLR11
5NULLNULLR12

 

After select:

 

Field 1Field 2Field 3Field 4
1aaa111bbb111R1
2aaa222NULLR6
3aaa333NULLR8
4NULLbbb444R10
5NULLNULLR12


          Since cant use sub-query or "order by" clause, so..., How can I do.

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

$
0
0

And, FYI, I had to restart HANA before it came effective. R3trans -x worked, but SAP did not come up until we restarted the database. SAP<SID> user on database still became locked.

Viewing all 2110 articles
Browse latest View live


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