Demo_Chess_V_Stage7

DDL: DEMO_CHESS_V_STAGE7 SQL: DEMO_CHESS_SST7 Type: view

Stage7 in generating allowed chess movements

Demo_Chess_V_Stage7 is a CDS View that provides data about "Stage7 in generating allowed chess movements" in SAP S/4HANA. It reads from 2 data sources (Demo_Chess_V_Stage6, 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_Stage6 moves from
Demo_Chess_V_Pos_Cds pos inner

Annotations (4)

NameValueLevelField
AbapCatalog.sqlViewName DEMO_CHESS_SST7 view
AccessControl.authorizationCheck #NOT_ALLOWED view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Stage7 in generating allowed chess movements view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY gameuuid Demo_Chess_V_Stage6 gameuuid UUID
KEY movecnt Demo_Chess_V_Stage6 movecnt Halbzugnummer
KEY move_color Demo_Chess_V_Stage6 color Level Color
KEY move_from_x Demo_Chess_V_Stage6 from_x X-Position
KEY move_from_y Demo_Chess_V_Stage6 from_y Y-Position
KEY move_to_x Demo_Chess_V_Stage6 to_x X-Position
KEY move_to_y Demo_Chess_V_Stage6 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_Stage7.
-- 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_SST7

CREATE VIEW Demo_Chess_V_Stage7 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_Stage6 AS moves
INNER JOIN Demo_Chess_V_Pos_Cds AS pos ON /* join condition not captured in parsed metadata */
;