Skip to Content

File upload through SAP Query Program

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2010 at 12:25 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Rocky Kumar Agarwal

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.