вторник, 5 марта 2013 г.

APPEND:

Встретил тут в коде удобный APPEND

DATA: r_typ_x TYPE RANGE OF typ_x.


APPEND:              
                'IEQ10' TO r_typ_x,  "Условие А
                'IEQ12' TO r_typ_x.  "Условие Б


append |ILE{ p_par }| to s_par[].
append |IGT{ p_par }| to k_par[].
append |IEQ00000000| to d_par[].
append |IEQ{ zcl_utils=>get_type( ) } | to lr_type.

7.4
lt_AGGA  TYPE TABLE OF abap_compname WITH EMPTY KEY. " table of  fields

  lt_AGGA  = VALUE #( ( 'Field1' ) ( 'Field2' ) ( 'Field3') ).


LOOP AT lt_AGGA ASSIGNING FIELD-SYMBOL().
              ASSIGN COMPONENT OF STRUCTURE TO .

TABLE_LINE


DATA itab TYPE RANGE OF i.
itab = VALUE #( sign = ‘I’  option = ‘BT’ ( low = 1  high = 10 )
                                          ( low = 21 high = 30 )
                                          ( low = 41 high = 50 )
                            option = ‘GE’ ( low = 61 )  ).

  lr_customer = VALUE #(
  FOR <ls_customer> IN lt_customer
  ( sign = 'I'
    option = 'EQ'
    low = )
  ).


DATA:  lr_L_Port type range of /BIC/OIZL_PORT.

    lr_L_Port = VALUE #(
      FOR <ls_t_var_range> IN i_t_var_range
        WHERE ( vnam = 'D_ZL_PORT_CEOO01' )
     ( sign   = -SIGN
       option = -OPT
       low    = -LOW
       high   = -HIGH

     ) ).

CONCATENATE LINES OF lt_sales_order INTO l_logtmp separated by ';'.

* Select fields
DATA:
    ls_view TYPE ZVTETATET,
    lo_struct TYPE REF TO cl_abap_structdescr,

    lt_fields TYPE STANDARD TABLE OF FIELDNAME.

"get list of fields
    lo_struct ?= cl_abap_typedescr=>describe_by_data( ls_view ).
    lt_fields = VALUE #(
      FOR <ls_comp> IN lo_struct->get_components( )

         ( |V~{ -name },| ) ).
...

1 комментарий:

Анонимный комментирует...

супер!