Prog Alv Cu Functii

download Prog Alv Cu Functii

If you can't read please download the document

description

test

Transcript of Prog Alv Cu Functii

*&---------------------------------------------------------------------**& Report ZSA_PROG_ALV_FUNCTII*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORT ZSA_PROG_ALV_FUNCTII.type-pools: slis.tables: likp.selection-screen begin of block b1 with frame. select-options: so_dl for likp-vbeln obligatory, "del so_dl_dt for likp-lfdat, "del date so_dl_ty for likp-lfart, "del type so_sh_po for likp-vstel, "Shipping point so_s_to for likp-kunnr. "Ship-to party parameters: p_del_c type c as checkbox, "Only deliveries completely Goods Issued (checkbox) p_var type disvariant-variant, "ALV Layout (parameter) p_sort_s type c as checkbox, "Sort by shipping point p_sort_d type c as checkbox."Sort by delivery date (checkbox)selection-screen end of block b1.types: begin of ty_itab, vbeln type likp-vbeln, "delivery posnr type lips-posnr, "delivery item lfdat type likp-lfdat, "delivery date lfart type likp-lfart, "delivery type vstel type likp-vstel, "shipping point kunnr type likp-kunnr, "ship-to party wadat_ist type likp-wadat_ist, "actual goods movement date lfimg type lips-lfimg, "quantity meins type lips-meins, "UoM vbeln_v type vbap-vbelv, "sales order posnr_v type vbap-posnv, "sales order item auart type vbak-auart, "? sales order type sau vbap-posar item type kwmeng type vbap-kwmeng, "sales order quantity wbstk type vbuk-wbstk, "total goods movement status end of ty_itab, begin of ty_del, vbeln type likp-vbeln, "delivery posnr type lips-posnr, "delivery item lfdat type likp-lfdat, "delivery date lfart type likp-lfart, "delivery type vstel type likp-vstel, "shipping point kunnr type likp-kunnr, "ship-to party wadat_ist type likp-wadat_ist, "actual goods movement date lfimg type lips-lfimg, "quantity meins type lips-meins, "UoM end of ty_del, begin of ty_s_order, vbeln_v type vbap-vbeln, "sales order posnr_v type vbap-posnr, "sales order item auart type vbak-auart, "? sales order type sau vbap-posar item type kwmeng type vbap-kwmeng, "sales order quantity* wbstk type vbuk-wbstk, "total goods movement status end of ty_s_order, begin of ty_vbuk, wbstk type vbuk-wbstk, "total goods movement status end of ty_vbuk.data: gs_del type ty_del, it_del type table of ty_del, gs_s_order type ty_s_order, it_s_order type table of ty_s_order, it_vb type table of ty_vbuk, gs_vb type ty_vbuk, gs_delivery type ty_itab, gs_delivery2 type ty_itab, it_delivery type table of ty_itab, it_delivery2 type table of ty_itab, gs_delivery3 type ty_itab, it_delivery3 type table of ty_itab, gs_fieldcat type slis_fieldcat_alv, "slis_fieldcat_alv, it_fieldcat type slis_t_fieldcat_alv, "slis_t_fieldcat_alv. it_vbfa type table of vbfa, gs_vbfa type vbfa.data: it_sort type slis_t_sortinfo_alv, gs_sort type slis_sortinfo_alv, gd_layout TYPE slis_layout_alv, gd_repid LIKE sy-repid, g_save TYPE c VALUE 'X', g_variant TYPE disvariant, gx_variant TYPE disvariant, g_exit TYPE c.initialization.gx_variant-report = sy-repid. CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET' EXPORTING i_save = g_save CHANGING cs_variant = gx_variant EXCEPTIONS not_found = 2. IF sy-subrc = 0. p_var = gx_variant-variant. ENDIF.** F4 Help for VarientAT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var.**-- Display all existing variants g_variant-report = sy-repid.* Utilizing the name of the report, this function module will search for a list of* variants and will fetch the selected one into the parameter field for variants CALL FUNCTION 'REUSE_ALV_VARIANT_F4' EXPORTING is_variant = g_variant i_save = g_save IMPORTING e_exit = g_exit es_variant = gx_variant EXCEPTIONS not_found = 2. IF sy-subrc = 2. MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. IF g_exit = space. p_var = gx_variant-variant. ENDIF. ENDIF.start-of-selection.perform select.perform catalog.perform sort.perform variant.perform display.*&---------------------------------------------------------------------**& Form SELECT*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* p1 text* p1 text*