Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

How to Optimize ALV Report which causes low Performance in Production System

$
0
0

Hi All

 

I had below ALV Report which causes very bad performance when i try to execute in production system due to lot of records exits in production

if user given posting date between one year in selection screen its getting triggered for a long time. i need to improve performance for this report.

Please suggest me from below code where i can do modifications to improve the performance?

 

 

REPORT  ztesting.

 

 

""""""""""""""""""""""Types Declarations""""""""""""""""""""""""""""""""""

TYPES : BEGIN OF ty_crm_order,

        guid  TYPE crmt_object_guid,

        END OF ty_crm_order.

 

 

TYPES : BEGIN OF tl_text2,

        object_id TYPE crmt_object_id_db,

        posting_date TYPE comt_created_at_usr,

        pdate TYPE string,

        ptime TYPE string,

        txt30 TYPE j_txt30,

        desc TYPE crmt_process_description,

        category1 TYPE crm_erms_cat_ca_id, "crmt_description_20,

        category2 TYPE crm_erms_cat_ca_id, "crmt_description_20,

        category3 TYPE crm_erms_cat_ca_id, "crmt_description_20,

        category4  TYPE crm_erms_cat_ca_id, "crmt_description_20,

        string TYPE string,

        transdesp TYPE string,

        rootcause TYPE string,

        priority TYPE sc_txt,

        chreq TYPE bu_namep_f,

        chreq_no TYPE string,

        chman TYPE bu_namep_f,

        supp TYPE string,

        supp_no TYPE string,

        rep_supp TYPE string,

        rep_supp_no TYPE string,

        stdate TYPE char10,

        sttime TYPE sy-uzeit,

        department TYPE ad_dprtmnt,

        extref TYPE crmt_po_number_sold,

        subject TYPE qtxt_code,

        sysid TYPE dnot_sysid,

        chdat TYPE comt_changed_at_usr,

        chdat1 TYPE string,

        chtime1 TYPE string,

        bname TYPE xubname,

        building TYPE ad_bldng_p,

        process_type TYPE crmt_process_type_db,

        mnumm TYPE dnot_mnumm,

        mstat TYPE val_text,

        zero TYPE char2,

        function TYPE crmt_description_20,

        udate TYPE string,

        utime TYPE string,

        country TYPE landx,

        ticket_type TYPE zdtel000000,

        related_uc_no TYPE zdtel000074,

        planned_effort TYPE /aicrm/dtel003j,

        actual_effort TYPE /aicrm/dtel003n,

        solpos_date TYPE string,

        solpos_time TYPE string,

END OF tl_text2.

"""""""""""""""Begin of Tabels Declarations"""""""""""""""""""""""""""""""""""""""""""""""""""""

 

 

TABLES : crmd_orderadm_h,but000,dd07t.

 

 

"""""""""""""end of Table Declarations"""""""""""""""""""""""""""""""""""""""""""""""""""""""

 

 

"""""""""""""begin of Data Declarations""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

DATA : BEGIN OF l_filehead,

           text TYPE char255,

       END OF l_filehead.

 

 

DATA :   t_text2 TYPE TABLE OF tl_text2,

         l_text2 TYPE tl_text2,

         t_filehead LIKE TABLE OF l_filehead,

         l_filename TYPE string,

         l_layout  TYPE slis_layout_alv,

         ls_crm_order TYPE ty_crm_order,

         lv_exit     TYPE  char1,

         ls_variant  TYPE  disvariant,

         gs_variant  TYPE disvariant,

         gv_save(1) TYPE  c,

         lr_order      TYPE REF TO cl_crm_bol_entity,

         lr_adminh     TYPE REF TO cl_crm_bol_entity,

         lr_entity     TYPE REF TO cl_crm_bol_entity,

         lv_guid       TYPE crmt_genil_object_guid,

         lr_core       TYPE REF TO cl_crm_bol_core,

         lr_coll       TYPE REF TO if_bol_entity_col,

         lr_partner_it TYPE REF TO if_bol_entity_col_iterator,

         ls_urgency    TYPE bsp_wd_dropdown_line,

         ls_function   TYPE bsp_wd_dropdown_line,

         ls_priority   TYPE bsp_wd_dropdown_line,

          wa_jcds       TYPE crm_jcds.

 

 

"""""""""""BEGIN OF internal tables""""""""""""""""""""""""""""""""""""""""""

DATA:    lt_crm_order TYPE TABLE OF ty_crm_order,

         lt_urgency    TYPE bsp_wd_dropdown_table,

         lt_function   TYPE bsp_wd_dropdown_table,

         lt_priority   TYPE bsp_wd_dropdown_table,

         lt_text_all   TYPE comt_text_textdata_t,

         lt_text_table TYPE string_table,

         it_jcds TYPE TABLE OF crm_jcds.

"""""""""""""BEGIN OF INTERNAL TABLES"""""""""""""""""""""""""""""""""""""

 

 

 

 

""""""""""""""""""""end of data declartaions""""""""""""""""""""""""""""""""""""""

 

 

""""""""""""BEGIN OF local variables""""""""""""""""""""""""""""""""""""""""""""""""""""""""

DATA:  lv_logtext    TYPE string,

       lv_string     TYPE string,

       lv_bp_guid   TYPE bu_partner_guid,

       lv_username  TYPE syuname,

       lv_domname TYPE char30 VALUE 'DNOE_MSTAT',

       lv_process_type TYPE crmt_process_type VALUE 'ZMIN',

       lv_as4local TYPE char1 VALUE 'A',

       lv_priority   TYPE char40, "string,

       lv_subject    TYPE char40,

       lv_function   TYPE char40,

       lv_category   TYPE string,

       lv_stat       TYPE char10,

       lv_date TYPE string,

       lv_time TYPE string,

       lv_count TYPE string.

 

 

""""""""""end of local variables"""""""""""""""""""""""""""""""""""""""""""""""""""

 

 

 

 

""""""""begin of field symbol"""""""""""""""""""""""""""""""""""""""""""""""""""

FIELD-SYMBOLS: <ls_textdata> LIKE LINE OF lt_text_all.

""""""""""""""end of field symbol"""""""""""""""""""""""""""""""""""""""""""""""

 

 

"""""""""""""""""""""begin of Selection Screen """""""""""""""""""""""""""""""""""

SELECTION-SCREEN BEGIN OF BLOCK cr WITH FRAME.

 

 

SELECT-OPTIONS : s_cr    FOR crmd_orderadm_h-object_id,

                 s_pdate FOR crmd_orderadm_h-posting_date,

                 s_pat   FOR but000-partner NO INTERVALS.

 

 

SELECTION-SCREEN END OF BLOCK cr.

""""""""""""""""""""'end of selection Screen""""""""""""""""""""""""""""""""""

 

 

 

 

SELECTION-SCREEN BEGIN OF BLOCK layout WITH FRAME.

 

 

PARAMETERS: p_vari LIKE disvariant-variant.

 

 

SELECTION-SCREEN END OF BLOCK layout.

""""""""""""At Selection Screen"""""""""""""""""""""""""""""""""""""""""

 

 

AT SELECTION-SCREEN.

 

 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.

 

 

* save before image

  gs_variant = sy-repid.

  IF p_vari IS NOT INITIAL.

    ls_variant = p_vari.

  ELSE.

    ls_variant = gs_variant.

  ENDIF.

  gv_save = 'A'.

* call f4 function

  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

    EXPORTING

      is_variant = gs_variant

      i_save     = gv_save

    IMPORTING

      e_exit     = lv_exit

      es_variant = ls_variant

    EXCEPTIONS

      OTHERS     = 1.

* copy changes

  IF sy-subrc IS INITIAL AND lv_exit IS INITIAL.

    gs_variant     = ls_variant.

    p_vari         = gs_variant-variant.

  ENDIF.

  """"""""""""""""""begin of start of selection"""""""""""""""""""""""""""""""""""""""""""""

 

 

START-OF-SELECTION.

 

 

*   Fecth all the Business Trasaction records

  SELECT guid

      FROM crmd_orderadm_h

      INTO TABLE lt_crm_order

      WHERE object_id IN s_cr      AND

            process_type = lv_process_type  AND

            posting_date IN s_pdate.

 

 

  IF sy-subrc = 0.

    IF s_pat[] IS NOT INITIAL.

      SELECT c~guid_hi  FROM ( ( but000 AS a INNER JOIN crmd_partner AS b  ON a~partner_guid = b~partner_no )

                                         INNER JOIN crmd_link AS c     ON b~guid = c~guid_set )

                                         INTO TABLE lt_crm_order

                                         FOR ALL ENTRIES IN lt_crm_order

                                         WHERE a~partner IN s_pat

                                         AND b~partner_fct = 'SLFN0003'

                                         AND c~objtype_set = '07'

                                         AND c~guid_hi     = lt_crm_order-guid.

 

 

    ENDIF.

 

 

    IF lt_crm_order IS NOT INITIAL.

* Get priority text

      CLEAR lt_priority.

      CALL METHOD cl_crm_uiu_cust_get=>get_values_for_field

        EXPORTING

          iv_fieldname = 'PRIORITY'

        RECEIVING

          rt_value     = lt_priority

        EXCEPTIONS

          OTHERS       = 4.

* Get Function text

      CLEAR lt_function.

      CALL METHOD cl_crm_uiu_cust_get=>get_values_for_field

        EXPORTING

          iv_fieldname = 'IMPACT'

        RECEIVING

          rt_value     = lt_function

        EXCEPTIONS

          OTHERS       = 4.

*  Get Urgency text

      CLEAR lt_urgency.

      CALL METHOD cl_crm_uiu_cust_get=>get_values_for_field

        EXPORTING

          iv_fieldname = 'URGENCY'

        RECEIVING

          rt_value     = lt_urgency

        EXCEPTIONS

          OTHERS       = 4.

* Loading Component Set

      lr_core = cl_crm_bol_core=>get_instance( ).

      lr_core->start_up('ONEORDER').

 

 

      LOOP AT lt_crm_order INTO ls_crm_order.

 

 

        CLEAR lv_guid.

        lv_guid = ls_crm_order-guid.

        lr_order = lr_core->get_root_entity( iv_object_name = 'BTOrder'

                                             iv_object_guid = lv_guid ).

 

 

        IF  lr_order IS BOUND.

          lr_adminh = lr_order->get_related_entity( 'BTOrderHeader' ).

 

 

          IF lr_adminh IS BOUND.

*Get Object Id

            l_text2-object_id = lr_adminh->get_property_as_string( 'OBJECT_ID' ).

*conversion routine

            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

              EXPORTING

                input  = l_text2-object_id

              IMPORTING

                output = l_text2-object_id.

*Get Process Type

            l_text2-process_type  = lr_adminh->get_property_as_string( 'PROCESS_TYPE' ).

 

 

*Get Description

            l_text2-desc       = lr_adminh->get_property_as_string( 'DESCRIPTION' ).

 

 

*Get Created at date and time

            l_text2-pdate      = lr_adminh->get_property_as_string( 'CREATED_AT_DATE' ).

            l_text2-ptime      = lr_adminh->get_property_as_string( 'CREATED_AT_TIME' ).

 

 

*Get Date Last Changed

            l_text2-chdat1     = lr_adminh->get_property_as_string( 'CHANGED_AT_DATE' ).

            l_text2-chtime1    = lr_adminh->get_property_as_string( 'CHANGED_AT_TIME' ).

 

 

* Get the last status change date

 

 

            SELECT *

                      FROM crm_jcds

                      INTO TABLE it_jcds

                      WHERE objnr = lv_guid

                      AND stat = 'E0020'.

 

 

            DESCRIBE TABLE it_jcds LINES lv_count.

            CASE lv_count.

              WHEN 1 OR 2.

                SORT it_jcds BY chgnr ASCENDING.

                READ TABLE  it_jcds INTO  wa_jcds INDEX 1.

              WHEN OTHERS.

 

 

                SORT it_jcds BY chgnr DESCENDING.

                READ TABLE  it_jcds INTO  wa_jcds WITH KEY inact = ' ' chind = 'U'.

            ENDCASE.

** sol pos date

            lv_date = wa_jcds-udate.

            lv_time = wa_jcds-utime.

            CLEAR wa_jcds.

 

 

            CONCATENATE  lv_time+0(2) ':' lv_time+2(2) ':'  lv_time+4(2) INTO lv_time.

            CONCATENATE  lv_date+6(2) '/' lv_date+4(2)   '/' lv_date+0(4)  INTO  lv_date.

 

 

            l_text2-solpos_date = lv_date.

            IF l_text2-solpos_date IS INITIAL.

              l_text2-solpos_date = 'NA'.

            ENDIF.

            CLEAR lv_date.

*** sol pos time

            l_text2-solpos_time = lv_time.

            IF l_text2-solpos_time IS INITIAL.

              l_text2-solpos_time = 'NA'.

            ENDIF.

            CLEAR lv_time.

 

 

* Get Priority

            lr_coll = lr_adminh->get_related_entities( iv_relation_name = 'BTHeaderActivityExt' ). "#EC NOTEXT

            lr_entity = lr_coll->get_current( ).

            IF lr_entity IS BOUND.

              CLEAR lv_priority.

              lv_priority = lr_entity->get_property_as_string( 'PRIORITY' ).

              IF lt_priority IS NOT INITIAL.

                READ TABLE lt_priority INTO ls_priority WITH KEY key = lv_priority.

                IF sy-subrc = 0.

                  l_text2-priority = ls_priority-value.

                ENDIF.

              ENDIF.

            ENDIF.

*Get Status

            lr_coll = lr_adminh->get_related_entities( iv_relation_name = 'BTHeaderStatusSet' ). "#EC NOTEXT

            lr_entity = lr_coll->get_current( ).

            IF lr_entity IS BOUND.

              lr_coll = lr_entity->get_related_entities( iv_relation_name = 'BTStatusHCurrent' ). "#EC NOTEXT

              lr_entity = lr_coll->get_current( ).

              IF lr_entity IS BOUND.

                l_text2-txt30 = lr_entity->get_property_as_string( 'TXT30' ).

              ENDIF.

            ENDIF.

*Get Categories

            lr_coll = lr_adminh->get_related_entities_by_bpath( './BTHeaderCategorySet/BTCategorySchemaAll/BTCategoryFirst_S' ).

            IF lr_coll IS BOUND.

              lr_entity = lr_coll->get_current( ).

              IF lr_entity IS BOUND.

                lv_category    = lr_entity->get_property_as_string( 'CONCATENATED_DESCRIPTION' ).

                SPLIT lv_category AT ',' INTO l_text2-category1 l_text2-category2 l_text2-category3 l_text2-category4.

              ENDIF.

            ENDIF.

* Get Text

            CALL FUNCTION 'CRM_DNO_READ_ORDER_TEXT'

              EXPORTING

                iv_header_guid = lv_guid

              IMPORTING

                et_alltexts    = lt_text_all.

  "Changed to display all texts except SUSD System Data

            IF lt_text_all IS NOT INITIAL.

 

 

              DELETE lt_text_all WHERE NOT ( stxh-tdid = 'SU01' OR stxh-tdid = 'SU99' OR stxh-tdid = 'A004' ). "#EC NOTEXT

 

 

              LOOP AT lt_text_all ASSIGNING <ls_textdata>.

                CALL FUNCTION 'CONVERT_ITF_TO_STREAM_TEXT'

                  EXPORTING

                    language     = sy-langu

                    lf           = 'X'

                  IMPORTING

                    stream_lines = lt_text_table

                  TABLES

                    itf_text     = <ls_textdata>-lines.

 

 

                CLEAR lv_logtext.

                IF lt_text_table IS NOT INITIAL.

                  LOOP AT lt_text_table INTO lv_string.

                    IF sy-tabix = 1.

                      lv_logtext = lv_string.

                    ELSE.

                      CONCATENATE lv_logtext lv_string INTO lv_logtext SEPARATED BY space. "cl_abap_char_utilities=>horizontal_tab.

                    ENDIF.

                  ENDLOOP.

 

 

                  IF <ls_textdata>-stxh-tdid = 'SU01'.

                    CONCATENATE lv_logtext l_text2-string INTO l_text2-string SEPARATED BY space.

                  ENDIF.

                  IF <ls_textdata>-stxh-tdid = 'SU99'.

                    l_text2-transdesp = lv_logtext.

                  ENDIF.

                  IF <ls_textdata>-stxh-tdid = 'A004'.

                    l_text2-rootcause = lv_logtext.

                  ENDIF.

                ENDIF.

              ENDLOOP.

            ENDIF.

 

 

**reading related UC NO and Ticket Type

            lr_entity = lr_adminh->get_related_entity( 'BTHeaderServiceExt' ).

            IF lr_entity IS BOUND.

              l_text2-ticket_type    = lr_entity->get_property_as_string( 'ZZFLD000000' ).

              l_text2-related_uc_no  = lr_entity->get_property_as_string( 'ZZFLD00000H' ).

              l_text2-sysid          = lr_entity->get_property_as_string( '/AICRM/SYSTEM_ID' ).

              l_text2-mnumm          = lr_entity->get_property_as_string( '/AICRM/ICT_NUM' ).

** Fetch the Actual and planned effort

              l_text2-planned_effort = lr_entity->get_property_as_string( '/AICRM/CUSTTXT01' ).

              l_text2-actual_effort  = lr_entity->get_property_as_string( '/AICRM/CUSTTXT03' ).

              CLEAR lv_stat.

              lv_stat               = lr_entity->get_property_as_string( '/AICRM/SAP_STAT' ).

              IF lv_stat IS NOT INITIAL.

 

 

 

 

                SELECT SINGLE * FROM dd07t WHERE domname = lv_domname AND

                                                  ddlanguage = 'EN' AND

                                                  as4local = lv_as4local AND

                                                  domvalue_l = lv_stat.

                IF sy-subrc = 0.

                  l_text2-mstat = dd07t-ddtext.

                ENDIF.

              ENDIF.

            ENDIF.

 

 

*Reading sales attribute

            lr_entity = lr_adminh->get_related_entity( 'BTHeaderSalesSet' ).

            IF lr_entity IS BOUND.

              l_text2-extref = lr_entity->get_property_as_string( 'PO_NUMBER_SOLD' ).

            ENDIF.

 

 

* Reading Service Request attribute

            lr_entity = lr_adminh->get_related_entity( 'BTHeaderSrvRequestExt' ).

            IF lr_entity IS BOUND.

* Reading goal

              lv_function = lr_entity->get_property_as_string( 'IMPACT' ).

              IF lt_function IS NOT INITIAL.

                READ TABLE lt_function INTO ls_function WITH KEY key = lv_function.

                IF sy-subrc = 0.

                  l_text2-function = ls_function-value.

                ENDIF.

              ENDIF.

 

 

*Reading Subject

              CLEAR lv_subject.

              lv_subject = lr_entity->get_property_as_string( 'URGENCY' ).

              IF lt_urgency IS NOT INITIAL.

                READ TABLE lt_urgency INTO ls_urgency WITH KEY key = lv_subject.

                IF sy-subrc = 0.

                  l_text2-subject = ls_urgency-value.

                ENDIF.

              ENDIF.

            ENDIF.

 

 

*Get Partners

            lr_coll = lr_adminh->get_related_entities( iv_relation_name = 'BTHeaderPartnerSet' ).

            IF lr_coll IS BOUND.

              lr_entity = lr_coll->get_current( ).

              lr_coll = lr_entity->get_related_entities( iv_relation_name = 'BTPartnerAll' ).

              IF lr_coll IS BOUND.

                lr_partner_it ?= lr_coll->get_iterator( ).

*Get Supoort team

                lr_entity ?= lr_partner_it->find_by_property( iv_attr_name = 'PARTNER_FCT' iv_value = 'SLFN0003' ).

                IF lr_entity IS BOUND.

                  l_text2-supp_no = lr_entity->get_property_as_string( 'PARTNER_NO' ).

                  l_text2-supp    = lr_entity->get_property_as_string( 'DESCRIPTION_NAME' ).

                ENDIF.

*Get Reporter

                lr_entity ?= lr_partner_it->find_by_property( iv_attr_name = 'PARTNER_FCT' iv_value = 'SLFN0002' ).

                IF lr_entity IS BOUND.

                  l_text2-rep_supp_no = lr_entity->get_property_as_string( 'PARTNER_NO' ).

                  l_text2-rep_supp    = lr_entity->get_property_as_string( 'DESCRIPTION_NAME' ).

                  lv_bp_guid          = lr_entity->get_property_as_string( 'BP_PARTNER_GUID' ).

 

 

                  CALL FUNCTION 'BP_CENTRALPERSON_GET'

                    EXPORTING

                      iv_bu_partner_guid  = lv_bp_guid

                    IMPORTING

                      ev_username         = lv_username

                    EXCEPTIONS

                      no_central_person   = 1

                      no_business_partner = 2

                      no_id               = 3

                      OTHERS              = 4.

                  IF sy-subrc = 0.

                    l_text2-bname = lv_username.

                  ENDIF.

* Get Country

                  lr_entity = lr_entity->get_related_entity( 'BTBusinessPartner' ).

                  IF lr_entity IS BOUND.

                    l_text2-country    = lr_entity->get_property_as_string( 'NAMCOUNTRY' ).

                    IF l_text2-country IS INITIAL.

                      l_text2-country = 'IN'.

                    ENDIF.

                  ENDIF.

                ENDIF.

*Get Processor

                lr_entity ?= lr_partner_it->find_by_property( iv_attr_name = 'PARTNER_FCT' iv_value = 'SLFN0004' ).

                IF lr_entity IS BOUND.

                  l_text2-chreq_no = lr_entity->get_property_as_string( 'PARTNER_NO' ).

                  l_text2-chreq    = lr_entity->get_property_as_string( 'DESCRIPTION_NAME' ).

                ENDIF.

              ENDIF.

            ENDIF.

            APPEND l_text2 TO t_text2.

            CLEAR l_text2.

          ENDIF.

        ENDIF.

        CLEAR ls_crm_order.

      ENDLOOP.

    ENDIF.

  ENDIF.

 

 

END-OF-SELECTION.

"""""""""""""""""""""""END OF SELECTION"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

  SORT t_text2 BY object_id.

  IF t_text2 IS NOT INITIAL.

    PERFORM alv.

  ELSE.

* MESSAGE 'No entries for the specified selection criteria' TYPE 'S'.

    MESSAGE text-000 TYPE 'S'.

  ENDIF.

 

 

*&---------------------------------------------------------------------*

*&      Form  GUI_DOWNLOAD

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM gui_download .

*creating filepath

  CONCATENATE text-002 sy-datum+6(2) '_' sy-datum+4(2) '_'

              sy-datum(4) '_' sy-uzeit '.XLS' INTO l_filename.

 

 

  FREE : t_filehead[].

  CLEAR : l_filehead.

 

 

  l_filehead-text = text-002.  APPEND l_filehead TO t_filehead. CLEAR l_filehead.

  l_filehead-text = text-003.  APPEND l_filehead TO t_filehead. CLEAR l_filehead.

  l_filehead-text = text-004.  APPEND l_filehead TO t_filehead. CLEAR l_filehead.

 

 

  CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

      filename                = l_filename

      filetype                = 'ASC'

      write_field_separator   = 'X'

    TABLES

      data_tab                = t_text2

      fieldnames              = t_filehead[]

    EXCEPTIONS

      file_write_error        = 1

      no_batch                = 2

      gui_refuse_filetransfer = 3

      invalid_type            = 4

      no_authority            = 5

      unknown_error           = 6

      header_not_allowed      = 7

      separator_not_allowed   = 8

      filesize_not_allowed    = 9

      header_too_long         = 10

      dp_error_create         = 11

      dp_error_send           = 12

      dp_error_write          = 13

      unknown_dp_error        = 14

      access_denied           = 15

      dp_out_of_memory        = 16

      disk_full               = 17

      dp_timeout              = 18

      file_not_found          = 19

      dataprovider_exception  = 20

      control_flush_error     = 21

      OTHERS                  = 22.

  IF sy-subrc <> 0.

*    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

*            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  ELSE.

**Log

    PERFORM file_path.

  ENDIF.

 

 

 

 

ENDFORM.                    " GUI_DOWNLOAD

*&---------------------------------------------------------------------*

*&      Form  FILE_PATH

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM file_path .

  WRITE : / 'Filename :',l_filename.

ENDFORM.                    " FILE_PATH

*&---------------------------------------------------------------------*

*&      Form  ALV

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM alv.

  DATA : ifield_cat TYPE slis_t_fieldcat_alv,

         wfield_cat TYPE slis_fieldcat_alv.

 

 

  wfield_cat-fieldname   = 'OBJECT_ID'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Transaction Number'.

  wfield_cat-key        = 'X'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'PROCESS_TYPE'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Transaction Type'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'PDATE'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Created Date'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'PTIME'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Created Time'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'CHDAT1'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Changed Date'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'CHTIME1'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Changed Time'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'DESC'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Transaction Description'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'TXT30'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'User Status'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

  wfield_cat-fieldname   = 'SOLPOS_DATE'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Solution proposed date'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'SOLPOS_TIME'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Solution proposed Time'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'PRIORITY'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Priority'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

 

 

  wfield_cat-fieldname   = 'CATEGORY1'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Category1'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'CATEGORY2'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Category2'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'CATEGORY3'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Category3'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'CATEGORY4'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m   = 'Category4'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'EXTREF'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'External Reference'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'SUBJECT'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Catalog(Sub)'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'CHREQ'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Person Responsible'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

 

 

  wfield_cat-fieldname   = 'SYSID'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'System'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'BNAME'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'User ID'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

 

 

  wfield_cat-fieldname   = 'FUNCTION'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Function'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'MNUMM'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Notification Number'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'MSTAT'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Notification Status at SAP'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'SUPP_NO'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Support Team ID'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'SUPP'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Support Team'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'REP_SUPP_NO'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Reported By ID'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'REP_SUPP'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Reported By'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'TRANSDESP'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Problem Description'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'STRING'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Solution Provided'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'ROOTCAUSE'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Problem RootCause'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

 

 

  wfield_cat-fieldname   = 'COUNTRY'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'COUNTRY'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'TICKET_TYPE'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Ticket Type'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'RELATED_UC_NO'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Related UC NO'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

 

 

  wfield_cat-fieldname   = 'PLANNED_EFFORT'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Planned effort'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

  wfield_cat-fieldname   = 'ACTUAL_EFFORT'.

  wfield_cat-tabname     = 'T_TEXT2'.

  wfield_cat-seltext_m  = 'Actual effort'.

  APPEND wfield_cat TO ifield_cat.

  CLEAR wfield_cat.

 

 

 

 

  l_layout-zebra = 'X'.

  l_layout-colwidth_optimize = 'X'.

 

 

 

 

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

      i_callback_program = sy-repid

      it_fieldcat        = ifield_cat

      is_layout          = l_layout

      i_save             = 'A'

    TABLES

      t_outtab           = t_text2.

ENDFORM.


Viewing all articles
Browse latest Browse all 3363

Trending Articles