cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP cds or ABAP AMDP

anil_lahori2
Explorer
0 Likes
991

ABAP Community,

can you tell me when to use Abap cds and when ABAP amdps?

pls illustrate with some real time examples / or Any business  requirement which has been met with implementing AMDPs and not CDS . 

ANIL 

 

 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

keremkoseoglu
Contributor
0 Likes

I would approach this differently, depending on the environment.

For on-premise development, CDS is useful for centralizing queries and handling simpler requirements. As things get more complex, AMDP (SqlScript) becomes preferable due to its more powerful features, such as window functions. In some cases, AMDP can even replace ABAP (code-pushdown).

I tend to use CDS for simple cases and AMDP for complex ones - or when I foresee that the requirement may become complex in the near future. If I start with CDS and things become surprisingly complex, it's possible to write AMDP and begin by calling the CDS anyway - so no harm done in many cases.

You can foresee business examples by inspecting what's possible by AMDP and not CDS; for example:

  • Ordering query results
  • Limiting number of records
  • Flow control (if, for, while)
  • Cursors, nested loops
  • Window functions
  • Executing dynamic SQL
  • Fuzzy search
  • DML features (insert, update, delete, etc...)

For managed ABAP RAP development, CDS would be your default starting point. However, if your requirement is too complex for CDS, you can leverage the power of AMDP via table functions or ABAP via virtual elements.

junwu
SAP Champion
SAP Champion
0 Likes
i don't see any difference from mine.
junwu
SAP Champion
SAP Champion
0 Likes

go cds first

if you cannot get it done by cds, then amdp.