How to give path at runtime in GUI_DOWNLOAD

Hi experts,
I have a below given parameter on the selection screen:
SELECTION-SCREEN: BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.
PARAMETERS: p_path LIKE RLGRAP-FILENAME modif id ZF1.
SELECTION-SCREEN: END OF BLOCK b5.
I am using the FM GUI_DOWNLOAD in my report.
My requirement is that I need to pass the path given
in p_path in this FM, i.e. I need not hard code the path in the
FM parameter 'filename', but need to pass it at runtime.
How can this functionality be achieved?
Thanks,
Ajay.

Hi Ajay,
check the below code i hope it will help you.
SELECTION-SCREEN BEGIN OF BLOCK upfile WITH FRAME TITLE text-009.
PARAMETERS: p_file     TYPE rlgrap-filename OBLIGATORY.       "Source  file name
SELECTION-SCREEN END OF BLOCK upfile.
*AT SELECTION-SCREEN
Browse source file name
  AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
   PERFORM f_browse_file CHANGING p_file.
FORM f_browse_file CHANGING p_p_file.
  DATA: it_l_filetab  TYPE filetable,
        wa_l_filetab  TYPE file_table,
        l_rc          TYPE i.
  CLEAR it_l_filetab.
Browsing file
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    CHANGING
      file_table              = it_l_filetab
      rc                      = l_rc
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.
  IF sy-subrc IS NOT INITIAL.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    READ TABLE it_l_filetab INTO wa_l_filetab INDEX 1.
    IF sy-subrc IS INITIAL.
      p_p_file = wa_l_filetab-filename.
    ENDIF. " sy-subrc  Read
  ENDIF. " sy-subrc-call method
ENDFORM.                    " f_browse_file
START-OF-SELECTION.
*Upload File
  PERFORM f110_upload_from_pc.
FORM f110_upload_from_pc .
DATA :  lv_file TYPE rlgrap-filename.
  DATA :  l_files TYPE string,
          l_ret   TYPE abap_bool.
  CLEAR  it_file_data.
  lv_file = p_file.
  l_files = p_file.
  CONSTANTS: c_tab    TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = l_files
      filetype                = 'ASC'
      has_field_separator     = c_tab
     codepage                = '6300'
     READ_BY_LINE            = 'X'
     replacement             = '-'
    TABLES
      data_tab                = i_tab_order
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      OTHERS                  = 17.
  IF sy-subrc <> 0.
    MESSAGE 'Error in upload'(008) TYPE 'I' DISPLAY LIKE 'E' .
    LEAVE TO LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " f_UPLOAD_FROM_PC
I hopr this will helps you
Regards,
Tarun
Edited by: Devalla T Kumar on Dec 29, 2009 9:54 AM

Similar Messages

  • How to give path in Runtime. exec( )

    Hi,
    I am trying to create an user interface, in which, it should open a different file (for example, example.doc)when a button is clicked in the applet. let us say, the path for example.doc is "C:\\WINDOWS\\DeskTOP\\folder1".
    I tried with the following code
    Runtime.getRuntime().exec("C:\\WINDOWS\\Desktop\\folder1\\example.doc");
    but, when I click on the button it is not opening example file and I am getting an exception. I am using Runtime.exec() command for the first time.Anybody can help me with this???

    Since when was a document an executable? The main problem is many people think Runtime.exec () is the same thing as the command line. The answer is, it's not. Typing "example.doc" in the windows terminal emulator (also known as cmd.exe in Windows 2000/XP or command.com in others) will work because example.doc is opened with the application configured to open files with the ".doc" extension.
    However, files ending with ".doc" are not executables. If you wish to open a ".doc" file with the associated application, try this: Runtime.getRuntime ().exec ("cmd /c example.doc"); Not that I don't know if this will work with command.com as I haven't tried, but it should work with cmd.exe without problems.
    Hope it helps.
    Cheers

  • How to give valut at runtime in adobe

    Hi
    Suppose made four fields in adobe and connected it to any function module ( by data connection). Now i how to validate these fields using java script and give values at runtime. One more problem is that if i give different names to fields in function modules and in adobe designer then which name is used to validate the field. on more thing if i don't know the name of function module which is binded to fields in adobe then how to get the the name of these fields.
    Thanks in advance
    Regards
    Aditya

    Hi,
    You can either go by field names in the hierarchy or try out the binding values using '$record.<field>.****....'. PLease refer the scripting guide <a blog is available on this in SDN> or the Adobe Designer help for basics.
    Thanks and Regards,
    Anto.

  • How to give grants on runtime objects

    Hi,
    I have created read only apps user,but i want to have a trigger/procedure which should give grant at runtime when the object i.e synnonym/view created in apps user.
    I have tried the anil passi read only apps user-trigger but it is throwing errors in alert log.
    the trigger need to be corrected can any one help on this as it became an urgent issue.
    with regards,
    Surya

    Hi,
    Can anyone help on this,
    (A)
    The command which am using is
    Create a Trigger on the apps schema to issue select only grants for all new views and synonyms. Please note that I am excluding grants for sequences. SELECT grants for views and synonyms will be provided to apps_query as and when such objects are created in APPS. Please note that, all the APPS objects (views and synonyms) that existed in APPS schema prior to the implementation of this design, would have been granted read-only access to apps_query in Step 2.
    conn apps/&1 ;
    PROMPT CREATE OR REPLACE TRIGGER xx_grant_apps_query
    CREATE OR REPLACE TRIGGER xx_grant_apps_query
    AFTER CREATE ON APPS.SCHEMA
    DECLARE
    l_str VARCHAR2(255);
    l_job NUMBER;
    BEGIN
    IF (ora_dict_obj_type IN ('SYNONYM', 'VIEW'))
    AND (ora_dict_obj_name NOT LIKE '%_S')
    THEN
    l_str := 'execute immediate "grant select on ' || ora_dict_obj_name ||
    ' to apps_query";';
    dbms_job.submit(l_job, REPLACE(l_str, '"', ''''));
    END IF;
    END;
    (b)
    The error in alert log as follows---------
    Errors in file /db002/oracle/dnddb/9.2.0/admin/dnd_cdx16/bdump/dnd_j001_15164.trc:
    ORA-12012: error on auto execute of job 2290
    ORA-01031: insufficient privileges
    ORA-06512: at line 1
    as this job trying to "grant select on read only apps user".
    2)For testing i have created a synonym in apps where i have encountered this type of errors in the alertlog.
    The way i have checked the trigger,
    a) I have created a custom schema (user A) after that i have created a table in the custom schema.
    b)Based on the object of user A i have created a synonym on that table in apps(user B).
    After that i have tried to retrive the same synonym in read only apps user(user C).
    as am able to see the data in user C.But there is errors as above in alert log.
    Plz help in this situation.
    with regards,
    Surya
    Edited by: SuryaSrinivas on Jul 6, 2009 4:51 AM

  • How to give Path for a properties file

    Hi,
    I am using a SQL.properties file to load all my SQL statements to my EJB JDBC prepared Statement. I have placed the SQL.properties file in com.company.sql package. I have another SQL class in the same package which is loading the SQL.properties file to cache for future use. I am using the path as "SQL.properties" (the file name straight ) in the SQL class to access the properties file.
    I am using Sun App Server 7. To get access to this file I need to copy the SQL.properties file to the config directory of the app server instance. Otherwise it is not able to locate the file. I don't want to put the properties file in the config directory of the app server instance. Please help me, what path I have to give to access the file from the package itself, rather from the config directory of server instance.
    I think , some one who is doing localization can help me out here. They have to put the localized properties file to access the text out of it. Please help me. Thanks in advance.
    Thanks
    Amit

    You can use ResourceBundle class to load this properties file from the classpath:
    ResourceBundle props = null;
    props = ResourceBundle.getBundle("com.company.sql.SQL");

  • How to give path to a boilerplate developing in windows, deploy in Solaris

    Hi
    I want to add an image into my reports.
    I am developing the report in windows machine and deploy the report in UNIX machine.
    Could you please tell me how to do that?
    Regards

    Hi
    Thanks
    That is what I have done.
    When the report is executed I am generating a .pdf file.
    The .pdf file is generated appropriately, but the image is not shown.
    When I open the .pdf file it gives me *'insufficient data for an image'* error
    could you please help me in fixing this?
    regards

  • How to give jar at runtime as JVM parameter in Config tool

    Hi
    I am executing  java spring based webservice on WS navigator CE7.1 . I am getting the follwing error. To avoid this i have to provide the spring-agent.jar at runtime to the javm , I tried to configure the Configtool jvm parameters as specified in the sap help.
    Is is possible to give the jar as JVM param  via config tool.
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
        <ns2:po1ProcessingResponse xmlns:ns2="http://metering.com/greams/flowmanagement/inbound/">
          <return status="TECHNICAL_ERROR">
            <technicalErrors>
              <code>TECHNICAL_ERROR</code>
              <description>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.weaving.AspectJWeavingEnabler#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Initialization of bean failed; nested exception is java.lang.IllegalStateException: ClassLoader [com.sap.engine.boot.loader.ResourceMultiParentClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:spring-agent.jar</description>
              <additionalInformation>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.weaving.AspectJWeavingEnabler#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Initialization of bean failed; nested exception is java.lang.IllegalStateException: ClassLoader [com.sap.engine.boot.loader.ResourceMultiParentClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:spring-agent.jar</additionalInformation>
              <responseMessageCode>TECHNICAL_ERROR</responseMessageCode>
            </technicalErrors>
          </return>
        </ns2:po1ProcessingResponse>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    Have you checked note 1363755 - Integration of third party zipping library with 6.40 Engine
    It might be helpful for for your issue..
    Or check parameter   -Xrun<library>[:options]  load native agent library
    Kind regards,
    Mark
    Edited by: M. Dijsselbloem on Apr 8, 2010 3:02 PM

  • How to give paths to icons.

    ImageIcon audioIcon = new ImageIcon("music.gif");
    with this declaration, i can't see the icon,which is in the same folder with the source file. If i give the FULL path, everything is ok..
    the problem is that i want to create a JAR file, and of course i can't give any full path. What i want is to "say" to search at the same place where the class files of the JAR are..if i give only the name of the icon,the jar executes without showing the photo..if i give full path, it's ok but only at my pc where i have the icons in a certain folder..
    i'd be grateful to any suggestions as i'm a novice java developer

    The problem is when you are giving relative paths you should give it relatively to the working directory of your program not relatively to the Source path.

  • How to give path in plsql while exporting table data into .csv file

    hi,
    i have a code like this
    PROCEDURE dump_table_to_csv (
    p_tname IN VARCHAR2,
    p_dir IN VARCHAR2,
    p_filename IN VARCHAR2
    IS
    l_output UTL_FILE.file_type;
    l_thecursor INTEGER DEFAULT DBMS_SQL.open_cursor;
    l_columnvalue VARCHAR2 (4000);
    l_status INTEGER;
    l_query VARCHAR2 (1000) DEFAULT 'select * from ' || p_tname;
    l_colcnt NUMBER := 0;
    l_separator VARCHAR2 (1);
    l_desctbl DBMS_SQL.desc_tab;
    BEGIN
    l_output := UTL_FILE.fopen (p_dir, p_filename, 'w');
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''';
    DBMS_SQL.parse (l_thecursor, l_query, DBMS_SQL.native);
    DBMS_SQL.describe_columns (l_thecursor, l_colcnt, l_desctbl);
    FOR i IN 1 .. l_colcnt
    LOOP
    UTL_FILE.put (l_output,
    l_separator || '"' || l_desctbl (i).col_name || '"'
    DBMS_SQL.define_column (l_thecursor, i, l_columnvalue, 4000);
    l_separator := ',';
    END LOOP;
    UTL_FILE.new_line (l_output);
    l_status := DBMS_SQL.EXECUTE (l_thecursor);
    WHILE (DBMS_SQL.fetch_rows (l_thecursor) > 0)
    LOOP
    l_separator := '';
    FOR i IN 1 .. l_colcnt
    LOOP
    DBMS_SQL.column_value (l_thecursor, i, l_columnvalue);
    UTL_FILE.put (l_output, l_separator || l_columnvalue);
    l_separator := ',';
    END LOOP;
    UTL_FILE.new_line (l_output);
    END LOOP;
    DBMS_SQL.close_cursor (l_thecursor);
    UTL_FILE.fclose (l_output);
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-MON-yy'' ';
    EXCEPTION
    WHEN OTHERS
    THEN
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-MON-yy'' ';
    RAISE;
    END;
    I am getting error like :-------
    SQL> exec dump_table_to_csv('deptair','c:/csv','aa.deptair');
    BEGIN dump_table_to_csv('deptair','c:/csv','aa.deptair'); END;
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 8
    ORA-29280: invalid directory path
    ORA-06512: at "SCOTT.DUMP_TABLE_TO_CSV", line 58
    ORA-06512: at line 1
    pplease help me out
    thanks
    vicky

    look at your other thread, answer is already there.

  • How to give path of tablename in Schema in RCU?

    How to use Report Action in OSB?
    How to Report the messages in the database of a system?
    I already have done RCU installation.
    IN RCU we know how to mention schema names but how to mention correct tablename where Reports gets stored is still a grey area..
    Kindly,Suggest
    Aryashree......

    How to use Report Action.?
    Regards,
    Anuj

  • How to get object-path at runtime

    Hi, In my application paths of particular controls(radio buttons and links) get changed at runtime. Therefore I cant access those objects. It would be helpful if somebody guide me how to get paths of objects(controls) at runtime. To be more specific following are the paths procured on different time ie. on different runs.
    "window(name='incident173747')[1].window(name='ifrmTabWindow')[1].input(name='generateQuote')[1]"
    "window(name='incident173750')[1].window(name='ifrmTabWindow')[1].input(name='generateQuote')[1]"
    One can see only first window name is changed here.In first case it is :
    name='incident173747'
    while in the second one it's:
    name='incident173750'

    Hi Vivek555,
    How do you know which radio button or link you want to click on? If each one is called generateQuote, what is in on the page that says "This is the one I want to click on".
    Please give a snippet of the html for the page so that we can help you out.
    Thanks,
    Kevin Gehrke
    Empirix, Inc.

  • How to give dynamic file path in the selection  screen

    Hi All,
    How to give dynamic file path f4 functionality to user on the selection so that he can browse for the path in the presentation serve? I believe there is one fun module is there for this purpose I am not getting that
    Please help me in this regard.
    Thanks&Regards
    Mahesh

    HI,
    check this program.
    <b>report ZWA_TEST2.
    PARAMETERS: a(100) default 'PRESS F4'.
    data: filet type table of FILE_TABLE.
    data: wa type file_table.
    data: count type i.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR a.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      CHANGING
        FILE_TABLE              = filet
        RC                      = count .
    loop at filet into wa.
      a = wa-FILENAME.
    endloop.</b>
    Regards,
    HRA

  • How to give manual font path location when document opening?

    Hi,
    I want to know how to give manual path location for fonts when document opening like LinoType FontExplorerX, Font Book, UTS. Please Help me its very urgent
    Thanks

    Hi, I am doing the code likthis,please give the solution.
    SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    2 insCtx DBMS_XMLSave.ctxType;
    3 l_ctx dbms_xmlsave.ctxtype;
    4 rows number;
    5 begin
    6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    9 end;
    10 /
    Procedure created.
    SQL> begin
    2 insProc('/usr/tmp/ROWSET.xml', 'emp');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 7
    ORA-06512: at line 2
    Kishore B

  • How to give network path while creating oracle directory.

    I have created
    CREATE OR REPLACE DIRECTORY TESTDIR AS '\\168.176.33.117\TESTDIR';
    but through this path i m not able to create text file.
    create or replace procedure WriteTest is
    f utl_file.file_type;
    s varchar2(200) := 'this is some info';
    begin
    f := utl_file.fopen('TEST2DIR','sample2.txt','W');
    utl_file.put_line(f,s);
    utl_file.fclose(f);
    end WriteTest;
    Help how to give network path while creating oracle directory.
    --when i give local machine path then it will create at local machine where oracle is installed. but not able to create at other machine.
    Zakir

    Well for starters your directory object is called TESTDIR and in your fopen statement you are referring to TEST2DIR.
    On top of that I'm not sure oracle is happy to refer to network locations. I think you have to map it to a regular drive mapping (shared directory) type path. Can't say I've every tried to do it though.

  • How to give the reference to the path  to copy the file to the server?

    hi all
    i am developing a page in jsp , in which i will open tiff image or autocad drawing,
    i get a file from one CMS, through JSP i login into CMS and get the file reference, till that i am successfull.
    but after that to open a file i have to copy that file into local pc or to the server(where my jsp page runs) and then try to open it.
    could any one know how to give the reference to the path if i have to copy the file to the server or my Local PC from CMS.
    Regards
    Oersla Afroze Ahmed

    hi Deepu,
    Use FM '/SAPDMC/LSM_F4_FRONTEND_FILE' for fetching the data from the application server path/presentation server path
    Regards,
    Santosh

Maybe you are looking for