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

problem in getting physical path name

Former Member
0 Likes
962

Hi,

I have a selection screen, In that i want to create a field, where for this field, if i press F4 windows pop up should come, where i can see the local hard disk file. From this i can go and click the file, then the complete path should come in the selection screen field.How should i do this. plz help, me it is very urgent.

Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
909
9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
909

Simple way is to do this.



report zrich_0001.

parameters: p_file1 type localfile default'C:test.txt'.

at selection-screen on value-request for p_file1.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = p_file1.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
909

Hi,

Use F4_FILENAME at AT SELECTION-SCREEN event.

Read only

venkata_ramisetti
Active Contributor
0 Likes
909

Hi,

parameters: p_file1 like rlgrap-filename.

at selection-screen on value-request for p_file1.

data: l_file like ibipparms-path, "Local file for upload/download

l_repid like syst-cprog, "ABAP program, caller in external

"procedures

l_dynnr type syst-dynnr. "ABAP program, number of current

"screen

l_repid = sy-cprog.

l_dynnr = sy-dynnr.

move: filename to l_file.

call function 'F4_FILENAME'

exporting

program_name = l_repid

dynpro_number = l_dynnr

field_name = 'P_FIEL1'

importing

file_name = l_file.

move: l_file to filename.

tHANKS,

Ramakrishna

Read only

0 Likes
909

Thank you so much all.

I also has one more requiremt.

ON the output list, i need to download the list to a file locally. I have created a button on a appn toolbar.

If i click the button i should get the same pop up and if i give the name of the file, the list should be saved i that file in particular path.

Plz help me and make my object done.

thanks you all once again.

Kumar

Read only

0 Likes
909

Hi,

YOu can use FM DOWNLOAD function module. It shows the popup automatically,

Thanks,

Ramakrishna

Read only

0 Likes
909

No ramakrishna,

I think download is for the internal table data download.

but i want to download the list with one click.

do anybody has any links on this. previously this question may ask.

kindly tell me..

Kumar

Read only

0 Likes
909

Hi Nitin,

I think you can use CODE similar to below.

Check the function module SXMI_XMB_SYSLOG_READ for more details. It contains similar logic.

SUBMIT RSLG0000 LINE-SIZE 255

WITH TR_TERM EQ '*'

WITH TR_DATE EQ FROM_DATE

WITH TR_TIME EQ FROM_TIME

WITH TR_EDATE EQ TO_DATE

WITH TR_ETIME EQ TO_TIME

WITH TR_CPU EQ SERVER_NAME

  • WITH TR_PAGES EQ '003' " Begrenzung Anzahl Seiten

WITH TR_USER EQ LOOKING_FOR_USER

WITH NOCODEVC EQ 'X'

WITH NOCOTASK EQ 'X'

WITH NOCOMAND EQ 'X'

WITH NOCOTRAN EQ 'X'

WITH NOCOTERM EQ 'X'

EXPORTING LIST TO MEMORY

AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LIST_IN_MEMORY

EXCEPTIONS

OTHERS = 99.

Thanks,

Ramakrishna

Message was edited by: Ramakrishna Prasad Ramisetti

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
909

Here is another way....



report zrich_0001.

data: ifiletable type filetable.
data: xfiletable like line of ifiletable.
data: rc type i.

parameters: p_file1 type localfile default'C:test.txt'.

at selection-screen on value-request for p_file1.

call method cl_gui_frontend_services=>file_open_dialog
   EXPORTING
*    WINDOW_TITLE            =
*    DEFAULT_EXTENSION       =
*    DEFAULT_FILENAME        =
*    FILE_FILTER             =
     INITIAL_DIRECTORY       = 'C:'
*    MULTISELECTION          =
  changing
    file_table              = ifiletable
    rc                      = rc
*    USER_ACTION             =
  EXCEPTIONS
    FILE_OPEN_DIALOG_FAILED = 1
    CNTL_ERROR              = 2
    ERROR_NO_GUI            = 3
    others                  = 4.
        .
 read table ifiletable into xfiletable index 1.
 if sy-subrc = 0.
  p_file1 = xfiletable-FILENAME.
 endif.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
910