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: 

Uploading and reading file from application server

paruchuri_nagesh
Active Contributor
0 Kudos

Hi

My problem is when am uploading a file to application server it is getting stored in

usr/sap/transyp1/prod/in directory

after that i want to read that file from application server to update database

when using below code it is showing some other directory in f4 help

DATA: lv_hostname TYPE msxxlist-name.

DATA: lv_server TYPE bank_dte_jc_servername.

PARAMETERS: p_file TYPE rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'BANK_API_SYS_GET_CURR_SERVER'

IMPORTING

e_server = lv_server.

lv_hostname = lv_server.

CALL FUNCTION 'F4_DXFILENAME_4_DYNP'

EXPORTING

dynpfield_filename = 'P_FILE'

dyname = sy-cprog

dynumb = '1000'

filetype = 'P'

location = 'A'

server = lv_hostname.

experts could you please help me out

Thanks & Regards

Nagesh.Paruchuri

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think it default to some other location . from the F4 you select double dot(..) second file it will go up one folder....and like that you move to the relevant path....

Regards

Muthappan

3 REPLIES 3

Former Member
0 Kudos

I think it default to some other location . from the F4 you select double dot(..) second file it will go up one folder....and like that you move to the relevant path....

Regards

Muthappan

0 Kudos

Hi

thank you very much

How can i show exact path in f4 help?

Thanks & Regards

Nagesh.Paruchuri

0 Kudos

User Transaction file. You will get all logical file path names.

used following fucntion module to read file name and use command open dataset to read the file.

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

CLIENT = SY-MANDT

LOGICAL_FILENAME = C_LOGICAL_FILENAME

OPERATING_SYSTEM = SY-OPSYS

PARAMETER_1 = P_IN_FILENAME

IMPORTING

FILE_NAME = P_OUT_FILENAME

EXCEPTIONS

FILE_NOT_FOUND = 1

OTHERS = 2.

OPEN DATASET P_OPEN_FILE ENCODING UTF-8 IN TEXT MODE FOR OUTPUT.

IF SY-SUBRC <> 0.

MESSAGE E000(38) WITH 'Error in Opening file: ' V_PHY_FILENAME.

ENDIF.