on 2024 Jun 17 9:32 PM
Hi ,
I have a AMDP class where the final itab is a join of several itabs.
I wrote this code initially as normal abap report and since the execution time was much longer I am approaching it as AMDP class.
How can I write this in my amdp select
Request clarification before answering.
@winona8689
If you consume the procedures from ABAP, use the read text there.
If you consume it in a fiori app you can also use a custom entity so you can fill an element with read_text.
Otherwise for the long text to be available on hanadb:
A. You can use an enhancement to store the text in a readable format, in a custom table.
B. Use SLT to transform the text.
For me, the easiest option is the first, if possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can include CASE statements in your select query. You can also do this with openSQL if your abap version allows it and still have improved performance from the code pushdown. For example :
SELECT
CASE WHEN kwmeng = 0
THEN division( kzwi4 , kwmeng , 2 )
ELSE CAST( 0 AS DEC )
END AS
summary,
CASE WHEN kalsm IN ( @LC_usf , @LC_ysf )
THEN coalesce( division( kzwi2 , kwmeng , 2 ) , 0 )
ELSE coalesce( division( ( kzwi1 - kszwi4 ) , kwmeng , 2 ) , 0 )
END AS
order_net_subtotal,
CASE WHEN kalsm IN ( @LC_usf , @LC_ysf )
THEN kzwi2
ELSE ( kzwi1 - kzwi4 )
END AS
order_net_subval
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update , I was able to solve many of the issues. Division statement was throwing error so replaced with
I have to join stxh and stxl to pull the comment , since we cannot use read_text.
Since we cannot use read_text in the amdp class, I am fetching data from stxh and stxl. However , I am facing issues while decompressing the raw data to text.
I tried BINTOHEX and BINTOSTR , but no luck.
Anyway I can get this done?
Hi @winona8689
Curious to ask you but from the code snippet shared, it can be done in a CDS easily, without needing to do an AMDP class.
Regards
RG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Romanos Thanks, That helped a lot. However I am unable to apply filter. I have below code in my report
This is my class below , Should I mention FKDAT in my where Clause?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.