in

CDS String Functions(Concat, Instr, Left / Right, Length, Lpad / Rpad, Ltrim / Rtrim ,Replace)

CDS String functions:
• CONCAT(arg1, arg2)
• LENGTH(arg)
• LPAD/RPAD(arg, len, src)
• REPLACE(arg1, arg2, arg3)
• SUBSTRING(arg, pos, len)

@AbapCatalog.sqlViewName: 'S4HCDS_SEL_VD14'
define view zcds_string_demo as select from sbook
{
  CONCAT( carrid, connid ) as FlightNo,
  CONCAT_WITH_SPACE(  carrid, connid, 10) as FlightNo_Spaces,
  LENGTH( carrid ) as Carrid_Length,
  LPAD( carrid, 10, 'x' ) as Lpad_Carrid,
  REPLACE( carrid, 'GHI', 'XXX' ) as Replace_Carrid,
  bookid as BookingID,
  CONCAT( CONCAT( SUBSTRING(order_date,5,2), '-'),SUBSTRING(order_date,1,4) ) as OrderMonth,
  LPAD( connid, 13, '0' ) as New_connid
 }

What do you think?

-6 Points
Upvote Downvote

Written by admin

Leave a Reply

Your email address will not be published.

CDS SQL Expressions

CDS Conversion Functions (CAST, Unit Conversion, Currency Conversion)

CDS Arithmetic Functions

SAP ABAP CDS Arithmetic Functions – Ceil, Floor, Div (Integer), Division (Dec), Mod, Round & Aggregate Expressions – MAX, MIN, AVG, SUM, COUNT, Group By Clause, HAVING Clause