quinta-feira, 2 de abril de 2020

Util - SQL ABAP 740

    DELETE FROM demo_expressions.
    INSERT demo_expressions FROM TABLE @( VALUE #(
      ( id = 'X'
        char1 = ' 0123'
        char2 = 'aAaA' ) ) ).

    SELECT SINGLE
           char1 AS text1,
           char2 AS text2,
           CONCAT(            char1,char2 )     AS concat,
           CONCAT_WITH_SPACE( char1,char2, 1 )  AS concat_with_space,
           INSTR(             char1,'12' )      AS instr,
           LEFT(              char1,3 )         AS left,
           LENGTH(            char1 )           AS length,
           LOWER(             char2 )           AS lower,
           LPAD(              char1,10,'x' )    AS lpad,
           LTRIM(             char1,' ' )       AS ltrim,
           REPLACE(           char1,'12','__' ) AS replace,
           RIGHT(             char1,3 )         as right,
           RPAD(              char1,10,'x' )    AS rpad,
           RTRIM(             char1,'3' )       AS rtrim,
           SUBSTRING(         char1,3,3 )       AS substring,
           UPPER(             char2 )           AS upper
           FROM demo_expressions
           INTO @DATA(result).

    cl_demo_output=>display( result ).

========================================================================

        SELECT SINGLE concatconcatrtrimort01,' ' ),'-' )regio AS incol2
          FROM t001w
         WHERE werks EQ @ls_ped_transf-werks_dest
          INTO @DATA(l_incol2).


======================================================================

  TYPESBEGIN OF tp_upl,
           partner_coop TYPE zsdt_0099-partner_coop,
           id_coop      TYPE zsdt_0099-id_coop,
           partner_prop TYPE zsdt_0099-partner_prop,
           barracao     TYPE zsdt_0099-barracao,
           semana       TYPE zsdt_0099-semana,
           ano          TYPE zsdt_0099-ano,
           rodada       TYPE zsdt_0099-rodada,
           dt_cri_lote  TYPE zsdt_0099-dt_cri_lote,
         END OF tp_upl.

  TYPEStp_dados_sel TYPE TABLE OF tp_upl WITH DEFAULT KEY.


    DATA(lt_uplVALUE tp_dados_sel(
                  FOR ls_dados IN gt_zsdt_0099
                  WHERE partner_prop zsds_0041-id_propr )
                  partner_coop ls_dados-partner_coop
                    id_coop      ls_dados-id_coop
                    partner_prop ls_dados-partner_prop
                    barracao     ls_dados-barracao
                    semana       ls_dados-semana
                    ano          ls_dados-ano
                    rodada       ls_dados-rodada
                    dt_cri_lote  ls_dados-dt_cri_lote ).


============================
DATA: lt_flights_all TYPE STANDARD TABLE OF spfli 
                     WITH NON-UNIQUE SORTED KEY carrid
                     COMPONENTS carrid,
 
      lt_flight_lh   TYPE STANDARD TABLE OF spfli.

SELECT *  FROM spfli
          INTO TABLE @lt_flights_all.
IF sy-subrc = 0.

lt_flight_lh = FILTER #( lt_flights_all USING KEY carrid 
                                        WHERE carrid = 'LH ' ).

ENDIF.
================================
https://blogs.sap.com/2015/10/25/abap-740-quick-reference/






Nenhum comentário:

Postar um comentário