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

File upload through SAP Query Program

Rocky1
Product and Topic Expert
Product and Topic Expert
0 Likes
694

Hi Experts,

I have a reqirement, where I need to upload a file through Query program. But to upload file, when I am writing the following code to locate file name,

SELECTION-SCREEN BEGIN OF BLOCK main.

PARAMETERS p_file TYPE rlgrap-filename OBLIGATORY." OBLIGATORY.

SELECTION-SCREEN END OF BLOCK main.

AT SELECTION SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

IMPORTING

file_name = p_file.

It is throwing a dump because AT SELECTION SCREEN cannot be used in SAP Query. If I manually write the whole path in the parameter that i have declared, then everything is working fine. Issue is just to locate file. Is there any way to achieve the same. Any help on this will be highly appreciated.

Thanks & Regards

Rocky

3 REPLIES 3
Read only

Former Member
0 Likes
519

Hi Rocky,

only paramters defined in infoset can be used for Event AT SELECTION SCREEN.

Try to call function 'F4_FILENAME' after exectuing the report after START-OF-SELECTION.

regards

REA

Read only

Rocky1
Product and Topic Expert
Product and Topic Expert
0 Likes
519

Hi,

Thanks for responding. Can you explain it. it is not clear to me. I wrote the code in the 'Data read program' tab in infoset.

Here AT SELECTION SCREEN or START OF SELECTION event is not allowed.

Thanks & Regards

Rocky

Read only

0 Likes
519

Hi Rocky,

you dont have to declare selection-Screen etc.

Within your infoset you have to:

1. tab selections: declare parameter p_file

2. tab code: choose coding section "at selection-screen" for p_file and insert your function call

regards

rea

Edited by: Ramy EL-ARNAOUTY on Feb 9, 2010 5:35 PM