After displaying result of report, my report goes back to source code edito

Hello experts,
I am currently having a big problem with my report. Here is the problem, after displaying the
result(write), when I press BACK button it is not going back to my selection-screen which is the
usual for reports. Now, what happens is that it goes back to the source code or worse, to the main menu of SAP.
What I want to do is that when I press BACK button it should go to either selection-screen 500 or
selection-screen 1500.
Here's a rough flow of what is happening in my report:
start report -> fetch records based on user input -> display results(not in ALV) ->
after displaying report, click 'BACK' button -> it goes back to source code
Now, here's what I want to do:
start report -> fetch records based on user input -> display results(not in ALV) ->
after displaying report, click 'BACK' button -> go back to either selection-screen 500 or 1500
or call again the transaction of my report.
Help would be greatly appreciated here.

Hi guys,
Thanks again for the quick replies.Here is the source code:
REPORT zdealer_contacts NO STANDARD PAGE HEADING
                        LINE-COUNT 0
                        LINE-SIZE 255
                        MESSAGE-ID zz.
TYPE-POOLS: slis.
Data Dictionary Tables
TABLES: zts0001,
        zsoemailid,
        kna1,
        zts_stpgeoloc.
Includes
*INCLUDE zun_globe_header.       " Globe Telecom Report Header
Structures, internal tables and data declarations
TYPES: BEGIN OF t_upload,
        kunnr LIKE zts0001-kunnr,
        zaddress(100),
        zcperson(30),
        zcnumber(18),
       END OF t_upload.
TYPES: BEGIN OF t_error,
        kunnr LIKE zts0001-kunnr,
        zaddress(100),
        zcperson(30),
        zcnumber(18),
       END OF t_error.
TYPES: BEGIN OF t_kna1,
        name1 LIKE kna1-name1,
       END OF t_kna1.
TYPES: BEGIN OF t_zts0001,
        kunnr      LIKE zts0001-kunnr,
        cdseq      LIKE zts0001-cdseq,
        zaddress   LIKE zts0001-zaddress,
        zcperson   LIKE zts0001-zcperson,
        zcnumber   LIKE zts0001-zcnumber,
        zactivated LIKE zts0001-zactivated,
        name1      LIKE kna1-name1,
       END OF t_zts0001.
DATA: it_upload  TYPE STANDARD TABLE OF t_upload  WITH HEADER LINE,
      it_error   TYPE STANDARD TABLE OF t_error   WITH HEADER LINE,
      it_kna1    TYPE STANDARD TABLE OF t_kna1    WITH HEADER LINE,
      it_zts0001 TYPE STANDARD TABLE OF t_zts0001 WITH HEADER LINE.
DATA: it_ztstemp LIKE zts0001 OCCURS 100 WITH HEADER LINE,
      it_ztstemp_gloc LIKE zts_stpgeoloc OCCURS 100 WITH HEADER LINE.
*AVH - start of insertion - 04/18/06
FIELD-SYMBOLS: <fs_zts0001> LIKE LINE OF it_zts0001.
**ALV Declarations
DATA:   gt_fieldcat         TYPE slis_t_fieldcat_alv,
        g_repid             LIKE sy-repid,
        gs_layout           TYPE slis_layout_alv,
        gt_list_top_of_page TYPE slis_t_listheader,
        gt_events           TYPE slis_t_event WITH HEADER LINE,
        gt_print            TYPE slis_print_alv.
CONSTANTS: gc_top  TYPE slis_formname  VALUE 'TOP_OF_PAGE',
           gc_topsum  TYPE slis_formname  VALUE 'TOP_OF_LIST',
           gc_ucomm  TYPE slis_formname  VALUE 'USER_COMMAND'.
*AVH - end of insertion
Variables
DATA: v_kunnr LIKE zts0001-kunnr,
      v_title(100) TYPE c,
      gc_kunnr(06) TYPE c,
      v_compflag(1) TYPE c,
      v_flag(1).
Selection Screen
*AVH - start of modification - 06/27/06
*if user is controller, selection-screen 500 will be called else,
*selection-scren 1500 will be called.
*selection-screen for controllers
SELECTION-SCREEN BEGIN OF SCREEN 500.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_upld RADIOBUTTON GROUP grp2 USER-COMMAND ucomm1.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme.
PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:\'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_list1 RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 500.
*selection-screen for non-controllers.
SELECTION-SCREEN BEGIN OF SCREEN 1500.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(22) text-002 FOR FIELD p_dcode.
PARAMETERS: p_dcode LIKE vbak-kunnr,
            p_name1 LIKE kna1-name1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_list2 RADIOBUTTON GROUP grp USER-COMMAND ucomm2.
SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_add  RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(3) text-005 FOR FIELD pr_add.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_edit RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(4) text-006 FOR FIELD pr_edit.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 03(20) text-a12 FOR FIELD p_code.
PARAMETERS: p_code LIKE zts0001-cdseq.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 1500.
INITIALIZATION.
  SELECT SINGLE kunnr comp_flag INTO (gc_kunnr,v_compflag)
    FROM zsoemailid
   WHERE bname = sy-uname.
  IF sy-subrc <> 0.
    MESSAGE i000 WITH
         'You are not authorised to use this transaction'.
    LEAVE PROGRAM.
  ENDIF.
  IF v_compflag = 'X'.
    CALL SCREEN 500.
  ELSE.
    CALL SCREEN 1500.
  ENDIF.
*AVH - end of modification
AT SELECTION-SCREEN OUTPUT.
  PERFORM authority_check.
added by derick 050125
**-changed by weng rulloda 06012005
*AVH - start of insertion - 05/22/06
*no need to get value of kunnr from global memory
*since gc_kunnr would be filled via the select statement below
GET PARAMETER ID 'KUN' FIELD gc_kunnr.
*AVH - end of insertion
  p_dcode = gc_kunnr.
*AVH - start of insertion - 05/22/06
**fetch the respective description of dealer based from p_dcode
**and put in parameter p_name1
  SELECT SINGLE name1 FROM kna1
  INTO p_name1
  WHERE kunnr = p_dcode.
*AVH - end of insertion
*AVH - start of insertion - 05/22/06
**selection-screen parameters is based if user is controller or not.
**created new selection-screen conditions based from orig. code
  v_kunnr = gc_kunnr.
  LOOP AT SCREEN.
    IF screen-name      =  'P_DCODE'.
      screen-input      =  '0'.
      screen-output     =  '1'.
      MODIFY SCREEN.
    ELSEIF screen-name  =  'P_NAME1'.
      screen-input      =  '0'.
      screen-output     =  '1'.
      MODIFY SCREEN.
    ELSEIF screen-name  =  'P_CODE'.
      screen-input      =  '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
  IF pr_list2 = 'X' OR pr_add = 'X'.
    LOOP AT SCREEN.
      IF screen-name   =  'P_CODE'.
        screen-input   =  '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF pr_edit = 'X'.
    LOOP AT SCREEN.
      IF screen-name   =  'P_CODE'.
        screen-input  =  '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
  IF pr_list1   = 'X'.
    LOOP AT SCREEN.
      IF screen-name   = 'P_FLNME'.
        screen-input  = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
*AVH - end of modification
AT SELECTION-SCREEN.
CHECK sy-ucomm = 'UCOMM1' OR sy-ucomm = 'UCOMM2'.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_flnme.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_flnme.
  CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
            mask             = ',.,..'
            mode             = 'O'
            title            = 'File Selection'
       IMPORTING
            filename         = p_flnme
       EXCEPTIONS
            inv_winsys       = 1
            no_batch         = 2
            selection_cancel = 3
            selection_error  = 4
            OTHERS           = 5.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_code.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_code.
  DATA : BEGIN OF itab_list OCCURS 0,
          kunnr LIKE zts0001-kunnr,
          cdseq LIKE zts0001-cdseq,
          zaddress LIKE zts0001-zaddress,
          zcperson LIKE zts0001-zcperson,
          zcnumber LIKE zts0001-zcnumber,
         END OF itab_list.
  DATA: tab_fields LIKE dfies      OCCURS 0 WITH HEADER LINE,
        tab_valuetab(100) TYPE c   OCCURS 0 WITH HEADER LINE.
  DATA: tab_dynnr TYPE sy-dynnr.
  DATA: BEGIN OF tab_return_tab OCCURS 0.
          INCLUDE STRUCTURE ddshretval.
  DATA: END OF tab_return_tab.
  DATA: progname LIKE sy-repid.
  CLEAR: tab_valuetab[], tab_fields[].
  SELECT kunnr cdseq zaddress zcperson zcnumber
    INTO CORRESPONDING FIELDS OF TABLE itab_list
    FROM zts0001
    WHERE kunnr = v_kunnr.
  tab_dynnr = sy-dynnr.
  tab_fields-tabname = 'ZTS0001'.
  tab_fields-fieldname = 'KUNNR'.
  APPEND tab_fields.
  tab_dynnr = sy-dynnr.
  tab_fields-tabname = 'ZTS0001'.
  tab_fields-fieldname = 'CDSEQ'.
  APPEND tab_fields.
  tab_fields-tabname = 'ZTS0001'.
  tab_fields-fieldname = 'ZADDRESS'.
  APPEND tab_fields.
  tab_fields-tabname = 'ZTS0001'.
  tab_fields-fieldname = 'ZCPERSON'.
  APPEND tab_fields.
  tab_fields-tabname = 'ZTS0001'.
  tab_fields-fieldname = 'ZCNUMBER'.
  APPEND tab_fields.
  LOOP AT itab_list.
    tab_valuetab = itab_list-kunnr.
    APPEND tab_valuetab.
    tab_valuetab = itab_list-cdseq.
    APPEND tab_valuetab.
    tab_valuetab = itab_list-zaddress.
    APPEND tab_valuetab.
    tab_valuetab = itab_list-zcperson.
    APPEND tab_valuetab.
    tab_valuetab = itab_list-zcnumber.
    APPEND tab_valuetab.
  ENDLOOP.
  progname = sy-repid.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
            retfield    = 'CDSEQ'
            dynpprog    = progname
            dynpnr      = '1000'
            dynprofield = 'P_CODE'
       TABLES
            value_tab   = tab_valuetab
            field_tab   = tab_fields
            return_tab  = tab_return_tab
       EXCEPTIONS
            OTHERS      = 0.
START-OF-SELECTION.
  IF pr_edit = 'X' AND p_code IS INITIAL.
    MESSAGE i008 WITH 'Please specify a ship-to code.'.
     LEAVE TO TRANSACTION 'ZDCONTACT'.
  ENDIF.
  PERFORM get_data.
  IF pr_upld = 'X'.
    PERFORM upload_file.
  ELSEIF pr_add = 'X'.
    PERFORM add_record.
  ELSEIF pr_edit = 'X'.
    PERFORM edit_record.
  ELSEIF pr_list1 = 'X' OR pr_list2 = 'X'.
    PERFORM display_alv.
  ENDIF.
END-OF-SELECTION.
based from ALV PF-STATUS
  IF sy-ucomm = '&F03'.                  "BACK
   LEAVE TO TRANSACTION 'ZDCONTACT'.
  ELSEIF sy-ucomm = '&F15'.              "EXIT
   LEAVE TO TRANSACTION 'ZDCONTACT'.
  ELSEIF sy-ucomm = '&F12'.              "CANCEL
   LEAVE TO TRANSACTION 'ZDCONTACT'.
  ENDIF.
*&      Form  authority_check
FORM authority_check.
  CALL FUNCTION 'AUTHORITY_CHECK'
       EXPORTING
            field1              = 'TCD' "MDM
            object              = 'S_TCODE'
            user                = sy-uname
            value1              = 'ZMEN'
           VALUE3              = '01' MDM
       EXCEPTIONS
            user_dont_exist     = 1
            user_is_authorized  = 2
            user_not_authorized = 3
            user_is_locked      = 4
            OTHERS              = 5.
  IF sy-subrc NE 2.
**-added by weng 04/28/2006
**-if user is not authorized to use dealer portal check if he is
**-  authorized to use the tcode ZDCONTACT
    CALL FUNCTION 'AUTHORITY_CHECK'
         EXPORTING
              field1              = 'TCD' "MDM
              object              = 'S_TCODE'
              user                = sy-uname
              value1              = 'ZDCONTACT'
           VALUE3              = '01' MDM
         EXCEPTIONS
              user_dont_exist     = 1
              user_is_authorized  = 2
              user_not_authorized = 3
              user_is_locked      = 4
              OTHERS              = 5.
**-weng
    IF sy-subrc NE 2.
      MESSAGE i000 WITH
        'You are not authorised to use this transaction'.
      LEAVE PROGRAM.
    ENDIF.
  ENDIF.
ENDFORM.                    " AUTHORITY_CHECK
*&      Form  get_data
FORM get_data.
*AVH - start of insertion - 04/19/06
**records selected from table zts0001 that has been marked as
**activated will be fetched otherwise, ignore.
  IF v_kunnr IS INITIAL.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zts0001
      FROM zts0001.
  ELSEIF v_compflag = 'X'.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zts0001
       FROM zts0001.
  ELSE.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zts0001
       FROM zts0001
       WHERE kunnr = v_kunnr.
  ENDIF.
*AVH - start of insertion - 05/24/06
**fetch name based from kunnr and put in itab
  LOOP AT it_zts0001 ASSIGNING <fs_zts0001>.
    SELECT SINGLE name1 FROM kna1
    INTO <fs_zts0001>-name1
    WHERE kunnr = <fs_zts0001>-kunnr.
  ENDLOOP.
*AVH - end of insertion
ENDFORM.                    " get_data
*&      Form  Upload_file
FORM upload_file.
  DATA: lv_seq(5) TYPE n,
        lv_ctr(5) TYPE c,
        lv_kunnr LIKE it_upload-kunnr.
  v_title = 'Upload from File'.
  CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
            filename = p_flnme
            filetype = 'DAT'
       TABLES
            data_tab = it_upload
       EXCEPTIONS
            OTHERS   = 1.
  IF sy-subrc <> 0.
    MESSAGE i008 WITH 'File does not exist.'.
    IF v_compflag IS INITIAL.
      LEAVE TO TRANSACTION 'ZDCONTACT'.
    ELSE.
      LEAVE TO TRANSACTION 'ZDCONTACT'.
    ENDIF.
  ENDIF.
  CHECK sy-subrc EQ 0.
  DELETE it_upload
    WHERE zaddress EQ space
      AND zcperson EQ space
      AND zcnumber EQ space.
  SORT it_zts0001 BY kunnr ASCENDING cdseq DESCENDING.
  SORT it_upload BY kunnr ASCENDING.
  LOOP AT it_upload.
    lv_kunnr = it_upload-kunnr.
    AT NEW kunnr.
AVH - start of insertion - 06/30/06
      SELECT SINGLE kunnr FROM zsoemailid
      INTO lv_kunnr
      WHERE kunnr = it_upload-kunnr.
if it_upload-kunnr is not found in table ZSOEMAILID, it will
not be included in the upload.
      IF sy-subrc <> 0.
        DELETE it_upload.
        CLEAR it_upload.
        CONTINUE.
      ENDIF.
AVH - end of insertion
      READ TABLE it_zts0001 WITH KEY kunnr = lv_kunnr.
      IF sy-subrc EQ 0.
        lv_seq = it_zts0001-cdseq.
      ELSE.
        CLEAR lv_seq.
      ENDIF.
    ENDAT.
    IF it_upload-zaddress IS INITIAL.
      MOVE-CORRESPONDING it_upload TO it_error.
      APPEND it_error.
      CLEAR it_error.
    ELSE.
      REPLACE '"' WITH '' INTO it_upload-zaddress.
      REPLACE '"' WITH '' INTO it_upload-zaddress.
      REPLACE '"' WITH '' INTO it_upload-zcperson.
      REPLACE '"' WITH '' INTO it_upload-zcperson.
      CONDENSE it_upload-zaddress.
      CONDENSE it_upload-zcperson
      ADD 1 TO lv_seq.
      MOVE: it_upload-kunnr    TO it_ztstemp-kunnr,
            lv_seq             TO it_ztstemp-cdseq,
            it_upload-zaddress TO it_ztstemp-zaddress,
            it_upload-zcperson TO it_ztstemp-zcperson,
            it_upload-zcnumber TO it_ztstemp-zcnumber,
            'X'                TO it_ztstemp-zactivated,
            sy-uname           TO it_ztstemp-zcreated_by,
            sy-datum           TO it_ztstemp-zchanged_date.
      MOVE-CORRESPONDING it_ztstemp TO it_ztstemp_gloc.
      APPEND: it_ztstemp, it_ztstemp_gloc.
      CLEAR: it_ztstemp, it_ztstemp_gloc.
    ENDIF.
  ENDLOOP.
  IF NOT it_ztstemp[] IS INITIAL.
    INSERT zts0001 FROM TABLE it_ztstemp.
    INSERT zts_stpgeoloc FROM TABLE it_ztstemp_gloc.
    WRITE:/ 'List of Records Uploaded.' COLOR 1 INTENSIFIED ON.
    FORMAT COLOR 1 INTENSIFIED OFF.
    WRITE:/(020) 'Dealer Code' CENTERED,
           (007) 'Code'         CENTERED,
           (100) 'Address',
           (030) 'Contact Person' CENTERED,
           (018) 'Contact Number' CENTERED.
    FORMAT COLOR OFF.
    WRITE:/(179) sy-uline.
    DESCRIBE TABLE it_ztstemp LINES lv_ctr.
    SORT it_ztstemp BY kunnr cdseq.
    LOOP AT it_ztstemp.
      WRITE:/(020) it_ztstemp-kunnr,
             (007) it_ztstemp-cdseq,
             (100) it_ztstemp-zaddress,
             (030) it_ztstemp-zcperson,
             (018) it_ztstemp-zcnumber.
    ENDLOOP.
    SKIP 1.
    WRITE:/ 'TOTAL :', lv_ctr.
  ENDIF.
  IF NOT it_error[] IS INITIAL.
    SKIP 2.
    FORMAT COLOR 1 INTENSIFIED OFF.
    WRITE:/(020) 'Dealer Code' CENTERED,
           (030) 'Contact Person' CENTERED,
           (018) 'Contact Number' CENTERED.
    FORMAT COLOR OFF.
    WRITE:/(070) sy-uline.
    DESCRIBE TABLE it_error LINES lv_ctr.
    SORT it_error BY kunnr zcperson.
    LOOP AT it_error.
      WRITE:/ 'With No Address.' COLOR 6 INTENSIFIED ON.
      WRITE:/(020) it_error-kunnr,
             (030) it_error-zcperson,
             (018) it_error-zcnumber.
    ENDLOOP.
    SKIP 1.
    WRITE:/ 'TOTAL :', lv_ctr.
  ENDIF.
ENDFORM.                    " Upload_file
*&      Form  add_record
FORM add_record.
  v_title = ''.
  IF NOT v_kunnr IS INITIAL.
    SUBMIT zdealer_contacts_add_edit AND RETURN
                                     WITH p_kunnr = v_kunnr
                                     WITH p_name1 = p_name1  "AVH
                                     WITH p_cdseq = space
                                     WITH p_flag = 'A'
                                     WITH p_addr = it_zts0001-zaddress
                                     WITH p_pers = it_zts0001-zcperson
                                     WITH p_numb = it_zts0001-zcnumber
                                     VIA SELECTION-SCREEN.
  ENDIF.
    LEAVE TO TRANSACTION 'ZDCONTACT'.
ENDFORM.                    " add_record
*&      Form  edit_record
FORM edit_record.
  v_title = ''.
  READ TABLE it_zts0001 WITH KEY kunnr = v_kunnr
                                 cdseq = p_code.
  IF sy-subrc EQ 0.
    SUBMIT zdealer_contacts_add_edit AND RETURN
                                     WITH p_kunnr = v_kunnr
                                     WITH p_name1 = p_name1  "AVH
                                     WITH p_cdseq = p_code
                                     WITH p_flag = 'E'
                                     WITH p_addr = it_zts0001-zaddress
                                     WITH p_pers = it_zts0001-zcperson
                                     WITH p_numb = it_zts0001-zcnumber
                                     WITH v_controller = v_compflag
                                     VIA SELECTION-SCREEN.
  ELSE.
    MESSAGE i008 WITH 'No record found.'.
    CALL TRANSACTION 'ZDCONTACT'.
  ENDIF.
    LEAVE TO TRANSACTION 'ZDCONTACT'.
ENDFORM.                    " edit_record
*&      Form  display_records
*FORM display_records.
IF NOT it_zts0001[] IS INITIAL.
   v_title = 'List of Dealer Contacts'.
   FORMAT COLOR 1 INTENSIFIED OFF.
   WRITE:/(020) 'Customer Number' CENTERED,
          (007) 'Code' CENTERED,
          (100) 'Address',
          (030) 'Contact Person' CENTERED,
          (018) 'Contact Number' CENTERED.
   FORMAT COLOR OFF.
   WRITE:/(179) sy-uline.
   SORT it_zts0001 BY kunnr cdseq.
   LOOP AT it_zts0001.
     WRITE:/(020) it_zts0001-kunnr,
            (007) it_zts0001-cdseq,
            (100) it_zts0001-zaddress,
            (030) it_zts0001-zcperson,
            (018) it_zts0001-zcnumber.
   ENDLOOP.
ELSE.
   MESSAGE i008 WITH 'No records to display.'.
ENDIF.
*ENDFORM.                    " display_records
*&      Form  display_alv
FORM display_alv.
  SORT it_zts0001 BY kunnr cdseq.
  PERFORM f_build_layout USING gs_layout.
  PERFORM f_init_fieldcat USING gt_fieldcat[].
  PERFORM f_init_events USING 'BACK' gt_events[].
  g_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program      = g_repid
            i_callback_top_of_page  = 'TOP_OF_PAGE'
            i_callback_user_command = 'USER_COMMAND'
            is_layout               = gs_layout
            it_fieldcat             = gt_fieldcat[]
            it_events               = gt_events[]
            i_save                  = 'X'
           it_sort                 = gt_sort
       TABLES
            t_outtab                = it_zts0001[]
       EXCEPTIONS
            program_error           = 1
            OTHERS                  = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.                    " DISPLAY_ALV
      FORM top_of_page                                          *
FORM top_of_page.
*ALV Header declarations
  DATA: t_header TYPE slis_t_listheader,
        wa_header TYPE slis_listheader,
        t_line LIKE wa_header-info,
        lv_title(60),
        lv_user(60),
        lv_date(10),
        lv_time(10),
        lv_time_n_date(30),
        lv_dcode_n_name(150),
        lv_dlr_n_desc(100),
        ld_lines TYPE i,
        ld_linesc(10) TYPE c.
Title
  CLEAR: lv_title, wa_header.
  MOVE sy-title TO lv_title.
  wa_header-typ  = 'H'.
  wa_header-info = lv_title.
  APPEND wa_header TO t_header.
  CLEAR wa_header.
User
  CLEAR: lv_user, wa_header.
  CONCATENATE: 'Generated by:' sy-uname
               INTO lv_user SEPARATED BY space.
  wa_header-typ  =  'A'.
  wa_header-info =  lv_user.
  APPEND wa_header TO t_header.
  CLEAR wa_header.
*Date and time
  CLEAR: lv_date, lv_time.
  WRITE: sy-datum TO lv_date MM/DD/YYYY,
         sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.
  CONCATENATE: 'Generated on:' lv_date lv_time
    INTO lv_time_n_date SEPARATED BY space.
  wa_header-typ  = 'A'.
  wa_header-info =  lv_time_n_date.
  APPEND wa_header TO t_header.
  CLEAR wa_header.
  IF NOT v_kunnr IS INITIAL AND v_compflag IS INITIAL.
*Dealer code and name
    CONCATENATE: 'Dealer:' p_dcode p_name1
      INTO lv_dcode_n_name SEPARATED BY space.
    wa_header-typ  =  'A'.
    wa_header-info =  lv_dcode_n_name.
    APPEND wa_header TO t_header.
    CLEAR wa_header.
  ENDIF.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            it_list_commentary = t_header.
ENDFORM.                    " TOP_OF_PAGE
      FORM f_build_layout                                           *
-->  %LAYOUT                                                       *
FORM f_build_layout USING %layout TYPE slis_layout_alv.
  %layout-zebra             = 'X'.
  %layout-colwidth_optimize = 'X'.
ENDFORM.                    " F_BUILD_LAYOUT
      FORM f_init_fieldcat                                          *
-->  %FIELDCAT                                                     *
FORM f_init_fieldcat USING %fieldcat TYPE slis_t_fieldcat_alv.
  DATA: lc_fieldcat TYPE slis_fieldcat_alv.
  CLEAR lc_fieldcat.
  DEFINE m_field.
    add 1 to lc_fieldcat-col_pos.
    lc_fieldcat-fieldname   = &1.
    lc_fieldcat-outputlen   = &2.
    lc_fieldcat-seltext_l   = &3.
    lc_fieldcat-do_sum      = &4.
    lc_fieldcat-inttype     = &5.
    lc_fieldcat-hotspot     = &6.
    lc_fieldcat-fix_column  = &7.
    lc_fieldcat-ddictxt     = 'L'.
    lc_fieldcat-no_zero     = 'X'.
    append lc_fieldcat to %fieldcat.
  END-OF-DEFINITION.
  IF v_kunnr IS INITIAL.
    m_field 'KUNNR' '5' 'Dealer Code'            ''  ''  '' ''.
  ENDIF.
  IF v_compflag = 'X'.
    m_field 'KUNNR' '5' 'Dealer Code'        ''  ''  '' ''.
  ENDIF.
  IF v_compflag = 'X'.
    m_field 'NAME1'    '40' 'Dealer Name'        ''  ''  '' ''.
  ENDIF.
  m_field 'CDSEQ' '05' 'Ship-To Code'            ''  ''  '' ''.
  m_field 'ZADDRESS' '100' 'Address'             ''  ''  '' ''.
  m_field 'ZCPERSON' '30' 'Contact Person'       ''  ''  '' ''.
  m_field 'ZCNUMBER' '18' 'Contact Number'       ''  ''  '' ''.
  IF v_kunnr IS INITIAL.
    m_field 'NAME1'    '40' 'Dealer Name'        ''  ''  '' ''.
  ENDIF.
  m_field 'ZACTIVATED' '1' 'Activated'           ''  ''  '' ''.
ENDFORM.                    " f_init_fieldcat
      FORM f_init_events                                            *
-->  P_TYPE                                                        *
-->  %EVENTS                                                       *
FORM f_init_events USING p_type CHANGING %events TYPE slis_t_event.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
            i_list_type     = 0
       IMPORTING
            et_events       = %events
       EXCEPTIONS
            list_type_wrong = 1
            OTHERS          = 2.
  IF sy-subrc = 0.
    PERFORM f_build_events USING: slis_ev_user_command.
   IF p_type = 'TOP'.
     PERFORM f_build_events USING: gc_top.
   ELSEIF p_type = 'SUM'.
     PERFORM f_build_events_sum USING: gc_topsum.
   ENDIF.
  ELSE.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.                    " F_INIT_EVENTS
      FORM user_command                                             *
-->  P_UCOMM                                                       *
-->  P_SELFIELD                                                    *
FORM user_command USING p_ucomm LIKE sy-ucomm
                        p_selfield TYPE slis_selfield.
  CASE p_ucomm.
    WHEN 'E'.
      CALL SELECTION-SCREEN 500.
  ENDCASE.
ENDFORM.
      FORM f_build_events                                           *
-->  %EVENT                                                        *
FORM f_build_events USING %event.
  READ TABLE gt_events WITH KEY name = %event.
  IF sy-subrc = 0.
    MOVE: %event TO gt_events-form.
    MOVE 'USER_COMMAND' TO gt_events-form.
    MODIFY gt_events INDEX sy-tabix.
  ENDIF.
ENDFORM.                    " F_BUILD_EVENTS

Similar Messages

  • How to download ABAP(report,module pool...etc) source code to client PC?

    hi guys,
    please advise how can i download/export ABAP(report,module pool...etc) source code to client PC?
    thanks.

    hi
    this report is to export to another server...
    PROGRAM ZDOWNLOAD_SAP
    LINE-SIZE 132
    LINE-COUNT 62
    NO STANDARD PAGE HEADING.
    This program up / downloads from / to a local dataset
    all the components of an ABAP - i.e TEXTS, the entire CUA
    including statuses and menus, DYNPROS and source code.
    Program documentation and variants are not handled.
    INCLUDED programs are automatically handled both on upload
    or download. INCLUDE selection can be excluded or generic
    e.g only handle INCLUDES starting with ZIN*
    INCLUDES within INCLUDES alos handled.
    The only restriction is on UPLOAD the INCLUDED programs must come
    from the same directory as the main program.
    On Download of course the ABAP must exist in the library.
    Note for LINUX and BATCH users
    This program was originally designed as a one off tool for
    getting ABAPS etc from a SAP R2 (IBM MVS mainframe system) into
    an R3 test system minimising the need for a large amount of
    mainframe sysprogs (anybody remember what they were !!) time
    and support to say nothing of access problems from TSO /JES2 /
    SAP R2. At that time network connections were patchy and the
    transport systems largely incompatable and not very reliable.
    This program was originally designed as a one off tool for
    Must run on Windows front end ---- If you are running SAP with
    LINUX on your work station you will have to change the WS_UPLOAD
    and WS_DOWNLOAD functions to reflect the Linux file system. The
    contents of the data sets themseleves do not need to be changed
    Program can easily be modified to run in batch and store
    the data on a UNIX host. Change the WS_UPLOAD and WS_DOWNLOAD
    to read from and write to UNIX data sets (OPEN FILE etc).
    You will also need to modify the parts of the program that get
    the DOS directory and display the Windows file paths.
    The actual abap data sets do not need to be changed.
    Rel 4.0 names can now be up to 40 bytes long
    Dynpros and CUA have changed from rel 3.1
    Tabstrips now loaded and unloaded in dynpros
    Please note restriction on 4.6 systems for users who
    have ABAP names which include '/'s in their names.
    Rel 4.6b, 4.6c Abap names can include the '/' in their names
    e.g /CUST1/CUST2/ORDER
    This causes problems when storing to a local file.
    a solution is to change the name to %CUST1%CUST2%ORDER i.e / will
    be changed to %. On upload the % should be changed back to /
    again. This change still needs to be implemented.
    If you don't use the / in the abap name then this is not a problem.
    If file to be uploaded is in rel 3 format then names are only 8
    bytes long.
    program uses 3 datasets per abap
    1) abapname.eee source, dynpr logic, texts, CUA stuff
    2) abapname.hhh dynpr header
    3) abapname.fff dynpro fields.
    because of varying lengths and contents 3 data sets are used. The
    complexity of combining all these to 1 data set would make the
    program far too complex.
    NOTE: This version of the program can only be used on
    release 4.0 or higher. Once an ABAP has been converted
    to rel 4.0 it cannot be converted back to rel 3.0
    on a release 3/3.1 system. Release 4 CUA tables
    are different. Use release 3 version of this program
    for releases 3.0 and 3.1. Available on SAPFANS website.
    Note that data to be uploaded must have been previously downloaded
    by this program (any version since rel 2.0) - except for Initial
    Load -- see end of these comments.
    Dynpros and CUA statuses have changed since rel 3.1
    This program will handle rel 3.1 format on upload but will
    download in rel 4.0 format. To upload 3.1 format specify an 'X'
    in the rel3 parameter.
    If you have downloaded components in rel 4.0 format and you
    want to re-load to a 3.1 system you will have to load
    the source via standard upload and re-create dynpros and the CUA
    manually.
    As names can now be longer than 8 characters you can only
    use this program if the SAP front end (SAPGUI) supports
    long file names (WIN 95/98 or WIN NT). Windows 3.x will not
    work as the underlying DOS system cannot handle long file names.
    UPLOAD function and DOS directory.
    When an ABAP is selected for UPLOAD then the DOS
    directory is read into a table. A file called ABAP.BAT is created,
    and down loaded to the 'C' drive and executed.
    This file executes a DOS DIR command and pipes the output
    into a dataset which is then uploaded into an internal
    table on SAP.
    Note on running DOS commands from ABAP
    The first time this procedure is executed you will see a DOS window
    which you will have to close manually. To get round this
    use windows explorer to select the file ABAP.BAT and then
    right mouse click on the file name. Select the
    properties window. From this click the CLOSE on EXIT box. This
    will then automatically close the DOS function after it has
    executed. (Windows restriction).
    The DOS function has not been tested using Windows 2000 so
    it might not work. OK on W95,W98,WME and Windows NT (No Thanks)
    If INCLUDE programs are wanted on UPLOAD only the specified
    directory is searched.
    Instead of entering path name manually you can click on
    the path parameter. Because of Windows restriction you will
    have to select ANY file in the relevant directory.
    The path will then be copied on to the selection screen.
    To do still : Merge 3 files to one and compress output to .ZIP file
    fix 4.5 4.6 problem of abaps containing '/' in the name
    possibility to automatically up / download referenced
    function modules with selection criteria like INCLUDES
    To load the ist time into a system.
    Create program with ABAP editor and Upload the .EEE file.
    Delete ist line (????SRCE) in the ABAP EDITOR --NOT THE DISK FILE
    Delete all the source from the line that starts ????TEXT (towards
    the end file) till the end so the last line in your source is ENDFORM.
    DO NOT ALTER THE DISK FILE. DO THESE CHANGES IN THE ABAP EDITOR.
    Save file and execute
    Use following parameters (Note the ist time you won't get proper
    text on the selection screen).
    Function U
    Path full dos path containing source e.g c:\abaps\
    NOTE YOU MUST ENTER THE FINAL \ as above.
    REPID the program name. e.g ZZJIMHXX
    note that on the DISK you will see 3 files
    ZZJIMHXX.EEE, ZZJIMHXX.FFF, ZZJIMHXX.HHH
    just use the name before the dos qualifier - the
    program will do the rest
    ignore other parameters
    The program will then load itself with all the texts etc.
    It should now be ready for use.
    Macros
    DEFINE DEFINE_TABLE.
    DATA: &1 LIKE &2 OCCURS &3 WITH HEADER LINE.
    END-OF-DEFINITION.
    DEFINE CLS.
    REFRESH &1.
    CLEAR &1.
    END-OF-DEFINITION.
    DEFINE INIT.
    IF &1 NE SPACE.
    SEARCH &1 FOR '. .'.
    IF SY-SUBRC = 0.
    WRITE '*' TO &1+SY-FDPOS(1).
    ENDIF.
    TRANSLATE &1 USING '*%'.
    ELSE.
    MOVE '%' TO &1.
    ENDIF.
    END-OF-DEFINITION.
    end of macros
    / SAP standard tables */
    TABLES: D020S, "Dynpro header
    D020T, "Dynpro title
    D021T, "Screen field keyword texts
    TRDIR, "Attribute table
    TADIR, "Dev. class etc.
    EUDB, "CUA data
    TSTC, "transaction data
    TITLE, "CUA titles
    RSMPTEXTS. "Function texts (rel 4.0)
    / Work tables to hold ABAP source etc, and dynpro */
    / contents. */
    DATA: BEGIN OF H. "Header
    INCLUDE STRUCTURE D020S.
    DATA: END OF H.
    DATA: BEGIN OF H1 OCCURS 10, "Header
    NAME(40) TYPE C, "rel 4
    NUMBER(4) TYPE N.
    INCLUDE STRUCTURE D020S.
    DATA: END OF H1.
    DATA: BEGIN OF H2 OCCURS 0, "Rel 3 dynp. header
    CNAME(8) TYPE C,
    CNUM(4) TYPE C,
    NNAME(8) TYPE C,
    NNUM(4) TYPE C,
    FILL(51) TYPE C,
    CDAT(6) TYPE C,
    CTIM(6) TYPE C,
    END OF H2.
    DATA: BEGIN OF F OCCURS 250. "Dynpro Fields
    INCLUDE STRUCTURE D021S.
    DATA: END OF F.
    DATA: BEGIN OF F1 OCCURS 500, "Dynpro Fields
    NAME(40) TYPE C, "rel 4
    NUMBER(4) TYPE N.
    INCLUDE STRUCTURE D021S.
    DATA: END OF F1.
    DATA: BEGIN OF OLD_F1 OCCURS 0, "Dynpro Fields (rel 3)
    NAME(8) TYPE C,
    NUMBER(4) TYPE C.
    INCLUDE STRUCTURE D021SE_OLD.
    DATA: END OF OLD_F1.
    DATA: BEGIN OF F2 OCCURS 0, "Dynpro Fields (rel 3)
    TFIL(284) TYPE C,
    END OF F2.
    DATA: BEGIN OF M OCCURS 3. "Match codes (if any)
    INCLUDE STRUCTURE D023S.
    DATA: END OF M.
    DATA: BEGIN OF E OCCURS 0. "Dynpro Logic
    INCLUDE STRUCTURE D022S.
    DATA: END OF E.
    DATA: BEGIN OF E1 OCCURS 0, "Dynpro Logic
    NAME(40) TYPE C, "rel 4
    NUMBER(4) TYPE N.
    INCLUDE STRUCTURE D022S.
    DATA: END OF E1.
    DATA: BEGIN OF T OCCURS 0, "prog name and dynpro nrs
    NAME(40) TYPE C, "rel 4
    NUMBER(4) TYPE N,
    END OF T.
    DATA: BEGIN OF R OCCURS 56, "prog name and language
    NAME(40) TYPE C, "rel 4
    LANGUAGE(1) TYPE C,
    END OF R.
    DATA: BEGIN OF S OCCURS 3000,
    TXT(180) TYPE C, "rel 4 was 132
    END OF S.
    DATA: BEGIN OF R1 OCCURS 50, "for include programs
    NAME(40) TYPE C, "rel 4
    INSTANCE(3) TYPE P,
    END OF R1.
    DATA: BEGIN OF S1 OCCURS 3000,
    TXT(180) TYPE C, " rel 4 was 132
    END OF S1.
    DATA: BEGIN OF U OCCURS 100, "Text elements
    TXT(180) TYPE C, " rel 4 was 132
    END OF U.
    DATA: BEGIN OF DIR. "ABAP Attributes
    INCLUDE STRUCTURE TRDIR.
    DATA: END OF DIR.
    DATA: BEGIN OF DTXT. "Dynpro field keyword texts
    INCLUDE STRUCTURE D021T.
    DATA: END OF DTXT.
    / This data contains all the components of the */
    / CUA such as menus, statuses, Pfkeys */
    / As from rel 4.5 Tabstrips are automatically copied as well */
    / The rel3 parameter must be set however to load the */
    / correct version of the CUA tables if uploading rel 3 */
    / data to a rel 4 system. */
    / Rel 4.0B can convert 3.1 and earlier CUA's */
    / This could change later however. */
    CUA Tables.
    Key of CUA tables in EUDB data set. Name is len 40 in rel 4.0
    DATA BEGIN OF EU_KEY.
    INCLUDE STRUCTURE RSEU1_KEY.
    DATA END OF EU_KEY.
    Status
    DATA BEGIN OF STA OCCURS 0.
    INCLUDE STRUCTURE RSMPE_STAT. " rel 4
    DATA END OF STA.
    Functions
    DATA BEGIN OF FUN OCCURS 0.
    INCLUDE STRUCTURE RSMPE_FUNT. "rel 4
    DATA END OF FUN.
    Menus
    DATA BEGIN OF MEN OCCURS 0.
    INCLUDE STRUCTURE RSMPE_MEN. "rel 4.0
    DATA END OF MEN.
    Menus (texts)
    DATA BEGIN OF MTX OCCURS 0.
    INCLUDE STRUCTURE RSMPE_MNLT. "rel 4.0
    DATA END OF MTX.
    Action Bar
    DATA BEGIN OF ACT OCCURS 0.
    INCLUDE STRUCTURE RSMPE_ACT. "rel 4.0
    DATA END OF ACT.
    Push Buttons
    DATA BEGIN OF BUT OCCURS 0.
    INCLUDE STRUCTURE RSMPE_BUT. "rel 4.0
    DATA END OF BUT.
    PF-Keys
    DATA BEGIN OF PFK OCCURS 0.
    INCLUDE STRUCTURE RSMPE_PFK. "rel 4.0
    DATA END OF PFK.
    Function sets
    DATA BEGIN OF SET OCCURS 0.
    INCLUDE STRUCTURE RSMPE_STAF. "rel 4.0
    DATA END OF SET.
    Documentation
    DATA BEGIN OF DOC OCCURS 0.
    INCLUDE STRUCTURE RSMPE_ATRT. "rel 4.0
    DATA END OF DOC.
    Title codes with text
    DATA: BEGIN OF TIT OCCURS 0.
    INCLUDE STRUCTURE RSMPE_TITT. "rel 4.0
    DATA: END OF TIT.
    DATA BEGIN OF FTX OCCURS 0. "rel 4.0
    INCLUDE STRUCTURE RSMPTEXTS.
    DATA END OF FTX.
    rel 3.1 CUA components.
    Status
    DATA BEGIN OF OLD_STA OCCURS 0.
    INCLUDE STRUCTURE RSEU1_GEN. " rel 3.1
    DATA END OF OLD_STA.
    Functions
    DATA BEGIN OF OLD_FUN OCCURS 0.
    INCLUDE STRUCTURE RSEU1_FUN. "rel 3.1
    DATA END OF OLD_FUN.
    Menus
    DATA BEGIN OF OLD_MEN OCCURS 0.
    INCLUDE STRUCTURE RSEU1_MEN. "rel 3.1
    DATA END OF OLD_MEN.
    Menus (texts)
    DATA BEGIN OF OLD_MTX OCCURS 0.
    INCLUDE STRUCTURE RSEU1_TXM. "rel 3.1
    DATA END OF OLD_MTX.
    Action Bar
    DATA BEGIN OF OLD_ACT OCCURS 0.
    INCLUDE STRUCTURE RSEU1_ACT. "rel 3.1
    DATA END OF OLD_ACT.
    Push Buttons
    DATA BEGIN OF OLD_BUT OCCURS 0.
    INCLUDE STRUCTURE RSEU1_BUT. "rel 3.1
    DATA END OF OLD_BUT.
    PF-Keys
    DATA BEGIN OF OLD_PFK OCCURS 0.
    INCLUDE STRUCTURE RSEU1_PFK. "rel 3.1
    DATA END OF OLD_PFK.
    Function sets
    DATA BEGIN OF OLD_SET OCCURS 0.
    INCLUDE STRUCTURE RSEU1_SET. "rel 3.1
    DATA END OF OLD_SET.
    Documentation
    DATA BEGIN OF OLD_DOC OCCURS 0.
    INCLUDE STRUCTURE RSEU1_ETM. "rel 3.1
    DATA END OF OLD_DOC.
    Title codes with text
    DATA: BEGIN OF OLD_TIT OCCURS 0.
    INCLUDE STRUCTURE TITLE. "rel 3.1
    DATA: END OF OLD_TIT.
    dynamic function text
    DATA BEGIN OF FDN OCCURS 1.
    INCLUDE STRUCTURE RSEU1_FDYN. "not req for rel 4.
    DATA END OF FDN.
    Icons
    DATA BEGIN OF FIN OCCURS 1.
    INCLUDE STRUCTURE RSEU1_ICON. "not req for rel 4
    DATA END OF FIN.
    dynamic menu texts
    DATA BEGIN OF MDN OCCURS 1.
    INCLUDE STRUCTURE RSEU1_MDYN. "not req for rel 4.
    DATA END OF MDN.
    Symbol list
    DATA BEGIN OF SYM OCCURS 0.
    INCLUDE STRUCTURE RSEU1_SYMB.
    DATA END OF SYM.
    Status Short text
    DATA BEGIN OF STX OCCURS 0.
    INCLUDE STRUCTURE RSEU1_CTX.
    DATA END OF STX.
    Attributes for function key settings (menu bars) Rel 3.0
    DATA BEGIN OF ATT OCCURS 0.
    INCLUDE STRUCTURE RSEU1_HAT.
    DATA END OF ATT.
    Include-Menus
    DATA BEGIN OF INC OCCURS 3.
    INCLUDE STRUCTURE RSEU1_INC.
    DATA END OF INC.
    Last used numbers
    DATA BEGIN OF LAST.
    INCLUDE STRUCTURE RSEU1_LST.
    DATA END OF LAST.
    data for call transaction (SE41 to re-generate the CUA)
    DATA: BEGIN OF T_BDC_TAB OCCURS 0.
    INCLUDE STRUCTURE BDCDATA. "BDC data
    DATA: END OF T_BDC_TAB.
    DATA: BEGIN OF T_MESSTAB OCCURS 0.
    INCLUDE STRUCTURE BDCDATA.
    DATA: END OF T_MESSTAB.
    / Program data */
    DATA: NUMBER(4) TYPE N,
    OLDNUM(4) TYPE N,
    FILESIZE TYPE I,
    NR_OF_BYTES TYPE I,
    I(3) TYPE P,
    IX(3) TYPE P,
    J(3) TYPE P,
    L(3) TYPE P,
    CUA-FLAG(1) TYPE C,
    CUA_RETURN(10) TYPE C,
    DYNPRO_MESSAGE(160) TYPE C,
    DYNPRO_LINE TYPE P,
    DYNPRO_WORD(30) TYPE C,
    NUM(3) TYPE N,
    DYNNAME(44) TYPE C,
    FN1(128) TYPE C,
    FN2(128) TYPE C,
    FN3(128) TYPE C,
    W_ITERATE(1) TYPE C,
    MAIN(1) TYPE C,
    FUNC(1) TYPE C,
    OLDNAME(40) TYPE C,
    OLD-FUNC(8) TYPE C,
    NEW-FUNC(8) TYPE C,
    FOUND(1) TYPE C,
    LANGUAGE LIKE SY-LANGU,
    FIRST-TIME(1) TYPE C VALUE 'Y',
    OK-CODE(5) TYPE C,
    NAME(40) TYPE C, "rel 4
    TXLINE(70) TYPE C,
    LINE(132) TYPE C.
    DATA:
    UL_FILE(128) TYPE C,
    DL_FILE(128) TYPE C,
    DOSLINE(72) TYPE C.
    DATA: BEGIN OF DOSDIR OCCURS 0,
    TEXT(72),
    END OF DOSDIR.
    DATA: BEGIN OF I_PROG OCCURS 0,
    NAME(40),
    END OF I_PROG.
    DATA: BEGIN OF I_PROGT OCCURS 0,
    NAME(40),
    END OF I_PROGT.
    DATA: BEGIN OF I_INCLUDE OCCURS 0,
    NAME(40),
    HANDLED(1) TYPE C,
    END OF I_INCLUDE.
    DATA: BEGIN OF I_INCL OCCURS 0,
    NAME(40),
    END OF I_INCL.
    DATA: BUFFER(1024).
    DATA: WINSYS(3).
    DATA: GLOBAL_FILEMASK_MASK(20), GLOBAL_FILEMASK_TEXT(20).
    DATA: GLOBAL_FILEMASK_ALL(80).
    DATA: T_FILENAME(128),
    TMP_FILENAME(128),
    T_MODE(1),
    FIELDLN TYPE I.
    DEFINE_TABLE I_DYNPFIELDS DYNPREAD 0. "dynpro fields to be updated
    DATA: I_FLDS LIKE HELP_VALUE OCCURS 0 WITH HEADER LINE.
    FIELD-SYMBOLS: <F>.
    / Parameters */
    SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS REPID FOR TRDIR-NAME OBLIGATORY .
    PARAMETERS:
    FUNCTION(1) TYPE C OBLIGATORY, "Function
    DSNAME(40) TYPE C, "Data set name
    INCLUDES(1) TYPE C DEFAULT 'N', "Resolve Includes
    IMASK(40) TYPE C, "Include Mask
    CLASS LIKE TRDIR-CLAS,
    AUTHOR LIKE TRDIR-CNAM, "Author
    APPL LIKE TRDIR-APPL,
    PATH(88) TYPE C DEFAULT 'A:\',
    REL3(1) TYPE C.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-005.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-002.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-003.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK A1.
    / Check users workstation is running WINDOWS, */
    / WINDOWS 95, or WINDOWS NT. OS/2 no good for */
    / this application. */
    CALL FUNCTION 'WS_QUERY'
    EXPORTING
    QUERY = 'WS'
    IMPORTING
    RETURN = WINSYS.
    IF WINSYS(2) NE 'WN'. "Win 3.X no good either
    WRITE: / 'Windows NT or Windows 95/98 is required'.
    EXIT.
    ENDIF.
    / Get names of programs to be handled. */
    / Name can be a single value, many values or ranges */
    / as per standard SELECT-OPTIONS on selection screen */
    / On Download read TRDIR and store program names in a table */
    / as per selection options. */
    / On upload read the specified directory for all files of */
    / type .EEE from specified directory */
    / compare file names with selection criteria */
    MOVE FUNCTION TO FUNC.
    MOVE 'Y' TO MAIN.
    CASE FUNC.
    WHEN 'U'. "Upload required
    PERFORM READ_DOS_DIRECTORY.
    PERFORM GET_RANGE_UL. "Get list of progs to process
    WHEN 'D'. "Download required
    PERFORM GET_RANGE_DL. "Get list of progs to process
    WHEN OTHERS.
    WRITE: / 'Function not performed due to user request'.
    EXIT.
    ENDCASE.
    SORT I_PROG.
    DELETE ADJACENT DUPLICATES FROM I_PROG.
    For download INCLUDE handling can be resolved via function
    module call.
    All Includes within Includes are also resolved by the function
    module call.
    Note that this method does not work if program itself is of type
    I (it's an include)
    In this case we can still search the source.
    IF FUNC = 'D'.
    IF INCLUDES = 'Y'.
    PERFORM GET_INCLUDES_DL.
    PERFORM PROCESS_INCLUDES_DL.
    ENDIF.
    ENDIF.
    Program list from selection criteria i.e excluding INCLUDES found
    LOOP AT I_PROG.
    MOVE I_PROG-NAME TO R1-NAME.
    APPEND R1.
    DESCRIBE TABLE R1 LINES I.
    WHILE I NE 0.
    PERFORM EXECUTE-FUNCTION.
    ENDWHILE.
    REFRESH R1.
    ENDLOOP.
    We need to check now for INCLUDES on DOWNLOAD when the INCLUDE
    program itself is of type I. In this case the function call
    will not return the INCLUDES. For example we could be
    downloading ZTESTTOP (an Include itself) which as an include
    ZTEST01.
    The process fortunately is the same as the UPLOAD function
    except of course we need to read the library instead of the
    DOS directory
    process INCLUDE modules for Upload
    On upload the procedure is more complex as Includes within
    Includes can only be resolved by scanning the code and
    searching if the program exists in the directory.
    To get all INCLUDES within INCLUDES entries in table I_INCL
    that do not exist in I_INCLUDE are copied to table I_INCLUDE
    after each entire pass of table i_INCLUDE and table is then
    re-looped through. Programs in table I_INCLUDE that have already
    been processed have a "Y" indicator set in I_INCLUDE-AVAIL.
    if func = 'U'.
    IF INCLUDES = 'Y'.
    DESCRIBE TABLE I_INCL LINES I.
    IF I > 0.
    W_ITERATE = 'Y'.
    ELSE.
    W_ITERATE = ' '.
    ENDIF.
    WHILE W_ITERATE = 'Y'.
    PERFORM PROCESS_INCLUDES_UL.
    PERFORM LOOP_THROUGH.
    DESCRIBE TABLE I_INCL LINES I.
    IF I > 0.
    W_ITERATE = 'Y'.
    ELSE.
    W_ITERATE = ' '.
    ENDIF.
    ENDWHILE.
    endif.
    ENDIF.
    DESCRIBE TABLE I_INCLUDE LINES I.
    IF I > 0.
    SKIP 1.
    WRITE: / ' Included Programs found'.
    SKIP 1.
    LOOP AT I_INCLUDE.
    WRITE I_INCLUDE-NAME TO LINE(40).
    CONDENSE LINE.
    WRITE: / LINE(80).
    ENDLOOP.
    ENDIF.
    / Table R contains ABAP names to up / download. */
    / Loop through table R and perform up / download */
    / for each program. */
    / Table R1 contains INCLUDE names found (if any) */
    / As each */
    FORM EXECUTE-FUNCTION.
    LOOP AT R1.
    MOVE-CORRESPONDING R1 TO R.
    APPEND R.
    ENDLOOP.
    REFRESH R1.
    LOOP AT R.
    REFRESH : T, E1, H1, F1, S, U.
    PERFORM PROCESS.
    MOVE 'N' TO MAIN.
    ENDLOOP.
    REFRESH R.
    DESCRIBE TABLE R1 LINES I.
    ENDFORM.
    / Build file names for UP/DOWNLOAD */
    / 3 files are generated per ABAP. */
    / 1) ABAP Path\PROGNAME.EEE (ABAP, Attr,Texts) */
    / Logic Path\PROGNAME.EEE (Dynpro Source Logic) */
    / CUA Path\PROGNAME.EEE (CUA components - keys etc) */
    / 2) Header Path\PROGNAME.HHH (Dynpro Header) */
    / 3) Fields Path\PROGNAME.FFF (Dynpro Field definitions )*/
    / ( If alternate file name specified -DSNAME- this will */
    / be used instead. This is only valid for the main program. */
    / INCLUDED programs will have file names as specified */
    / above). */
    / By using this scheme it saves the user from having to */
    / be prompted for 3 file names. */
    / If you want multiple copies / versions on disk either */
    / rename the old versions or specify a different directory in */
    / the path parameter. */
    FORM PROCESS.
    MOVE PATH TO FN1.
    CASE MAIN.
    WHEN 'Y'.
    IF DSNAME NE SPACE.
    WRITE DSNAME TO FN1+66. "rel 4
    ELSE.
    WRITE R-NAME TO FN1+66. "rel 4
    ENDIF.
    WHEN OTHERS.
    WRITE R-NAME TO FN1+66. "rel 4
    ENDCASE.
    MOVE FN1 TO FN2.
    MOVE FN1 TO FN3.
    WRITE '.HHH' TO FN1+124(4). "rel 4
    WRITE '.FFF' TO FN2+124(4). "rel 4
    WRITE '.EEE' TO FN3+124(4). "rel 4
    CONDENSE FN1 NO-GAPS.
    CONDENSE FN2 NO-GAPS.
    CONDENSE FN3 NO-GAPS.
    NAME = R-NAME.
    CASE FUNC.
    WHEN 'D'.
    PERFORM DOWNLOAD_OBJECTS.
    CLEAR LINE.
    WRITE : 'ABAP : ' TO LINE.
    WRITE R-NAME TO LINE+8.
    WRITE 'has been unloaded' TO LINE+55.
    CONDENSE LINE.
    WRITE: / LINE.
    DESCRIBE TABLE T LINES I.
    IF I = 0.
    WRITE: / 'No Dynpros were found for unload function'.
    ELSE.
    WRITE: / 'The following Dynpros have been unloaded : '.
    PERFORM LOOP_THROUGH_T.
    ENDIF.
    WHEN 'U'.
    PERFORM UPLOAD_OBJECTS.
    DESCRIBE TABLE T LINES I.
    CASE I.
    WHEN 0.
    WRITE: / 'No Dynpros were found for restore function'.
    WHEN OTHERS.
    WRITE: / 'The following Dynpros have been restored : '.
    PERFORM LOOP_THROUGH_T.
    ENDCASE.
    IF MAIN EQ 'Y'.
    CASE OLDNAME.
    WHEN SPACE.
    CLEAR LINE.
    WRITE : 'ABAP : ' TO LINE.
    WRITE R-NAME TO LINE+8.
    WRITE 'has been restored' TO LINE+55.
    CONDENSE LINE.
    WRITE: / LINE.
    WHEN OTHERS.
    CLEAR LINE.
    WRITE : 'ABAP : ' TO LINE.
    WRITE R-NAME TO LINE+8.
    WRITE 'has been restored - original name :'
    TO LINE+55.
    WRITE OLDNAME TO LINE+92.
    CONDENSE LINE.
    WRITE: / LINE.
    ENDCASE.
    ELSE.
    CLEAR LINE.
    WRITE : 'ABAP : ' TO LINE.
    WRITE R-NAME TO LINE+8.
    WRITE 'has been restored' TO LINE+55.
    CONDENSE LINE.
    WRITE: / LINE.
    ENDIF.
    ENDCASE.
    ENDFORM.
    / print progname + dynpro nrs that have been processed. */
    FORM LOOP_THROUGH_T.
    LOOP AT T.
    CLEAR LINE.
    WRITE R-NAME TO LINE.
    WRITE T-NUMBER TO LINE+50.
    CONDENSE LINE.
    WRITE: / LINE.
    ENDLOOP.
    ENDFORM.
    / Download Objects */
    FORM DOWNLOAD_OBJECTS.
    PERFORM UNLOAD_ABAP. "ABAP source, texts, attr
    SELECT SINGLE * FROM TRDIR
    WHERE NAME EQ R-NAME.
    IF TRDIR-SUBC = 'I'.
    CASE INCLUDES. "Included file wanted
    WHEN 'Y'.
    PERFORM SCAN4-INCLUDES.
    ENDCASE.
    ENDIF.
    PERFORM UNLOAD_CUA. "CUA stuff
    PERFORM DOWNLOAD_DATA. "Download EEE file to PC
    PERFORM BUILD_T. "Build table of all dynpros in ABAP
    DESCRIBE TABLE T LINES I.
    CASE I.
    WHEN 0. "if no dynpros exist then cannot download any
    PERFORM DOWNLOAD_DATA. "Download EEE file to PC
    WHEN OTHERS.
    PERFORM UNLOAD_DYNPROS. "Get Raw dynpros from SAP
    PERFORM UNLOAD_DYNPRO_COMPONENTS."Convert to table
    PERFORM DOWNLOAD_DATA. "Download ABAP etc. to PC
    PERFORM DOWNLOAD_BIN_H1. "Download dynpro header
    PERFORM DOWNLOAD_BIN_F1. "Download dynpro fields
    ENDCASE.
    ENDFORM.
    / Split ABAP up into its component parts */
    / A) Program source (72) */
    / B) Texts (132) */
    / C) Attributes (117) */
    / D) CUA stuff (Various) */
    FORM UNLOAD_ABAP.
    / Get ABAP language. Only required on download. */
    SELECT SINGLE * FROM TRDIR
    WHERE NAME EQ R-NAME.
    MOVE TRDIR-RLOAD TO R-LANGUAGE.
    READ REPORT R-NAME INTO S. "Get source into table S
    MOVE '????SRCE' TO S-TXT.
    INSERT S INDEX 1.
    / Text elements, Numbered texts, headings, selection texts */
    / Read text elements with logon language. If they don't */
    / exist read with the value taken from TRDIR. */
    READ TEXTPOOL R-NAME INTO U LANGUAGE SY-LANGU.
    IF SY-SUBRC NE 0.
    READ TEXTPOOL R-NAME INTO U LANGUAGE R-LANGUAGE.
    ENDIF.
    DESCRIBE TABLE U LINES I.
    CASE I.
    WHEN 0.
    WHEN OTHERS.
    MOVE '????TEXT' TO S-TXT.
    APPEND S.
    LOOP AT U.
    MOVE U-TXT TO S-TXT.
    APPEND S.
    DELETE U.
    ENDLOOP.
    ENDCASE.
    / Retrieve Attributes from TRDIR and add to table S */
    / Change language to logged on language */
    MOVE '????ATTR' TO S-TXT.
    APPEND S.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME EQ R-NAME.
    MOVE SY-LANGU TO TRDIR-RLOAD.
    MOVE-CORRESPONDING TRDIR TO DIR.
    MOVE DIR TO S-TXT.
    APPEND S.
    ENDFORM.
    / retrieve CUA stuff and append to table S. */
    FORM UNLOAD_CUA.
    MOVE R-NAME TO EU_KEY-NAME. "Program name for CUA
    MOVE 'D' TO EU_KEY-SPRSL. "CUA seems to want D as lang
    MOVE R-LANGUAGE TO EU_KEY-SPRSL. "Language "rel 2.2
    IMPORT STA FUN MEN MTX ACT BUT PFK SET LAST INC STX DOC "rel 2.2
    IMPORT STA STX FUN MEN MTX ACT BUT PFK SET LAST INC DOC "rel 3.0
    ATT FDN MDN SYM FIN "rel 3.0
    FROM DATABASE EUDB(CU) ID EU_KEY.
    IF SY-SUBRC NE 0. "No statuses
    EXIT.
    ENDIF.
    read titles in logged on language. If not present use
    language from TRDIR.
    CASE REL3.
    WHEN SPACE. "(rel 4)
    SELECT * FROM RSMPTEXTS WHERE PROGNAME EQ R-NAME
    AND SPRSL = SY-LANGU.
    MOVE-CORRESPONDING RSMPTEXTS TO FTX.
    APPEND FTX.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    SELECT * FROM RSMPTEXTS WHERE PROGNAME EQ R-NAME
    AND SPRSL = R-LANGUAGE.
    MOVE-CORRESPONDING RSMPTEXTS TO FTX.
    APPEND FTX.
    ENDSELECT.
    ENDIF.
    DESCRIBE TABLE FTX LINES I.
    IF I > 0.
    MOVE '????FTXT' TO S-TXT.
    APPEND S.
    LOOP AT FTX.
    MOVE FTX TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    WHEN OTHERS.
    SELECT * FROM TITLE WHERE PROGNAME EQ R-NAME
    AND DDLANGUAGE EQ SY-LANGU.
    MOVE-CORRESPONDING TITLE TO TIT.
    APPEND TIT.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    SELECT * FROM TITLE WHERE PROGNAME EQ R-NAME
    AND DDLANGUAGE EQ R-LANGUAGE.
    MOVE-CORRESPONDING TITLE TO TIT.
    APPEND TIT.
    ENDSELECT.
    ENDIF.
    ENDCASE.
    DESCRIBE TABLE STA LINES I.
    IF I > 0.
    MOVE '????STAT' TO S-TXT.
    APPEND S.
    LOOP AT STA.
    MOVE STA TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE FUN LINES I.
    IF I > 0.
    MOVE '????FUNC' TO S-TXT.
    APPEND S.
    LOOP AT FUN.
    MOVE FUN TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE MEN LINES I.
    IF I > 0.
    MOVE '????MEN1' TO S-TXT.
    APPEND S.
    LOOP AT MEN.
    MOVE MEN TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE MTX LINES I.
    IF I > 0.
    MOVE '????MTX1' TO S-TXT.
    APPEND S.
    LOOP AT MTX.
    MOVE MTX TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE ACT LINES I.
    IF I > 0.
    MOVE '????ACTN' TO S-TXT.
    APPEND S.
    LOOP AT ACT.
    MOVE ACT TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE BUT LINES I.
    IF I > 0.
    MOVE '????BUTN' TO S-TXT.
    APPEND S.
    LOOP AT BUT.
    MOVE BUT TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE PFK LINES I.
    IF I > 0.
    MOVE '????PFKY' TO S-TXT.
    APPEND S.
    LOOP AT PFK.
    MOVE PFK TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE SET LINES I.
    IF I > 0.
    MOVE '????SETS' TO S-TXT.
    APPEND S.
    LOOP AT SET.
    MOVE SET TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    IF LAST NE SPACE.
    MOVE '????LIST' TO S-TXT.
    APPEND S.
    MOVE LAST TO S-TXT.
    APPEND S.
    ENDIF.
    DESCRIBE TABLE INC LINES I.
    IF I > 0.
    MOVE '????INCL' TO S-TXT.
    APPEND S.
    LOOP AT INC.
    MOVE INC TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE STX LINES I.
    IF I > 0.
    MOVE '????STXT' TO S-TXT.
    APPEND S.
    LOOP AT STX.
    MOVE STX TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE DOC LINES I.
    IF I > 0.
    MOVE '????DOCN' TO S-TXT.
    APPEND S.
    LOOP AT DOC.
    MOVE DOC TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE TIT LINES I.
    IF I > 0.
    MOVE '????TITL' TO S-TXT.
    APPEND S.
    LOOP AT TIT.
    MOVE TIT TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    Next 5 tables are rel 3.0 specific (ATT, FDN, MDN, SYM, FIN)
    DESCRIBE TABLE ATT LINES I.
    IF I > 0.
    MOVE '????VATT' TO S-TXT.
    APPEND S.
    LOOP AT ATT.
    MOVE ATT TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE FDN LINES I.
    IF I > 0.
    MOVE '????VFDN' TO S-TXT.
    APPEND S.
    LOOP AT FDN.
    MOVE FDN TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE MDN LINES I.
    IF I > 0.
    MOVE '????VMDN' TO S-TXT.
    APPEND S.
    LOOP AT MDN.
    MOVE MDN TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE SYM LINES I.
    IF I > 0.
    MOVE '????VSYM' TO S-TXT.
    APPEND S.
    LOOP AT SYM.
    MOVE SYM TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    DESCRIBE TABLE FIN LINES I.
    IF I > 0.
    MOVE '????VFIN' TO S-TXT.
    APPEND S.
    LOOP AT FIN.
    MOVE FIN TO S-TXT.
    APPEND S.
    ENDLOOP.
    ENDIF.
    ENDFORM.
    / Upload Objects. */
    FORM UPLOAD_OBJECTS.
    PERFORM UPLOAD_EEE. "ABAP,texts,attr dynpro logic
    DESCRIBE TABLE E1 LINES I.
    IF I > 0. "Do dynpro components exist
    PERFORM UPLOAD_HHH. "dynpro header
    PERFORM UPLOAD_FFF. "dynpro fields.
    PERFORM RECONSTRUCT_DYNPROS. "load + gen dynpros
    ENDIF.
    ENDFORM.
    / Build table containing dynpro names and numbers */
    FORM BUILD_T.
    SELECT * FROM D020S WHERE PROG EQ R-NAME.
    T-NUMBER = D020S-DNUM.
    T-NAME = D020S-PROG.
    APPEND T.
    ENDSELECT.
    ENDFORM.
    / Split dynpros into constituent parts. */
    FORM UNLOAD_DYNPROS.
    MOVE 'Y' TO FIRST-TIME.
    LOOP AT T.
    REFRESH: F, E.
    CLEAR: H, F, E.
    PERFORM BUILD_HHH. "Dynpro Header
    PERFORM BUILD_FFF. "Dynpro Fields
    PERFORM BUILD_EEE_DYNP. "Dynpro Logic
    ENDLOOP.
    ENDFORM.
    / Header H length 284. */
    FORM BUILD_HHH.
    MOVE T-NAME TO DYNNAME(40). "rel 4.
    MOVE T-NUMBER TO DYNNAME+40(4). "rel 4.
    IMPORT DYNPRO H F E M ID DYNNAME.
    MOVE T-NAME TO H1-NAME.
    MOVE T-NUMBER TO H1-NUMBER.
    MOVE-CORRESPONDING H TO H1.
    APPEND H1.
    ENDFORM.
    / Fields D021S Len 87. */
    FORM BUILD_FFF.
    MOVE T-NAME TO F1-NAME.
    MOVE T-NUMBER TO F1-NUMBER.
    LOOP AT F.
    MOVE-CORRESPONDING F TO F1.
    APPEND F1.
    DELETE F.
    ENDLOOP.
    ENDFORM.
    / Dynpro Logic D022S E */
    FORM BUILD_EEE_DYNP.
    MOVE T-NAME TO E1-NAME.
    MOVE T-NUMBER TO E1-NUMBER.
    LOOP AT E.
    MOVE-CORRESPONDING E TO E1.
    APPEND E1.
    DELETE E.
    ENDLOOP.
    ENDFORM.
    / Unload Constituent parts of dynpro. */
    FORM UNLOAD_DYNPRO_COMPONENTS.
    MOVE '????LOGC' TO S-TXT.
    APPEND S.
    LOOP AT E1.
    MOVE E1 TO S-TXT.
    APPEND S.
    DELETE E1.
    ENDLOOP.
    FREE E1.
    LOOP AT T.
    MOVE 'N' TO FOUND.
    SELECT SINGLE * FROM D020T "use logged on language
    WHERE PROG EQ T-NAME
    AND DYNR EQ T-NUMBER
    AND LANG EQ SY-LANGU.
    IF SY-SUBRC NE 0. "try original language.
    SELECT SINGLE * FROM D020T
    WHERE PROG EQ T-NAME
    AND DYNR EQ T-NUMBER
    AND LANG EQ R-LANGUAGE.
    ENDIF.
    IF SY-SUBRC EQ 0.
    IF FOUND = 'N'.
    MOVE '????DTIT' TO S-TXT.
    APPEND S.
    MOVE 'Y' TO FOUND.
    ENDIF.
    MOVE T-NAME TO S-TXT.
    WRITE T-NUMBER TO S-TXT+8(4).
    WRITE D020T-DTXT TO S-TXT+12(60).
    APPEND S.
    ENDIF.
    MOVE 'N' TO FOUND.
    SELECT * FROM D021T
    WHERE PROG EQ T-NAME
    AND DYNR EQ T-NUMBER
    AND LANG EQ SY-LANGU. "logged on language
    IF FOUND = 'N'.
    MOVE '????DTXT' TO S-TXT.
    APPEND S.
    MOVE 'Y' TO FOUND.
    ENDIF.
    MOVE-CORRESPONDING D021T TO DTXT.
    MOVE DTXT TO S-TXT.
    APPEND S.
    ENDSELECT.
    CASE SY-SUBRC.
    WHEN 0.
    WHEN OTHERS. "try original language
    SELECT * FROM D021T
    WHERE PROG EQ T-NAME
    AND DYNR EQ T-NUMBER
    AND LANG EQ R-LANGUAGE.
    IF FOUND = 'N'.
    MOVE '????DTXT' TO S-TXT.
    APPEND S.
    MOVE 'Y' TO FOUND.
    ENDIF.
    MOVE-CORRESPONDING D021T TO DTXT.
    MOVE DTXT TO S-TXT.
    APPEND S.
    ENDSELECT.
    ENDCASE.
    ENDLOOP.
    ENDFORM.
    / Build the original dynpro component tables. */
    / Table H1 contains 1 entry for each dynpro. H1 contains */
    / the header for the dynpro prefixed by the program name */
    / and dynpro number. */
    / By looping round this table we can re-build the F */
    / (Fields) and E (Logic) components. By stripping off the */
    / program name and dynpro number the original tables are */
    / re-created. (Tables F1 and E1 also have a prefix of */
    / Program name and dynpro nr). */
    / After the original set of tables has been re-created we */
    / use R3 - SYSTEM-CALL (rel 2.2) to generate the screen */
    / and then get the next entry in table H1 to build the */
    / next screen. For releases 3.0 and higher use generate */
    / dynpro. */
    FORM RECONSTRUCT_DYNPROS.
    LOOP AT H1.
    CASE MAIN.
    WHEN 'Y'.
    if h1-name ne repid.
    IF H1-NAME NE R1-NAME.
    MOVE H1-NAME TO OLDNAME.
    ENDIF.
    ENDCASE.
    PERFORM RECONSTRUCT_F.
    PERFORM RECONSTRUCT_E.
    MOVE-CORRESPONDING H1 TO H.
    IF MAIN = 'Y'.
    move repid to h-prog.
    MOVE R1-NAME TO H-PROG.
    move repid to dynname.
    MOVE R1-NAME TO DYNNAME.
    ELSE.
    MOVE H1-NAME TO H-PROG.
    MOVE H1-NAME TO DYNNAME.
    ENDIF.
    MOVE H1-NUMBER TO H-DNUM.
    WRITE H1-NUMBER TO DYNNAME+40(4).
    EXPORT DYNPRO H F E M ID DYNNAME.
    SYSTEM-CALL GENERATE-SCREEN DYNNAME. "Up to rel 2.2
    GENERATE DYNPRO H F E M ID DYNNAME "R 3.0, 4.0, 4.5
    MESSAGE DYNPRO_MESSAGE
    LINE DYNPRO_LINE
    WORD DYNPRO_WORD.
    REFRESH: M, F, E.
    CLEAR: M, H, F, E.
    ENDLOOP.
    ENDFORM.
    / Re-build Fields table */
    FORM RECONSTRUCT_F.
    LOOP AT F1 WHERE NAME EQ H1-NAME AND
    NUMBER EQ H1-NUMBER.
    MOVE-CORRESPONDING F1 TO F.
    APPEND F.
    ENDLOOP.
    ENDFORM.
    / Re-build Logic table */
    FORM RECONSTRUCT_E.
    LOOP AT E1 WHERE NAME EQ H1-NAME AND
    NUMBER EQ H1-NUMBER.
    MOVE-CORRESPONDING E1 TO E.
    APPEND E.
    ENDLOOP.
    ENDFORM.
    / scan for included files (Upload) */
    FORM SCAN4-INCLUDES.
    IF FUNC = 'D'. "Downloads - whole table needs to be scanned
    LOOP AT S.
    PERFORM SEARCH-FUNC.
    ENDLOOP.
    ENDIF.
    IF FUNC = 'U'. "On upload scan line by line as we are re-building abap
    PERFORM SEARCH-FUNC.
    ENDIF.
    ENDFORM.
    / scan for text INCLUDE xxxxxxxx */
    / reject INCLUDE STRUCTURE as structure not a valid */
    / program name */
    FORM SEARCH-FUNC.
    CONDENSE S-TXT.
    SEARCH S-TXT FOR '.INCLUDE .'.
    CASE SY-SUBRC.
    WHEN 0.
    IF S-TXT+8(9) EQ 'STRUCTURE'
    OR S-TXT+8(9) EQ 'structure'
    OR S-TXT+8(6) EQ '<ICON>' "rel 3.0c 3.0d
    OR S-TXT+8(6) EQ '<icon>'
    OR S-TXT+8(6) EQ '<type>'
    OR S-TXT+8(6) EQ '<TYPE>'
    OR S-TXT+8(9) EQ '<methods>'
    OR S-TXT+8(9) EQ '<METHODS>'.
    EXIT.
    ENDIF.
    IF SY-FDPOS EQ 0. "INCLUDE must be in pos 1 (by reason of condense)
    PERFORM VALIDATE_INCLUDE.
    ELSE.
    EXIT.
    ENDIF.
    ENDCASE.
    ENDFORM.
    / Validate INCLUDES . */
    FORM VALIDATE_INCLUDE.
    SEARCH S-TXT FOR '...' STARTING AT 9 ENDING AT 39.
    CASE SY-SUBRC.
    WHEN 0.
    WHEN OTHERS.
    SEARCH S-TXT FOR '. .' STARTING AT 9 ENDING AT 38.
    IF SY-SUBRC NE 0.
    EXIT.
    ENDIF.
    ENDCASE.
    IX = SY-FDPOS.
    ASSIGN S-TXT+8(IX) TO <F>.
    Now check for Include Mask for example if include mask was set to
    Z* then only include programs whose first letter starts with a Z.
    1) get length of the INCLUDE program name. Must be less than or
    equal 40.
    2) Compare it with the Include mask.
    3) If Ok add include program name to include table
    clear i_include.
    move <f> to i_include-name.
    CLEAR I_INCL.
    SEARCH IMASK FOR '.*.'.
    IF SY-SUBRC = 0.
    CONDENSE IMASK.
    ENDIF.
    IF ( <F> CP IMASK OR IMASK = ' ' ).
    READ TABLE I_INCL WITH KEY = <F>.
    IF SY-SUBRC NE 0.
    MOVE <F> TO I_INCL-NAME.
    move 1 to i_include-count.
    collect i_include.
    APPEND I_INCL.
    ENDIF.
    ENDIF.
    ENDFORM.
    / Download table S. */
    FORM DOWNLOAD_DATA.
    CLEAR TXLINE.
    WRITE 'Downloading ' TO TXLINE.
    WRITE R1-NAME TO TXLINE+12.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    PERCENTAGE = 0
    TEXT = TXLINE
    EXCEPTIONS
    OTHERS = 1.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = FN3
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = S.
    ENDFORM.
    / Download Binary files H1 */
    FORM DOWNLOAD_BIN_H1.
    DESCRIBE FIELD H1 LENGTH J.
    DESCRIBE TABLE H1 LINES I.
    NR_OF_BYTES = I * J.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = FN1
    FILETYPE = 'BIN'
    BIN_FILESIZE = NR_OF_BYTES
    IMPORTING
    FILELENGTH = FILESIZE
    TABLES
    DATA_TAB = H1.
    ENDFORM.
    / Download Binary files F1 */
    FORM DOWNLOAD_BIN_F1.
    DESCRIBE FIELD F1 LENGTH J.
    DESCRIBE TABLE F1 LINES I.
    NR_OF_BYTES = I * J.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = FN2
    FILETYPE = 'BIN'
    BIN_FILESIZE = NR_OF_BYTES
    IMPORTING
    FILELENGTH = FILESIZE
    TABLES
    DATA_TAB = F1.
    ENDFORM.
    / Upload data from file .EEE */
    FORM UPLOAD_EEE.
    CLEAR TXLINE.
    WRITE 'Uploading ' TO TXLINE.
    WRITE R1-NAME TO TXLINE+10.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    PERCENTAGE = 0
    TEXT = TXLINE
    EXCEPTIONS
    OTHERS = 1.
    MOVE 'Y' TO FIRST-TIME.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = FN3
    FILETYPE = 'ASC'
    IMPORTING
    FILELENGTH = NR_OF_BYTES
    TABLES
    DATA_TAB = S1.
    LOOP AT S1.
    IF S1-TXT(4) = '????'.
    MOVE S1-TXT(8) TO NEW-FUNC.
    IF FIRST-TIME = 'Y'.
    MOVE S1-TXT(8) TO OLD-FUNC.
    MOVE 'N' TO FIRST-TIME.
    ELSE.
    PERFORM STORE_COMPONENT.
    MOVE NEW-FUNC TO OLD-FUNC.
    ENDIF.
    ENDIF.
    IF S1-TXT(4) NE '????'.
    PERFORM REBUILD-COMPONENT.
    ENDIF.
    ENDLOOP.
    PERFORM STORE_COMPONENT. "last component still to be processed
    PERFORM REBUILD-CUA. "re-build CUA, statuses, pfk etc
    ENDFORM.
    / Upload Dynpro headers (HHH) and fields (FFF) */
    / titles and dynpro logic is contained in file .EEE */
    / and has already been processed. */
    FORM UPLOAD_HHH.
    CASE REL3.
    WHEN 'X'.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = FN1
    FILETYPE = 'BIN'
    IMPORTING
    FILELENGTH = NR_OF_BYTES
    TABLES
    DATA_TAB = H2.
    LOOP AT H2.
    MOVE H2-CNAME TO H1-NAME.
    MOVE H2-CNUM TO H1-NUMBER.
    MOVE H2-NNAME TO H1-PROG.
    MOVE H2-NNUM TO H1-DNUM.
    MOVE H2-CTIM TO H1-TGEN.
    WRITE '19' TO H1-DGEN(2).
    WRITE H2-CDAT TO H1-DGEN+2(6).
    WRITE H2-FILL TO H1+88(39).
    APPEND H1.
    ENDLOOP.
    WHEN OTHERS.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = FN1
    FILETYPE = 'BIN'
    IMPORTING
    FILELENGTH = NR_OF_BYTES
    TABLES
    DATA_TAB = H1.
    ENDCASE.
    LOOP AT H1.
    MOVE H1-NAME TO T-NAME.
    MOVE H1-NUMBER TO T-NUMBER.
    APPEND T.
    ENDLOOP.
    ENDFORM.
    / Upload Binary file F1 - Dynpro fields */
    FORM UPLOAD_FFF.
    CASE REL3.
    WHEN 'X'.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = FN2
    FILETYPE = 'BIN'
    IMPORTING
    FILELENGTH = NR_OF_BYTES
    TABLES
    DATA_TAB = F2.
    LOOP AT F2.
    OLD_F1 = F2.
    APPEND OLD_F1.
    ENDLOOP.
    LOOP AT OLD_F1.
    MOVE-CORRESPONDING OLD_F1 TO F1.
    APPEND F1.
    ENDLOOP.
    WHEN OTHERS.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = FN2
    FILETYPE = 'BIN'
    IMPORTING
    FILELENGTH = NR_OF_BYTES
    TABLES
    DATA_TAB = F1.
    ENDCASE.
    ENDFORM.
    / Re-construct data from file .EEE */
    FORM REBUILD-COMPONENT.
    CASE OLD-FUNC.
    WHEN '????LOGC'. "Dynpro LOGIC.
    CASE REL3.
    WHEN 'X'.
    SHIFT S1-TXT+8 RIGHT BY 32 PLACES.
    ENDCASE.
    MOVE S1-TXT TO E1.
    APPEND E1.
    / Load ABAP Source code, CUA, pfkeys etc to int tables */
    WHEN '????SRCE'.
    MOVE S1-TXT TO S-TXT.
    APPEND S.
    CASE INCLUDES. "Included file wanted
    WHEN 'Y'.
    PERFORM SCAN4-INCLUDES.
    ENDCASE.
    if restoring / uploading rel 3.1 or lower different cua tables
    are used. At generate CUA time these will be converted by the
    system to rel 4.0
    WHEN '????STAT'.
    CASE REL3.
    WHEN 'X'.
    MOVE S1-TXT TO OLD_STA.
    APPEND OLD_STA.
    WHEN SPACE.
    MOVE S1-TXT TO STA.
    APPEND STA.
    ENDCASE.
    MOVE 'Y' TO CUA-FLAG.
    WHEN '????FUNC'.
    CASE REL3.
    WHEN 'X'.
    MOVE S1-TXT TO OLD_FUN.
    APPEND OLD_FUN.
    WHEN SPACE.
    MOVE S1-TXT TO FUN.
    APPEND FUN.
    ENDCASE.
    MOVE 'Y' TO CUA-FLAG.
    WHEN '????MEN1'.
    CASE REL3.
    WHEN 'X'.
    MOVE S1-TXT TO OLD_MEN.
    APPEND OLD_MEN.
    WHEN SPACE.
    MOVE S1-TXT TO MEN.
    APPEND

  • Hello there, am new here and very stressed, i have an Imac core i3 which is logging off itself after a few seconds of login, it goes back to the login menu where i put the password. I have tried to repair the os but my pioneer rom is not reading the disk.

    Hello there, am new here and very stressed, i have an Imac core i3 which is logging off itself after a few seconds of login, it goes back to the login menu where i put the password. I have tried to repair the os but my pioneer rom is not reading the disk. I press the :c" button on startup but its not picking up the disk in the rom, i have tried to put the disk in an external rom but same answer, am starting to think that my os disk is bad. Please help me.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, or if a firmware password is set, you can’t boot in safe mode.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Hi my iphone was fully charged and turned its self off, i have tried to turn it back on and reset it, but no luck so i have plugged it in to my pc and it displays the apple logo and then goes back off i have tried this a number of times with no success

    hi my iphone was fully charged and turned its self off, i have tried to turn it back on and reset it, but no luck so i have plugged it in to my pc and it displays the apple logo and then goes back off i have tried this a number of times with no success anyone got any idears?

    Try here:
    iOS: Not responding or does not turn on

  • The date and time is not working after setting it to current date and goes back to may,26 2011

    the date and time is not working after setting it to current date and goes back to may,26 2011; 2 PM . I bought my ipod tocuh 4th gen on july 18th

    On the iPod, make sure your Calendar is set to Gregorian (Settings > General > International > Calendar).  Also make sure your date and time on your computer is correct as well as the Time Zones on both.

  • I was using my ipad it was under 10% but no under 4% it turned off then i pluged the charger in and flashed on then showed apple sign after i turned it on. now its going back and forth from the apple sign and battery symbol ive changed chargers its not on

    hey please help!
    i was using my ipad it was under 10% but no under 4% it turned off then i pluged the charger in and flashed on then showed apple sign after i turned it on. now its going back and forth from the apple sign and battery symbol ive changed chargers its made no differnce its been like 3 hours ive tried to do that reset thing holding lock button and home button for 10 seconds at the same time. WHAT DO I DO?

    Could be the charger, cable or iPad. Plug the USB cable into your computer. It may say "Not Charging", however, it is charging slowly and will verify that the cable is good.
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W (5W on Mini) USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    iPhone: Hardware troubleshooting (Power/Battery section also applies to iPad)
    http://support.apple.com/kb/TS2802
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    iOS 7 Battery Life Draining Too Fast? It’s Easy to Fix
    http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    iPad: Charging the battery
    http://support.apple.com/kb/HT4060
    Best Practices for iPad Battery Charging
    http://www.ilounge.com/index.php/articles/comments/best-practices-for-ipad-batte ry-charging/
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • After logging in to personal site screen goes back to login

    after logging in to personal site screen goes back to login

    i've been logging into yhese sites for the past year or so with no problem

  • Adding new rows after displaying subtotals in an ALV report by using OOABAP

    Dear All,
    I am creating an ALV report, displaying subtotals and total by using Classes. I have used classes CL_SALV_AGGREGATIONS (Method : add_aggregation) and CL_SALV_AGGREGATIONS (Method : add_sort) for sorting and doing subtotals.
    Output of my report as follows :- (I have used * for displaying spaces between fields)
    Materia*******Quantity**SerialNo*Equipment**Value***WBS Element
    ISM-DBSVR****1********12363****31872565***2165***Q-0040358945.001010
    ISM-DBSVR****1********12364****31872566***2165***Q-0040358945.001010
    **************************************Subtotal***********4330
    -> If the value of "Quantity" is greater than 1 then the value of subtotal for the field "Value" is to be divided by the Quantity for that line item and needs to be displayed Quantity, SerialNo, Value details information after subtotal .
    -> Basically I need to add few more rows for displaying above additional information in the ALV grid after displaying subtotal .
    Q: Do we have any methods for change the layout for the above requirement.
    I Appreciate your early response.
    Thank you.
    RajaSekhar.

    Hi,
    For such type of requirement you need to use ALV hierchical table.
    You can have your main table in master table.
    For quantity greater than 1 you need to move the data into a seperate internal table....this internal table will have material as the key between the main table and the second table.
    *... §2 create an ALV hierseq table
      try.
          cl_salv_hierseq_table=>factory(
            exporting
              t_binding_level1_level2 = lt_binding
            importing
              r_hierseq               = gr_hierseq
            changing
              t_table_level1           = gt_master
              t_table_level2           = gt_slave ).
        catch cx_salv_data_error cx_salv_not_found.
      endtry.
    you can display both the tables together with the subtotals also.
    please refer to program SALV_DEMO_HIERSEQ_SIMPLE to see how to display the hierarchical display.
    Plr reward points if found helpful.
    Regards,
    Mayank

  • How to display results set of multiple reports into a single report table

    Our goal is to create a single report (or dashboard) that shows the "funnel" of object creations related to each campaign. The flow goes from Activity to Lead to Opportunity as well as multiple steps within each (ie. Unqualified Lead -> Qualified Lead, etc).
    We currently have 3 separate reports in three different subject areas, each reporting the different metrics and we would like to combine the output into a single Unified report.
    For example what we currently have is:
    Activities:
    Campaign Name # of Activities
    Campaign A 12
    Campaign B 26
    Leads:
    Campaign Name # of Leads # of Qualified Leads
    Campaign A 10 4
    Campaign B 20 18
    Opportunities:
    Campaign Name # of Opportunities # of Opps per Sales Stage ... # of Wins Closed Revenue
    Campaign A 3 2 1 $1,000.00
    Campaign B 10 8 3 $2,800.00
    What we want to see is:
    Combined:
    Campaign Name - Campaign Cost - # of Activities - # of Leads - # of Qualified Leads - # of Opportunities - # of Opps per Sales Stage - # of Wins - Closed Revenue
    Campaign A - $423.00 - 12 - 10 - 4 - 3 - 2 - 1 - $1,000.00
    Campaign B - $ 1,000.00 - 26 - 20 - 18 - 10 - 8 - 3 - $2,800.00
    We have tried using the "Combine with similar analysis" but the number of columns for each subject area differ. We also tried creating multiple UNION criteria (one for each column), but in the case of # of Opps per Sales Stage and Closed Revenue, those are not "Metrics" fields, so they won't combine.

    Hi, You may have to create some dummy fields to equate the no. of field in each of the report matching the data type too and get a one single report using combined analytics and then using the resultant data you can create a simple pivot like below. Haven't tried it before
    -- Venky CRMIT
    Hi Venky,
    I am facing the same problem. Can you please say Steps how to create resultant data and Combine in pivot Table .
    Please Help me .
    Thanks in Advance .
    My mail id is :
    [email protected]

  • Weird bug after upgrading itunes to 7.5 and going back to 7.2

    hey everyone,
    I've made a series of mistakes. I run OS X 10.3.9 on a G4 desktop. I upgraded itunes 7.2 to 7.5 and when it didn't work i tried to go back. I found a way, but i didn't uninstall 7.5 correctly and developed a bug. whenever i click on a .wav or .aif in column view in Finder or Pro Tools the window or application crashes.
    I re-upgraded to itunes 7.5 in hope of fixing this, but nothing.
    any suggestions
    thanks in advance

    it could be quicktime. When my dumb *** updated itunes, i also updated QT from 6.5.2 to 7.3. That version didn't work with my digidesign hardware and i had to find a way to downgrade. I found this link: http://fox-gieg.com/tutorials/2005/undo-quicktime-7/
    everything seemed to run smoothly.

  • Can anyone help me with why Facebook keeps disappearing after being open for 30 seconds it goes back to my icon screen.

    I Have added and deleted Facebook, I have changed my password. I even got a new phone. Nothing works. My ipad worked for most of Sunday but now it will not stay on.

    I don't have a 4G device, but I thought you can use mobile safari, the safari on the iPad, on 4G.
    You could also try looking for a third party app. The official facebook app has been non to barely functional for years. I use mobile safari on my iPad although I do have a couple  of apps I've used upon occasion.

  • After i register my imac it just goes back to the very beginning of the registration process

    I lost my password and when thru the process of the whole rm var/db/.applesetupdone  thing to reset my admin password. it takes me thru the registration process but when it gets to the end it just starts over completely at the beginning of the registration process. does anyone have an suggestions?

    Boot up in single user mode.  See if /var/db/.applesetupdone  exists.
    The name is:
    -rw-------
    1 root 
    wheel     
    1K Dec 13  2010 .AppleSetupDone
    If not create one:
    mac $ pwd
    /var/db
    mac $ sudo cat .AppleSetupDone
    Password:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>Address</key>
            <dict>
                    <key>AreaCode</key>
                    <string>111</string>
                    <key>City</key>
                    <string>burg</string>
                    <key>Company</key>
                    <string></string>
                    <key>CountryName</key>
                    <string>United States</string>
                    <key>ExistingEmailAddress</key>
                    <string></string>
                    <key>FirstName</key>
                    <string>Robert</string>
                    <key>LastName</key>
                    <string>Last</string>
                    <key>LocalPhoneNumber</key>
                    <string>111111</string>
                    <key>StateProv</key>
                    <string>St</string>
                    <key>StreetAddr1</key>
                    <string>111 S Street</string>
                    <key>StreetAddr2</key>
                    <string></string>
                    <key>ZipPostal</key>
                    <string>11111</string>
            </dict>
            <key>RegistrationInfo</key>
            <dict>
                    <key>AppleSpam</key>
                    <string>NO</string>
                    <key>Location</key>
                    <string>B</string>
                    <key>Occupation</key>
                    <string>13</string>
                    <key>OthersSpam</key>
                    <string>NO</string>
            </dict>
    </dict>
    </plist>
    mac $

  • My Macbook Mavericks pro does connect well to a data projector, even after following the process recommended, what is the optimum display settings? Has anybody else had this problem, I'm close to going back to PC's

    My Macbook pro Mavericks does not connect well to a data project even after following the recommended process, Has anybody else struck this problem, what is the optimum display setting? Im close to going back to PCs

    You said " digital AV Adapter and thunderbolt". Do you mean Thunderbolt/min displayport to HDMI adapter?
    It appears you are using the free version of the Display Menu app.
    What does the Apple Display properties show? System Preferences>Displays>Display show?
    Look at the projector/go to the manufacturer's support site and find the native resolution of the projector.
    Googling for Sori data projector id not produce any hits

  • Exporting Report definitions/source codes

    Hi gyus,
    I'm looking for a software or tool or an algorithm which I could use to export all the Report definitions and search in them. Especially I mean source codes of formulas and section-conditions. My "heritage" is a huge chaotic report and often I need to look for a specific thing which may be contained in any formula source code, any suppress condition, anywhere...
    I know of .rpt Inspector, which is unfortunately too expensive for me ($400).
    I know of the CR XI ability to export Report definitions to .txt files. But they aren't complete since they contain only condition source codes (those ones you type in via section expert), and I miss the formula source codes.
    Thank you so much in advance for any help or tip
    Regards
    Martin F.

    Hi, I do know about this feature. unfortunately, the resulting exported file doesn't contain complete report definition info. Especially formulas' source codes. So I can't search (CTRL+F) within these parts of source code.

  • My imessage wont work, when i open it the screen turns white for a few seconds then goes back to the home screen

    WHEN I OPEN IMESSAGE THE SCREEN BLANKS WHITE AND AFTER A FEW SECONDS CLOSES IMESSAGE AND GOES BACK TO HOME SCREEN!!! HELP ME I HAVE NO IDEA WHAT TO DO!!!!

    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Go to Settings>Messages>Send and Receive and sing out and sing back in
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

Maybe you are looking for