Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO DOWNLOAD FILELDS IN A COLUMN WISE

0 Kudos

HI EXPERTS,

My requirement is to download the fields into excel file in a column wise and my report program having a more than 100 fields to display in column .

when I am downloading a file only it is taking SIX fields means 37 Bytes it is taking.I need to download more than 50 fields.

Kindly help me on this issue.

Thanks&Regards,

fayaz

2 REPLIES 2

former_member1716
Active Contributor
0 Kudos

Hi fayaz,

How are you trying to download the report. in the Report or externally, if externally you can follow the below steps.

There is one option in the menu path as below,

List -> Export -> Local File

Post Which You select Spreadsheet from POP up, then give the filename and path.

Now you can see the files in the destined path with all the fields.

Regards,

0 Kudos

This is Report Program Please help me ...

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

*& Report  ZDEMO1

*&

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

*&

*&

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

REPORT  ZDEMO1                       LINE-SIZE 80

                                       LINE-COUNT 68

                                       NO STANDARD PAGE HEADING..

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

*Tables *

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

TABLES : sscrfields, "Fields on selection screens

          dd03l. "Table Fields

data: gv_t_old LIKE dd03l-tabname . "Earlier Table name

TYPES: BEGIN OF t_dd03l,

tabname LIKE dd03l-tabname, "Table Name

fieldname LIKE dd03l-fieldname, "Field Name

keyflag LIKE dd03l-keyflag, "Key Flag

rollname LIKE dd03l-rollname, "Roll Name

position LIKE dd03l-position, "Position

ddtext(30), "Description

END OF t_dd03l,

BEGIN OF t_fields.

         INCLUDE STRUCTURE dd03l.

TYPES: END OF t_fields.

TYPES : BEGIN OF t_tabs. "To hold the table names

         INCLUDE STRUCTURE rsdstabs.

TYPES : END OF t_tabs.

TYPES : BEGIN OF t_flds. "To hold the field names

         INCLUDE STRUCTURE rsdsfields.

TYPES : END OF t_flds.

TYPES : BEGIN OF t_fname, "To hold the field names

fld LIKE dd03l-fieldname,

END OF t_fname.

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

*Internal Tables *

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

DATA : it_dd03l TYPE TABLE OF t_dd03l, "To hold the field names

it_tabs TYPE TABLE OF t_tabs, "To hold the table names

it_flds TYPE TABLE OF t_flds, "To hold the field names

it_temp TYPE TABLE OF t_flds, "Temp. table to hold field names

it_fields TYPE TABLE OF t_fields, "To hold the field names

it_cat TYPE TABLE OF lvc_s_fcat,"To hold Field Catalog

it_fname TYPE TABLE OF t_fname.

TYPES:BEGIN OF ty_data,

   tabname TYPE  rsdstabs-PRIM_TAB,

       END OF ty_data.

data:it_test TYPE TABLE OF ty_data,

  wa_test TYPE  ty_data.

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

*Work areas *

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

DATA: d_ref TYPE REF TO data , "Data reference

wa_dd03l LIKE LINE OF it_dd03l, "Workarea for IT_DD03L

wa_tabs LIKE LINE OF it_tabs, "Workarea for IT_TABS

wa_flds LIKE LINE OF it_flds, "Workarea for IT_FLDS

wa_temp LIKE LINE OF it_temp, "Workarea for IT_TEMP

wa_fields LIKE LINE OF it_fields, "Workarea for IT_FIELDS

wa_cat LIKE LINE OF it_cat , "Workarea for IT_CAT

wa_fname LIKE LINE OF it_fname. "Workarea for IT_FNAME

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

*Variables *

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

DATA: gx_texpr TYPE rsds_texpr, "Variable to hold Expression

gx_twhere TYPE rsds_twhere, "Variable to hold Where Clause

gv_selid LIKE rsdynsel-selid, "Variable to hold Selid

gv_actnum LIKE sy-tfill, "Variable to hold no of fields

gv_title LIKE sy-title, "Variable to hold Title

gv_where_cl(100) TYPE c, "Variable to hold Where clause

gv_tbname LIKE dd03l-tabname,

gv_temp.

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

*Field Symbols *

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

FIELD-SYMBOLS : <f_fs> TYPE table. "FieldSymbol for holding fields

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

   PARAMETERS:p_rb1 TYPE c RADIOBUTTON GROUP rb1 USER-COMMAND ucomm DEFAULT 'X',

              p_rb2 TYPE c RADIOBUTTON GROUP rb1.

SELECTION-SCREEN END OF BLOCK b1 .

  SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

     SELECTION-SCREEN : PUSHBUTTON 3(8LV_CH1 USER-COMMAND cl. "Select-options

  SELECTION-SCREEN END OF BLOCK b2.

*data: lv_ch1 TYPE TABNAME.

INITIALIZATION.

**--Initialize values

   PERFORM initialize.

*  DATA :(10) TYPE C.

*   = 'ska1'.

**   = 'ska1'.

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

*At Selection Screen *

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

AT SELECTION-SCREEN.

*--Select the fields of the input table

   PERFORM select_flds.

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

*Start Of Selection *

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

START-OF-SELECTION.

*if p_ch1 = 'X'.

*--Fetch data to display output

   PERFORM fetch_data.

*ENDIF.

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

*End Of Selection *

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

END-OF-SELECTION.

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

*At User Command *

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

AT USER-COMMAND.

   CASE sy-ucomm.

     WHEN 'OK'.

        REFRESH it_temp.

       CLEAR it_temp.

       MOVE 'S' TO wa_temp-type.

       MOVE gv_tbname TO wa_temp-tablename.

       DO.

         READ LINE sy-index FIELD VALUE gv_temp INTO gv_temp.

         IF sy-subrc NE 0.

           EXIT.

         ENDIF.

         IF gv_temp EQ 'X'.

           sy-index = sy-index - 1.

           READ TABLE it_dd03l INTO wa_dd03l INDEX sy-index.

           IF sy-subrc = 0.

             MOVE wa_dd03l-fieldname TO wa_temp-fieldname.

             APPEND wa_temp TO it_temp.

             CLEAR gv_temp.

           ENDIF.

         ENDIF.

       ENDDO.

       DESCRIBE TABLE it_temp.

       IF sy-tfill GT 570.

**--More than 70 fields can not be selected

*        MESSAGE i001 WITH 'Cannot select more than 70 Parameters'(006).

         REFRESH it_temp[]. CLEAR it_temp.

       ELSE.

         LEAVE LIST-PROCESSING.

       ENDIF.

     WHEN 'CANCEL'.

       LEAVE LIST-PROCESSING.

     WHEN 'SELALL'.

**--Select all fields

       CLEAR wa_dd03l-fieldname.

       DO.

         READ LINE sy-index.

         IF sy-subrc EQ 0 AND

         wa_dd03l-fieldname NE space.

           gv_temp = 'X'.

           MODIFY LINE sy-index INDEX 0 FIELD VALUE gv_temp.

           HIDE gv_temp.

           CLEAR wa_dd03l-fieldname.

         ELSEIF sy-subrc NE 0.

           EXIT.

         ENDIF.

       ENDDO.

     WHEN 'DESEALL'.

**--Deselect all fields

       CLEAR gv_temp.

       DO.

         READ LINE sy-index.

         IF sy-subrc EQ 0.

           CLEAR gv_temp.

           MODIFY LINE sy-index INDEX 0 FIELD VALUE gv_temp FROM gv_temp.

           HIDE gv_temp.

         ELSEIF sy-subrc NE 0.

           EXIT.

         ENDIF.

       ENDDO.

   ENDCASE.

*  sy-lsind = 0.

*&amp; Form INITIALIZE

*&amp;---------------------------------------------------------------------

* Initialize values on selection-screen

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

FORM initialize .

   LV_CH1 = 'SKA1'(003).

ENDFORM. " INITIALIZE

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

*& Form SELECT_FLDS

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

* Select fields from the table

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

FORM select_flds .

   CASE sscrfields-ucomm.

     WHEN 'CL'.

**--Display Screen with the list of fields

       PERFORM genr_scr.

   ENDCASE.

ENDFORM. " SELECT_FLDS

FORM fetch_data .

*  DATA: lv_where TYPE string,

*  lv_cnt TYPE i.

***--Check for the existance of the table

*  SELECT *

*  FROM dd03l

*  INTO TABLE it_fields

*  WHERE tabname = .

*  SORT it_fields BY position.

***--Delete the fields starting with .INCLU

*  DELETE it_fields WHERE fieldname CP '.INCLU*'.

***--Display the first 150 fields of the table

*  LOOP AT it_fields INTO wa_fields TO 150.

*    lv_cnt = lv_cnt + 1.

*    wa_cat-tabname = .

*    wa_cat-fieldname = wa_fields-fieldname.

*    wa_cat-col_pos = lv_cnt.

*    wa_cat-inttype = wa_fields-inttype.

*    wa_cat-datatype = wa_fields-datatype.

*    wa_cat-intlen = wa_fields-intlen.

*    wa_cat-seltext = wa_fields-fieldname.

*    wa_cat-decimals = wa_fields-decimals.

*    wa_cat-ref_field = wa_fields-fieldname.

*    wa_cat-ref_table = .

*    APPEND wa_cat TO it_cat.

*    CLEAR wa_cat.

*    wa_fname-fld = wa_fields-fieldname.

*    APPEND wa_fname TO it_fname.

*    CLEAR wa_fname.

*  ENDLOOP.

***--Create a dynamic internal table with the 150 fields

*  CALL METHOD cl_alv_table_create=>create_dynamic_table

*    EXPORTING

*      it_fieldcatalog = it_cat

*    IMPORTING

*      ep_table        = d_ref.

*  ASSIGN d_ref->* TO <f_fs>.

***--Populate the Where clause as a string

*  LOOP AT s_where.

*    CONCATENATE lv_where s_where-low INTO lv_where SEPARATED BY space.

*  ENDLOOP.

***--Select the data from the table given as input and populate

***--it into the dynamic internal table created based on the where condition

*  SELECT (it_fname)

*  FROM (p_tab)

*  INTO CORRESPONDING FIELDS OF TABLE <f_fs>

*  WHERE (lv_where).

***--If no entries are found that satisfies the selection criteria

*  IF sy-subrc <> 0.

*    MESSAGE i000(zz) WITH 'No data found'(010).

*  ENDIF.

ENDFORM. " FETCH_DATA

*&amp;---------------------------------------------------------------------

*&amp; Form genr_scr

*&amp;---------------------------------------------------------------------

* Display a screen with list of fields

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

FORM genr_scr.

**--If table in the parameter is not the same as the old table and

**--old table is not blank, then initialise all the variables associated

   IF  lv_ch1 NE gv_t_old AND gv_t_old IS NOT INITIAL.

     REFRESH: it_tabs, it_flds,

     gx_texpr, gx_twhere.

*    s_where, s_selop.

     CLEAR: gv_selid.

**--Pass current table parameter value to Old table parameter

     gv_t_old = lv_ch1.

   ENDIF.

**--Pass the current table name to old table variable

   IF gv_t_old EQ space.

     gv_t_old = lv_ch1.

   ENDIF.

**--Check if table name is given before clicking the button

   IF  lv_ch1 IS INITIAL.

*    MESSAGE e001 WITH 'Enter the Table name'(004).

   ENDIF.

**--Get the list of fields of a given table

   PERFORM get_selections.

**--If none of the fields, provide the list of fields for selecting

   IF it_flds[] IS INITIAL.

     CLEAR gv_selid.

     PERFORM select_fieldlist.

   ENDIF.

**--Show message if none of the fields are selected

   IF it_flds[] IS INITIAL.

*    MESSAGE s001 WITH 'No parameters selected'(005).

     EXIT.

   ENDIF.

**--Generate dynamic select-options

   REFRESH it_tabs.

   CLEAR : it_tabs, wa_tabs.

   wa_tabs-prim_tab = lv_ch1 .

   APPEND wa_tabs TO it_tabs.

   PERFORM set_values.

**--Generate Expression from Where clause

   CALL FUNCTION 'FREE_SELECTIONS_WHERE_2_EX'

     EXPORTING

       where_clauses        = gx_twhere

     IMPORTING

       expressions          = gx_texpr

     EXCEPTIONS

       incorrect_expression = 1

       OTHERS               = 2.

   IF sy-subrc NE 0.

*    MESSAGE i001 WITH 'Error in Dynamic screen generation'(009).

     EXIT.

   ENDIF.

   IF gx_texpr IS NOT INITIAL.

**--Populate values to select-options from expression

     PERFORM set_values.

   ENDIF.

**--Display screen with the fields listed

   IF gv_selid IS NOT INITIAL.

*    PERFORM call_screen.

   ENDIF.

ENDFORM. " genr_scr

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

**& Form CALL_SCREEN

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

** Call the screen to display the fields

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

*FORM call_screen.

*DATA : wa_where LIKE LINE OF gx_twhere,

*  lv_txt TYPE string.

*  lv_txt = 'Dynamic Selections Parameters for'.

*  CONCATENATE lv_txt

*  INTO gv_title SEPARATED BY space.

*  CALL FUNCTION 'FREE_SELECTIONS_DIALOG'

*    EXPORTING

*      selection_id            = gv_selid

*      title                   = gv_title

*      tree_visible            = ' '

*    IMPORTING

*      where_clauses           = gx_twhere

*      expressions             = gx_texpr

*      number_of_active_fields = gv_actnum

*    TABLES

*      fields_tab              = it_flds

*    EXCEPTIONS

*      internal_error          = 01

*      no_action               = 02

*      no_fields_selected      = 03

*      no_tables_selected      = 04

*      selid_not_found         = 05.

*  IF sy-subrc EQ 0.

**    REFRESH: s_where, s_selop.

***--Populate the Where clause with selected values

**    s_where-sign = gc_i.

**    s_where-option = gc_eq.

*    CLEAR wa_where.

*    READ TABLE gx_twhere INDEX 1 INTO wa_where.

**    LOOP AT wa_where-where_tab INTO s_where-low.

**      APPEND s_where.

**    ENDLOOP.

***--Populate all the fields

**    s_selop-sign = gc_i.

**    s_selop-option = gc_eq.

**    CLEAR : wa_flds.

**    LOOP AT it_flds INTO wa_flds.

**      s_selop-low = wa_flds-fieldname.

**      APPEND s_selop.

**    ENDLOOP.

*  ENDIF.

*ENDFORM. " CALL_SCREEN

*&amp;---------------------------------------------------------------------

*&amp; Form SELECT_FIELDLIST

*&amp;---------------------------------------------------------------------

* Display the list of fields

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

FORM select_fieldlist.

   CLEAR: it_dd03l[], it_dd03l,

   gv_tbname.

**--Get field names for given table

   SELECT tabname

   fieldname

   keyflag

   rollname

   position

   FROM dd03l

   INTO TABLE it_dd03l

   WHERE tabname EQ

   lv_ch1 AND fieldname NE 'MANDT'.

   IF sy-subrc = 0.

     SORT it_dd03l BY position.

     DELETE it_dd03l WHERE fieldname CP '.INCLU*'.

   ENDIF.

**--Get the description of the fields

   LOOP AT it_dd03l INTO wa_dd03l.

     IF NOT wa_dd03l-rollname IS INITIAL.

       SELECT SINGLE ddtext

       FROM dd04t

       INTO wa_dd03l-ddtext

       WHERE rollname EQ wa_dd03l-rollname

       AND ddlanguage = sy-langu

       AND as4local = 'A'.

       MODIFY it_dd03l FROM wa_dd03l.

     ELSE.

       SELECT SINGLE ddtext

       FROM dd03t

       INTO wa_dd03l-ddtext

       WHERE tabname EQ wa_dd03l-tabname

       AND ddlanguage = sy-langu

       AND as4local = 'A'

       AND fieldname = wa_dd03l-fieldname.

       MODIFY it_dd03l FROM wa_dd03l.

     ENDIF.

   ENDLOOP.

   gv_tbname = lv_ch1.

**--Display screen with the fields listed for the given table

   CALL SCREEN 100 STARTING AT 3 2

   ENDING AT 70 22.

**--Clear all the fields selected

   CLEAR : it_flds, it_flds[], gv_tbname.

**--Populate the newly selected fields

   it_flds[] = it_temp[].

**--Clear temporary table with the fields selected

   CLEAR : it_temp, it_temp[].

   LOOP AT it_flds into wa_flds.

     wa_fname-fld = wa_flds-fieldname .

     append wa_fname to it_fname.

     CLEAR:wa_fname.

   ENDLOOP.

   CALL FUNCTION 'GUI_DOWNLOAD'

             EXPORTING

*             BIN_FILESIZE                    = 'I'

               FILENAME                        'C:\Desktop\Template.XLS'

              FILETYPE                        = 'DAT'

*             APPEND                          = 'X'

              WRITE_FIELD_SEPARATOR           = 'X'

*             HEADER                          = '00'

*             TRUNC_TRAILING_BLANKS           = ' '

*             WRITE_LF                        = 'X'

*             COL_SELECT                      = 'X'

*             COL_SELECT_MASK                 = 'X'

*             DAT_MODE                        = 'X'

*             CONFIRM_OVERWRITE               = ' '

*             NO_AUTH_CHECK                   = ' '

              CODEPAGE                        = ' '

*             IGNORE_CERR                     = ABAP_TRUE

*             REPLACEMENT                     = '#'

*             WRITE_BOM                       = ' '

*             TRUNC_TRAILING_BLANKS_EOL       = 'X'

*             WK1_N_FORMAT                    = ' '

*             WK1_N_SIZE                      = ' '

*             WK1_T_FORMAT                    = ' '

*             WK1_T_SIZE                      = ' '

*             WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE

*             SHOW_TRANSFER_STATUS            = ABAP_TRUE

*             VIRUS_SCAN_PROFILE              = '/SCET/GUI_DOWNLOAD'

*           IMPORTING

*             FILELENGTH                      =

             TABLES

               DATA_TAB                        = it_temp

              FIELDNAMES                      = it_fname

            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.

* Implement suitable error handling here

           ENDIF.

ENDFORM. " SELECT_FIELDLIST

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

*& Form GET_SELECTIONS

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

* Fetch the fields in the table given

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

FORM get_selections.

   DATA : wa_where LIKE LINE OF gx_twhere.

   REFRESH: it_flds, gx_twhere.

   CLEAR : wa_flds.

   wa_flds-tablename = lv_ch1 .

   wa_flds-type = 'S'.

*  LOOP AT s_selop.

***--Populate all the fields selected that are previously selected

*    wa_flds-fieldname = s_selop-low.

*    APPEND wa_flds TO it_flds.

*  ENDLOOP.

*  IF s_where[] IS NOT INITIAL.

***--Populate values to where condition if any data is previously given

***--to the dynamic select-options

*    wa_where-tablename = p_tab.

*    LOOP AT s_where.

*      APPEND s_where-low TO wa_where-where_tab.

*    ENDLOOP.

*    APPEND wa_where TO gx_twhere.

*ENDIF.

   ENDFORM. " GET_SELECTIONS

*&amp;---------------------------------------------------------------------

*&amp; Form SET_VALUES

*&amp;---------------------------------------------------------------------

* Set the values to the select-options

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

FORM set_values.

*  CALL FUNCTION 'FREE_SELECTIONS_INIT'

*    EXPORTING

*      kind                     = 'T'

*      expressions              = gx_texpr

*    IMPORTING

*      selection_id             = gv_selid

*      number_of_active_fields  = gv_actnum

*    TABLES

*      tables_tab               = it_tabs

*      fields_tab               = it_flds

*    EXCEPTIONS

*      fields_incomplete        = 01

*      fields_no_join           = 02

*      field_not_found          = 03

*      no_tables                = 04

*      table_not_found          = 05

*      expression_not_supported = 06

*      incorrect_expression     = 07

*      illegal_kind             = 08

*      area_not_found           = 09

*      inconsistent_area        = 10

*      kind_f_no_fields_left    = 11

*      kind_f_no_fields         = 12

*      too_many_fields          = 13.

ENDFORM. " SET_VALUES

*tables:x030l.

*

*

*TYPES: BEGIN OF ty_NAME ,

*        FIELDNAME LIKE DD03L-FIELDNAME,

*        SCRTEXT_S LIKE DD04T-SCRTEXT_S,

*        SCRTEXT_M LIKE DD04T-SCRTEXT_M,

*        SCRTEXT_L LIKE DD04T-SCRTEXT_L,

*        FIELDTEXT LIKE DD04T-DDTEXT,

*      END OF ty_NAME.

*

*DATA:l_dfies TYPE STANDARD TABLE OF dfies,

*     WA_dfies TYPE  dfies,

*     IT_KNA1 TYPE TABLE OF X031L.

*

*DATA:IT_TEXT TYPE TABLE OF ty_NAME.

*

*DATA:i_tab1 TYPE TABLE OF X031L.

*FIELD-SYMBOLS:<l_dfies> TYPE dfies,

*              <i_tab> TYPE ty_name.

**              <i_tab1> TYPE X031L.

*DATA: LV_FKEY(1) TYPE X VALUE '01'.

*

*data:it_name TYPE TABLE OF X031L,

*     it_name1 TYPE TABLE OF X031L,

*      wa_name TYPE X031L,

*      it_ret TYPE TABLE OF X031L,

*      wa_ret TYPE X031L.

*

*SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

*

*  PARAMETERS:p_rb1 TYPE c RADIOBUTTON GROUP rb1 USER-COMMAND ucomm DEFAULT 'X',

*             p_rb2 TYPE c RADIOBUTTON GROUP rb1.

*

*SELECTION-SCREEN END OF BLOCK b1 .

*

*if p_rb1 = 'X'.

*SELECTION-SCREEN BEGIN OF block b2 with FRAME TITLE text-002.

*

*  PARAMETERS: AS CHECKBOX MODIF ID a1.

*

*

*

*SELECTION-SCREEN END OF BLOCK b2.

*

*endif.

*

*

*IF  = 'X'.

*

*

*

***--Fetch Field details of table

*  CALL FUNCTION 'DDIF_FIELDINFO_GET'

*    EXPORTING

*      tabname   = 'KNA1'

*    IMPORTING

*      x030l_wa  = x030l

*    TABLES

*      dfies_tab = l_dfies

*    EXCEPTIONS

*      others    = 0.

*

*  LOOP AT l_dfies ASSIGNING <l_dfies>.

*

*

*    APPEND INITIAL LINE TO IT_TEXT ASSIGNING <i_tab>.

*

*    <i_tab>-FIELDNAME     = <l_dfies>-FIELDNAME.

*

*

*

*    IF NOT <l_dfies>-SCRTEXT_L IS INITIAL.

*      <i_tab>-SCRTEXT_L     = <l_dfies>-SCRTEXT_L.

*    ELSEIF not <l_dfies>-SCRTEXT_M IS INITIAL.

*      <i_tab>-SCRTEXT_M     = <l_dfies>-SCRTEXT_M.

*    ELSEIF not <l_dfies>-SCRTEXT_S IS INITIAL.

*      <i_tab>-SCRTEXT_S    = <l_dfies>-SCRTEXT_S.

**    ELSEIF not <l_dfies>-REPTEXT   IS INITIAL.

**      <i_tab>-SCRTEXT_M     = <l_dfies>-REPTEXT.

*    ENDIF.

*

*

*

*

*  MOVE-CORRESPONDING <L_DFIES> TO WA_NAME.

*

*   WA_NAME-DTYP = <l_dfies>-datatype.

*   WA_NAME-EXID  = <l_dfies>-INTtype.

*   WA_NAME-exlength = <l_dfies>-outputlen.

*   WA_NAME-dblength = <l_dfies>-leng.

*   if not <l_dfies>-keyflag is initial.

*        WA_NAME-flag1 = LV_fkey.

*      endif.

*   APPEND WA_NAME TO IT_NAME.

*   IT_RET = IT_NAME.

*   IT_NAME1 = IT_NAME.

*  ENDLOOP.

*

*

*  CALL FUNCTION 'RS_DATABROWSE_FIELDSELECT'

*    EXPORTING

*      TABNAME             = 'KNA1'

*     ACTION_2            = 'X'

**   IMPORTING

**     OKCODE              =

*    TABLES

*      NAME_TAB            = it_name

*      RETT_NAME_TAB       = it_ret

*      TAB2_FIELD          = IT_NAME1

*            .

*

*

*ENDIF.

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

*&      Module  STATUS_0100  OUTPUT

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

*       text

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

MODULE STATUS_0100 OUTPUT.

    DATA: lv_txt TYPE string.

  lv_txt = 'Selection Paramters List'(008).

   SET PF-STATUS 'ZSELECTION'.

   LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

   SUPPRESS DIALOG.

   MOVE lv_txt TO sy-title.

**--display list of fields that can be selected for creating dynamic select-options

   LOOP AT it_dd03l INTO wa_dd03l.

     AT FIRST.

       WRITE: (60) sy-uline.

     ENDAT.

     READ TABLE it_flds INTO wa_flds WITH KEY fieldname = wa_dd03l-fieldname.

     IF sy-subrc NE 0.

       CLEAR gv_temp.

     ELSE.

       gv_temp = 'X'.

     ENDIF.

     WRITE:/ '|' ,gv_temp AS CHECKBOX.

     WRITE: (20) wa_dd03l-fieldname,'|', wa_dd03l-ddtext, AT 60 '|'.

     HIDE: gv_temp, wa_dd03l-fieldname, wa_dd03l-keyflag.

     AT LAST.

       WRITE: (60) sy-uline.

     ENDAT.

   ENDLOOP.

ENDMODULE.                 " STATUS_0100  OUTPUT