Error calling methods CL_GUI_FRONTEND_SERVICES

Hi all,
I have a requirement in BAPI (integrating solman to portal) to download file from app. server to local directory. I used the below FM to get temp directory of presntation server.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
   CHANGING
     TEMP_DIR             =  LV_TEMP_DIR
   EXCEPTIONS
     CNTL_ERROR           = 1
     ERROR_NO_GUI         = 2
     NOT_SUPPORTED_BY_GUI = 3
     others               = 4.
   CALL METHOD cl_gui_cfw=>flush.
It works fine in R3, but when i called it from portal it shows Access not possible using 'NULL' object reference with a short dump .
st22 shows
Error in ABAP application program.
The current ABAP program "CL_GUI_FRONTEND_SERVICES======CP" had to be
terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
An exception occurred. This exception is dealt with in more detail belo
. The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL',
neither
caught nor passed along using a RAISING clause, in the procedure
"GET_TEMP_DIRECTORY" "(METHOD)"
Since the caller of the procedure could not have expected this exceptio
to occur, the running program was terminated.
The reason for the exception is:
Attempt to access a component using 'NULL' object reference (points
to nothing).
An object reference must point to an object (an instance of a class)
before you can use it to access components (variable:
"CL_GUI_FRONTEND_SERVICES=>HANDLE").
Either the reference has not yet been set, or it has been reset to
'NULL' by a CLEAR statement.
When i put external break point and the dump comes during execution of CALL METHOD cl_gui_cfw=>flush.
Is it not possible to use CL_GUI_FRONTEND_SERVICES in RFC ??.
thanks and regards
Jijo

Hi,
the dump is because you cannot use that function from a BSP application, which runs in internet or intranet. The procedure in this case is different:
DATA: flights  TYPE flighttab,
        flight   LIKE LINE OF flights,
        appl     TYPE string,
        filetype TYPE string,
        output   TYPE string,
        output2  TYPE xstring,
        response     TYPE REF TO if_http_response,
        l_len        TYPE i,
        seatsmax     TYPE string,
        seatsocc     TYPE string.
  appl = 'application/msexcel'.
  filetype = 'attachment;filename=mi archivo.xls'.
  SELECT * FROM sflight
     INTO TABLE flights
     UP TO 20 ROWS.
  LOOP AT flights INTO flight.
    seatsmax = flight-seatsmax. CONDENSE seatsmax.
    seatsocc = flight-seatsocc. CONDENSE seatsocc.
    CONCATENATE output
    flight-carrid cl_abap_char_utilities=>horizontal_tab
    flight-connid cl_abap_char_utilities=>horizontal_tab
    flight-fldate cl_abap_char_utilities=>horizontal_tab
    flight-planetype cl_abap_char_utilities=>horizontal_tab
    seatsmax cl_abap_char_utilities=>horizontal_tab
    seatsocc cl_abap_char_utilities=>horizontal_tab
    cl_abap_char_utilities=>cr_lf
    INTO output.
  ENDLOOP.
  response = runtime->server->response.
  response->delete_header_field( name = if_http_header_fields=>cache_control ).
  response->delete_header_field( name = if_http_header_fields=>expires ).
  response->delete_header_field( name = if_http_header_fields=>pragma ).
  response->set_header_field( name = if_http_header_fields=>content_type
                              value = appl ).
  response->set_header_field( name = 'content-disposition'
                              value = filetype ).
  CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
      text     = output
      mimetype = 'text/unicode; charset=utf-16le'
    IMPORTING
      buffer   = output2.
  CONCATENATE cl_abap_char_utilities=>byte_order_mark_little
              output2 INTO output2 IN BYTE MODE.
  l_len = XSTRLEN( output2 ).
  response->set_data( data = output2
                      length = l_len ).
  navigation->response_complete( ).
This is the code for downloading an Excel file.

Similar Messages

  • CALL METHOD cl_gui_frontend_services= file_save_dialog

    Hi,
    I want to use 'CALL METHOD cl_gui_frontend_services=>file_save_dialog', to choose a path for saving my txt files.  I only want the user to be able to choose the path and not have to supply a filename aswell.  My filenames are standard in the program and I don't want them to be changed by the user.
    Is there another method which is designed for this or is there a simple parameter I have missed?
    Thanks and regards,
    Simon.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_f.
       PERFORM f_search_help_pa_f1.
    FORM f_search_help_pa_f1 .
       CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
         EXPORTING
           program_name  = sy-repid
           dynpro_number = sy-dynnr
         CHANGING
           file_name     = pa_f
         EXCEPTIONS
           mask_too_long = 1
           OTHERS        = 2.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    ENDFORM.                    " f_search_help_pa_f1
    Try this
    Regards

  • Error calling method of a PBNI object

    Dear All,
    We are facing issue of "Error calling method of a PBNI object". We are calling web services of WCF after some time to refresh data.We need help to solve this issue as we have to go live with client.
    It's really urgent!
    Regards
    Imran Zaheer

    Hi Chris,
    Thanks for your concern.
    1) PB version & Build?
         PB builder 12.5.2 build 5609
    2) MS-Window version?
         Windows 7 professional.
    3) Why are you using PBNI and what kind of class are you utilizing in that context?
         We are calling webservices through soap objects.
    4) What error(s) codes and messages are you getting?
        we get "Error calling method of a PBNI object"
    5) Why are you not using PB.net that supports WCF natively (I wish PB classic did)?
        For this we need to convert our whole application in PB.Net which is not feasible for us.
    6) Can you lightly describe your over-all architecture and application approach to Web Services?
         We have replace EASERVER with WCFserver and we are calling webservices for fetching( pulling) data from WCF server. It's a soft of 3 tier architecture.
    Regards .... Imran

  • What is error  "Error calling method on NPObject!" ?

    I use API get mks link and submit ticket open VMRC console but console doesn't run and get this error "Error calling method on NPObject!"
    How i can fix?

    Well,
    I did that and I don't see much difference...where is the debugging suppose to be?
    anyway I use FF and Firebug and I exporting to flash player 9
    The error seems to be coming from a line of code
    function (params) {
    86        obj = FB.JSON.parse(params);
    87        cb = function (response) {FBAS.getSwf().uiResponse(FB.JSON.stringify(response), obj.method);};
    88        FB.ui(obj, cb);
    89    }
    90    function () {
    91        session = FB.getSession();
    92        return FB.JSON.stringify(session);
    93    }
    I assume that this is from the FB graph swf wrapper?
    The object in question seems to be the session I get back from facebook. The thing is I successfully get it sooo I'm kinda stumped as to what really is the problem here...

  • Running Browser calling method'CL_GUI_FRONTEND_SERVICES' in the background.

    Hello SAP Gurus
    My intention is to shutdown and restart communication channels on PI side. To do this externally, we can send a URL with right parameters.
    I have written a simple ABAP  code to do this by calling the method 'CL_GUI_FRONTEND_SERVICES 'with the URL. Since I have several channels, I am calling this method in a loop. It is doing the job well.
    However, for each channel an IE browser screen pops up with the XML data for that particular URL.  It is kind of annoying to see so many popups.
    Is there a way in ABAP to supress this multiple browser pop ups? Is there a way to make this method run in the background?
    I know that this method is meant to call a browser screen with the URL, however I want to suppress this Browser POP up and use the remaining function.
    Any feedback will be highly appreciated.
    Thanks
    Ram

    You cannot use a frontend (GUI) service when a program is running in the background.
    You'll have to call the URL in a different way... something that doesn't create a popup window. Or execute the command that is invoked when accessing that URL.

  • Error calling Method on Managed Bean from another Managed Bean

    Hi
    (Jdev 11.1.1.2.0)
    Help please:
    I have a managed bean (page flow scope) which is used by my main page for dynamic region flow navigation:
    *public class RegionNavigationBean implements Serializable{*+
    private String dynamicTaskFlowId = "/WEB-INF/home-task-flow-definition.xml#home-task-flow-definition";+
    *public RegionNavigationBean() {*+
    *public TaskFlowId getDynamicTaskFlowId() {*+
    return TaskFlowId.parse(dynamicTaskFlowId);+
    *public void setDynamicTaskFlowId(String taskFlowId) {*+
    this.dynamicTaskFlowId = taskFlowId;+
    taskFlowId property on main page def is set to +*${pageFlowScope.regionNavigationBean.dynamicTaskFlowId}*+
    In a DB table (i.e. View Object on my model layer) I store a menu ID and a corresponding task_flow_id.
    Then I have created an action listener class (RegionNavigationListener - page flow scope) which I link to my menu items on my main page (action listener property on menu item = +*#{pageFlowScope.regionNavigationAction.processAction}*+ )
    In this action listener (processAction method), I retrieve the row set from the menu VO and find the record which matches my menu ID which caused the action event, thereby retrieving the task_flow_id which must be navigated to.
    I then try to retrieve the instance of the RegionNavigationBean with the following statement: RegionNavigationBean regNav = (RegionNavigationBean)JSFUtils.getManagedBeanValue("regionNavigationBean");+
    This seems to work fine, but as soon as I try and use this I get NullPointerException error, e.g.:
    regNav.setDynamicTaskFlowId(menusRow.gettaskFlowId());+
    or even:
    System.out.println("%%% " + regNav.toString());+
    This is all quite new to me... any help would be appreciated!
    Thanks
    Mario

    Hi Mario,
    I think JSFUtils.getManagedBeanValue(String) has difficult to evaluate the "regionNavigationBean" managed bean.
    What JSFUtils.getManagedBeanValue(String) do is important. I remember that "JSF scoped" bean can be found by JSF style find method, such as requestScope, sessionScope, applicationScope. For a managed bean put in these scope, scope prefix is not needed, for example: using #{beanName} to locate a requestScope bean. The #{requestScope} prefix is not needed.
    But pageFlowScope is different. If a bean is put in the pageFlowScope, you must use #{pageFlowScope.beanName} to locate it.
    Say, ManagedBean is the java class of your manged bean.
    FacesContext ctx = FacesContext.getCurrentInstance();
    Application app = ctx.getApplication();
    ManagedBean mb = (ManagedBean)app.evaluateExpressionGet(ctx, "#{pageFlowScope.managedBeanName}", ManagedBean.class);
    Hope it helps.
    Todd
    Edited by: Todd Bao on Nov 26, 2009 9:58 PM

  • Error calling class methods CL_GUI_FRONTEND_SERVICES

    Hi all,
    I have a requirement in BAPI (integrating solman to portal) to download file from app. server to local directory. I used the below FM to get temp directory of presntation server.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
       CHANGING
         TEMP_DIR             =  LV_TEMP_DIR
       EXCEPTIONS
         CNTL_ERROR           = 1
         ERROR_NO_GUI         = 2
         NOT_SUPPORTED_BY_GUI = 3
         others               = 4.
       CALL METHOD cl_gui_cfw=>flush.
    It works fine in R3, but when i called it from portal it shows Access not possible using 'NULL' object reference with a short dump .
    st22 shows
    Error in ABAP application program.
    The current ABAP program "CL_GUI_FRONTEND_SERVICES======CP" had to be
    terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    An exception occurred. This exception is dealt with in more detail belo
    . The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL',
    neither
    caught nor passed along using a RAISING clause, in the procedure
    "GET_TEMP_DIRECTORY" "(METHOD)"
    Since the caller of the procedure could not have expected this exceptio
    to occur, the running program was terminated.
    The reason for the exception is:
    Attempt to access a component using 'NULL' object reference (points
    to nothing).
    An object reference must point to an object (an instance of a class)
    before you can use it to access components (variable:
    "CL_GUI_FRONTEND_SERVICES=>HANDLE").
    Either the reference has not yet been set, or it has been reset to
    'NULL' by a CLEAR statement.
    When i put external break point and the dump comes during execution of CALL METHOD cl_gui_cfw=>flush.
    Is it not possible to use CL_GUI_FRONTEND_SERVICES in RFC ??.
    thanks and regards
    Jijo

    [CL_GUI_FRONTEND_SERVICES|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cl_gui_frontend_services+portal&adv=false&sortby=cm_rnd_rankvalue] needs a SAPGUI, so it is not possible to use it in RFC, BSP or other portal.
    Regards

  • Error when using the method cl_gui_frontend_services= file_open_dialog

    Hello Experts,
    I am currently practicing BDC and I think the first step is to locate where my text file is. Now based on my code below, after selecting my text file nothing happens.
    Also, what will be my next after getting the file from a specific location? Thanks guys!
    REPORT  z_aris_practice_bdc_0
            NO STANDARD PAGE HEADING
            LINE-SIZE 255
            LINE-COUNT 64
            MESSAGE-ID zz.
    *BDC Data
    DATA: BEGIN OF bdc_tab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    *Internal Table
    DATA: BEGIN OF it_input OCCURS 0,
             user     TYPE usr02-bname,
             title    TYPE sza5_d0700-title_medi,
             lname    TYPE addr3_data-name_last,
             fname    TYPE addr3_data-name_first,
             initials TYPE addr3_data-initials,
             nickname TYPE addr3_data-nickname,
             function TYPE addr3_data-function,
          END OF it_input.
    DATA: gt_lines TYPE sy-tabix,
          gt_file  TYPE filetable,
          wa_file  TYPE filetable,
          gt_subrc TYPE i.
    *CONSTANTS
    CONSTANTS: c_mask(60) TYPE c  VALUE ',..'.
    *Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_input LIKE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_input.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
       WINDOW_TITLE            =
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
          initial_directory       = 'C:\Temp\'
          multiselection          = 'X'
        CHANGING
          file_table              = gt_file[]
          rc                      = gt_subrc
       USER_ACTION             =
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM put_in_itab.
      PERFORM process_records.
    *&      Form  get_files
          text
    FORM put_in_itab.
      DATA: lv_file TYPE string.
      lv_file = p_input.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = lv_file
        FILETYPE                      = 'ASC'
         has_field_separator           = 'X'
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
        CODEPAGE                      = ' '
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
        CHECK_BOM                     = ' '
        VIRUS_SCAN_PROFILE            =
        NO_AUTH_CHECK                 = ' '
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        TABLES
          data_tab                      = it_input
       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.
      ELSE.
        DESCRIBE TABLE it_input LINES gt_lines.
      ENDIF.
    ENDFORM.                    "get_files
    *&      Form  process_records
          text
    FORM process_records.
      LOOP AT it_input.
      ENDLOOP.
    ENDFORM.                    "process_records

    Hii viraylab,
    go throgh this link..This sample code solves ur problem....
    /people/milind.upasani/blog/2007/03/07/step-by-step-approach-to-ceate-simple-bdc-session-program-using-reusable-template
        U are new to BDC it seems...
        first u read the sap help ... then u will come know what to do after wards....
        http://help.sap.com/saphelp_47x200/helpdata/en/fa/097720543b11d1898e0000e8322d00/frameset.htm
    Be familiar with the structure BDCDATA.
    <b>Data transfers</b>  In this page..
    Next u need to know about the <b>transaction RECORDER the tcode is SHDB.</b>
    Nothing is difficult in this ..
    For example When u r creating a data element in SE11 u go through some screens in a flow, by clicking some pushbuttons and by generating some function codes manually, and entering values manually...
    But here u wont do it manually, these values will be populated from file into an internal table...
    Before calling a transaction into which u r going to populate the data is to be filled into a table with structure <b>BDCDATA.</b>
    <b>U need to use CALL TRANSACTION 'SE11' using BDCDATA or
    the session method..</b>
    Reward points for helpful answers...
    sai ramesh

  • Getting error while using cl_gui_frontend_services= gui_download

    Hi Experts,
    I am using class method cl_gui_frontend_services=>gui_download for downloading a file and i getting an error that of type compatible of internal table with formal parameter DATA_TAB of class cl_gui_frontend_services. My code is as follow -
    DATA: filename_string TYPE string VALUE 'c:\data\testdw.txt'.
    TYPES : BEGIN OF y_citibank,
                  data(1028) TYPE c,
                  END   OF y_citibank.
    DATA : t_citibank TYPE STANDARD TABLE OF y_citibank.
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename                  = filename_string
        FILETYPE                  = 'ASC'
      changing
        data_tab                  = t_citibank
      EXCEPTIONS
        FILE_WRITE_ERROR          = 1
        NO_BATCH                  = 2
        GUI_REFUSE_FILETRANSFER   = 3
        INVALID_TYPE              = 4
        NO_AUTHORITY              = 5
        UNKNOWN_ERROR             = 6
        HEADER_NOT_ALLOWED        = 7
        SEPARATOR_NOT_ALLOWED     = 8
        FILESIZE_NOT_ALLOWED      = 9
        HEADER_TOO_LONG           = 10
        DP_ERROR_CREATE           = 11
        DP_ERROR_SEND             = 12
        DP_ERROR_WRITE            = 13
        UNKNOWN_DP_ERROR          = 14
        ACCESS_DENIED             = 15
        DP_OUT_OF_MEMORY          = 16
        DISK_FULL                 = 17
        DP_TIMEOUT                = 18
        FILE_NOT_FOUND            = 19
        DATAPROVIDER_EXCEPTION    = 20
        CONTROL_FLUSH_ERROR       = 21
        NOT_SUPPORTED_BY_GUI      = 22
        ERROR_NO_GUI              = 23
        others                    = 24.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Please let me know, how can i overcome this error.
    Thanks in advance,
    Akash Sawant

    Hi,
    Pass t_citibank[] instead of t_citibank in the CALL METHOD.
    CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
    filename = filename_string
    FILETYPE = 'ASC'
    changing
    data_tab = <b>t_citibank[]</b>
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    NOT_SUPPORTED_BY_GUI = 22
    ERROR_NO_GUI = 23
    others = 24.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Sri
    Message was edited by:
            Sri Tayi

  • Doubt in call method program

    hi,
    I am getting error as i marked BOLD in this program...can u give solutions for that..
    REPORT  YSBDC6.
    TABLES:LFA1.
    DATA:BEGIN OF ITAB OCCURS 0,
         LIFNR LIKE LFA1-LIFNR,
         LAND1 LIKE LFA1-LAND1,
         NAME1 LIKE LFA1-NAME1,
         END OF ITAB.
    DATA:BEGIN OF JTAB OCCURS 0.
         INCLUDE STRUCTURE BDCDATA.
    DATA:END OF JTAB.
    DATA:BEGIN OF KTAB OCCURS 0.
         INCLUDE STRUCTURE BDCMSGCOLL.
    DATA:END OF KTAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
      FILENAME = 'C:\PRABA.TXT'
      FILETYPE = 'ASC'
      HAS_FIELD_SEPARATOR = 'X'
      CHANGING
        DATA_TAB = ITAB[].
       LOOP AT ITAB[] INTO ITAB.
        REFRESH JTAB.
        PERFORM SUB USING 'YVTRANS' '100'.
        PERFORM SUB1 USING:'LFA1-LIFNR' ITAB-LIFNR,
                           'LFA1-LAND1' ITAB-LAND1,
                           'LFA1-NAME1' ITAB-NAME1.
        PERFORM SUB1 USING 'BDC_OKCODE' 'INSERT'.
        CALL TRANSACTION 'YVTRANS' USING JTAB MODE 'A' MESSAGES INTO KTAB.
        LOOP AT KTAB.
        IF KTAB-MSGTYP = 'I' OR KTAB-MSGNR = 000.
          WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'INSERTED'.
          ELSEIF
            KTAB-MSGTYP ='E' OR KTAB-MSGNR = 001.
            WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'NOT INSERTED'.
            ENDIF.
            <b>REFRESH KTAB."ERROR IN THIS LINE 'YOU MAY NOT
            "Delete or overwrite table 'ktab' with in a loop through itself</b>
          ENDLOOP. 
       ENDLOOP.
            FORM SUB USING A B.
            CLEAR JTAB.
            JTAB-PROGRAM = A.
            JTAB-DYNPRO = B.
            JTAB-DYNBEGIN = 'X'.
            APPEND JTAB.
            ENDFORM.
        FORM SUB1 USING C D.
          CLEAR JTAB.
          JTAB-FNAM = C.
          JTAB-FVAL = D.
          APPEND JTAB.
          ENDFORM.

    HI,
    thanks for both..for immediate response..my PC got struck up that why i could not
    after editing this program i got error like YVTRANS not found..that means i have written seperate code for YVTRANS like below..is it correct..can u give solution for this..
    REPORT  YVTRANS.
    TABLES:LFA1.
    *DATA: WA TYPE LFA1.
    *ITAB TYPE TABLE OF LFA1.
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'INSERT'.
          INSERT LFA1.
          IF SY-SUBRC = 0.
            MESSAGE I000(0) WITH 'RECORD INSERTED'.
            ELSE.
              MESSAGE E001(0) WITH 'NOT INSERTED'.
              ENDIF.
              WHEN 'EXIT'.
                LEAVE PROGRAM.
                ENDCASE.
                ENDMODULE.
    orginal program
    REPORT  YSBDC6.
    TABLES:LFA1.
    DATA:BEGIN OF ITAB OCCURS 0,
         LIFNR LIKE LFA1-LIFNR,
         LAND1 LIKE LFA1-LAND1,
         NAME1 LIKE LFA1-NAME1,
         END OF ITAB.
    DATA:BEGIN OF JTAB OCCURS 0.
         INCLUDE STRUCTURE BDCDATA.
    DATA:END OF JTAB.
    DATA:BEGIN OF KTAB OCCURS 0.
         INCLUDE STRUCTURE BDCMSGCOLL.
    DATA:END OF KTAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
      FILENAME = 'C:\PRABA.TXT'
      FILETYPE = 'ASC'
      HAS_FIELD_SEPARATOR = 'X'
      CHANGING
        DATA_TAB = ITAB[].
       LOOP AT ITAB[] INTO ITAB.
        REFRESH JTAB.
        PERFORM SUB USING 'YVTRANS' '100'.
        PERFORM SUB1 USING:'LFA1-LIFNR' ITAB-LIFNR,
                           'LFA1-LAND1' ITAB-LAND1,
                           'LFA1-NAME1' ITAB-NAME1.
        PERFORM SUB1 USING 'BDC_OKCODE' 'INSERT'.
        CALL TRANSACTION 'YVTRANS' USING JTAB MODE 'A' MESSAGES INTO KTAB.
        LOOP AT KTAB.
        IF KTAB-MSGTYP = 'I' OR KTAB-MSGNR = 000.
          WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'INSERTED'.
          ELSEIF
            KTAB-MSGTYP ='E' OR KTAB-MSGNR = 001.
            WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'NOT INSERTED'.
            ENDIF.
            ENDLOOP.
          REFRESH KTAB.
       ENDLOOP.
            FORM SUB USING A B.
            CLEAR JTAB.
            JTAB-PROGRAM = A.
            JTAB-DYNPRO = B.
            JTAB-DYNBEGIN = 'X'.
            APPEND JTAB.
            ENDFORM.
        FORM SUB1 USING C D.
          CLEAR JTAB.
          JTAB-FNAM = C.
          JTAB-FVAL = D.
          APPEND JTAB.
          ENDFORM.

  • Calling Method

    hi abaper expert,
    can a method be called from a method or a program ?
    if it can be called from a method or a program, how can we do it ?
    please give an example
    many thanks in advance
    regards
    eddhie

    Hi
    Yes it is, but only if you need to use an INSTANCE method.
    DATA: <OBJECT> TYPE REF TO <CLASS>.
    CREATE OBJECT <OBJECT>.
    CALL METHOD <OBJECT>-><METHOD>
    If you need a static method:
    CALL METHOD <CLASS>=><METHOD>.
    For example the method to dowload a file (defined in the class CL_GUI_FRONTEND_SERVICES) is static so
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
                        EXPORTING
                        IMPORTING
    Max
    Max

  • What is the functionality CALL METHOD CL_GUI_CFW= FLUSH

    Hi,
    What is the functionality of method "FLUSH" in class CL_GUI_CFW
    Should it be used after every call method CL_GUI_FRONTEND_SERVICES=>......
    What is the purpose of using it? What happens if we don't use it?

    hi
    good
    The class CL_GUI_CFW contains static methods that apply to all instantiated custom controls when you call them.
    You can force a synchronization point in your program by calling a method that is not buffered, or by calling the static method FLUSH.
    CLASS event_handler IMPLEMENTATION.
      METHOD handle_f1.
        DATA row TYPE i.
        MESSAGE i888(sabapdocu) WITH text-003.
        CALL METHOD sender->get_selection_pos
             IMPORTING from_line = row.
        CALL METHOD sender->get_line_text
             EXPORTING line_number = row
             IMPORTING text = field.
        CALL METHOD cl_gui_cfw=>set_new_ok_code 
             EXPORTING new_code = 'F1'.         
        CALL METHOD cl_gui_cfw=>flush.
      ENDMETHOD.
    thanks
    mrutyun^

  • *ERROR IN OLE CALL - METHOD CALL ERROR...*

    HI ..
    When trying to Upload a file using BDC with Vista OS, we are getting the following error..
    ERROR IN OLE CALL - METHOD CALL ERROR...
    There is no problem with BDC as its working fine with XP & other OS.
    Pls help!!

    Seems that you are working with microsoft files.
    Maybe you are using deprecated functions like WS_EXCEL

  • Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu

    When exporting html and viewing locally we receive the following error... This error disappears after removing menu from top of page. This error does not occur when viewed on Outdoors360.businesscatalyst.com (our temporary site)
    Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu
    Any ideas??

    I fix the problem.
    I have carefully reviewed JAVASCRIPT files and I could see that these are not a major influence within the site, only are reference code and utilities of the same application.
    By removing these files nothing has stopped working, I thought I would have some error in the sliders, or opacities, but no, nothing happened.
    DELETE IT
    FRANCISCO CATALDO DISEÑADOR GRÁFICO

  • Error During Method Call in Scripting Host

    Hey all ,
    I am running a webdynpro application , which runs an Ecatt which in turn runs an Underlying SAP GUI recording , and as soon we hit the  SAP GUI command we are getting an Error saying ERROR DURING METHOD CALL IN SCRIPTING HOST.
    As of now we know that this might be a security issue as this was working perfectly fine when we were running on a R3 system.
    If any of you have come across such a situation and was able to find a work around it would be of great help if you respond back as I need this info ASAP.
    Thanks And Kind Regards,
    Nischal

    Hi Lawrence,
    I have analyzed the condition, and come with the conclusion that, when eCATT calls QTP in integrated mode, and downloads the QTP scripts from server to your local machine,  it requires more memory. So try to free memory on C drive and don't keep running more application on the local machine.
    Thanks,
    Mahantesh

Maybe you are looking for

  • Is the built in microphone in the iPad 2 3G under the warranty

    My microphone is broken, when ever I record something, it is all fuzzy. Is it under warranty? Thanks!

  • [SOLVED] KDE4: No sleep on laptop lid close while screensaver active

    I've been trying to figure this out for a while now, and it turns out it's an upstream bug with PowerDevil: https://bugs.kde.org/show_bug.cgi?id=205453 A patch was just posted on that bug report within the last couple days. I rebuilt kdebase-workspac

  • Can't add songs to iPod mini - Please help

    I am running iTunes 6 on Windows XP and my iPod mini is updated with the latest software. I connect it to my computer and it appears in iTunes without any problems. I add songs to it from my library and they appear to transfer without any problems. B

  • Using Disk Utility to backup SD cards

    Does anyone have any idea how to allow non-admin users to backup entire SD cards using Disk Utility on Mavericks? It now asks for an admin login and I cannot go round logging in every time one of the 300+ students here wants to back up their card aft

  • Ignore or not to ignore field dominance in inspector?

    Created DVSD and 8bit movies in FC lower field dominant,(this of course can be checked by clip or movie properties,) however when brought into Compressor, inspector often gets it wrong. Changing native field dominance back to lower in inspector cause