Demo_Chess_V_Next

DDL: DEMO_CHESS_V_NEXT SQL: DEMO_CHESS_SNXT Type: view

Generating the final position after carrying out the move

Demo_Chess_V_Next is a CDS View that provides data about "Generating the final position after carrying out the move" in SAP S/4HANA. It reads from 2 data sources (Demo_Chess_V_Stage13, Demo_Chess_V_Pos_Cds) and exposes 13 fields with key fields gameuuid, movecnt, move_color, move_from_x, move_from_y.

Data Sources (2)

SourceAliasJoin Type
Demo_Chess_V_Stage13 moves from
Demo_Chess_V_Pos_Cds pos inner

Annotations (4)

NameValueLevelField
AbapCatalog.sqlViewName DEMO_CHESS_SNXT view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Generating the final position after carrying out the move view
AccessControl.authorizationCheck #NOT_ALLOWED view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY gameuuid Demo_Chess_V_Stage13 gameuuid UUID
KEY movecnt Demo_Chess_V_Stage13 movecnt Halbzugnummer
KEY move_color Demo_Chess_V_Stage13 color Level Color
KEY move_from_x Demo_Chess_V_Stage13 from_x X-Position
KEY move_from_y Demo_Chess_V_Stage13 from_y Y-Position
KEY move_to_x Demo_Chess_V_Stage13 to_x X-Position
KEY move_to_y Demo_Chess_V_Stage13 to_y Y-Position
KEY color Demo_Chess_V_Pos_Cds color Level Color
KEY xendasx
KEY yendasy
before_x Demo_Chess_V_Pos_Cds x X-Position
before_y Demo_Chess_V_Pos_Cds y Y-Position
ythenXelseendasmoved_flag

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view Demo_Chess_V_Next.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: DEMO_CHESS_SNXT

CREATE VIEW Demo_Chess_V_Next AS
SELECT
  moves.gameuuid AS gameuuid,
  moves.movecnt AS movecnt,
  moves.color AS move_color,
  moves.from_x AS move_from_x,
  moves.from_y AS move_from_y,
  moves.to_x AS move_to_x,
  moves.to_y AS move_to_y,
  pos.color AS color,
  case when moves.chessman = pos.chessman and moves.color = pos.color and moves.from_x = pos.x and moves.from_y = pos.y then moves.to_x when moves.special_flag = #DEMO_CHESS_SPECIAL_FLAG.'C' and moves.chessman_dep = pos.chessman and moves.color_dep = pos.color and moves.from_x_dep = pos.x and moves.from_y_dep = pos.y then moves.to_x_dep else pos.x end as x AS xendasx,
  case when moves.chessman = pos.chessman and moves.color = pos.color and moves.from_x = pos.x and moves.from_y = pos.y then moves.to_y when moves.special_flag = #DEMO_CHESS_SPECIAL_FLAG.'C' and moves.chessman_dep = pos.chessman and moves.color_dep = pos.color and moves.from_x_dep = pos.x and moves.from_y_dep = pos.y then moves.to_y_dep else pos.y end as y AS yendasy,
  pos.x AS before_x,
  pos.y AS before_y,
  case when moves.chessman = pos.chessman and moves.color = pos.color and moves.from_x = pos.x and moves.from_y = pos.y then 'X' when moves.special_flag = #DEMO_CHESS_SPECIAL_FLAG.'C' and moves.chessman_dep = pos.chessman and moves.color_dep = pos.color and moves.from_x_dep = pos.x and moves.from_y_dep = pos.y then 'X' else ' ' end as moved_flag AS ythenXelseendasmoved_flag
FROM Demo_Chess_V_Stage13 AS moves
INNER JOIN Demo_Chess_V_Pos_Cds AS pos ON /* join condition not captured in parsed metadata */
;