Calling FM gui_upload in BSP

Hi
I am calling the FM "gui_upload" in my BSP in OnInputProcessing and I am getting the dump " OBJECTS_OBJREF_NOT_ASSIGNED" as soon as it reaches this FM.
Error on webpage :
Note
The following error text was processed in the system BWD : Access via 'NULL' object reference not possible.
The error occurred on the application server sapdevy_BWD_18 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Function: DP_CONTROL_ASSIGN_TABLE of program SAPLCNDP
Method: DIRECTORY_LIST_FILES of program CL_GUI_FRONTEND_SERVICES======CP
Method: FILE_EXIST of program CL_GUI_FRONTEND_SERVICES======CP
Function: GUI_UPLOAD of program SAPLSFES
Method: ONINPUTPROCESSING of program CLO24DHTL8LLWSOFNRTJ2EVIH3DCVCP
Method: %_ONINPUTPROCESSING of program CL_O24DHTL8LLWSOFNRTJ2EVIH3DCVCP
Method: DO_REQUEST of program CL_BSP_PAGE===================CP
Method: ON_REQUEST of program CL_BSP_RUNTIME================CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_HTTP_EXT_BSP===============CP
Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
Please help me.

Alex,
Here is my code.
IF event->id = 'UPLOAD' .
CALL METHOD REQUEST->GET_FORM_FIELD
EXPORTING
NAME = 'echoFile'
RECEIVING
VALUE = v_fname.
CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = v_fname
      filetype                      = 'ASC'
      has_field_separator           = 'X'
    HEADER_LENGTH                 = 0
     READ_BY_LINE                  = 'X'
     dat_mode                      = ''
  IMPORTING
    FILELENGTH                    =
    HEADER                        =
    TABLES
      data_tab                      = itab "gt_download " i_text_data
    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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
Thanks
Sunny

Similar Messages

  • Call FM GUI_UPLOAD from BSP

    How to call a standard function module  GUI_UPLOAD from BSP?I nees to load excel files to internal tables with the interface being web Applications.Please suggest.
    Thanks
    Ankit

    Hi,
    use the below function module.
    TYPE-POOLS : truxs.
    DATA: BEGIN OF itab occurs 0,
              v1 TYPE c,
              v2(10) TYPE c,
              v3(10) TYPE c,
              v4(10) TYPE c,
           END OF itab..
    DATA:  raw_data TYPE truxs_t_text_data.
    DATA: filename TYPE ibipparms-path.
    DATA: i_filename TYPE rlgrap-filename.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
      I_FIELD_SEPERATOR          =
      I_LINE_HEADER              =
        i_tab_raw_data             = raw_data
        i_filename                 = ' i_filename'
      TABLES
        i_tab_converted_data       = itab
    EXCEPTIONS
      CONVERSION_FAILED          = 1
      OTHERS                     = 2
    award me if ti's helpful.

  • Calling SAP Transaction from BSP

    I wonder whether it is possible to call SAP transaction from BSP application and pass to it some data; e.g., PO# when calling VA02?
    The called transaction could appear in a separate MS IE Window (like in some Portal applications) or in SAP GUI.
    Any help will be appreciated.
    Thank you in advance

    I have launched the Java SAPGui from BSP pages before.  I used SNC so that the users were logged on via Single Sign On.  I store the Java Gui in the Mime directory.  You can force the startup transaction.  Theorectically you could also Gui Scripting to try and control the Gui and force in the default value for your PO field.  I have not tried that however.  You will probably want to check the Service Marketplace for documents on the Gui Scripting.  The following is the code from my BSP page to launch the Java Gui in the Browser as an applet:
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <HTML>
    <HEAD>
      <TITLE>SAPGUI for the Java Environment</TITLE>
      <STYLE type="text/css">
          body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px; }
      </STYLE>
    </HEAD>
    <BODY scroll="no">
    <SCRIPT language="JavaScript">
    // user configurable part starts here
    var pluginurl         = '';
    var scriptable     = 'true';
    var codebase         = '.';
    var jnlp           = 'platin.jnlp';
    var keepalive      = 'true';
    var frog           = 'true';
    var trace          = '';
    var tracefile      = '';
    var connectionData = 'conn=/M/nts163/S/3620/G/SPACE/&tran=SE80&clnt=088&fast=true&sncon=true&sncname=p:[email protected]&sncqop=9';
    // user configurable part ends here
    // verify if Java Plugin as control in Internet Explorer or Java Plugin for Netscape or native JRE of browser must be used
    var jre = 'control';
    if(navigator.platform.indexOf("Mac") > -1)
       jre = 'native';
    else if (navigator.appName.indexOf("Netscape") != -1)
       jre = 'plugin';
    document.open();
    switch (jre)
    case 'control':
        document.writeln('<OBJECT CLASSID  = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"                               ');
        document.writeln('    ID       = "PlatinGUI"                                                                    ');
        document.writeln('    CODEBASE = "j2re-1_3_1_02-win-i.exe#Version=1,3,1,0"                             ');
        document.writeln('    WIDTH    = "100%"                                                 ');
        document.writeln('    HEIGHT   = "100%"                                                 ');
        document.writeln('    BORDER   = 0>                                                      ');
        document.writeln('<PARAM NAME = "TYPE"           VALUE = "application/x-java-applet;jpi-version=1.3.1">         ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable,'">                                ');
        document.writeln('<PARAM NAME = "code"           VALUE = "com.sap.platin.GuiApplet2">                   ');
        document.writeln('<PARAM NAME = "codebase"       VALUE = "', codebase,'">                             ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp,'">                             ');
        document.writeln('<PARAM NAME = "archive"        VALUE = "GuiStartS.jar">                             ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive,'">                             ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog,'">                             ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace,'">                             ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile,'">        ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData,'">                               ');
        document.writeln('                                                                ');
        document.writeln('This page requires a Sun Java Plugin 1.3 and a SAPGUI for Java to view.                      ');
        document.writeln('                                                                ');
        document.writeln('</OBJECT>                                                           ');
        break;
    case 'plugin':
        document.writeln('<EMBED TYPE        = "application/x-java-applet;version=1.3"                         ');
        document.writeln('    PLUGINURL      = "', pluginurl,'"                                          ');     
        document.writeln('    WIDTH          = "100%"                                            ');                                        
        document.writeln('    HEIGHT         = "100%"                                             ');
        document.writeln('    ALIGN          = "BASELINE"                                                ');
        document.writeln('    code           = "com.sap.platin.GuiApplet2"                                      ');
        document.writeln('    codebase       = "', codebase,'"                                        ');
        document.writeln('    jnlp           = "', jnlp,'"                                                ');
        document.writeln('    archive        = "GuiStartS.jar"                                       ');
        document.writeln('    keepalive      = "', keepalive,'"                                       ');
        document.writeln('    frog           = "', frog,'"                                            ');
        document.writeln('    trace          = "', trace,'"                                            ');
        document.writeln('    tracefile      = "', tracefile,'"                                       ');
        document.writeln('    connectionData = "', connectionData,'"                                        ');
        document.writeln(' <NOEMBED>                                                      ');
        document.writeln(' </NOEMBED>                                                      ');
        document.writeln(' </EMBED>                                                              ');
        break;
    case 'native':
        document.writeln('<APPLET CODEBASE  = "', codebase,'"                                                           ');
        document.writeln('        ARCHIVE   = "GuiStartS.jar"                                                           ');
        document.writeln('        CODE      = "com.sap.platin.GuiApplet2"                                               ');
        document.writeln('        WIDTH     = "100%"                                                                    ');
        document.writeln('        HEIGHT    = "100%">                                                                   ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable, '">                                    ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp, '">                                          ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive, '">                                     ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog, '">                                          ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace, '">                                         ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile, '">                                     ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData, '">                                ');
        document.writeln('</APPLET>                                                                                ');
        break;
    document.close();
    </SCRIPT>
    </BODY>
    </HTML>

  • How to call Java API from BSP?

    I have a requirement to call Java API from BSP application.
    I have checked the forum and found that it is possible by using some ABAP codes.
    However there is no pointer on how this is done.
    Can someone explain the details on how to call Java API from BSP is done?
    I found class CL_EJB_JAVA_OBJECT_METHODS to call a method in EJB but can't find function or SAP class to call Java API.
    Actually is there any BSP extention which can used to call Java API?
    Thanks,
    Hendri

    check out these weblogs, it should give you an idea how to go about it.
    /people/ignacio.hernndez/blog/2006/12/04/speech-synthesis-listen-the-application-server-is-talking-to-you
    /people/puru.govind/blog/2006/12/20/let-abap-speak
    Regards
    Raja

  • Calling ABAP Code From BSP

    Hello all,
    I dont have much idea of BSP ans would like to have some inputs from you all.
    I would like to know that can I call ABAP transaction from BSP page ?
    I have got a set of column entries just as an ALV column on my BSP page and I would like to provide hotspot or double click functionality so that for each of the entries in the table , the BSP page navigates to ABAP tcode and back to BSP page.Is this functionality possible?
    any help would highly be appreciated.
    Regards
    Amruta

    Hi Amruta ,
    You can't call an R/3 transaction directly from BSP.
    But you can achieve all the functionalities it does .
    for ex ..if an r/3 transaction is a report , u hav to code in BSP editor .u can call function modules from BSP .
    But one thing u hav to concern is ,,in BSP Apllication logic is seperatd from Business logic .
    U hav to move all your results into an itab / params and display that inside HTML tables .
    Start ur journey from here .......
    http://help.sap.com/saphelp_erp2004/helpdata/en/e6/e23fd8c47e11d4ad320000e83539c3/frameset.htm
    All the best .
    Regards,
    J

  • Gui_upload in BSP controller

    Hi all,
       Can someone please tell me, how to use gui_upload FM in BSP controller ?
    I'm trying to get the data of text file into internal table on a specific event, but the FM gui_upload or the method cl_gui_frontend_services=>gui_upload is giving an exception, "CNTL_ERROR" .
    Can anyone please guide me?

    Hi Hemant,
    You can't use cl_gui_frontend_services=>gui_upload in BSP. You can use this method only if you have logged on as a dialog user which is not the case when using BSP, instead try to use htmlb:fileUpload element. For more details see page FileUpload.bsp in BSP Application SBSPEXT_HTMLB.
    Regards,
    narinder Hartala

  • Calling function module in bsp

    hi all,
    please help me out. i am calling function module in bsp(in on initialization). i am calling 2d_matrix fm. but in output, its not showing the graphics. i think i have to do something in layout also, to connact the FM. Plz help me if you have any idea in bsp.
    thanks in advance.

    thanks for ur reply.
    but i am using it in layout and its giving me an error.
    i have selected all the fields in on initialization.
    and in layout i am displaying my data in tabular form. correspondigly i want to display same data in graphical format.
    for that i have used a FM in on initialization(2d_matrix FM).
    but how i link it in layout . so, that i can give me a output.
    i can understand.
    plz reply me.
    thanks in advance.

  • Error while calling RFC when using BSP Web Interface

    Hi,
    we have a problem with the Authorization when we use an Web Interface for BSP. We have assigned all roles to the user which were mentioned in the SAP standard documentation:
    R_AREA   
    R_METHOD 
    R_PACKAGE
    R_PARAM  
    R_PLEVEL 
    R_PM_NAME
    R_PROFILE
    R_STS_PT 
    R_STS_SUP
    R_WEBITF 
    S_RS_ADMWB
    S_RS_AUTH
    S_RS_COMP
    S_RS_COMP1
    S_RS_DAS 
    S_RS_ICUBE
    but we still get the error message: "Error while calling RFC".
    When using a user with SAP_ALL, it works.
    What can we do?
    Thx for your time.
    Joerg

    Actually that's surprising - because BSP (Business Server Pages) and RFC (Remote Function Call) are not related; they use totally different transport protocols (http vs. RFC). Even if an BSP application is calling a function module remotely (acting as RFC client) no authorizations for S_RFC are required - in the calling system (but in the called system, i.e. the RFC server).
    Since assigning SAP_ALL seems to "cure" the problem, it seems to be an authorization issue, indeed. In that case it makes sense to use the authorization trace (ST01 - notice: that's specific to one single ABAP application server; you might have to activate the trace on multiple instances) to find out which authorizations are checked / demanded.

  • Error while calling the PDF in BSP pages in ECC6.0: Question BSP Gurus

    Hi BSP experts,
    Any Experts have solutions for below.
    We recently moved BSP pages into ECC 6.0 .Iam getting the error in BSP page while calling the PDF.
    The scenario is like this: The PDF is getting called the via URL:
    The code is like this
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_32 = guid.
      CONCATENATE runtime->application_url '/' guid '.pdf'    INTO   URL.
    <u><b>This URL is called in the front end LAYOUT.</b></u>
    <iframe src="<%= URL %>" width="100%" height="600px">
    </iframe>

    you missed one question of mine  <b>Do you create the PDF after creating the GUID ?</b>
    try giving a fixed URL just to test.
    Aman

  • Urgent: call ABAP program from BSP

    hi BSP experts,
    We just want to trigger an ABAP program to say "Hello World" in BSP and see the wording "Hello World" on web browser when running it from BSP.  One BSP expert Raj gave the answer by using the following in BSP:
    oninitialization:
    submit ('z_program_name') and return exporting list to memory.
      call function 'LIST_FROM_MEMORY'
           tables
                listobject = listobject.
      call function 'WWW_HTML_FROM_LISTOBJECT'
           exporting
                report_name = 'z_program_name'
           tables
                html        = html
                listobject  = listobject.
      clear output_str.
      loop at html into html_wa.
        concatenate output_str html_wa into output_str.
      endloop.
    layout code:
    <htmlb:content design="design2003">
    <htmlb:page title = " ">
    <htmlb:form>
    <%= output_str %>
    </htmlb:form>
    </htmlb:page>
    </htmlb:content>
    We put the above in our BSP and then activate them, but get the following error:
    Field "LISTOBJECT" is unknown. It's neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement.
    And the error stopps here:
    submit ('z_program_name') and return exporting list to memory.
    call function 'LIST_FROM_MEMORY'
    tables
    listobject = listobject.
    Any idea? 
    We will give you reward points!

    hi Tanguy,
    Eventually, I have figured it out on how to make the code works by showing "Hello World!" on web browser. But actually we would like to run another ABAP program which open a new container on users' machines, download an Excel template stored on server to the opened container on users' machinese, and then dump SAP table data to the opened excel template. This program works very well through SAP GUI, but users would like to run it on web that we tried to run this program in BSP, but it doesn't work with your code! Any idea?
    Thanks alot!

  • Call Function POPUP in BSP

    I have a BSP form, and I have a button that calls a BADI on one screen. This BADI will show a list with some options, the chosen options will return to this form's screen on WEB. Upon a clicking the button, the program pass through the BADI, but it does not show the list.
    Inside R3, when BADI is executed, it shows the list, since it calls a pop-up function named "HRHAP_F4_FOR_DEV_PLANS". I wonder what BSP function would do the same.
    I need some help in order to know how to show this BADI in the form. Do I need some treatment in the BADI to identify what is BSP? Has someone experienced this situation?
    Thanks. And I wait a response.

    What version of SAPConsole do you use?
    Markus

  • Call BW Report in BSP

    Hi,
    How to pass variable values to a BW report from BSP and hence call the report with these values withing the BSP.
    I have a BW report, for which I want to change the initial variable screen.
    Thanks,
    CD

    Look at below link. It might help you.
    [Integrate BW Queries Within BSP|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/web-application-server/g-i/how%20to%20integrate%20bw%20queries%20within%20bsp.article]
    Raja

  • Call planning function in BSP application in IP

    Hello,
    In BPS we used function module API_SEMBPS_FUNCTION_EXECUTE to call a BPS planning function in a BSP application.
    Now, we want to call an IP planning function in the same BSP application. Is there a similar function module or any other method we can use??
    Thank you very much

    Try function module - RSPLSSE_SERVICE_EXECUTE to directly execute the function(planning service) or RSPLSSE_PLSEQ_EXECUTE to execute the planning function via planning sequence.

  • Call another page in BSP application

    Hi all,
    I am new to BSP. I want to know how to call a page from another page in BSP.
    Like, in dialog programming, we use CALL SCREEN etc., I want to know the procedure in BSP.
    Please help.
    Regards
    Natasha Garg

    search this forum, or read the documentation.
    Raja

  • Using Call transaction in a BSP scenario

    I encountered a problem the other day with using a BAPI in a BSP application. Within this BAPI a call transaction was made. After reading several posts in this forum and the very interesting blog BSP In-Depth: MESSAGE Statement Handling /people/mark.finnern/blog/2003/09/16/bsp-in-depth-message-statement-handling of Brian, it became clear to me that message types E,A and X during this call transaction cause HTTP error 500 no dump info and termination of the session. All in all not so much fun.
    After having an OSS message battle with SAP, their final conclusion was: it is not possible and there are no alternatives.
    Unsatisfied I tried to find a solution. And I found one, which I would like to share with you as it might cause more people problems.
    To be short, read the weblog from brian for more info, the main problem is the use of a 'very dark' dynpro when logged in with a bsp application. This session is of type Plug-in HTTP. If we call the BAPI/RFC with DESTINATION NONE a RFC type session is opened. With such a session the message type E,A and X result in 'normal' behaviour, that is the BAPI returns message type E.
    This doesnt work with Function modules which are not RFC enabled, however most of the times it is easy to create a RFC enabled wrapper around it.
    Have fun,
    Vincent

    Hallo Vincent,
    Many thanks for taking the time to write this down! I have actually learned something new tonight. Very simple and ellegant solution to this problem. If you don't mind, I would like to add this into the <a href="/people/brian.mckellar/blog/2003/10/23/bsp-trouble-shooting-frequently-asked-short-questions">FAQ</a>. This is something that is sure to help other people as well!
    regards, brian

Maybe you are looking for

  • Can't Release a billing document to accounting

    Hi, kindly help me with this issue When I release my document to accounting, it show this error "Error in account determination: table T030K key GOC MWS I0" Yes it wil show this error because I0 is not defined in our FTXP. We are now using O0, I'm re

  • JDBC MySQL Connector/J problems when using in applets

    I wrote a piece of code which uses the MySQL Connector/J which worked in a normal shell application but when used in an applet it just didnt print anything. The code is: import java.net.*; import java.sql.*; class DB { static Connection c; static Sta

  • Dynamic where clause: Urgent

    Hi, I am facing a problem with data retrieval in a BADI with dynamic where clause. I have a variable defined as: data: lv_where_condn    TYPE string. I concatenate the data in the string based on the user's input and perform the following select:   

  • Extraction unicode  BW & unicode R/3 source system

    Hello, I have a situation where I need to load a material master data from R/3 to BW. In source system for material description, language key used as "EN" and description maintained in Chinese language. Both R/3 and BW systems are unicode compliance.

  • One touch recording - CUCM 9.0

    Im trying to find out a bit more about the one touch recording feature in CUCM. Does this mean that from Jabber, users will be able to record calls natively using CUCM? Or is there some sort of third party hw/sw required for this integration? Also, i