CL_GUI_FRONTEND_SERVICES= FILE_EXIST

Hi experts,
See the following method.
Here what value i have to give for  RECEIVING  RESULT   It is a type group.
How to declare a type-group?           
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
      EXPORTING
        FILE                 = m_filename
      RECEIVING
        RESULT               =
     EXCEPTIONS
       CNTL_ERROR           = 1
       ERROR_NO_GUI         = 2
       WRONG_PARAMETER      = 3
       NOT_SUPPORTED_BY_GUI = 4
       others               = 5
    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 in Advance

type-pools: abap.
<b>data: v_reult type ABAP_BOOL.</b>
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE = m_filename
RECEIVING
<b>RESULT = v_result</b>
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Ravi

Similar Messages

  • Cl_gui_frontend_services= file_exist is not reading files from C drive

    Hi experts ,
    I am using the method 'cl_gui_frontend_services=>file_exist' to check whether a file exists in frontend machine or not. This method works fine and gives corerct result when i keep the file on desktop and provide the path of the files as parameter to the program but it is unable to check the existance of the same file if kept in C drive under folder program files e.g.(C:/Program files/Documware/Barcode.exe). Is this a limitation of the method or is due to some restriction/access permitions at system level that files could not be read from program files in C drive . kinldy provide your useful inputs if any one faced same issue and what is the  solution for this problem .
    Regards
    Priyank

    ALL FUNCTION 'DX_FILE_EXISTENCE_CHECK'
        EXPORTING
          filename             = file
          pc                       = 'X'
    *   SERVER              =
        IMPORTING
          file_exists           = file_exist
    IF NOT ( sy-subrc = 0 and file_exist = 'X' )
      MESSAGE  'the input file does not exist.' TYPE 'E'.
    ENDIF.

  • SERVICES= FILE_EXIST  not work in background  , what else can work ?

    i was trying to locate file in background job by using method  :
    CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
    but the job been cancel when i call this method not in online  .
    what else ( may be function ) can do the work  (locate file for Existence) ?
    thanks .

    why i need it  ?
    i have to upload the file in the following way  :
        SUBMIT (YITF_NAME-IFCPROGRAM) AND RETURN
               USING SELECTION-SET YITF_NAME-IFCVARIANT
            via selection-screen
               EXPORTING LIST TO MEMORY.
    this is  lsmw program that do the upload but she expect to the file  ,
    3 years it was working fine  , but now its start to do problem  ,
    by the messages , i can see that the lsmw is search for
    the file and not find it  .
    there allote of reason why it happend but i want to check
    first of all if the file is created  , and than to decide what to do  .
    ok , may be the open dataset can solve my problem  .
    i will check it .

  • CL_GUI_FRONTEND_SERVICES in select loop

    Hi all,
    I have a problem using CL_GUI_FRONTEND_SERVICES=>FILE_EXIST within a select loop. I want to loop through a databasetable with filenames and if the file exists, do some stuff with it. The method works good, but when the loop is executed and the next SELECT is executed I get a short dump:
    DBIF_RSQL_INVALID_CURSOR
    CX_SY_OPEN_SQL_DB
    Invalid interruption of a database selection.
    This is my code:
    SELECT file FROM files  INTO l_file.
                   WHERE EXTID = p_extid AND UNAME = sy-uname.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
                    EXPORTING
                      FILE                 = l_strfloc
                      RECEIVING
                      RESULT               = l_result.
    ENDSELECT.

    Better select data into table.
    then use
    LOOP AT ITAB.
       CALL GUI_FRONT END SERVICES.
    ENDLOOP.
    OTHER WISE......you cannot interfere the Prsentation (Desktop) Servier Logic with the DATA BASE LOGIC ....SELECT ENDSELECT.
    Vijay

  • "WS_QUERY" is obsolete in ECC 6.0

    Hi Guys
    Which is the correct Function module in ECC 6.0 is related to "WS_QUERY"
    Thanks,
    Gourisankar.

    Refer to this thread in sdn
    CALL FUNCTION 'WS_QUERY'
    or refer
    Use the appropriate module from the function group SFES.
    The appropriate function modules from funciton group SFES.
    GUI_GET_DESKTOP_INFO
    GUI_GET_FILE_INFO
    GUI_EXEC
    GUI_RUN etc
    The Equivalent Function Module for in ABAP 4.7 is
    WS_QUERY-File Exist is CL_GUI_FRONTEND_SERVICES=>FILE_EXIST , or ,
    WS_QUERY-Directory Exist is CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST.
    Reward if useful.

  • How to print PDF file content from ABAP in background?

    Hi,
    Is it possible to print PDF file content from ABAP in background?
    I have some PDF content which I need to print it, these PDF files are generated outside the SAP.
    Please have you any suggestions?
    Thank you
    Tomas

    <b><u>Solution:</u></b><br>
    <br>
    The target output device must support PDF print, this is only one limitation.<br>
    <br>
    REPORT  z_print_pdf.
    TYPE-POOLS: abap, srmgs.
    PARAMETERS: p_prnds LIKE tsp01-rqdest OBLIGATORY DEFAULT 'LOCL',
                p_fname TYPE file_table-filename OBLIGATORY LOWER CASE,
                p_ncopi TYPE rspocopies OBLIGATORY DEFAULT '1',
                p_immed AS CHECKBOX.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      DATA: lv_rc     TYPE i,
            lv_filter TYPE string.
      DATA: lt_files TYPE filetable.
      FIELD-SYMBOLS: <fs_file> LIKE LINE OF lt_files.
      CONCATENATE 'PDF (*.pdf)|*.pdf|' cl_gui_frontend_services=>filetype_all INTO lv_filter.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          file_filter             = lv_filter
        CHANGING
          file_table              = lt_files
          rc                      = lv_rc
        EXCEPTIONS
          OTHERS                  = 1.
      IF sy-subrc NE 0 AND lv_rc EQ 0.
        MESSAGE 'Error' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      READ TABLE lt_files ASSIGNING <fs_file> INDEX 1.
      IF sy-subrc EQ 0.
        p_fname = <fs_file>-filename.
      ENDIF.
    AT SELECTION-SCREEN.
      DATA: lv_name   TYPE string,
            lv_result TYPE boolean.
      lv_name = p_fname.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = lv_name
        RECEIVING
          result               = lv_result
        EXCEPTIONS
          OTHERS               = 1.
      IF sy-subrc NE 0.
        MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      IF lv_result NE abap_true.
        MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
    START-OF-SELECTION.
    END-OF-SELECTION.
      PERFORM process.
    FORM process.
      DATA: lv_name     TYPE string,
            lv_size     TYPE i,
            lv_data     TYPE xstring,
            lv_retcode  TYPE i.
      DATA: lt_file TYPE srmgs_bin_content.
      lv_name = p_fname.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename                = lv_name
          filetype                = 'BIN'
        IMPORTING
          filelength              = lv_size
        CHANGING
          data_tab                = lt_file
        EXCEPTIONS
          OTHERS                  = 1.
      IF sy-subrc NE 0.
        MESSAGE 'Read file error!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = lv_size
        IMPORTING
          buffer       = lv_data
        TABLES
          binary_tab   = lt_file
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
      IF sy-subrc NE 0.
        MESSAGE 'Binary conversion error!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      PERFORM print USING p_prnds lv_data CHANGING lv_retcode.
      IF lv_retcode EQ 0.
        WRITE: / 'Print OK' COLOR COL_POSITIVE.
      ELSE.
        WRITE: / 'Print ERROR' COLOR COL_NEGATIVE.
      ENDIF.
    ENDFORM.                    " PROCESS
    FORM print USING    iv_prndst  TYPE rspopname
                        iv_content TYPE xstring
               CHANGING ev_retcode TYPE i.
      DATA: lv_handle    TYPE sy-tabix,
            lv_spoolid   TYPE rspoid,
            lv_partname  TYPE adspart,
            lv_globaldir TYPE text1024,
            lv_dstfile   TYPE text1024,
            lv_filesize  TYPE i,
            lv_pages     TYPE i.
      CLEAR: ev_retcode.
      CALL FUNCTION 'ADS_SR_OPEN'
        EXPORTING
          dest            = iv_prndst
          doctype         = 'ADSP'
          copies          = p_ncopi
          immediate_print = p_immed
          auto_delete     = 'X'
        IMPORTING
          handle          = lv_handle
          spoolid         = lv_spoolid
          partname        = lv_partname
        EXCEPTIONS
          OTHERS          = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ADS_GET_PATH'
        IMPORTING
          ads_path = lv_globaldir.
      CONCATENATE lv_globaldir '/' lv_partname '.pdf' INTO lv_dstfile.
      OPEN DATASET lv_dstfile FOR OUTPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      TRANSFER iv_content TO lv_dstfile.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CLOSE DATASET lv_dstfile.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ZBAP_RM_PDF_GET_PAGES'
        EXPORTING
          iv_content = iv_content
        IMPORTING
          ev_pages   = lv_pages.
      lv_filesize = XSTRLEN( iv_content ).
      CALL FUNCTION 'ADS_SR_CONFIRM'
        EXPORTING
          handle   = lv_handle
          partname = lv_partname
          size     = lv_filesize
          pages    = lv_pages
          no_pdf   = ' '
        EXCEPTIONS
          OTHERS   = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ADS_SR_CLOSE'
        EXPORTING
          handle = lv_handle
        EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
    ENDFORM.                    " PRINT

  • Issue in Download file - If the file name is same

    Hi Experts,
    I have a requirement to download the company code hierarchy data into a file. On selection screen I am giving the file path along with the file name If I run the report it is downloading the data into the particular file in the file path this is expected result but if i am running the report with same filename which is already exists in the same path then instead of replacing the file with new data it is appending the data to that file.
    But my expected result is: If the file name is same, file should be replaced with the Current Data instead of Appending the file.
    And this issue is happening for the file formats TXT and CSV and also this issue is happening only when i am saving to the local drive.
    I executed  the report by giving the file name Eg: " XXXX.xls" extension even in this case the records getting replaced with the new data, problem is when the file extension is with TXT and CSV formats.
    FYI... to download the data i am using the below funtion module and i am passing the below parameters: Please correct me if i am wrong.
       CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
           FILENAME                        = G_LFILE
           FILETYPE                        = G_FILETYPE
           APPEND                          = 'X'
           WRITE_FIELD_SEPARATOR           = GC_FIELDSEP    " Passing X
           TRUNC_TRAILING_BLANKS           = GC_TRUNCBLNKS " Passing X
           DAT_MODE                        = GC_DATMODE                 "Passing X
           CODEPAGE                        = G_LCODEPAGE
          TABLES
            DATA_TAB                        = GT_ITAB_HIER1
         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
           OTHERS                          = 22
        IF SY-SUBRC <> 0.
          G_FNAME = G_LFILE.
          MESSAGE E043(ZFI) WITH G_FNAME.
        ENDIF.
    Can any one please provide me the solution.
    Thanks in advance.
    Koushik

    Hi all,
    Issue got resolve. I have used the class CL_GUI_FRONTEND_SERVICES
    and the methods file_delete and file_exist. below is the sample code :
      1)  Write the below code in subroutine “PEFORM FILL_DATA_FILE” to check the given file exists in the directory or not.
    DATA: lv_FILENAME TYPE STRING,
               lv_RESULT  TYPE C,
               lv_rc TYPE i.
               lv_FILENAME = g_lfile.
        CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
          EXPORTING
               FILE                 = lv_FILENAME
          RECEIVING
               RESULT               = lv_RESULT
          EXCEPTIONS
               CNTL_ERROR                          = 1
               ERROR_NO_GUI                     = 2
               WRONG_PARAMETER          = 3
               NOT_SUPPORTED_BY_GUI  = 4
               OTHERS                                   = 5.
        IF lv_RESULT = 'X'.
          lV_RC = '1'.
        ELSE.
          lV_RC = '0'.
        ENDIF.
      2)  If the given file is exists in the directory(or in the given file path) delete or modify that file with the current data
          for that add the below code :
             IF lv_rc = 1.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
          EXPORTING
            FILENAME             = lv_FILENAME
            CHANGING
            RC                           = lv_RC
          EXCEPTIONS
            FILE_DELETE_FAILED   = 1
            CNTL_ERROR                = 2
            ERROR_NO_GUI           = 3
            FILE_NOT_FOUND       = 4
            ACCESS_DENIED           = 5
            UNKNOWN_ERROR      = 6
            NOT_SUPPORTED_BY_GUI = 7
            WRONG_PARAMETER      = 8
          OTHERS               = 9.
        IF SY-SUBRC <> 0.
           *           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           *           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.       
       ENDIF.
       ENDIF.
    Thanks,
    koushik

  • Problems in uploading from excel sheet to internal table

    hi experts,
    i got one problem regarding uploading data from excel sheet to int.table. I used FM ALSM_EXCEL_TO_INTERNAL_TABLE but in that the value is char of 50. but i need a case where i have to send value more than 50 characters. please suggest me any other FM to overcome this problem.
    advanced thanks
    vijay

    Hi,
    >
    Vijay Krishna Arvapalli wrote:
    > hi tarun,
    >
    > thank you for your reply
    >
    > but when i tried to use FM TEXT_CONVERT_XLS_TO_SAP it is giving error actually that 'Error generating the test frame'.
    >
    > so can you suggest me with some other option where i can upload the field with more than 50 character length.
    >
    > thank you
    > regards
    > vijay
    Yes, when you execute the FM from SE37, then it displays a message.
    Just copy the below code and paste it in a report (SE38) and execute.
    Create a file in C:/ with name test.xls and execute it will display the records even with more than 50 characters of length.
    I have tested and its working.
    I have taken three fields in the excel file empid, name and doj.
    TYPE-POOLS : truxs.
    PARAMETERS : p_file TYPE rlgrap-filename DEFAULT 'C:\TEST.XLS'.
    DATA : BEGIN OF itab OCCURS 0,
             empid(150) TYPE c,
             name(150) TYPE c,
             doj(150) TYPE c,
           END OF itab.
    DATA: it_raw TYPE truxs_t_text_data.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM f4_file_process USING p_file.
    AT SELECTION-SCREEN.
      PERFORM validate_file_path USING p_file.
    START-OF-SELECTION.
      PERFORM upload_data.
    END-OF-SELECTION.
      PERFORM display_data.
    *&      Form  F4_FILE_PROCESS
    *       text
    *      -->P_FILE_PATH  text
    FORM f4_file_process USING p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
      IF sy-subrc NE 0.
        MESSAGE e000(zsd).
      ENDIF.
    ENDFORM.                    " F4_FILE_PROCESS
    *&      Form  VALIDATE_FILE_PATH
    *       text
    *      -->P_FILE  text
    FORM validate_file_path USING p_file.
      DATA : lv_dir TYPE string,
             lv_file TYPE string,
             lv_result(1) TYPE c.
      DATA : lv_filename TYPE string.
      lv_filename = p_file.
      CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
        EXPORTING
          full_name     = p_file
        IMPORTING
          stripped_name = lv_file
          file_path     = lv_dir
        EXCEPTIONS
          x_error       = 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.
      CALL METHOD cl_gui_frontend_services=>directory_exist
        EXPORTING
          directory            = lv_dir
        RECEIVING
          result               = lv_result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF lv_result IS INITIAL.
        MESSAGE 'Invalid Directory' TYPE 'E'.
      ENDIF.
      CLEAR lv_result.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = lv_filename
        RECEIVING
          result               = lv_result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF lv_result IS INITIAL.
        MESSAGE 'Invalid File' TYPE 'E'.
      ENDIF.
    ENDFORM.                    " VALIDATE_FILE_PATH
    *&      Form  UPLOAD_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM upload_data .
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator    = 'X'
          i_line_header        = 'X'
          i_tab_raw_data       = it_raw
          i_filename           = p_file
        TABLES
          i_tab_converted_data = itab[]
        EXCEPTIONS
          conversion_failed    = 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.                    " UPLOAD_DATA
    *&      Form  DISPLAY_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_data .
      LOOP AT itab.
        WRITE : / itab-empid, itab-name, itab-doj.
      ENDLOOP.
    ENDFORM.                    " DISPLAY_DATA
    Hope this helps you.
    Regards,
    Tarun

  • Check if files exist using ABAP

    Hi All,
    I'm currently using FM: FILE_GET_NAME_USING_PATH, and I'd like to do a check to see if the filepath with file (i.e. /com/tmp/file.txt) I am getting back exists or not.
    Very simple question, just not sure what to do.
    Thanks,
    John

    There is a class that provides methods to check, if a file exist or if a certain directory does exist
      CALL METHOD cl_gui_frontend_services=>directory_exist
        EXPORTING
          directory            = lv_path
        RECEIVING
          result               = lv_valid
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
          CALL METHOD cl_gui_frontend_services=>file_exist
            EXPORTING
              file                 = x_file_with_path
            RECEIVING
              result               = y_file_exists
            EXCEPTIONS
              cntl_error           = 1
              error_no_gui         = 2
              wrong_parameter      = 3
              not_supported_by_gui = 4
              OTHERS               = 5.
    Hope that helps,
    Michael

  • File path error in same screen.

    hey guys,
    I want to check my file path validation and display error in same screen itself.
    I used my GUI_UPLOAD method in START OF SELECTION. to read the file.
    If error it displays error in some other plain screen.
    I know AT selection screen will allow me to display in same screen.
    But is the way of using GUI_UPLOAD method in AT selection screen is advisable?
    or else please give me alternate way.
    ambichan

    Hi
    You can use in AT Selection screen
    data result.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
      EXPORTING
        FILE                 =  'C:\test.txt'
      RECEIVING
        RESULT               =
    EXCEPTIONS
       CNTL_ERROR           = 1
       ERROR_NO_GUI         = 2
       WRONG_PARAMETER      = 3
       NOT_SUPPORTED_BY_GUI = 4
       others               = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    the return parameter will be "X" if file exists else it will be blank.
    Cheers

  • F4 for filename does not behave good in CALL SELECTION_SCREEN?

    I have a F4_File name called on value -request for p_file which was decalred as part of the CALL SELECTION-SCREEN 500
    It does bring up the file dialog but gets out of the loop as soon as the EXECUTE button is clicked?
    How to over come this?

    That is the standard behvaiour. The value will be in changing parameter (file_table              = t_filetable). you need to read the value.
    Check out this example.
    at selection-screen on value-request for pu_path.
      clear: t_rc.
      refresh: t_filetable.
      call method cl_gui_frontend_services=>file_open_dialog
        exporting
          window_title            = 'Gui upload demo'
          with_encoding           = 'X'
          initial_directory       = 'C:\test\'
         FILE_FILTER             = '*.XLS'
         DEFAULT_EXTENSION       = 'Excel files [*.XLS]'
        changing
          file_table              = t_filetable
          rc                      = t_rc
          user_action             = user_action
          file_encoding           = encoding
        exceptions
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          others                  = 5.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      elseif user_action eq 0.
        read table t_filetable into wa_filetable index 1.
        t_path = wa_filetable-filename.
        call method cl_gui_frontend_services=>file_exist
          exporting
            file                 = t_path
          receiving
            result               = abap_bool
          exceptions
            cntl_error           = 1
            error_no_gui         = 2
            wrong_parameter      = 3
            not_supported_by_gui = 4
            others               = 5.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        elseif abap_bool eq 'X'.
          pu_path = t_path.
        else.
      Message File does not exist.
        endif.
      endif.
    If you have questions, look at method documentation.

  • Report without a selection-screen, just a dynpro

    Hi experts,
    I wrote a small report, which reads out a file. After this I want to display it in a tablecontrol of my dynpro. In the dynpro there is a button to push the data of the tablecontrol in the R/3 via BDC.
    Now I have the problem of a automatic generated Selection-Screen. Which has some fields of my used variables (e.g. file-name, file-typ) and even maybe 10 fields (input-fields and checkboxes) from the BDC program.
    The fact is that it is not possible to use this code, simply without any "START-OF-SELECTION" statement:
    REPORT ZMM_REPORT01.
    TABLES: mseg.
    TYPES:  BEGIN of input_struk,
              matnr TYPE mseg-matnr,
              erfmg TYPE mseg-erfmg,
            END   of input_struk,
           tt_input TYPE TABLE OF input_struk.
    DATA: it_input TYPE tt_input.
    DATA: wa_input LIKE LINE OF it_input.
    CALL SCREEN 100.
    The error is: "Statement 'CALL SCREEN 100' couldnt be reached."
    If I use the program-type M for PROGRAM and not type 1 for REPORT. Then fails with the necessary INCLUDE statement of the BDC program.
    Regards,
    Steffen

    ok, if I decode your big letters, I have to put the CALL SCREEN at the end of my program.
    so I do that but I didn't work . error: the call-statement could be reached.
    REPORT ZMM_REPORT01.
    TABLES: mseg.
    TYPES:  BEGIN of input_struk,
              matnr TYPE mseg-matnr,
              erfmg TYPE mseg-erfmg,
            END   of input_struk,
           tt_input TYPE TABLE OF input_struk.
    DATA: it_input TYPE tt_input.
    DATA: wa_input LIKE LINE OF it_input.
    PARAMETERS: fname TYPE rlgrap-filename DEFAULT 'c:lagerver.dat',
                ftype TYPE rlgrap-filetype DEFAULT 'ASC',
                bwart TYPE MSEG-BWART DEFAULT 201,
                werks TYPE MSEG-WERKS DEFAULT 2000,
                lgort TYPE MSEG-LGORT DEFAULT 2500,
                kostl TYPE COBL-KOSTL DEFAULT 201300.
    START-OF-SELECTION.
    * PBO Module
    MODULE pbo_0100 OUTPUT.
      SET TITLEBAR 'TITLE_100'.
      SET PF-STATUS 'SCREEN_100'.
      PERFORM z_daten_input.
      PERFORM z_convert_dummy.
    ENDMODULE.
    * PAI Module
    MODULE pai_0100 INPUT.
      IF sy-ucomm = 'BACK' OR
         sy-ucomm = 'EXIT' OR
         sy-ucomm = 'CANCEL'.
         LEAVE PROGRAM.
      ELSE.
      DATA: l_date TYPE sy-datum.
      >THE BDC PROGRAM statements<
      ENDIF.
    ENDMODULE.
    FORM z_daten_input.
    DATA: filename TYPE string,   " UNICODE
          result   TYPE boolean.
          filename = fname.
    REFRESH: it_input.
    CALL METHOD cl_gui_frontend_services=>file_exist
      EXPORTING    file       = filename
      RECEIVING    RESULT     = result.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       filename                      = filename
       filetype                      = 'ASC'
       READ_BY_LINE                  = 'X'
       REPLACEMENT                   = '#'
    CHANGING
       data_tab                      = t_dummy[].
    ENDFORM.
    FORM z_convert_dummy.
      LOOP AT T_DUMMY.
        wa_input-matnr = T_DUMMY-VAR+0(11).
        wa_input-erfmg = T_DUMMY-VAR+33(5).
        APPEND wa_input TO it_input.
      ENDLOOP.
    ENDFORM.
    *&spwizard: declaration of tablecontrol 'TC_FILE' itself
    controls: TC_FILE type tableview using screen 0100.
    *&spwizard: output module for tc 'TC_FILE'. do not change this line!
    *&spwizard: update lines for equivalent scrollbar
    module TC_FILE_change_tc_attr output.
      describe table IT_INPUT lines TC_FILE-lines.
    endmodule.
    CALL SCREEN 100.

  • BAPI to change purchase order to put deletion flag

    Hello Guru's,
            We are about to archive data & for that we need that according to date range all open purchase order ,open purchase requsitions & open RFQ should be marked for deletion.
    Is there some BAPI to do so.Please guide.

    *DELETING FLAG *
    REPORT ZMMR_DELETEPO NO STANDARD PAGE HEADING MESSAGE-ID zisb.
    tables : zvtls_sap.
    *C-- Types Declarations
    TYPES : BEGIN OF tp_flatfile_vtls,
            ebeln(10),
            ebelp type ekpo-ebelp,
            END OF tp_flatfile_vtls.
    *=====================================================================
                      INTERNAL TABLES DECLARATION
    *=====================================================================
    DATA:  t_flatfile_vtls TYPE tp_flatfile_vtls OCCURS 0 WITH HEADER LINE.
    data : begin of t_sapdata occurs 0,
           po like zvtls_sap-posap,
           item like zvtls_sap-itemsap,
           end of t_sapdata.
    data : begin of t_flatfile_vtls1 occurs 0,
           po(10),
           item like zvtls_sap-itemsap,
           end of t_flatfile_vtls1.
    data : begin of t_update occurs 0,
           mandt like zvtls_sap-mandt,
           povtls like zvtls_sap-povtls,
           itemvtls like zvtls_sap-itemvtls,
           posap like zvtls_sap-posap,
           itemsap like zvtls_sap-itemsap,
           aedat like zvtls_sap-aedat,
           paedt like zvtls_sap-paedt,
           loekz like zvtls_sap-loekz,
           end of t_update.
    data : begin of t_poheader occurs 0,
           po like zvtls_sap-posap,
           end of t_poheader.
    data : begin of t_poitem occurs 0,
           po like zvtls_sap-posap,
           item like zvtls_sap-itemsap,
           end of t_poitem.
    DATA : BEGIN OF T_MESSAGE OCCURS 0,
           MSGTY,
           MSGID(2),
           MSGNO(3),
           MSGTX(100),
           PO like zvtls_sap-povtls,
           item like zvtls_sap-itemvtls,
           END OF T_MESSAGE.
    DATA : BEGIN OF t_bapi_poheader OCCURS 0.
            INCLUDE STRUCTURE bapimepoheader.
    DATA : END OF t_bapi_poheader.
    DATA : BEGIN OF t_bapi_poheaderx OCCURS 0.
            INCLUDE STRUCTURE bapimepoheaderx.
    DATA : END OF t_bapi_poheaderx.
    DATA : BEGIN OF t_bapi_poitem OCCURS 0.
            INCLUDE STRUCTURE bapimepoitem.
    DATA : END OF t_bapi_poitem.
    DATA : BEGIN OF t_bapi_poitemx OCCURS 0.
            INCLUDE STRUCTURE bapimepoitemx.
    DATA : END OF t_bapi_poitemx.
    DATA : BEGIN OF t_bapireturn OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA : END OF t_bapireturn.
    *=====================================================================
                      V A R I A B L E S
    *=====================================================================
    DATA: w_success(6)  TYPE n,
          w_bklas like t023-bklas,
          w_curryear(4),
          w_begda like sy-datum,
          w_endda like sy-datum,
          w_begyr(4),
          w_endyr(4),
          w_currmon(2),
          w_assetclass like ankt-anlkl,
          w_price type p,
          w_recordsap type i,
          w_povtls(10),
          w_count type i.
    DATA:  w_filepath TYPE rlgrap-filename,
           w_rc TYPE sy-subrc,
           w_sscrfields_ucomm1   TYPE sscrfields-ucomm,
           w_file1 TYPE string,
           w_file2 TYPE FILENAME-FILEINTERN.
    *=====================================================================
                      C O N S T A N T S
    *=====================================================================
    CONSTANTS: c_x              TYPE  c         VALUE 'X',
               c_hyp            TYPE  c         VALUE '-',
               c_err            TYPE  bdc_mart  VALUE 'E'.
    CONSTANTS:  c_slash(1)            TYPE c VALUE '/',
                c_hash(1)             TYPE c VALUE '#',
                c_pipe                TYPE c VALUE '|',
                c_1                   TYPE i VALUE 1,
                c_zero                TYPE n VALUE '0',
                c_rg1(3)              TYPE c VALUE 'rg1',
                c_gr3(3)              TYPE c VALUE 'GR3',
                c_gr2(3)              TYPE c VALUE 'GR2',
                c_e(1)                TYPE c VALUE 'E',
                c_filepath(8)         TYPE c VALUE '/interf/',
                c_filetype(10)        TYPE c VALUE 'ASC'.
    CONSTANTS : c_bapimepoheaderx   TYPE x030l-tabname
                                   VALUE 'bapimepoheaderx',
               c_bapimepoitem      TYPE  x030l-tabname
                                   VALUE 'bapimepoitem',
               c_bapimepoaccount   TYPE  x030l-tabname
                                   VALUE 'bapimepoaccount',
               c_t_bapi_poheader(15)        TYPE c
                                            VALUE 't_bapi_poheader',
               c_t_bapi_poitem(13)          TYPE c
                                            VALUE 't_bapi_poitem',
               c_t_bapi_poitemx(14)         TYPE c
                                            VALUE 't_bapi_poitemx',
               c_t_bapi_poheaderx(16)       TYPE c
                                            VALUE 't_bapi_poheaderx'.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    CONSTANTS:con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *======================================================================
                           SELECTION SCREEN
    *======================================================================
    SELECTION-SCREEN BEGIN OF BLOCK inputpath WITH FRAME TITLE text-001.
    SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS : p_fore RADIOBUTTON GROUP rg1
                        USER-COMMAND pc,
                 p_back RADIOBUTTON GROUP rg1 DEFAULT 'X'.
    SELECTION-SCREEN : END OF BLOCK blk2.
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-003.
    PARAMETERS :  p_file1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr2.
    PARAMETERS :  p_afile1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr3.
    SELECTION-SCREEN : END OF BLOCK blk1.
    SELECTION-SCREEN END OF BLOCK inputpath.
    *C-- Initialization Event
    INITIALIZATION.
      CLEAR w_filepath.
      CONCATENATE c_filepath sy-sysid c_slash sy-mandt c_slash INTO
      w_filepath.
      CONDENSE w_filepath NO-GAPS.
      p_file1 = text-008.
      p_afile1 = text-009.
    *======================================================================
                           SELECTION SCREEN EVENTS
    *======================================================================
    *C-- Selection Screen Output
    AT SELECTION-SCREEN OUTPUT.
      IF p_fore = c_x.
        w_sscrfields_ucomm1 = space.
      ELSE.
        w_sscrfields_ucomm1 = c_rg1.
      ENDIF.
      LOOP AT SCREEN.
    *C--Modify selection screen if presentation
    *C--or application server radio button is chosen
        IF w_sscrfields_ucomm1 = space.
          IF screen-group1 = c_gr3.
            screen-active = c_zero.
          ENDIF.
        ELSE.
          IF screen-group1 = c_gr2.
            screen-active = c_zero.
          ENDIF.
        ENDIF.
        if screen-name = 'P_AFILE1'.
          screen-input = 0.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    *C-- Selection Screen VALUE-REQUEST FOR File path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      IF p_fore EQ c_x.
        CALL FUNCTION 'F4_FILENAME'
          EXPORTING
            program_name  = syst-cprog
            dynpro_number = syst-dynnr
          IMPORTING
            file_name     = p_file1.
      ENDIF.
    *C-- At Start of the Selection Process
    START-OF-SELECTION.
      IF p_fore EQ c_x.
        w_file1 = p_file1.
      ELSE.
        w_file2 = p_afile1.
      ENDIF.
      IF p_fore EQ c_x. " Presentaion Server
    *C--Validations for the input files
        PERFORM validate_pre_file USING p_file1.
    *C-- Load the contents of the input file into the internal table
        PERFORM upload_file TABLES t_flatfile_vtls
                            USING w_file1
                            CHANGING w_rc.
        IF w_rc <> 0.
          MESSAGE s006 DISPLAY LIKE c_e.
        ENDIF.
      ELSE. " Application Server
    *C--Validations for the input files
        PERFORM validate_app_file USING  w_file2.
    *C-- Load the contents of the input file into the internal table
        PERFORM upload_file_app TABLES t_flatfile_vtls
                                USING w_file2
                                CHANGING w_rc.
      ENDIF.
      loop at t_flatfile_vtls.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = t_flatfile_vtls-ebeln
          IMPORTING
            output = t_flatfile_vtls1-po.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = t_flatfile_vtls-ebelp
          IMPORTING
            output = t_flatfile_vtls1-item.
        append t_flatfile_vtls1.
        clear t_flatfile_vtls1.
      endloop.
      perform get_podata.
      loop at t_poheader.
        perform move_to_bapi.
        perform call_bapi.
      endloop.
      PERFORM STORE_MESSAGES TABLES T_MESSAGE.
    *&      Form  validate_pre_file
        Routine to validate presentation server file path.
         -->fp_name  text
    FORM validate_pre_file USING fp_name TYPE rlgrap-filename.
      DATA : l_result,
             l_filename TYPE string.
      l_filename = fp_name.
      CLEAR l_result.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = l_filename
        RECEIVING
          result               = l_result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF sy-subrc <> 0.
        MESSAGE s007 DISPLAY LIKE c_e.
        LEAVE LIST-PROCESSING.
      ELSEIF l_result IS INITIAL.
        MESSAGE s008 DISPLAY LIKE c_e.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " validate_pre_file_hdr
    *&      Form  validate_app_file
          text - Checks if the path entered and filename is correct
    FORM validate_app_file USING  fp_file  TYPE FILENAME-FILEINTERN.
      data : l_fname(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = FP_FILE
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = '0'.
        OPEN DATASET  L_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 0.
          MESSAGE s007 DISPLAY LIKE c_e.
        ELSE.
          CLOSE DATASET l_fname.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_app_file
    *&      Form  upload_file
          Routine to upload data from file to tables.
         -->P_fp_flatfile
         -->P_fp_file
         <--P_fp_rc
    FORM  upload_file TABLES   fp_flatfile
                      USING    fp_file TYPE string
                      CHANGING fp_rc TYPE sy-subrc.
      IF fp_flatfile[] IS INITIAL.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                = fp_file
            filetype                = c_filetype
            has_field_separator     = c_x
          TABLES
            data_tab                = fp_flatfile
          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.
        MOVE sy-subrc TO fp_rc.
      ENDIF.
    ENDFORM.  " upload_file
    *&      Form  upload_file_app
          text
         -->FP_FLATFILEtext
         -->FP_FILE    text
         -->FP_RC      text
    FORM  upload_file_app TABLES   fp_flatfile
                          USING    fp_file TYPE FILENAME-FILEINTERN
    CHANGING fp_rc TYPE sy-subrc.
      DATA: l_string TYPE tedata-data.
      DATA: wa_data_file TYPE tp_flatfile_vtls,
            l_wllength TYPE i,
            FNAME(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = FP_FILE
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = 0.
        OPEN DATASET  FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 0.
    *C-- commented by Bikash
         MESSAGE s107(yaero_ps) DISPLAY LIKE c_e.
          message e008.
        ELSE.
          DO.
            CLEAR: l_string.
            READ DATASET  FNAME INTO l_string LENGTH l_wllength.
            IF sy-subrc NE 0.
              EXIT.
            ELSE.
              SPLIT l_string AT con_tab INTO   wa_data_file-ebeln
                                               wa_data_file-ebelp.
              APPEND wa_data_file TO fp_flatfile.
            ENDIF.
          ENDDO.
          CLOSE DATASET  FNAME.
        ENDIF.
      ENDIF.
    ENDFORM.  " upload_file_app
    *&      Form  get_podata
          text
    form get_podata.
      select *
      into table t_update
      from zvtls_sap
      for all entries in t_flatfile_vtls1
       where itemvtls = t_flatfile_vtls1-item
      and povtls = t_flatfile_vtls1-po.
      sort t_update by posap itemsap.
      loop at t_update.
        at new posap.
          t_poheader-po = t_update-posap.
          append t_poheader.
          clear t_poheader.
        endat.
        t_poitem-po = t_update-posap.
        t_poitem-item = t_update-itemsap.
        append t_poitem.
        clear t_poitem.
        t_update-paedt = sy-datum.
        t_update-loekz = 'X'.
        modify t_update.
      endloop.
      modify zvtls_sap from table t_update.
    endform.                    "get_podata
    *&      Form  move_to_bapi
          text
    form move_to_bapi.
      t_bapi_poheader-po_number = t_poheader-po.
      CLEAR t_bapi_poheaderx.
      PERFORM fill_check_structure USING c_bapimepoheaderx
                                         c_t_bapi_poheader
                                         c_t_bapi_poheaderx
                                         c_x.
      refresh : t_bapi_poitem,t_bapi_poitemx.
      loop at t_poitem where po = t_poheader-po.
        clear t_bapi_poitem.
        t_bapi_poitem-po_item = t_poitem-item.
        t_bapi_poitem-delete_ind = 'X'.
        CLEAR t_bapi_poitemx.
        PERFORM fill_check_structure USING c_bapimepoitem
                                           c_t_bapi_poitem
                                           c_t_bapi_poitemx
                                           c_x.
        t_bapi_poitemx-po_item = t_poitem-item.
        t_bapi_poitemx-po_itemx = c_x.
        APPEND t_bapi_poitem.
        APPEND t_bapi_poitemx.
        clear t_bapi_poitem.
        clear t_bapi_poitemx.
      endloop.
    endform.                    "move_to_bapi
    *&      Form  call_bapi
          This form Routine is used to commit the data records
    FORM call_bapi .
      DATA : l_msgty      TYPE c,
             l_msgid(2)   TYPE c,
             l_msgno(3)   TYPE c,
             l_msgtx(100) TYPE c,
             l_errflag    TYPE c.
      CLEAR: t_bapireturn.
      REFRESH: t_bapireturn.
      *CALL FUNCTION 'BAPI_PO_CHANGE'*
        EXPORTING
          PURCHASEORDER = T_POHEADER-PO
          POHEADER      = T_BAPI_POHEADER
          POHEADERX     = T_BAPI_POHEADERX
        TABLES
          RETURN        = T_BAPIRETURN
          POITEM        = T_BAPI_POITEM
          POITEMX       = T_BAPI_POITEMX.
      READ TABLE t_bapireturn WITH KEY type = c_err TRANSPORTING NO FIELDS.
      IF sy-subrc NE 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = c_x.
      ENDIF.
    *C-- Write messages
      WRITE: / 'PO Number', t_poheader-po.
      clear : t_update,w_povtls.
      read table t_update with key posap = t_poheader-po.
      w_povtls = t_update-povtls.
      CLEAR l_errflag.
      LOOP AT t_bapireturn.
        CLEAR: l_msgty, l_msgid, l_msgno, l_msgtx.
        l_msgty = t_bapireturn-type.
        l_msgid = t_bapireturn-id.
        l_msgno = t_bapireturn-number.
        l_msgtx = t_bapireturn-message.
        WRITE: / l_msgty, l_msgid, l_msgno, l_msgtx.
        if l_msgtx cs t_poheader-po.
          w_count = w_count + 1.
          loop at t_update.
            if sy-tabix = w_count.
              t_message-item = t_update-itemvtls.
            endif.
          endloop.
        endif.
        t_message-msgty = l_msgty.
        t_message-msgid = l_msgid.
        t_message-msgno = l_msgno.
        t_message-msgtx = l_msgtx.
        t_message-po = w_povtls.
        append t_message.
        clear t_message.
        IF l_msgty EQ c_err.
          l_errflag = c_x.
        ENDIF.    " l_msgty EQ 'E'
      ENDLOOP.
      ULINE.
      IF l_errflag NE c_x.
        w_success = w_success + 1.
      ENDIF.    " l_errflag NE C_X
    endform.                    "call_bapi
    *&      Form  fill_check_structure
          This form Routine will check whether the specified structure
          exist/active
    FORM fill_check_structure  USING    fp_tabname TYPE any
                                        fp_orgtabname TYPE any
                                        fp_chktabname TYPE any
                                        fp_check TYPE c.
      FIELD-SYMBOLS : <fs_chk>, <fs_org>.
      DATA:    l_char1(61)  TYPE c,
               l_char2(61)  TYPE c.
      DATA:    BEGIN OF tl_nametab OCCURS 60.
              INCLUDE STRUCTURE x031l.
      DATA:    END OF tl_nametab.
      REFRESH tl_nametab.
      CALL FUNCTION 'RFC_GET_NAMETAB'
        EXPORTING
          tabname          = fp_tabname
        TABLES
          nametab          = tl_nametab
        EXCEPTIONS
          table_not_active = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
        CLEAR tl_nametab.
      ENDIF.
      LOOP AT tl_nametab.
        CLEAR: l_char1, l_char2.
        CONCATENATE fp_chktabname c_hyp tl_nametab-fieldname INTO l_char1.
        ASSIGN (l_char1) TO <fs_chk>.
        CONCATENATE fp_orgtabname c_hyp tl_nametab-fieldname INTO l_char2.
        ASSIGN (l_char2) TO <fs_org>.
        IF <fs_org> IS NOT INITIAL.
          <fs_chk> = fp_check.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " fill_check_structure
    *&      Form  STORE_MESSAGES
          text
         -->FP_MESSAGEStext
    FORM STORE_MESSAGES TABLES FP_MESSAGES STRUCTURE T_MESSAGE.
      DATA: wl_output_data LIKE t_MESSAGE.
      DATA: l_catstr TYPE string.
      DATA: l_fieldvalue TYPE string.
      DATA: l_index TYPE i VALUE 1.
      DATA: L_FNAME(60).
      FIELD-SYMBOLS <fs>.
      CLEAR l_catstr.
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = '/USR/SAP/VTLS/POCHANGE/LOG'
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = '0'.
        IF fp_messages[] IS NOT INITIAL.
          OPEN DATASET L_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc NE 0.
            LEAVE LIST-PROCESSING.
          ELSE.
            LOOP AT fp_messages INTO wl_output_data.
              DO.
               ASSIGN COMPONENT l_index OF STRUCTURE wl_output_data TO <fs>.
                IF sy-subrc <> 0.
                  EXIT.
                ENDIF.
                MOVE <fs> TO l_fieldvalue.
                IF l_catstr IS NOT INITIAL.
                  CONCATENATE l_catstr l_fieldvalue INTO l_catstr SEPARATED
                  BY con_tab.
                ELSE.
                  MOVE l_fieldvalue TO l_catstr.
                ENDIF.
                l_index = l_index + c_1.
                CLEAR l_fieldvalue.
                CLEAR <fs>.
              ENDDO.
              l_index = c_1.
              TRANSFER l_catstr TO L_FNAME .
              CLEAR wl_output_data.
              CLEAR l_catstr.
            ENDLOOP.
            CLOSE  DATASET L_FNAME.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "STORE_MESSAGES

  • Download to Excel using METHODS

    I want to change the Worksheet name which in default being created as Sheet1/ Sheet2/ Sheet3 on creation of Excel file while downloading using Objects.
    How should I change the name of Sheet1/ Sheet2/ Sheet3 to my requirement. Attached the coding part. Please help me out in finding the place where I should rename it using which statement.
    FORM excel_download.
      gv_step = 'Starting Excel'.
      CREATE OBJECT gw_excel 'EXCEL.APPLICATION'.
      PERFORM xls_error_hdl.
      SET PROPERTY OF gw_excel 'VISIBLE' = 0.
      GET PROPERTY OF gw_excel 'WORKBOOKS' = gw_wbooks.
      CALL METHOD OF gw_wbooks 'Add'.
    *Create Excel Sheet
      CALL METHOD OF gw_excel 'Worksheets' = gw_worksheet
        EXPORTING
          #1 = 1.
      CALL METHOD OF gw_wbooks 'Activate'.
      SET PROPERTY OF gw_wbooks 'Name' = 'Sheet1'.
      CALL METHOD OF gw_wbooks 'OPEN' = gw_wbooks
        EXPORTING
          #1 = gv_fname.
      CALL METHOD OF gw_wbooks 'Activate' .
    *Download to Worksheet 1.
      GET PROPERTY OF gw_excel 'Worksheets' = gw_worksheet
      exporting #1 = 'Sheet1'.      "S4M1MR
    exporting #1 = 'Appd_Sites'.   "S4M1MR
      PERFORM xls_error_hdl.
      CALL METHOD OF gw_worksheet 'Activate' .
      gv_step = 'Adding data to Excel'.
      gv_row  = 0.
      LOOP AT gi_yps_down_tab1 INTO gw_yps_grid2.
        CLEAR gw_yps_common-anln1.
        gv_row = gv_row + 1.
        gv_col = 2.
        DO 4 TIMES.
          ASSIGN COMPONENT sy-index OF STRUCTURE gw_yps_grid2 TO <comp>.
          PERFORM fill_cell USING gv_row gv_col  <comp>.
          gv_col = gv_col + 1.
        ENDDO.
      ENDLOOP.
    *Download to Worksheet 2.
      GET PROPERTY OF gw_excel 'Worksheets' = gw_worksheet
      exporting #1 = 'Sheet2'.
    exporting #1 = 'Appd Sites'.   "S4M1MR
      PERFORM xls_error_hdl.
      CALL METHOD OF gw_worksheet 'Activate' .
      gv_step = 'Adding data to Excel'.
      gv_row  = 0.
    LOOP AT gi_yps_down_tab2 INTO gw_yps_common.
      LOOP AT gi_yps_down_tab2 INTO gw_exclusion.
        PERFORM conversion.
      ENDLOOP.
    *Download to Worksheet 3.
      GET PROPERTY OF gw_excel 'Worksheets' = gw_worksheet
      exporting #1 = 'Sheet3'.
      PERFORM xls_error_hdl.
      CALL METHOD OF gw_worksheet 'Activate' .
      gv_step = 'Adding data to Excel'.
      gv_row  = 0.
    LOOP AT gi_yps_down_tab3 INTO gw_yps_common.
      LOOP AT gi_yps_down_tab3 INTO gw_exclusion.
        PERFORM conversion.
      ENDLOOP.
    *Download to Worksheet 4.
      CALL METHOD OF gw_excel 'Sheets' = gw_worksheet.
    Add new workbook (create a file)
      CALL METHOD OF gw_worksheet 'Add'.
      FREE OBJECT gw_worksheet.
      GET PROPERTY OF gw_excel 'Worksheets' = gw_worksheet
      exporting #1 = 'Sheet4'.
      PERFORM xls_error_hdl.
      CALL METHOD OF gw_worksheet 'Activate' .
      gv_step = 'Adding data to Excel'.
      gv_row  = 0.
    LOOP AT gi_yps_down_tab4 INTO gw_yps_common.
      LOOP AT gi_yps_down_tab4 INTO gw_exclusion.
        PERFORM conversion.
      ENDLOOP.
    To Save the Book after downloading.
      PERFORM save_excel.
    ENDFORM.                    " EXCEL_DOWNLOAD
    Thanks in advance

    hi,
    chk a sample pgm.
    *&  Include           YHCON9051INCL                                    *
    *   SUBROUTINES                                                       *
    *&      Form  F_CHECK_LOCAL_FILE_EXIST
    *       CHECK WETHER LOCAL FILE EXIST
    *      -->P_FILE LOCAL FILE NAME
    FORM f_check_local_file_exist  USING    p_file.
      DATA: loc_filename TYPE string,
            loc_flag     TYPE abap_bool.
      loc_filename = p_file.
      IF loc_filename Eq ' '.
        MESSAGE e053(8i) .
      ENDIF.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = loc_filename
        RECEIVING
          result               = loc_flag
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF sy-subrc NE wl_yes.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF loc_flag NE wl_true.
        MESSAGE e000(8i) WITH text-020 p_file.
      ENDIF.
    ENDFORM.                    " F_CHECK_LOCAL_FILE_EXIST
    *&      Form  F_UPLOAD_DATA_FROM_LOCAL_FILE
    *       GET DATA FROM EXCEL FILE AND CONVERT TO SAP FORMAT
    *      -->P_FILE LOCAL FILE NAME
    FORM f_upload_data_from_local_file  USING    p_file.
      DATA: loc_filename TYPE rlgrap-filename,
            int_raw      TYPE truxs_t_text_data.
      loc_filename = p_file.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator    = 'X'
          i_line_header        = 'X'
          i_tab_raw_data       = int_raw
          i_filename           = loc_filename
        TABLES
          i_tab_converted_data = int_content_lfile
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc NE wl_yes.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR : int_record , int_content_lfile ,int_record[].
      LOOP AT int_content_lfile.
    * Moving the records to the Internal table for process
        int_record-adm_area = int_content_lfile-adm_area .
        int_record-dsrd_loc = int_content_lfile-dsrd_loc.
        int_record-fl_ind   = int_content_lfile-fl_ind.
        int_record-loc_loc  = int_content_lfile-loc_loc.
        int_record-loc_desc = int_content_lfile-loc_desc .
        APPEND int_record.
        CLEAR  int_record.
      ENDLOOP.
    ENDFORM.                    " F_UPLOAD_DATA_FROM_LOCAL_FILE
    *&      Form  GET_FILE_OPEN_DIALOG
    *      F4 TO FETCH THE FILE
    FORM get_file_open_dialog .
      DATA: lint_filetable TYPE filetable,
            ls_filetable   TYPE file_table,
            li_count TYPE i.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
           window_title            = 'Please select the file'
           default_extension       = '*.XLS'
    *      DEFAULT_FILENAME        =
    *      FILE_FILTER             =
    *      INITIAL_DIRECTORY       =
           multiselection          = ''
    *      WITH_ENCODING           =
         CHANGING
           file_table              = lint_filetable
           rc                      = li_count
    *      USER_ACTION             =
    *      FILE_ENCODING           =
         EXCEPTIONS
           file_open_dialog_failed = 1
           cntl_error              = 2
           error_no_gui            = 3
           not_supported_by_gui    = 4
           OTHERS                  = 5.
      IF sy-subrc <> 0.
      ELSE.
        READ TABLE lint_filetable INDEX 1 INTO ls_filetable.
        IF sy-subrc EQ wl_yes.
          p_lcl = ls_filetable-filename.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_FILE_OPEN_DIALOG
    *&      Form  F_UPLOAD_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_upload_data .
    * To move the data to Internal table fields.
      PERFORM data_transfer.
    ENDFORM.                    " F_UPLOAD_DATA
    *&      Form  F_UPDATE_TABLE
    *       ZTABLE UPDATION
    FORM f_update_table .
      DATA:   wl_sess          TYPE c,
              loc_wf_loc_desc  TYPE  zhofs_loc_desc.
      REFRESH : int_caltrscc, int_caltrerr .
      LOOP AT int_record.
    ** Moving the data as desired for the Z -table updation
    *  PERFORM MOVE_DATA.
        MOVE :
           int_record-adm_area        TO   loc_wf_loc_desc-adm_area  ,
           int_record-dsrd_loc        TO   loc_wf_loc_desc-dsrd_loc ,
           int_record-fl_ind          TO   loc_wf_loc_desc-fl_ind    ,
           int_record-loc_loc         TO   loc_wf_loc_desc-loc_loc   ,
           int_record-loc_desc        TO   loc_wf_loc_desc-loc_desc .
    * Inserting the data to the Table ZHOFS_LOT_TABLE
        INSERT zhofs_loc_desc FROM loc_wf_loc_desc .
        IF sy-subrc EQ wl_yes.
    *     Entry Inserted Correctly
          wf_suc = wf_suc + 1.
          int_caltrscc-adm_area   =  int_record-adm_area .
          int_caltrscc-dsrd_loc   =  int_record-dsrd_loc.
          int_caltrscc-fl_ind     =  int_record-fl_ind.
          int_caltrscc-loc_loc    =  int_record-loc_loc.
          int_caltrscc-reason  =  text-007.
          APPEND int_caltrscc.
          CLEAR  int_caltrscc.
        ELSE.
    *     Entry Not Inserted
          wf_err = wf_err + 1.
          int_caltrerr-adm_area   =  int_record-adm_area .
          int_caltrerr-dsrd_loc   =  int_record-dsrd_loc.
          int_caltrerr-fl_ind     =  int_record-fl_ind.
          int_caltrerr-loc_loc    =  int_record-loc_loc.
          int_caltrerr-reason  =  text-006.
          APPEND int_caltrerr.
          CLEAR  int_caltrerr.
        ENDIF.
        CLEAR :  loc_wf_loc_desc-loc_desc,int_record .
      ENDLOOP.
    ENDFORM.                    " F_UPDATE_TABLE
    *&      Form  DATA_TRANSFER
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM data_transfer .
      DATA : loc_int_loc_desc TYPE TABLE OF zhofs_loc_desc WITH HEADER LINE.
      CLEAR: int_record.
      LOOP AT int_record.
        wf_rec =  wf_rec + 1.
    *  To Check Whether an already any records exists
        SELECT *
        FROM zhofs_loc_desc
        INTO TABLE loc_int_loc_desc
        WHERE
          adm_area = int_record-adm_area AND
          dsrd_loc  = int_record-dsrd_loc AND
          loc_loc = int_record-loc_loc.
        IF sy-subrc EQ wl_yes.
    *     The entry already exist in the Table
          int_error-adm_area   =  int_record-adm_area.
          int_error-dsrd_loc   =  int_record-dsrd_loc.
          int_error-fl_ind      = int_record-fl_ind .
          int_error-loc_loc  = int_record-loc_loc.
          int_error-message =  text-005.
          APPEND int_error.
          CLEAR : int_error.
          wf_err_rec = wf_err_rec + 1.
          CONTINUE.
        ELSE.
          wf_cor_rec = wf_cor_rec + 1 .
        ENDIF.
        CLEAR: int_record.
      ENDLOOP.
      CLEAR: int_record .
      LOOP AT int_error.
        READ TABLE int_record
        WITH KEY
             adm_area = int_error-adm_area
             dsrd_loc = int_error-dsrd_loc
             loc_loc  = int_error-loc_loc .
        IF sy-subrc EQ wl_yes.
    *     Delete the duplicate entries
          DELETE int_record
          WHERE
           adm_area = int_error-adm_area AND
           dsrd_loc    = int_error-dsrd_loc AND
           fl_ind = int_error-fl_ind AND
           loc_loc = int_error-loc_loc .
        ENDIF.
        CLEAR int_error.
      ENDLOOP.
    ENDFORM.                    " DATA_TRANSFER
    *&      Form  f_check_data
    *       Check DATA
    FORM f_check_data .
    *ERROR FULL DATA
      IF wf_err_rec GT 0.
        WRITE:/060(1)   sy-vline, text-000 COLOR 6,sy-vline.
        LOOP AT int_error.
          FORMAT RESET.
          FORMAT COLOR  6 .
          WRITE:/001(1)   sy-vline,
                 002(3)   int_error-adm_area ,
                 005(1)   sy-vline  CENTERED ,
                 006(4)   int_error-dsrd_loc ,
                 010(1)   sy-vline  CENTERED ,
                 011(1)    int_error-fl_ind  ,
                 012(1)   sy-vline  CENTERED,
                 013(4)   int_error-loc_loc  ,
                 017(1)   sy-vline  CENTERED ,
                 018(25)  int_error-message  ,
                 043(1)   sy-vline  CENTERED .
          FORMAT COLOR OFF .
        ENDLOOP.
        WRITE:/001(25)  text-002,wf_err_rec.
        WRITE:/001(25)  text-003,wf_rec .
      ENDIF.
    *SUCCESSFULL DATA
      IF wf_cor_rec GT 0.
        WRITE:/060(1)   sy-vline, text-001 COLOR 1 ,sy-vline.
        LOOP AT int_record.
          FORMAT RESET.
          FORMAT COLOR 1 ON .
          WRITE:/001(1)   sy-vline,
                 002(3)   int_record-adm_area ,
                 005(1)   sy-vline  CENTERED ,
                 006(4)   int_record-dsrd_loc ,
                 010(1)   sy-vline  CENTERED ,
                 011(1)   int_record-fl_ind  ,
                 012(1)   sy-vline  CENTERED,
                 013(4)   int_record-loc_loc  ,
                 017(1)   sy-vline  CENTERED ,
                 018(25)  'PROPER ENTRY' ,
                043(1)   sy-vline  CENTERED .
          FORMAT COLOR OFF .
        ENDLOOP.
        WRITE:/001(25)  text-002,wf_cor_rec .
        WRITE:/001(25)  text-003,wf_rec .
      ENDIF.
    ENDFORM.                    " f_check_data
    *&      Form  f_check_db_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_check_db_data .
    *ERROR FULL DATA - WHILE INSERTING TO TABLE
      IF wf_err GT 0.
        WRITE:/060(1)   sy-vline,text-004 COLOR 6,sy-vline.
        LOOP AT  int_caltrerr.
          FORMAT RESET.
          FORMAT COLOR  6 .
          WRITE:/001(1)   sy-vline,
                 002(3)    int_caltrerr-adm_area ,
                 005(1)   sy-vline  CENTERED ,
                 006(4)    int_caltrerr-dsrd_loc ,
                 010(1)   sy-vline  CENTERED ,
                 011(1)    int_caltrerr-fl_ind  ,
                 012(1)   sy-vline  CENTERED,
                 013(4)    int_caltrerr-loc_loc  ,
                 017(1)   sy-vline  CENTERED ,
                 018(25)   int_caltrerr-reason  ,
                 043(1)   sy-vline  CENTERED .
          FORMAT COLOR OFF .
        ENDLOOP.
        WRITE:/001(25)  text-002,wf_err.
        WRITE:/001(25)  text-003,wf_rec .
      ENDIF.
    *    ERROR BY DUPLICATION
      IF wf_err_rec GT 0.
        WRITE:/060(1)   sy-vline,text-000 COLOR 6,sy-vline.
        LOOP AT int_error.
          FORMAT RESET.
          FORMAT COLOR  6 .
          WRITE:/001(1)   sy-vline,
                 002(3)   int_error-adm_area ,
                 005(1)   sy-vline  CENTERED ,
                 006(4)   int_error-dsrd_loc ,
                 010(1)   sy-vline  CENTERED ,
                 011(1)    int_error-fl_ind  ,
                 012(1)   sy-vline  CENTERED,
                 013(4)   int_error-loc_loc  ,
                 017(1)   sy-vline  CENTERED ,
                 018(25)  int_error-message  ,
                 043(1)   sy-vline  CENTERED .
          FORMAT COLOR OFF .
        ENDLOOP.
        WRITE:/001(25)  text-002,wf_err_rec.
        WRITE:/001(25)  text-003,wf_rec .
      ENDIF.
    *SUCCESSFULL DATA
      IF wf_suc GT 0.
        WRITE:/060(1)   sy-vline,text-001 COLOR 1 ,sy-vline.
        LOOP AT int_caltrscc.
          FORMAT RESET.
          FORMAT COLOR 1 ON .
          WRITE:/001(1)   sy-vline,
                 002(3)   int_caltrscc-adm_area ,
                 005(1)   sy-vline  CENTERED ,
                 006(4)  int_caltrscc-dsrd_loc ,
                 010(1)   sy-vline  CENTERED ,
                 011(1)   int_caltrscc-fl_ind  ,
                 012(1)   sy-vline  CENTERED,
                 013(4)   int_caltrscc-loc_loc  ,
                 017(1)   sy-vline  CENTERED ,
                 018(25)  int_caltrscc-reason ,
                043(1)   sy-vline  CENTERED .
          FORMAT COLOR OFF .
        ENDLOOP.
        WRITE:/001(25)  text-002,wf_cor_rec .
        WRITE:/001(25)  text-003,wf_rec .
      ENDIF.
    ENDFORM.                    " f_check_db_data
    rgds
    Anver
    if hlped pls mark points

  • Process chain executed synchronously produces dump and hangs

    Process chain (RSPC) being executed synchronously hangs on a step (not first) with yellow status. Analysis of ST22 shows there is dump: RAISE_EXCEPTION
    The chain loads data from flat files on frontend to several characteristics (attributes and texts). All the steps are sequential.
    After the start first file is loaded successfully (info package), subsequent data transfer process has no errors too. But the second info package becomes yellow and hangs just after ( after some time timeout occurs and the step becomes red). In ST22 i see dump, text of the dump is below. Analysis of the dump reveals that 'GUI_UPLOAD' FM doesn't work during execution of the second info-package.
    The chain looks as follows:
    1. Info package 1
          V
    2. Data transfer process 1
          V
    3. Info package 2              <-------   hangs here because of dump
          V
    4. Data transfer process 2
         V
    Hangs on step 3 (infopackage 2).
    Text of the dump:
    Runtime Errors         RAISE_EXCEPTION
    Date and Time          10.10.2010 19:07:59
    |Short text                                                                                |
    |    Exception condition "NOT_SUPPORTED_BY_GUI" raised.                                            |
    |What happened?                                                                                |
    |    The current ABAP/4 program encountered an unexpected                                          |
    |    situation.                                                                                |
    |Error analysis                                                                                |
    |    A RAISE statement in the program "CL_GUI_FRONTEND_SERVICES======CP" raised the                |
    |     exception                                                                                |
    |    condition "NOT_SUPPORTED_BY_GUI".                                                             |
    |    Since the exception was not intercepted by a superior                                         |
    |    program, processing was terminated.                                                           |
    |                                                                                |
    |    Short description of exception condition:                                                     |
    |                                                                                |
    |                                                                                |
    |    For detailed documentation of the exception condition, use                                    |
    |    Transaction SE37 (Function Library). You can take the called                                  |
    |    function module from the display of active calls.                                             |
    |    -                                                                                |
    |How to correct the error                                                                          |
    |                                                                                |
    |    If the error occures in a non-modified SAP program, you may be able to                        |
    |    find an interim solution in an SAP Note.                                                      |
    |    If you have access to SAP Notes, carry out a search with the following                        |
    |    keywords:                                                                                |
    |                                                                                |
    |    "RAISE_EXCEPTION" " "                                                                         |
    |    "CL_GUI_FRONTEND_SERVICES======CP" or "CL_GUI_FRONTEND_SERVICES======CM00X"                   |
    |    "FILE_EXIST"                                                                                |
    |                                                                                |
    |    or                                                                                |
    |                                                                                |
    |    "CL_GUI_FRONTEND_SERVICES======CP" "NOT_SUPPORTED_BY_GUI"                                     |
    |                                                                                |
    |    or                                                                                |
    |                                                                                |
    |    "RSBATCH1 " "NOT_SUPPORTED_BY_GUI"                                                            |
    |    If you cannot solve the problem yourself and want to send an error                            |
    |    notification to SAP, include the following information:                                       |
    |                                                                                |
    |System environment                                                                                |
    |    SAP-Release 701                                                                               |
    |                                                                                |
    |                                                                                |
    |    SAP kernel....... 701                                                                         |
    |                                                                                |
    |    Patch level. 69                                                                               |
    |    Patch text.. " "                                                                              |
    |                                                                                |
    |User and Transaction                                                                              |
                                                                                    |
    |    Program............. "CL_GUI_FRONTEND_SERVICES======CP"                                       |
    |    Screen.............. "SAPMSSY0 1000"                                                          |
    |    Screen Line......... 6                                                                        |
    |                                                                                |
    |Information on where terminated                                                                   |
    |    Termination occurred in the ABAP program "CL_GUI_FRONTEND_SERVICES======CP" -                 |
    |     in "FILE_EXIST".                                                                             |
    |    The main program was "RSBATCH1 ".                                                             |
    |                                                                                |
    |    In the source code you have the termination point in line 8                                   |
    |    of the (Include) program "CL_GUI_FRONTEND_SERVICES======CM00X".                               |
    |Source Code Extract                                                                               |
    |Line |SourceCde                                                                                |
    |    1|method FILE_EXIST.                                                                          |
    |    2|* ...                                                                                |
    |    3|                                                                                |
    |    4|  CLASS CL_GUI_CONTROL DEFINITION LOAD .                                                    |
    |    5|                                                                                |
    |    6|*-check if valid GUI is available----
                             |
    |    7|  IF IS_VALID_HANDLE( ) NE 0 AND cl_gui_control=>www_active IS INITIAL.                     |
    |>>>>>|    RAISE NOT_SUPPORTED_BY_GUI.                                                             |
    |    9|  ENDIF.                                                                                |
    |   10|                                                                                |
    |   11|* check parameter, wild characters not allowed                                              |
    |   12|  IF FILE IS INITIAL OR FILE CA '*<>|"'.                                                    |
    |   13|  MESSAGE 'WRONG PARAMETER: FILE_NAME' TYPE 'I' RAISING WRONG_PARAMETER.                    |
    |   14|    EXIT.                                                                                |
    |   15|  ENDIF.                                                                                |
    |   16|                                                                                |
    |   17|* special handling for SAPGUI for HTML                                                      |
    |   18|  IF CL_GUI_CONTROL=>WWW_ACTIVE IS NOT INITIAL.                                             |
    |   19|                                                                                |
    |   20|    DATA: rc type i, filename(4096) type C.                                                 |
    |   21|    filename = file.                                                                        |
    |   22|    CALL FUNCTION 'ITS_QUERY'                                                               |
    |   23|      EXPORTING                                                                             |
    |   24|        filename = FILEname                                                                 |
    |   25|        query    = 'FE'                                                                     |
    |   26|      IMPORTING                                                                             |
    |   27|        return   = rc.                                                                      |
    |Active Calls/Events                                                                               |
    |No.   Ty.          Program                             Include                             Line   |
    |      Name                                                                                |
    |    8 METHOD       CL_GUI_FRONTEND_SERVICES======CP    CL_GUI_FRONTEND_SERVICES======CM00X     8  |
    |      CL_GUI_FRONTEND_SERVICES=>FILE_EXIST                                                        |
    |    7 FUNCTION     SAPLSFES                            LSFESU16                               96  |
    |      GUI_UPLOAD                                                                                |
    |    6 METHOD       CL_GUI_FRONTEND_SERVICES======CP    CL_GUI_FRONTEND_SERVICES======CM013     4  |
    |      CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD                                                        |
    |    5 METHOD       CL_RSDS_ACCESS_GUI_UPLOAD=====CP    CL_RSDS_ACCESS_GUI_UPLOAD=====CM001    74  |
    |      CL_RSDS_ACCESS_GUI_UPLOAD=>IF_RSDS_EXTRACT_DIRECT~EXTRACT                                   |
    |    4 FUNCTION     SAPLRSDS_BACKEND                    LRSDS_BACKENDU01                      304  |
    |      RSDS_DATA_PULL                                                                              |
    |    3 FUNCTION     SAPLRSSM                            LRSSMU17                             5422  |
    |      RSSM_CALL_RSAR_DATA_REQUEST_1                                                               |
    |    2 FORM         RSBATCH1                            RSBATCH1                             1327  |
    |      START                                                                                |
    |    1 EVENT        RSBATCH1                            RSBATCH1                              498  |
    |      START-OF-SELECTION                                                                          |

    If i load the step manually it works. The hung step is possible to re-execute after it gets red (with context menu) and it works then. After that it hangs on the 3rd info-package and so on.
    The file lays on a network drive, but i suspect it doesn't matter

Maybe you are looking for

  • My iphone 3gs, Wont let me click any apps all of a sudden or power off

    It's never done this before, out of nowhere i can't click any apps or even turn the phone off and i have no idea what to do, im kinda freaking out.

  • How to restore OS from time machine to a non-booting Mac HD

    My Mac HD has been playing up for some time and today it finally decided to not work at all. This was after I had installed 10.7.3 yesterday. I booted from my OS Leopard CD and installed it on my second HD which is usually used for data storage.  I d

  • Cancellation of Release of a purchase requisition

    Hi, Currently the system allow to cancel the Release of a purchase requisition eventhought the Purchase Order already created for it. I could not locate the any system message that actually control this. How to disallow the cancellation of Release of

  • Storing more than 15 lakhs records in TreeMap

    Hi All, I have a requirement to cache more than 15 lakh records in TreeMap. When i tested it, it takes around one hour for 15 lakh records. Is there any better way to cache this huge volume of records? 15 lakh records may increase in future. So my ap

  • Issues calling an online contact.

    Hello, I am using an ipad 3gen with ios 8.1 and latest skype 4.18. I am trying to call an online skype contact of mine and the procedure stuck in "connecting" state or it response with the automated message that the user is unavailable. The thing is