Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Inconsistent data while using AMDP in S/4 HANA 1511

matheusog
Participant
0 Likes
5,142

Hi experts!

I'm having an issue while using an AMDP in S/4 HANA.

We wrote an complex AMDP, using a modularization concept inside it.

When we execute the AMDP without debugging the call command of AMDP GET_CO_BALANCE_DATA we have a result, and when we run the AMDP debugging (without changing filters) the result set is different from the previous execution.

Custom AMDP GET_CO_BALANCE_DATA:

Input table (174563 records):

Output table (5467 records):

Number of result recods into main AMDP:

Now i will run debugging the AMDP ZCL_AMDP_DEMONST_SOCIO_V2=>GET_CO_BALANCE_DATA:

The same records in input table (174.563 records):

Debugging the procedure:

Result now changed (174.563 records into result table):

Number of result recods into main AMDP:

Now the error stops even if i execute the AMDP with no debug, but it just start occuring again if i log off S/4 HANA.

Any ideia what could be this error?

Thks!

Matheus Goulart

1 ACCEPTED SOLUTION
Read only

matheusog
Participant
0 Likes
4,238

Hello guy's,

The problem was related to a constant value.

The developer created a constant to empty values:

declare lc_false constant nvarchar(1) := ' '; --Empty space 

But the correct value for the field should be empty (no space).

This corrected the problem, but we did not discovered why when debugging the AMDP the error occur and when execute online do not.

Thanks.

4 REPLIES 4
Read only

matheusog
Participant
4,237

We've opened a SAP incident. When SAP responds i will update this post.

Complementing the informartion, while executing the procedure inside HANA, we’ve got 49.000 rows, but while executing the same AMDP on ABAP (throught SE24) we’ve got 3.800 rows. So i think it's some problem on the framework

AMDP execution:

Procedure executed directly on HANA with the same filters (bypassed the AMDP framework).

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
4,237

"Complementing the informartion, while executing the procedure inside HANA, we’ve got 49.000 rows, but while executing the same AMDP on ABAP (throught SE24) we’ve got 3.800 rows. So i think it's some problem on the framework"

You must not call AMDP procedures from inside HANA. You should call AMDP procedures from AS ABAP only.

See note 2511210. And that's exactly because of such "incidents".

AMDP procedures are an "internal implementation detail" of AS ABAP. They of course depend on being called from AS ABAP and that an AS ABAP is available. E.g. if you use an CDS View inside the the AMDP procedure that depends on ABAP specific session variables, you are lost when calling the procedure directly

Read only

0 Likes
4,237

Hello Keller,

Thanks for your reply.

I did execute the procedure inside SQL console of Hana database, we do not use that procedure directly in a HANA application or HANA artifact.

On my question all my screenshot's are from AMDP debugger and stack ABAP.

I did this test just for curiosity to check if i would have the same result from both approachs, calling the procedure from HANA and calling the AMDP from ABAP SE24 tcode with same filters on both. The result's were that when i did execute the AMDP without debugging, it gives me fewer records than when i did execute from HANA SQL console, but when i did execute the AMDP in debug mode, it gives me the correct numbers of result records (the same number of HANA Sql console execution).

Thanks.

Read only

matheusog
Participant
0 Likes
4,239

Hello guy's,

The problem was related to a constant value.

The developer created a constant to empty values:

declare lc_false constant nvarchar(1) := ' '; --Empty space 

But the correct value for the field should be empty (no space).

This corrected the problem, but we did not discovered why when debugging the AMDP the error occur and when execute online do not.

Thanks.