Snippets Collections
gv_print type slis_print_alv.

gv_print-print = 'X'.
 CALL FUNCTION 'SET_PRINT_PARAMETERS'
    EXPORTING
      destination = 'LOCL' " Printer
      layout      = 'X_65_512/2' "Format
      line_count  = '65' "Line Count
      line_size   = '1024'. "Line Size
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
   I_STRUCTURE_NAME                  = 'T000'
   IS_PRINT                          = v_print
  TABLES
    T_OUTTAB                          = gt_final
* EXCEPTIONS
*   PROGRAM_ERROR                     = 1
*   OTHERS                            = 2
          .
TYPES:
  BEGIN OF ty_sflight,
    carrid TYPE sflight-carrid,
    connid TYPE sflight-connid,
  END OF ty_sflight.
DATA:
  lt_sflight   TYPE STANDARD TABLE OF ty_sflight,
  r_type_table TYPE REF TO cl_abap_tabledescr,
  r_data_tab   TYPE REF TO data.
FIELD-SYMBOLS:
  <lt_table>   TYPE ANY TABLE.

START-OF-SELECTION.
  lt_sflight = VALUE #(
               ( carrid = 'AA' connid = 1 )
               ( carrid = 'LH' connid = 1 )
               ( carrid = 'AA' connid = 2 )
               ( carrid = 'LH' connid = 3 ) ).
  r_type_table = cl_abap_tabledescr=>create(
      p_line_type = cl_abap_structdescr=>create(
        p_components = VALUE #(
          ( name = 'CARRID' type = CAST #( cl_abap_datadescr=>describe_by_name( 'SFLIGHT-CARRID' ) ) )
          ( name = 'CONNID' type = CAST #( cl_abap_datadescr=>describe_by_name( 'SFLIGHT-CONNID' ) ) ) ) ) ).
  CREATE DATA r_data_tab TYPE HANDLE r_type_table.
  ASSIGN r_data_tab->* TO <lt_table>.

  <lt_table> = lt_sflight.

  FIELD-SYMBOLS <lt_temp> TYPE HASHED TABLE.
  r_type_table = cl_abap_tabledescr=>create(
      p_line_type = cl_abap_structdescr=>create(
        p_components = VALUE #(
          ( name = 'CARRID' type = CAST #( cl_abap_datadescr=>describe_by_name( 'SFLIGHT-CARRID' ) ) ) ) )
      p_table_kind = cl_abap_tabledescr=>tablekind_hashed
      p_unique = abap_true
      p_key_kind = cl_abap_tabledescr=>keydefkind_tableline ).
  CREATE DATA r_data_tab TYPE HANDLE r_type_table.
  ASSIGN r_data_tab->* TO <lt_temp>.

  <lt_temp> = CORRESPONDING #( <lt_table> DISCARDING DUPLICATES ).

  LOOP AT <lt_temp> ASSIGNING FIELD-SYMBOL(<ls_temp>).
    ASSIGN COMPONENT 1 OF STRUCTURE <ls_temp> TO FIELD-SYMBOL(<field>).
    cl_demo_output=>write( |Group - { <field> }| ).
  ENDLOOP.

  cl_demo_output=>display( ).
import com.sap.gateway.ip.core.customdev.util.Message
import groovy.util.XmlSlurper
import groovy.xml.XmlUtil

def Message processData(Message message) {
    def itemNewVal = message.getProperty('id')
    def queryUserResponse = new XmlSlurper().parseText(message.getBody(java.lang.String))
    queryUserResponse.User.Item.replaceBody(itemNewVal)
    message.setBody(XmlUtil.serialize(queryUserResponse))
    return message
}
star

Fri Aug 26 2022 01:34:34 GMT+0000 (Coordinated Universal Time) https://answers.sap.com/questions/8057535/backgroud-job-for-an-alv-report-no-spool-generated.html

#abap
star

Mon May 10 2021 11:00:39 GMT+0000 (Coordinated Universal Time) https://answers.sap.com/questions/12884088/loop-at-group-by-with-reference-field-symbol-chall.html

#abap
star

Thu Nov 12 2020 08:58:00 GMT+0000 (Coordinated Universal Time) https://answers.sap.com/questions/513060/change-data-of-a-child-node-in-message-payload-usi.html?childToView

#abap

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension