Modelo deocnsultas en ABAP
Enviado por Oscar Eduardo Puin Caro • 14 de Abril de 2018 • Tutorial • 745 Palabras (3 Páginas) • 167 Visitas
TABLES: sbook.
SELECTION-SCREEN BEGIN OF BLOCK b001 WITH FRAME TITLE text-000.
SELECT-OPTIONS:s_code FOR sbook-connid obligatory.
SELECT-OPTIONS:s_airli FOR sbook-carrid .
SELECT-OPTIONS:s_date FOR sbook-fldate .
SELECTION-SCREEN END OF BLOCK b001.
data gt_principal type standard table of ztaller5.
"data gs1 type ztaller5h.
types:
BEGIN OF ztaller5h1,
codeair TYPE scarr-carrid ,
nameair TYPE scarr-carrname ,
codecon TYPE spfli-connid ,
typeair TYPE sflight-planetype,
nameco0 TYPE t005t-landx ,
nameci0 TYPE spfli-cityfrom ,
nameae0 TYPE sairport-name ,
nameco1 TYPE t005t-landx ,
nameci1 TYPE spfli-cityto ,
nameae1 TYPE sairport-name ,
fevuelo TYPE sflight-fldate ,
END OF ztaller5h1.
data gs1 type ztaller5h1.
START-OF-SELECTION.
SELECT single sc~carrid sc~carrname sf~connid sf~planetype sp~countryfr sp~cityfrom sp~airpfrom sp~countryto sp~cityto sp~airpto sf~fldate INTO gs1
FROM scarr AS sc
INNER JOIN sflight AS sf
ON sc~carrid = sf~carrid
INNER JOIN spfli AS sp
ON sp~carrid = sc~carrid AND sf~connid = sp~connid
INNER JOIN t005t AS t
ON sp~countryfr = t~land1 and t~spras = 'EN'
INNER JOIN sairport AS sa
ON sp~airpfrom = sa~id
WHERE sf~carrid IN s_airli and sf~connid IN s_code and sf~fldate IN s_date.
*
* SELECT single sc~carrid sc~carrname sf~connid sf~planetype sp~countryfr sp~cityfrom sa~name sp~countryto sp~cityto sp~fltime sp~distance sp~distid INTO TABLE gt_principal
* FROM scarr AS sc
* INNER JOIN sflight AS sf
* ON sc~carrid = sf~carrid
* INNER JOIN spfli AS sp
* ON sp~carrid = sc~carrid AND sf~connid = sp~connid
* INNER JOIN t005t AS t
* ON sp~countryfr = t~land1 and t~spras = 'EN'
* INNER JOIN sairport AS sa
* ON sp~airpfrom = sa~id
* WHERE sf~carrid IN s_airli and sf~connid IN s_code and sf~fldate IN s_date.
SELECT sc~id sc~name t~landx sc~city sc~email INTO TABLE gt_principal
FROM scustom AS sc
INNER JOIN sbook AS sb
ON sc~id = sb~customid
...