Application Development and Automation 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: 
Read only

about selection screen

Former Member
0 Likes
1,228

Hi Experts,

I want to add a field in selection screen for giving a path for selecting excel sheet by using parameter concept.

Pls can any body help me.

Thanks,

Kaladhar.

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
1,204

Hi Kalandar,

Check below sample code.


PARAMETERS : p_fname LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM open_folder.

FORM open_folder .
  DATA: li_file  TYPE TABLE OF sdokpath,
        lwa_file TYPE sdokpath.
  CLEAR: p_fname, lwa_file.
  REFRESH li_file[].
  CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
       TABLES
            file_table = li_file
       EXCEPTIONS
            cntl_error = 1
            OTHERS     = 2.
  IF sy-subrc IS INITIAL.
    READ TABLE li_file INTO lwa_file INDEX 1.
    IF sy-subrc IS INITIAL.
     p_fname = lwa_file-pathname.
    ENDIF.
  ENDIF.
ENDFORM.                    " open_folder

Just copy paste above code. U will come to know how it works.

Thanks,

Vinod.

13 REPLIES 13
Read only

Former Member
0 Likes
1,204

declare as :

Parameters : p_file like rlgrap-filename.

Read only

Former Member
0 Likes
1,204

Hi,

Use the parameter file name strtucture as

RLGRAP-FILENAME and RLGRAP-FILETYPE for excel sheet

In the CL_GUI_FROTNEND_SERVICES->FILE_OPEN_DIALOG we can pass this parameter by converting it to in String type

Thanks & Regards,

Chandralekha.

Read only

Former Member
0 Likes
1,204

hi,

use as....parameters : p_fname type rlgrap-filename,

at selection-screen on value-request for p_fname.

call function 'KD_GET_FILENAME_ON_F4'

exporting

program_name = 'Z_MM_MATERIAL_UPLOAD'

dynpro_number = '1000'

field_name = 'P_FNAME'

changing

file_name = p_fname.

Read only

Former Member
0 Likes
1,204

hi,

Declare Parameter like

p_fname type rlgrap-filename

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
1,204

Hi,

check this:

parameters: p_file like rlgrap-filename default 'd:\testfile.xml'.

Regards

Adil

Read only

Former Member
0 Likes
1,204

Hi,

SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE tit.

SELECTION-SCREEN BEGIN OF LINE.

SELECT-OPTIONS: Ymatnr FOR ZMARA-MATNR NO INTERVALS .

PARAMETERS Mdesc TYPE ZMAKT-MAKTX .

PARAMETERS Path TYPE STRING .

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK mysel.

I hope this will help u...

Thanks & Regards

Ashu Singh.

Read only

Former Member
0 Likes
1,204

hi...

use like this.

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

PARAMETERS: p_emp LIKE rlgrap-filename,

SELECTION-SCREEN END OF BLOCK block1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_emp.

REFRESH: it_tabemp.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

window_title = 'Select File'

default_filename = '*.xls'

initial_directory = 'C:\'

multiselection = ' ' "No multiple selection

CHANGING

file_table = it_tabemp

rc = gd_subrcemp.

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,205

Hi Kalandar,

Check below sample code.


PARAMETERS : p_fname LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM open_folder.

FORM open_folder .
  DATA: li_file  TYPE TABLE OF sdokpath,
        lwa_file TYPE sdokpath.
  CLEAR: p_fname, lwa_file.
  REFRESH li_file[].
  CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
       TABLES
            file_table = li_file
       EXCEPTIONS
            cntl_error = 1
            OTHERS     = 2.
  IF sy-subrc IS INITIAL.
    READ TABLE li_file INTO lwa_file INDEX 1.
    IF sy-subrc IS INITIAL.
     p_fname = lwa_file-pathname.
    ENDIF.
  ENDIF.
ENDFORM.                    " open_folder

Just copy paste above code. U will come to know how it works.

Thanks,

Vinod.

Read only

Former Member
0 Likes
1,204

Hi Kaladhar.

I would like to suggest,

1. In Parameters,

parameters:
  p_file like rlgrap-filename.

2. Declaring a variable,

DATA:
 w_file TYPE string.

3. Equating the parameter with variable,

w_file = p_file.

4. Calling a function module like: GUI_DOWLOAD/GUI_UPLOAD.

In Exporting Parameters,

With filename -


> w_file.

and accordingly the file extension for EXCEL.

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Read only

Former Member
0 Likes
1,204

Hi,

Check this link-You wil get the sample code-

Regards,

sujit

Read only

Former Member
0 Likes
1,204

Hi,

Please refer the code below:


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

  parameter: p_file like IBIPPARMS-PATH obligatory.

  SELECTION-SCREEN:END OF BLOCK B1.

at selection-screen ON VALUE-REQUEST FOR p_file .
  perform get_filename.
FORM upload_data.


  CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
         FILENAME                      = p_file
         FILETYPE                      = 'DAT'
      TABLES
          DATA_TAB                      = IT_MATERIAL
      EXCEPTIONS
         CONVERSION_ERROR              = 1
         INVALID_TABLE_WIDTH           = 2
         INVALID_TYPE                  = 3
         NO_BATCH                      = 4
         UNKNOWN_ERROR                 = 5
         GUI_REFUSE_FILETRANSFER       = 6
         OTHERS                        = 7.

  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,204

Hi,

Declare a parameter of type rlgrap-filename

eg. p_file type rlgrap-filename.

and provide the F4 help for the parameter in

at selection screen on value-request for p_file.

Use function module F4_FILENAME

regards

padma

Read only

Former Member
0 Likes
1,204

Hi Kaladhar,

Use the function Module 'F4_FILENAME'.

CALL FUNCTION 'F4_FILENAME'
* EXPORTING
*   PROGRAM_NAME        = SYST-CPROG
*   DYNPRO_NUMBER       = SYST-DYNNR
*   FIELD_NAME          = ' '
 IMPORTING
   file_name           = file_path.

file_path would be of type ibipparms-path,

Hope this helps you.

Regards,

Chandra Sekhar