Gui_download issue - unicode

I'm working on changing programs to be unicode ready for our upgrade. I have 2 programs with gui_download functions I changed identically but one I get this error when I try to open the excel file it produces.
"You are attempting to open a file type that is blocked by your registry policy setting"
The other program the xls file opens perfectly. Any ideas?
Code:
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = lv_infile
      filetype                = 'ASC'
    TABLES
      data_tab                = downtab
    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.

Hi David,
check the below code:
    l_write_bom = 'X'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = filename
        filetype                = 'DAT'
        write_bom               = l_write_bom
      TABLES
        data_tab                = dload
        fieldnames              = itab_hdr
You should use filetype: DAT .

Similar Messages

  • Cl_gui_frontend_services= gui_download - issue with german special char

    Hello,
    we are using cl_gui_frontend_services=>gui_download to create from an itab an excel file.
    We face the issue that in this excel file german special characters like Ä, Ü, Ö, ß are not displayed correctly.
    I think we need to use a different codepage. But which one?
    could you please give us a short coding example how to call cl_gui_frontend_services=>gui_download.
    Thanks a lot
    Kind regards
    Manfred

    Hi,
    Check the system is unicode or non-unicode . Codepage for Unicode system is ' 4102' and non-unicode is '1100'.
    Below are the sample code for the GUI_download with Class.
    DATA:  l_filename    TYPE string,
           l_filen       TYPE string,
           l_path        TYPE string,
           l_fullpath    TYPE string,
           l_usr_act     TYPE I.
    l_filename = SPACE.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        DEFAULT_FILE_NAME    = l_filename
      CHANGING
        FILENAME             = l_filen
        PATH                 = l_path
        FULLPATH             = l_fullpath
        USER_ACTION          = l_usr_act
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2     
        NOT_SUPPORTED_BY_GUI = 3
        others               = 4.
    IF sy-subrc = 0
          AND l_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = l_fullpath
       FILETYPE                        = 'DAT'
      TABLES
        DATA_TAB                        = T_DOWNL
    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.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDIF.
    Edited by: Sumodh P on May 11, 2010 5:24 PM

  • GUI_DOWNLOAD Issues

    Hey All,
         I am trying to use GUI_DOWNLOAD to download some HR data to an excel file and was running into some issues.
    1] After downloading all the data to the excel file when I open the excel file the coulms are by default displayed in same column width. I have to then manually do Autofit to expand the columns. Is there any way to programatically do "Autofit".
    2] Some data like Bank account numbers [type c(30)] are displayed in exponential for like 1E+12. I am aware that by clicking that field it does expand. Is there a way to fix this through coding. I know the maunual way of saving as an text file and using excels text import wizard to output as text. I want a coding way to do this.
    3] The file by default is save as tablimited text file even if you name it "text.xls". Is there any way to save is as excel directly.
    I dont intend to use OLE. Is there any way to fix these issues using GUI_DOWNLOAD.
    Any input is higly appreciated.
    Thanks

    1] After downloading all the data to the excel file when I open the excel file the coulms are by default displayed in same column width. I have to then manually do Autofit to expand the columns. Is there any way to programatically do "Autofit".
    ---> Excel settings, nothing can be done from SAP
    2] Some data like Bank account numbers type c(30) are displayed in exponential for like 1E+12. I am aware that by clicking that field it does expand. Is there a way to fix this through coding. I know the maunual way of saving as an text file and using excels text import wizard to output as text. I want a coding way to do this.
    ---> Excel settings, nothing can be done from SAP
    3] The file by default is save as tablimited text file even if you name it "text.xls". Is there any way to save is as excel directly.
    ---> Can't be done through GUI_DOWNLOAD

  • Gui_download issue - trailing spaces getting truncated for fixed length fil

    Hi All,
    I have a requirement where I need to download an internal table as a fixed length file.
    The code is as follows:
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    FILENAME = L_FILE
    FILETYPE = 'ASC'
    APPEND = 'X'
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = ' '
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    DATA_TAB = IT_TEXT
    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
    Each row in the internal table IT_TEXT is 242 chars long.
    The FM is truncatinf the trailing blanks on the file. How do I get the FM to not truncate the trailing blanks in each row?
    My internal table has multiple rows and the number of rows on the table should be same as the number of rows on the downloaded file.
    I tried setting the WRITE_LF parameter to space.
    In this case, the trailing spaces are not truncated(which is as per my requirement), BUT all the rows in the internal table appear in a single line on the downloaded file instead of multiple rows.
    I also tried setting the TRUNC_TRAILING_BLANKS field to space but that does not work either. Spaces at the end of the row are still truncated.
    so the requirement is: the spaces at the end of each row should not be truncated and
    each row on the internal table should have a corresponding row on the downloaded file.
    (it is a fixed length file)
    I also tried using the following code
    class cl_abap_char_utilities definition load.
    DATA: BEGIN OF IT_TEXT OCCURS 0,
           TEXT(242) TYPE C,
           cr_lf TYPE c VALUE cl_abap_char_utilities=>cr_lf,
          END OF IT_TEXT.
    when i compile, i get the following error
    The type "CL_ABAP_CHAR_UTILITIES" is unknown.     
    Im using R/3 4.6C. Could this be a problem?     
    Please suggest a solution for this problem.
    Thanks!
    Sandeep
    Edited by: sandeep reddy on Jul 25, 2008 7:16 PM

    Hi,
    Try this..This worked..Add a dummy character at the end of the internal table...Then pass trunc_trailing_blanks   = ' '...
    PARAMETERS: p_file TYPE rlgrap-filename
                DEFAULT 'c:\test_download.txt'.
    DATA: BEGIN OF s_data,
            data TYPE char10,
            dummy,      " Added this.
          END OF s_data.
    DATA: t_data LIKE TABLE OF s_data.
    s_data-data = 'Test'.
    APPEND s_data TO t_data.
    s_data-data = 'Test2'.
    APPEND s_data TO t_data.
    s_data-data = 'Test3'.
    APPEND s_data TO t_data.
    s_data-data = 'Test4'.
    APPEND s_data TO t_data.
    * Download.
    DATA: v_file TYPE string.
    v_file = p_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = v_file
        trunc_trailing_blanks   = ' '
      TABLES
        data_tab                = t_data
      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.
    Thanks
    Naren

  • GUI_DOWNLOAD issue - returns empty table

    I am using the following to read a text file (I have tried a tab delimited text file as well as a .csv file) into an internal table.  The returned sy-subrc value is 0 but the returned table is empty.
    Any ideas?
    Regards,
    Davis
    d_string = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *   BIN_FILESIZE                    =
          filename                        = d_string
    *   FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    *   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    *   SHOW_TRANSFER_STATUS            = ABAP_TRUE
    * IMPORTING
    *   FILELENGTH                      =
        TABLES
          data_tab                        = it_string
    *   FIELDNAMES                      =
       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

    Arent you supposed to use GUI_UPLOAD?
    GUI_UPLOAD - Text file to internal table.
    GUI_Download - Internal table to text file.

  • System is unicode or not?

    Hello
    For some reason, i need to find out that executing system is unicode enabled or not? i should know it with in my prog. I need it to put a validation in mu prog. I checked SYST structure at runtime, no use!
    Thank you

    Hi,
    I am not understanding what are you trying to say.
    If I am correct then you want to check whether your SAP system is UNICODE enabled or not.
    If this is your query, then you can find this thing by:
    Login to SAP -> GoTo system -> Click on Status.
    In the middle, you will see "Unicode System", if value is "Yes", then your system is Unicode enabled.
    If you want to put check points in program, to know whether executing system is Unicode enabled or not, then this link will definately help you.[ABAP Development Under Unicode|http://help.sap.com/saphelp_nw04/helpdata/en/79/c55458b3dc11d5993800508b6b8b11/content.htm]
    For your referrence:
    [Unicode related issue|Unicode Check Active;
    [Unicode related issue|Isn't unicode check defaulted in ECC 6.0 ?;
    May it helps you.
    Regards,
    <DS>

  • MacOS 7 cannot find Unicode Converter

    Trying to launch a Classic application on MacOS 7.0, we get the message "Cannot start application. Cannot find Unicode Converter." Is it possible to obtain whatever it is the System is actually looking for? Or can the System be faked out on this issue? It is a graphics application; I don't really care about text issues.

    Unicode was introduced to the Mac OS in a version of Mac OS 8 if my faulty memory recalls correctly. It will be a system extension more than likely but also more than likely NOT called "Unicode Converter".
    If you can figure out what library file to use, you can put a copy into the extensions folder on your System 7 machine and see what happens when you start your application.
    But I suspect that your system will simply crash if you try this. It nay not even boot.
    Gary

  • [SOLVED] VIM not displaying many glyphs

    I'm struggling to get the full glyph set to display in VIM. Particularly missed are the mathematical super- and sub-script. I've worked on the problem and tried various fixes for displaying UTF-8 characters without success.
    (Code block bad form? Ok T. IMHO. There's that type of post where the OP doesn't know why something isn't working and they quote a dump truck of details, even though they're not sure what's relevant and what isn't. And the longer the quote, the harder it is to figure out what they're doing wrong. I didn't want to be that guy. I was hiding the verbosity, in the event my font problems are simpler than I've made it.)
    1) Applied settings from these WIKI pages:
    Fonts
    Xterm
    2) Apps I've installed
    $ pacman -Qs font
    local/dina-font 2.92-4
        A monospace bitmap font, primarily aimed at programmers
    local/fontconfig 2.11.1-1
        A library for configuring and customizing font access
    local/fontsproto 2.1.3-1
        X11 font extension wire protocol
    local/freetype2 2.5.3-2
        TrueType font rendering library
    local/gsfonts 1.0.7pre44-4
        Standard Ghostscript Type1 fonts from URW
    local/libfontenc 1.1.2-1
        X11 font encoding library
    local/libotf 0.9.13-2
        OpenType Font library
    local/libxfont 1.4.7-3
        X11 font rasterisation library
    local/libxft 2.3.2-1
        FreeType-based font drawing library for X
    local/t1lib 5.1.2-5
        Library for generating character- and string-glyphs from Adobe Type 1 fonts
    local/tamsyn-font 1.10-1
        A monospaced bitmap font for the console and X11
    local/terminus-font 4.39-1
        Monospace bitmap font (for X11 and console)
    local/ttf-bitstream-vera 1.10-10
        Bitstream vera fonts
    local/ttf-droid 20121017-3
        General-purpose fonts released by Google as part of Android
    local/xorg-bdftopcf 1.0.4-2 (xorg xorg-apps)
        Convert X font from Bitmap Distribution Format to Portable Compiled Format
    local/xorg-font-util 1.3.0-2 (xorg-fonts xorg)
        X.Org font utilities
    local/xorg-font-utils 7.6-4
        Transitional package depending on xorg font utilities
    local/xorg-fonts-100dpi 1.0.1-5 (xorg)
        X.org 100dpi fonts
    local/xorg-fonts-alias 1.0.3-1
        X.org font alias files
    local/xorg-fonts-encodings 1.0.4-4 (xorg-fonts xorg)
        X.org font encoding files
    local/xorg-fonts-misc 1.0.1-3
        X.org misc fonts
    local/xorg-fonts-type1 7.4-3
        X.org Type1 fonts
    local/xorg-mkfontdir 1.0.7-2 (xorg xorg-apps)
        Create an index of X font files in a directory
    local/xorg-mkfontscale 1.1.1-1 (xorg-apps xorg)
        Create an index of scalable font files for X
    3) A forum search found some common issues: 
    unicode symbols not working in my terminal
    $ localectl
       System Locale: LANG=en_US.UTF-8
                      LC_COLLATE=C
           VC Keymap: US
          X11 Layout: n/a
    $ locale -a
    C
    en_US.utf8
    POSIX
    $ echo $TERM
    xterm-256color
    4) ~/.Xresources
    ! wiki.archlinux.org/.../Xterm
    xterm*termName:           xterm-256color
    xterm*locale:             true
    xterm*saveLines:          4096
    xterm*bellIsUrgent:       false
    xterm*VT100.geometry:     80x25
    xterm*faceName:           Droid:style=Regular:size=12
    xterm*dynamicColors:      true
    xterm*utf8:               2
    xterm*toolBar:            false
    5) ~/.xinitrc
    # X11 Fonts
    xset +fp /usr/share/fonts
    Last edited by xtian (2014-07-27 14:43:23)

    Linux fonts are a muddle.  Consoles can only display 256 characters, maybe 512.  You simply cannot display many texts in a console. To navigate through the font mess in X, you need some familiarity with fontconfig.  Xft uses fontconfig to select fonts.  Fontconfig documentation is not user-friendly.
    Droid is a family of fonts. My installation of the Droid family includes 27 different fonts. The command fc-list will list fonts matching a pattern.  I usually filter the output by piping through grep. To list the Droid fonts, file name first followed by the fontconfig name, I use:
    $ fc-list | grep Droid
    Your fc-match results for Droid are from fontconfig doing its best to give you a readable display.  Fontconfig cannot find a matching font for the name 'Droid', so it falls back to a "safe" font, 'Bitstream Vera Sans'.
    XTerm or UXTerm or URxvt
    I have my locale correctly configured, I think. I do not see any real advantage for uxterm over xterm. In my X resources, I include the lines,
    xterm*termName: xterm-256color
    XTerm*locale: true
    For good glyph coverage with xterm, I have found 'DejaVu Sans Mono' to be among the better fonts.  If I truly need utf8 coverage, I use urxvt. Urxvt allows one to use a ladder of fonts. If the character is not found in the first font listed, urxvt will search through the other listed fonts until it finds a glyph that can be displayed.
    urxvt*font: xft:DejaVu Sans Mono:style=Book:antialias=false:size=8, \
    xft:WenQuanYi Bitmap Song:size=8, \
    xft:FreeSerif:style=Regular, \
    xft:unifont:style=Medium:antialias=false
    Here's a screenshot with three xterms using Droid, DejaVu Sans Mono, and Liberation Mono, plus one urxvt using the fonts in the code above.  They all show the same portion of Markus Kuhn's utf8 test text.

  • Issue in Downloading Unicode character to a file..

    Hi ,
    Iam working on a report which will  download role and user names to a file  ( Application or Presentation server) .
    The issue is - We are not able to download role and user names in Unicode language (for example *Chinese & Russian *).
    Is there a solution to Enable downloading user names and Role name in unicode languages. (ie. Chinesee, Russian).
    i.e  If system has unicode characters, output files should also contain unicode .
    Regards,
    Naveen

    Hi,
    do you use fm GUI_DOWNLOAD ?
    It should have some unicode parameters ...
    Regards,
    Klaus

  • Issue with filename in gui_download fn module

    Hi,
    i have an issue with the filename of text file that was dowloaded using gui_download fn module.
    PARAMETERS : p_file TYPE rlgrap-filename.
    CONCATENATE s_laufd-low6(2) s_laufd-low4(2) INTO gv_dt.
    CONCATENATE 'HINL' gv_dt '.001' INTO p_file.
    START-OF-SELECTION.
      DATA: v_file TYPE string.
      v_file = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = v_file
          filetype                = 'ASC'
          append                  = 'X'
        TABLES
          data_tab                = it_tab[]
        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.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    data is downloaded into the textfile with filename as HINL2411 truncating the decimal part.
    How can i get the filename along with the decimal part as HINL2411.001.
    Thanks

    Hi ,
    Declare p_file  as TYPE string

  • Windows 8.1 Pro Non-Unicode Issue: CS6 Standard

    I use WIndows 8.1 Pro English, I installed the CS6 Standard in Spanish, I changed the language for the non-unicode programs to spanish but still cannot use the Illustrator, I am having issue only with the Illustrator, noting that in the installation I was prompt for Spanish(Latin America) or Just Spanish, I clicked on Spanish(Latin America), but in the non-Unicode languages there is no Spanish(non-Unicode) they have Spanish per countries.

    I have the same problem did you manage to find the solution? is impossible to contact adobe helpers, they just hide all contact

  • Unicode related issue in 4.6c to ECC 6.0 upgrade

    Hi
    I am doing upgrade from 4.6c to ECC 6.
    Here I am getting one unicode related issue.
    "The data object A948 does not have a component called ZZMATWA.".
    This type of issues , how can I resolve.
    I am very new to upgrade, Plese do help me.
    Regards
    Sandeep Reddy.

    Hi,
    Can you give the error what you are coming across.
    Regards,
    Suhas

  • Issue with gui_download function module

    Hi All,
             I have an issue with gui_download function module that it is creating one extra line while downloading my internal table data into text file,which i donot want.i have searched for various threads but couldnot get the proper reply.Or please provide me some other Function Module which will not create one extra line.Please help.

    part 2
    INCLUDE RPPPXD00.
    DATA : BEGIN OF COMMON PART A.
    INCLUDE RPPPXD10.
    DATA : END OF COMMON PART.
    INCLUDE PC2RXTW0.
    INCLUDE RPC2RX00.
    DATA : BEGIN OF COMMON PART B.
    INCLUDE RPC2CD00.
    DATA : END OF COMMON PART.
    INCLUDE RPPPXM00.
    INCLUDE RPCMGR00.
    AT SELECTION-SCREEN OUTPUT.
      CONCATENATE SY-DATUM2(6) SY-UZEIT0(4) INTO REF_NO.
      LOOP AT SCREEN.
        IF R1 = 'X'.
          IF SCREEN-NAME = 'FLN' OR SCREEN-NAME = '%_FLN_%_APP_%-TEXT' OR
             SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT' OR
            SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT'"SOC BY ANKITA"
           OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
           OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
           OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
           OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
           OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R2 = 'X'.
          IF SCREEN-NAME = 'FLN' OR SCREEN-NAME = '%_FLN_%_APP_%-TEXT' OR
             SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT' OR
             SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT' "SOC BY ANKITA
             OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
             OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
             OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
             OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
             OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R3 = 'X'.
          IF SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT' "SOC BY ANKITA
            OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
            OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
            OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
            OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
            OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R4 = 'X'.
          IF SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'"SOC BY ANKITA
             OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    START-OF-SELECTION.
      SELECT SINGLE * FROM T549Q WHERE PERMO = '01'
                                 AND   PABRJ = PRD+0(4)
                                 AND   PABRP = PRD+4(2).
      FR_DT = T549Q-BEGDA.
      TO_DT = T549Q-ENDDA.
      CONCATENATE FR_DT0(4) FR_DT4(2) INTO FR_P.
      CONCATENATE TO_DT0(4) TO_DT4(2) INTO TO_P.
      PN-PAPER = PRD.
      PN-PERMO = '01'.
    GET PERNR.
      RP-PROVIDE-FROM-LAST P0003 SPACE PN-BEGDA PN-ENDDA.
      RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
      IF PNP-SW-FOUND EQ 1.
       SN = SN + 1.
       ITAB1-SNO = SN.
       ITCC-SNO = SN.
        ITAB1-ENO = PERNR-PERNR.
        ITAB1-NAM = PERNR-ENAME.
      ELSE.
        REJECT.
      ENDIF.
      RP-INIT-BUFFER.
      RP-SEL-CALC.
      CALL FUNCTION 'RP_EVALUATION_PERIODS'
        EXPORTING
          LAST_CALCULATED_DAY = P0003-ABRDT
          LAST_DAY_IN_PERIOD  = TO_DT
          RETROCALCULATED_DAY = RP-SEL-CALC-RRDAT
        TABLES
          DIR                 = RGDIR
          EVP                 = EVP
        EXCEPTIONS
          RGDIR_EMPTY         = 1
          INTERNAL_ERROR      = 2
          OTHERS              = 3.
      DESCRIBE TABLE EVP LINES LIN.
      IF LIN > 0.
        LOOP AT EVP.
          IF EVP-IAPER = TO_P AND EVP-PAPER = TO_P.
            RX-KEY-PERNR = PERNR-PERNR.
            UNPACK EVP-SEQNR TO RX-KEY-SEQNO.
            RP-IMP-C2-TN.
            READ TABLE BT INDEX 1.
            READ TABLE WPBP INDEX 1.
            READ TABLE TAX INDEX 1."CHANGES BY ANKITA
            ITAB1-BAC = BT-BANKN.
            ITAB1-BKEY = BT-BANKL .
            ITAB1-DEP = WPBP-KOSTL.
            ITAB1-BETRG = BT-BETRG."CHANGES BY ANKITA
            ITAB1-TAXID = TAX-TAXID."CHANGES BY ANKITA
            YEAR = VERSC-PAYDT+0(4) - 11.
            MONTH = VERSC-PAYDT+4(2).
            DAY = VERSC-PAYDT+6(2).
            CONCATENATE YEAR MONTH DAY INTO ITAB1-PDT.
           ITAB1-PDT = VERSC-PAYDT - 110000.
            ITCC-DEP = WPBP-KOSTL.
            LOOP AT RT WHERE LGART = '/559'.
              ITAB1-BTFR = RT-BETRG.
              ITCC-BTFR = RT-BETRG.
             IF EVP-SRTZA = 'P'.
               ITAB1-BTFR = ITAB1-BTFR - RT-BETRG.
             ELSE.
               ITAB1-BTFR = ITAB1-BTFR + RT-BETRG.
             ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
      APPEND: ITAB1, ITCC.
      CLEAR: ITAB1, ITCC.
    END-OF-SELECTION.
      CONCATENATE 'Prepared By:' ` ` PREPBY INTO PREPBY.
      CONCATENATE 'Approved By:' ` ` APROBY INTO APROBY.
      IF R1 = 'X'.
        FORMAT COLOR 2.
        ULINE (127).
        NEW-LINE.
        WRITE: 2 'Sr No.', 10 'Emp Num', 27 'Name'.
        WRITE: 57 'Department'.
        WRITE: 72 '  Transfer Amount' RIGHT-JUSTIFIED.
        WRITE: 92 'Bank Key', 107 'Bank AC. Number'.
        WRITE:1 '|', 8 '|', 25 '|', 55 '|', 70 '|', 90 '|', 105 '|', 127 '|'.
        NEW-LINE.
        ULINE (127).
        NEW-LINE.
        FORMAT COLOR OFF.
        LOOP AT ITAB1.
          SN = SY-TABIX.
          WRITE: 2 SN, 10 ITAB1-ENO, 27 ITAB1-NAM.
          WRITE: 57 ITAB1-DEP.
          WRITE: 72 ITAB1-BTFR.
          WRITE: 92 ITAB1-BKEY, 107 ITAB1-BAC.
          WRITE: 1 '|', 8 '|', 25 '|', 55 '|', 70 '|', 90 '|', 105 '|', 127 '|'.
          ULINE (127).
          NEW-LINE.
        ENDLOOP.
        SKIP 4.
        ULINE 90(32).
        NEW-LINE.
        WRITE: 90 PREPBY.
        SKIP 4.
        ULINE 90(32).
        NEW-LINE.
        WRITE: 90 APROBY.
      ENDIF.
      IF R2 = 'X'.
        LOOP AT ITCC.
          COLLECT ITCC INTO ITCOL.
        ENDLOOP.
        FORMAT COLOR 2.
        ULINE (44).
        NEW-LINE.
        WRITE:2 'Sr No.', 9 'Department'.
        WRITE: 27 'Transfer Amount  ' RIGHT-JUSTIFIED.
        WRITE:1 '|', 8 '|', 25 '|', 44 '|'.
        NEW-LINE.
        ULINE (44).
        NEW-LINE.
        FORMAT COLOR OFF.
        LOOP AT ITCOL.
          SN = SY-TABIX.
          WRITE: 2 SN, 9 ITCOL-DEP, 27 ITCOL-BTFR.
          WRITE:1 '|', 8 '|', 25 '|', 44 '|'.
          NEW-LINE.
          ULINE (44).
          NEW-LINE.
        ENDLOOP.
      ENDIF.
      IF R3 = 'X'.
        LOOP AT ITAB1.
          CLEAR: ITTF, P3, P11, P13, P6, V_BAC.
          LEN = STRLEN( ITAB1-BKEY ).
          IF LEN < 3.
            CONCATENATE ITAB1-BKEY '***' INTO P3.
          ELSE.
          LEN = LEN - 3.
            LEN = 3.
            P3 = ITAB1-BKEY+LEN(3).
          ENDIF.
          CLEAR LEN.
          V_BAC = ITAB1-BAC.
          REPLACE ALL OCCURRENCES OF '-' IN ITAB1-BAC WITH ''.
          CONDENSE ITAB1-BAC NO-GAPS.
          LEN = STRLEN( ITAB1-BAC )."if length of acc num > limit
          IF LEN > 11.
            IT_FAIL-EN = ITAB1-ENO.
            IT_FAIL-BA = V_BAC.
            APPEND IT_FAIL.
            CLEAR: IT_FAIL.
            CONTINUE.
          ENDIF.
          P11 = ITAB1-BAC.
          CONCATENATE P11 '***********' INTO P11.
    above step is for putting '' in place of unfilled chars of P11.
          P13 = ITAB1-BTFR * 100.
          P6 = ITAB1-PDT+2(6).
          CONCATENATE ` ` P3 P11 BTC P13 P6 INTO STR.
          ITTF-ROW = STR.
          APPEND ITTF.
        ENDLOOP.
        IF ITTF[] IS NOT INITIAL.
          CONCATENATE FLN SY-DATUM SY-UZEIT '.txt' INTO FILEPATH.
          CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME                        = FILEPATH
            FILETYPE                        = 'ASC'
         WRITE_FIELD_SEPARATOR           = 'X'
            TABLES
            DATA_TAB                        = ITTF
         OTHERS                          = 22
          SKIP 2.
          IF SY-SUBRC <> 0.
            WRITE:/ 'Unable to Download file at ', FILEPATH.
          ELSE.
            WRITE:/ 'File with following data downloaded at ', FILEPATH.
            NEW-LINE.
            SKIP 2.
            LOOP AT ITTF.
              WRITE:/ ITTF.
            ENDLOOP.
          ENDIF.
        ELSE.
          WRITE 'No Data, no file was downloaded'.
        ENDIF.
        IF IT_FAIL[] IS NOT INITIAL.
          SKIP 2.
          FORMAT COLOR 2.
          WRITE 'Acc. No. of following employees exceeded the length limit'.
          WRITE:/ 'So their entry was not created in the file'.
          SKIP 1.
          WRITE : 'Employee Number', 20 'Bank Acc. No.'.
          FORMAT COLOR OFF.
          LOOP AT IT_FAIL.
            NEW-LINE.
            WRITE : IT_FAIL-EN, 20 IT_FAIL-BA.
          ENDLOOP.
        ENDIF.
      ENDIF.
      IF R4 = 'X'."CHANGES BY ANKITA
        WRITE:/ 'ERROR LOG - BANK A/C NO. CONTAINS ALPHANUMERIC'.
        WRITE:/ 'EMPID' COLOR COL_POSITIVE,12 '|',15 'Receiving Bank Code' COLOR COL_POSITIVE,
                                                                      40 '|','Receiver A/C No' COLOR COL_POSITIVE.
        PERFORM EXTRACT_DATA.
        SKIP 2.
      ENDIF."EOC
      RP-READ-PAYROLL-DIR.
    Edited by: ANKITA BHARDWAJ on Dec 9, 2009 10:36 AM

  • Issues in using the fm "GUI_DOWNLOAD"

    Hi Group,
    I am using the fm "GUI_DOWNLOAD" in an output program.
    The issue is that, I was trying to call the output program in two different ways, 1)using the report 'RSNAST00' and 2)thru the tcode 'VF02' and specifying the output type & Transmission medium. In both the cases, same code will get executed.
    while using the report 'RSNAST00', I was not facing issues with the fm 'GUI_DOWNLOAD' but when generating the output through the tcode 'VF02', I was getting an exception 'CONTROL_FLUSH_ERROR' (sy-tabix = 21 - of the fm). the behaviour is strange, once it worked fine and now, there are issues.
    Kindly provide me your valuable inputs on this.
    Regards,
    Vishnu.

    Hi Vishnu,
    There is no solution for this, you cannot have GUI interactions(nor any statements that might invoke a implicit/explicit commit) in a V2 update. When you say this worked, did you have update debugging enabled, if so then it might have worked as the debugger session can access GUI...
    If the whole idea/need of this output is to download a file, use OPEN DATASET, TRANSFER and CLOSE DATASET.
    Even for the RSNAST00 execution, i am sure that in the actual business scenario(in production) this would be scheduled as a background job, where in again "GUI_DOWNLOAD" wouldn't work.
    Regards,
    Chen

  • Java JCo SAP XI RFC SAP R/3 6.C ... Unicode issue

    Hello,
    My scenario is very simple. I'd like to connect a Java program to a SAP R/3 (MDMP) for RFC calls (in both direction), using SAP XI (some of the RFC calls will redirected to some other systems). I use SAP JCo v2.1.8 and tried with Java 1.4.2_09 and Java 6.0.
    It works well when the Java program is calling a function module, but when SAP R/3 is doing it, the returned texts looks like: S#A#P# #J#C#o# #v#2#.#1#.#8# #(#2#0#0#6#-#1#2#-#1#1#)# (the text should be SAP JCo v2.1.8).
    It looks like an issue with Unicode. Although I didn't check the Unicode checkbox in the RFC sender adapter (the RFC receiver one doesn't offer the possibility to specify unicode or not).
    Do anyone have a solution ? Is it a code in the Java program or something to set in SAP XI / SAP R/3 ?
    Thanks in advance for your help.

    This is a workaround solution. In the case of this prototype it is ok, but the final plan is to migrate a web based application. It was directly connected to one SAP R/3, but now we would like to connect it to SAP XI because a few RFC calls will be re-directed to some other systems, but the majority of them will we'll still be sent to the SAP R/3. We don't want to make development on this part for cost reason (and time). Plus on some text there are the "#" character that is legitimate.

Maybe you are looking for