Strings on Screens

I have a requirement to have a STRG type element on a screen.
I wish to populate this field with data that is longer than the visible length of the field but as the field is scrollable (greyed out checkbox) and does indeed allow me to scroll I thought I would be able to pass in a string of any length.  This does not seem to be true as if I go over a certain amount of characters the program dumps with a 'field too short' error.
Has anyone had much experience with strings on screen?
Thanks in advance
Ian

Hi all,
I have been following this topic and I still have one question unanswered. I get a syntax error when I use something like this in my code...
=====================================
parameters p_test type string.
=====================================
The error message reads as "The deep data type "STRING" is not allowed.
The SAP Help Documentation says "It is not yet possible to use strings in screens or database tables. However, strings can be stored in database tables as clusters using EXPORT and transferred using IMPORT".
I'm using <u><b>SAP WebAS 6.20</b></u>.
Any thoughts on this ?
Regards,
Anand Mandalika.

Similar Messages

  • OT:  Alpha-numeric string after screen-name

    What the heck is this string attached to my screen name??   Only appeared after the forum had timed out and had to log back in again.
    Weird !

    I've emailed you privately about this. It appears you have an identity crisis - at least in cyberspace.
    There are at least three Nadia Perres, all of them you: Nadia Perre plain and simple, Nadia Perre-39BgI8, and Nadia Perre-NuTcRP (the Community Expert). You need to contact JC (or a shrink) to get things sorted out.

  • PLSQL - Output a long string to screen

    I am trying to create an XML file, but I don't have FTP access on the server, only read rights.
    So I need to output a long string on the screen.
    By using the
    DBMS_OUTPUT.PUT_LINE ('<Environment> ' || long_string_01 || long_string_02 || '</Environment>');
    I get the 255 buffer error.
    Whats the easiest way around it?
    Thanks in advance everyone!
    Edited by: 866635 on Aug 5, 2011 5:16 AM

    Hi,
    I agree with Mr Robertson.
    SQL> SET SERVEROUTPUT ON SIZE 1000000
    SQL> SET LONG 1000000000 LONGC 1000000000
    SQL> set pagesize 200
    SQL> select TO_CLOB('When I use a LONG setting smaller than the length of the TEXT column,
      2  I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the
    length of the TEXT column, I got it wrapped. When both are huge, it seems I am getting the expectin
    g result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
      3  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
      4  When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the length of the
      5   TEXT column, I got it wrapped. When both are huge, it seems I am getting the expecting
      6   result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
      7  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
      8  When I use a LONG setting smaller than the length of the TEXT column,
      9  I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the
    length of the TEXT column, I got it wrapped. When both are huge, it seems I am getting the expectin
    g result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
    10  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
    11  When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the length of the
    12   TEXT column, I got it wrapped. When both are huge, it seems I am getting the expecting
    13   result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
    14  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
    15  When I use a LONG setting smaller than the length of the TEXT column,
    16  I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the
    length of the TEXT column, I got it wrapped. When both are huge, it seems I am getting the expectin
    g result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
    17  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
    18  When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the length of the
    19   TEXT column, I got it wrapped. When both are huge, it seems I am getting the expecting
    20   result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
    21  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
    22  When I use a LONG setting smaller than the length of the TEXT column,
    23  I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the
    length of the TEXT column, I got it wrapped. When both are huge, it seems I am getting the expectin
    g result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
    24  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
    25  When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the length of the
    26   TEXT column, I got it wrapped. When both are huge, it seems I am getting the expecting
    27   result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.sql ?
    28  When I use a LONG setting smaller than the length of the TEXT column, I got it truncated.
    29  When I use a LONG setting smaller than the length of the TEXT column,
    30  I got it truncated. When I use a huge LONG setting but a  setting smallerthe length of the TEXT
    column, I got it wrapped. When both are huge, it seems I am getting ') from dual
    31  /
    TO_CLOB('WHENIUSEALONGSETTINGSMALLERTHANTHELENGTHOFTHETEXTCOLUMN,IGOTITTRUNCATED
    When I use a LONG setting smaller than the length of the TEXT column,
    I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting s
    maller than the length of the TEXT column, I got it wrapped. When both are huge,
    it seems I am getting the expecting result. So why not setting SET LONG 2000000
    000 LONGC 2000000000 in your login.sql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the leng
    th of the
    TEXT column, I got it wrapped. When both are huge, it seems I am getting the ex
    pecting
    result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.s
    ql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a LONG setting smaller than the length of the TEXT column,
    I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting s
    maller than the length of the TEXT column, I got it wrapped. When both are huge,
    it seems I am getting the expecting result. So why not setting SET LONG 2000000
    000 LONGC 2000000000 in your login.sql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the leng
    th of the
    TEXT column, I got it wrapped. When both are huge, it seems I am getting the ex
    pecting
    result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.s
    ql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a LONG setting smaller than the length of the TEXT column,
    I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting s
    maller than the length of the TEXT column, I got it wrapped. When both are huge,
    it seems I am getting the expecting result. So why not setting SET LONG 2000000
    000 LONGC 2000000000 in your login.sql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the leng
    th of the
    TEXT column, I got it wrapped. When both are huge, it seems I am getting the ex
    pecting
    result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.s
    ql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a LONG setting smaller than the length of the TEXT column,
    I got it truncated. When I use a huge LONG setting but a LONGCHUNKSIZE setting s
    maller than the length of the TEXT column, I got it wrapped. When both are huge,
    it seems I am getting the expecting result. So why not setting SET LONG 2000000
    000 LONGC 2000000000 in your login.sql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a huge LONG setting but a LONGCHUNKSIZE setting smaller than the leng
    th of the
    TEXT column, I got it wrapped. When both are huge, it seems I am getting the ex
    pecting
    result. So why not setting SET LONG 2000000000 LONGC 2000000000 in your login.s
    ql ?
    When I use a LONG setting smaller than the length of the TEXT column, I got it t
    runcated.
    When I use a LONG setting smaller than the length of the TEXT column,
    I got it truncated. When I use a huge LONG setting but a  setting smallerthe len
    gth of the TEXT column, I got it wrapped. When both are huge, it seems I am gett
    ing
    SQL>

  • How to display  LONG TEXT STRING in Module Pool Screen ?

    Hi Experts,
    I want to display long text string, on screen designed through module pool(SE51). I tried to display through input/output field , but it displays it in SINGLE LINE and i have to scroll all through to view all string.
    I want to display it in rectangular format . It doesnt allow me to set HEIGHT of component.
    Please provide solution.
    Thanks in advance.
    Regards
    Deepak

    This is the program where u can get the WA_THEAD from other program like report and trying to display and modifying that text. U can do instead of WA_THEAD u can generate here itself and use also
    *& Module pool       ZMP_LTEXT                                         *
    PROGRAM  ZMP_LTEXT                               .
    TABLES: STXL.
    *&      Module  STATUS_9000  OUTPUT
    MODULE STATUS_9000 OUTPUT.
    CONSTANTS:line_length type i value 132.
    DATA:g_editor type ref to cl_gui_textedit,
         g_editor_container type ref to cl_gui_custom_container,
         CONT1 type scrfname value 'CONT1',
         g_repid like sy-repid,
         g_ok_code like sy-ucomm,
         g_mytable(132) type c occurs 0,
         g_mycontainer(30) type c ,
         v_result(256) type c,
         g_head like thead,
         it_line type table of tline with header line,
         wa_stxl type stxl.
    DATA : BEGIN OF IT_THEAD1,
           ICON TYPE ICON-ID.
           INCLUDE STRUCTURE STXL.
    DATA : END OF IT_THEAD1.
    DATA : IT_THEAD LIKE TABLE OF IT_THEAD1,
           WA_THEAD LIKE LINE OF IT_THEAD.
    IMPORT WA_THEAD FROM MEMORY ID 'ABCD'.
    select SINGLE * from STXL into wa_stxl
                     where tdname = '00006000156500000002'.
    SELECT SINGLE * from STXL into wa_stxl
                      where tdname = WA_THEAD-TDNAME
                      AND TDID = WA_THEAD-TDID
                      AND TDOBJECT = WA_THEAD-TDOBJECT
                      AND TDSPRAS = WA_THEAD-TDSPRAS.
    IF SY-SUBRC NE 0.
    MESSAGE 'NO RECORD EXIST' TYPE 'E'.
    ENDIF.
    MOVE-CORRESPONDING WA_STXL TO G_HEAD.
    SET PF-STATUS 'STATUS'.
    SET TITLEBAR '001'.
      if g_editor is initial.
         CREATE OBJECT G_EDITOR_CONTAINER
           EXPORTING
            PARENT                      =
             CONTAINER_NAME              = CONT1
            STYLE                       =
            LIFETIME                    = lifetime_default
            REPID                       =
            DYNNR                       =
            NO_AUTODEF_PROGID_DYNNR     =
           EXCEPTIONS
            CNTL_ERROR                  = 1
            CNTL_SYSTEM_ERROR           = 2
            CREATE_ERROR                = 3
            LIFETIME_ERROR              = 4
            LIFETIME_DYNPRO_DYNPRO_LINK = 5
             others                      = 6.
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         CREATE OBJECT G_EDITOR
           EXPORTING
            MAX_NUMBER_CHARS       =
            STYLE                  = 0
       WORDWRAP_MODE          = cl_gui_textedit=>wordwrap_at_fixed_position
    for to fix number of characters in row to 132 characers
             WORDWRAP_POSITION      = line_length
             WORDWRAP_TO_LINEBREAK_MODE = cl_gui_textedit=>true
    for the word to break to next line if it don’t fit in line
            FILEDROP_MODE          = DROPFILE_EVENT_OFF
             PARENT                 = G_EDITOR_CONTAINER
            LIFETIME               =
            NAME                   =
           EXCEPTIONS
            ERROR_CNTL_CREATE      = 1
            ERROR_CNTL_INIT        = 2
            ERROR_CNTL_LINK        = 3
            ERROR_DP_CREATE        = 4
            GUI_TYPE_NOT_SUPPORTED = 5
             others                 = 6  .
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
      REFRESH g_mytable.
         MOVE: WA_THEAD-TDNAME TO STXL-TDNAME,
               WA_THEAD-TDID TO STXL-TDID,
               WA_THEAD-TDOBJECT TO STXL-TDOBJECT,
               WA_THEAD-TDSPRAS TO STXL-TDSPRAS.
        CALL FUNCTION 'READ_TEXT'
        EXPORTING
        CLIENT                        = SY-MANDT
          ID                            = wa_stxl-tdid
          LANGUAGE                      = wa_stxl-tdspras
          NAME                          = wa_stxl-tdname
          OBJECT                        = wa_stxl-tdobject
        ARCHIVE_HANDLE                = 0
        LOCAL_CAT                     = ' '
      IMPORTING
        HEADER                        =
        TABLES
          LINES                         = it_line
      EXCEPTIONS
        ID                            = 1
        LANGUAGE                      = 2
        NAME                          = 3
        NOT_FOUND                     = 4
        OBJECT                        = 5
        REFERENCE_CHECK               = 6
        WRONG_ACCESS_TO_ARCHIVE       = 7
        OTHERS                        = 8
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    LOOP AT IT_LINE INTO V_RESULT.
       APPEND V_RESULT TO G_MYTABLE.
    ENDLOOP.
    CALL METHOD G_EDITOR->SET_TEXT_AS_R3TABLE
       EXPORTING
         TABLE           = G_MYTABLE
       EXCEPTIONS
         ERROR_DP        = 1
         ERROR_DP_CREATE = 2
         others          = 3.
    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.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
    MODULE USER_COMMAND_9000 INPUT.
    CASE SY-UCOMM.
    REFRESH G_MYTABLE[].
    REFRESH IT_LINE[].
    CLEAR V_RESULT.
      WHEN 'SAVE'.
         CALL METHOD G_EDITOR->GET_TEXT_AS_R3TABLE
          EXPORTING
            ONLY_WHEN_MODIFIED     = FALSE
            IMPORTING
              TABLE                  = G_MYTABLE
            IS_MODIFIED            =
          EXCEPTIONS
            ERROR_DP               = 1
            ERROR_CNTL_CALL_METHOD = 2
            ERROR_DP_CREATE        = 3
            POTENTIAL_DATA_LOSS    = 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.
    LOOP AT G_MYTABLE INTO V_RESULT.
       APPEND V_RESULT TO IT_LINE.
    ENDLOOP.
    CLEAR V_RESULT.
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            CLIENT                = SY-MANDT
            HEADER                = G_HEAD
            INSERT                = ' '
            SAVEMODE_DIRECT       = 'X'
          OWNER_SPECIFIED       = ' '
          LOCAL_CAT             = ' '
        IMPORTING
          FUNCTION              =
          NEWHEADER             =
          TABLES
            LINES                 = IT_LINE
        EXCEPTIONS
          ID                    = 1
          LANGUAGE              = 2
          NAME                  = 3
          OBJECT                = 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.
    REFRESH G_MYTABLE[].
    REFRESH IT_LINE[].
    CLEAR V_RESULT.
    WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
    LEAVE TO SCREEN '0'.
    *CALL SCREEN '0'.
    WHEN OTHERS.
    ENDCASE.
    *G_OK_CODE = SY-UCOMM.
    *CLEAR SY-UCOMM.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT

  • F4 help for file on selection screen thro objects

    Hi Every one,
    this report is working , but as i am working ECC6.0 it is showing the obsolete statements
    how to rectify it .
    pls anybody let me know,
    tables rlgrap.
    TYPES : BEGIN OF TAB,
    MATNR TYPE MATNR ,
    MTART TYPE MTART,
    END OF TAB.
    DATA : ITAB TYPE  STANDARD TABLE OF TAB ,
           WTAB TYPE TAB.
    data: it_tab type filetable,
          gd_subrc type i.
    data : file0 type string.
    selection-screen begin of block m with frame.
        select-options: so_fpath for rlgrap-filename.
    selection-screen end of block m.
    data wfile like line of so_fpath.
    at selection-screen on value-request for so_fpath-low.
    REFRESH: it_tab.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
        EXPORTING
            WINDOW_TITLE = 'Select File'
            DEFAULT_FILENAME = '*.txt'
            MULTISELECTION = 'X'
        CHANGING
            FILE_TABLE = it_tab
            RC = gd_subrc.
    loop at it_tab into so_fpath-low.
       so_fpath-sign = 'I'.
       so_fpath-option = 'EQ'.
           append  so_fpath.
    endloop.
    move so_fpath+3 to file0.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FILE0
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                      = Itab
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 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.
    end-of-selection.
    write :/ file0.
    loop at itab into  wtab.
    write :/ wtab-matnr.
    endloop.
    its urgent please...

    See the below ex:change file parameter type .
      DATA: VFILE TYPE STRING.
      DATA: FL(1).
    DATA: L_FILETAB     TYPE FILETABLE,
          L_FILETAB_H   TYPE FILETABLE WITH HEADER LINE,
          INITIAL_DIR_PATH TYPE STRING,
          L_RC          TYPE I.
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    *PARAMETERS: FNAME LIKE RLGRAP-FILENAME OBLIGATORY.
    PARAMETERS: FNAME TYPE LOCALFILE OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FNAME.
    REFRESH L_FILETAB.
      INITIAL_DIR_PATH = 'C:\'.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
        EXPORTING
        WINDOW_TITLE            = 'Select the Asset Master Data file'
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
        FILE_FILTER             = 'Text Files (.TXT)|.TXT|'
        INITIAL_DIRECTORY       = INITIAL_DIR_PATH
          MULTISELECTION          = SPACE
       WITH_ENCODING           =
        CHANGING
          FILE_TABLE              = L_FILETAB
          RC                      = L_RC
       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.
        WRITE:/ 'Error while selecting the input file'.
      ELSE.
        LOOP AT L_FILETAB INTO L_FILETAB_H.
          FNAME = L_FILETAB_H-FILENAME.
          EXIT.
        ENDLOOP.
      ENDIF.
      FILE = FNAME.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
         FILENAME                      = VFILE
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                      = I_TAB
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • How long charactors can stored in 'STRING' type?

    HI
    I'm just curious how long charactors can stored in 'string' type.
    and if there is limit number to store what kind of type is unlimited length type?
    and is it possible send a parameter page to page with 'form'  'post' way unlimited length of string?
    and is there any type of DB field which is save last number of records  automatically when one record is inserted like MANDT?
    MANDT is client number though.
    Regards.

    Here is what ABAP key word documentation says about string
    The elementary data type STRING is similar to data type C and refers to a variable-length string. Accordingly, the elementary data type XSTRING is similar to data type X and refers to a variable-length byte sequence.
    In contrast to a C or X field, the length of a string is not static but variable and adjusts itself to the current field content at runtime. Dynamic memory management is used internally. Strings can have any length.
    The initial value of a string is an empty string with length 0. A structure containing a string is seen as deep. A deep structure cannot be used like a C field. Strings can be displayed in the ABAP Debugger and used in the ABAP Dictionary.
    It is not yet possible to use strings in screens or database tables. However, strings can be stored in database tables as clusters using EXPORT and transferred using IMPORT.
    As far as I know the limit is 4 Giga Byte which equals more or less no limit. I donnot expect that you will meet this limit in practice. Its very likely that will run out of memory before you reach this limit.
    In short there is no limit to the data stored in STRING var but the system memory has a limit....
    This can be proved with the below program:
    For the program system dumps with mess.
    "Unable to fulfil request for 127683972 bytes of memory space. "
    here's the test prog.:
    TABLES ekko.
    DATA testmax TYPE string.
    DATA z(16) TYPE i.
    SELECT * FROM ekko.
      CONCATENATE testmax ekko INTO testmax.
      z = strlen( testmax ).
      IF  z = 63841496.
        BREAK-POINT.
      ENDIF.
    ENDSELECT.

  • I want to know string contain symbol

    hhi
    i wana to know that if string contain symbol then remove the
    symbol from string
    i dont know which type of symbol is in string find and remove
    the symbol and put spacce
    like this
    string is ================"screen-capturing"
    result will be screen capturing
    tell me the result

    It would take a lot longer time that I have to explain how
    regular
    expressions work. And I only know the bare basics of them to
    begin
    with. Basically a regular expression is a pattern matching
    algorithm.
    You say what letters you want to find and what you want to do
    with those
    characters.
    function cleanString(vText){
    return vText.replace(/[^0-9a-z]|"_"/gi," ");
    In this example, the javascript replace function looks for
    the stuff in
    the beginning between the / marks and replaces it with the "
    " (space).
    The ^ character means "not" and everything in the brackets is
    what we
    are not looking for. i.e. it is saying that anything that is
    not a
    number (0-9) or a letter (a-z). Then the | pipe character
    means "or".
    So in addition to the non alphanumerics, it is also looking
    for "_" the
    underscore. Then after the last / are the switches. The g
    switch says
    to match all of the instances of the pattern (without the g,
    it would
    only replace the 1st one) and the i tells it to be
    case-insensitive..
    Now are you more confused than before?
    Here is a pretty good site with some more specific
    information about how
    the replace method works in Javascript:
    http://www.regular-expressions.info/javascript.html
    If you really want to get deep into regex, find the xtra for
    Director
    called pRegEx. It is free and super powerful and superfast.
    The
    documentation that comes with it is extremely detailed about
    all the
    different functions of regular expressions and how to use
    them in Director.

  • How many pixels does a string occupy??

    I'm making a credit script and have a little problem with centering the
    strings. If one string is eg. 12 characters long how many pixels will it occupy on screen? This depends on which letters the string contains. So the question is, HOW can i calculate the space (in pixels) needed to print any given string. (The size of the letters is constant!)
    Is it any other way to center a string on screen? I have a tendency to think a little complicated.. :)
    Any help is welcome. Code or just ideas is great!

    Hi
    There's a Graphics method very interesting:
    g.getFontMetrics()
    it recover the width of an String...Code of sample: (Sorry, but I'm from Spain and my code too):
    public void paint(Graphics g)
    g.setColor(cLinea);
    g.draw3DRect(5,5,iAncho-10,iAlto-10,true);
    g.draw3DRect(6,6,iAncho-12,iAlto-12,true);
    Color c=this.getBackground();
    if(!bAgra)
    { g.setColor(Color.orange); }
    else
    { g.setColor(cObligatorio); }
    g.fill3DRect(7,7,iAncho-13,iAlto-13,true);
    g.setColor(cLetra);
    g.setFont(new Font("Dialog",Font.BOLD,iSize));
    //Next line recover the X position referenced by the canvas width/2 and the text width/2...result:CENTERED
    int posX=(iAncho/2)-(g.getFontMetrics().stringWidth(sTitulo)/2);
    //Oopss. I've tried to do a vertical align to center, but it doesn't work properly...
    int posY=(iAlto/2);
    g.drawString(sTitulo,posX,posY+5);
    If you need more help about this code, don't worry to ask me again
    Greetings

  • Loading String in JTextArea/JTextPane

    I'm trying to create an app that will display long Strings (veeerry looong and I know this is very easy) on the screen. When I display the String on screen, it should change the colors of certain text on the fly (much like many IDEs now). This is not necessarily required of the app but it would be good to have. My problem now lies in the fact that I originally used JTextArea, which worked very fine, loading the files very fast, too. Now, in order for me to be able to change the colors of the text, I have to switch to a JTextPane (not much change in code). I haven't even gotten to the point of making it change the text's colors, I've just changed my code to use JTextPane instead of JTextArea (shown below) but the speed of loading the file was so much affected. It's like the JTextPane is several times slower than JTextArea.
       //JTextArea txtDisplay = new JTextArea();
       JTextPane txtDisplay = new JTextPane();
       timer.start();
       txtDisplay.setText(aVeryLongString);
       timer.end();
       System.out.println(timer.status());
       ...After running this, using JTextArea, the timer.status() returns 3 seconds. Using the JTextPane() returns something like 10-15 seconds.
    Appreciate help fom anyone.

    Try something like this :
    JTextPane txtDisplay = new JTextPane();
    BufferedReader reader = new BufferedReader(new FileReader(big.txt));
    String line = null;
    while((line = reader.readLine()) != null) {
    txtDisplay.insertString(txtDisplay.getDocument().getLength(),line,null);
    Bye,
    Evert

  • Regarding upload from excel to alv.

    Hi
    here is my code:
    TABLES
    TABLES: ioheader,        " IOC Communication structure
            ioitem,          " IOC Communication structure
            klah,            " Class and Class type
            ksml,            " Characteristic Keys for Class and Type
            cabn,            " Characteristics
            cabnt,           " Characteristic Descriptions
            vbap,            " SAles details
            sscrfields.
    Includes
    INCLUDE rvreuse_global_data.  " ALV Types etc
    DATA - INTERNAL TABLES AND FIELD LISTS
    Types
    TYPE-POOLS: ibco2.           " Characteristic types
    DATA - CONSTANTS
    CONSTANTS: c_true(1)    TYPE c             VALUE 'X',
               c_false(1)   TYPE c             VALUE ' ',
               c_zioheader  TYPE dd02l-tabname VALUE 'ZIOHEADER',
               c_command    TYPE slis_formname VALUE 'USER_COMMAND',
               c_backhoe(7) TYPE c             VALUE 'BACKHOE',
               c_300(3)     TYPE c             VALUE '300',
               c_no_data(7) TYPE c             VALUE 'No Data',
               c_save(1)    TYPE c             VALUE 'A'.
    Internal Tables
    Main IO Table
    DATA: i_header LIKE zioheader OCCURS 0 WITH HEADER LINE.
    Characteristic Values
    DATA: i_config TYPE ibco2_instance_tab2.
    Characteristics Keys
    DATA: BEGIN OF i_imerk OCCURS 0,
            imerk LIKE ksml-imerk,
          END OF i_imerk.
    ALV Grid Control
    DATA: i_grid TYPE sd_alv.
    Catalogues
    DATA: wa_cat LIKE LINE OF i_grid-fieldcat.
    Structures
    Structure for layout variant
    DATA: s_variant LIKE disvariant.
    DATA : filename TYPE string.
    DATA - WORKING VARIABLES
    DATA - FIELD GROUPS
    *field-groups:
    SELECTION SCREEN
    Variant control
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t02.
    PARAMETERS: p_var LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK b1.
    Printer Control
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    PARAMETERS: rad1 RADIOBUTTON GROUP rad USER-COMMAND radio,
                rad2 RADIOBUTTON GROUP rad,
                rad3 RADIOBUTTON GROUP rad.
    PARAMETER p_floc(128) DEFAULT '/usr/tmp/testfile.dat'
                             LOWER CASE.
    SELECTION-SCREEN END OF BLOCK b3.
    MAIN PROGRAM *************************
    INITIALIZATION.
      PERFORM initialise.             " Set up program defaults
    move 'Report Only' to rad1.
    move 'Export Sequence List' to s_but2.
    move 'Import Sequence List' to S_but3.
    Selection Screen Options
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var.
      PERFORM get_variant CHANGING p_var.             " ALV Layout
    DATA :   l_no_of_lines TYPE i,
              la_matnr LIKE s_matnr.
    DESCRIBE TABLE s_matnr LINES l_no_of_lines.
    IF l_no_of_lines > 1.
       MESSAGE e000(z1) WITH 'Enter only one product'.
    ENDIF.
    READ TABLE s_matnr INTO la_matnr WITH KEY sign = 'I'
                               option = 'EQ'.
    IF sy-subrc NE 0.
       MESSAGE e000(z1) WITH 'Enter only one product'.
    ENDIF.
    AT SELECTION-SCREEN.
      DATA :   l_no_of_lines TYPE i,
                la_matnr LIKE s_matnr.
      DESCRIBE TABLE s_matnr LINES l_no_of_lines.
      IF l_no_of_lines > 1.
        MESSAGE e000(z1) WITH 'Enter only one product'.
      ENDIF.
    READ TABLE s_matnr INTO la_matnr WITH KEY sign = 'I'
                                option = 'EQ'.
      IF sy-subrc NE 0.
        MESSAGE e000(z1) WITH 'Enter only one product'.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR  p_floc.
    data : pname type syst-repid.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
       PROGRAM_NAME        = pname
       DYNPRO_NUMBER       = SYST-DYNNR
       FIELD_NAME          = 'P_FLOC'
      STATIC              = ' '
      MASK                = ' '
      CHANGING
        FILE_NAME           = p_floc
    EXCEPTIONS
      MASK_TOO_LONG       = 1
      OTHERS              = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    START-OF-SELECTION.
      PERFORM set_catalogue.          " Set up basic headings from Itab
      PERFORM get_char_keys.          " Get the characteristic keys
      PERFORM modify_catalogue_key.   " Amend headings for char keys
    IOC Logical Database Event
      GET ioheader.
      PERFORM get_subsequent_data.    " Retrieve additional data
    END-OF-SELECTION.
    PERFORM modify_catalogue_title. " Place correct titles for AVL
    PERFORM alv_display.            " Display in ALV Grid
    if rad1 = 'X' .
      PERFORM modify_catalogue_title. " Place correct titles for AVL
      PERFORM alv_display.            " Display in ALV Grid
    elseif rad2 = 'X' .
    *if p_floc is initial .
    MESSAGE e000(z1) WITH
       ' Enter the file location'.
    *else.
       PERFORM download.               " Export sequence list to excel
    PERFORM modify_catalogue_title. " Place correct titles for AVL
      PERFORM alv_display.            " Display in ALV Grid
    *endif.
    elseif rad3 = 'X' .
    if p_floc is initial .
    MESSAGE e000(z1) WITH
        ' Enter the file location'.
    else .
         PERFORM upload.
    endif.
    endif.
    *AT SELECTION-SCREEN OUTPUT.
    *TOP-OF-PAGE.
    *END-OF-PAGE.
    *AT USER-COMMAND.
    perform PF_STATUS_SET.
    SUBROUTINES *******************************
          FORM get_variant                                              *
          Retrieve ALV display variant                                  *
    -->  X_VAR Variant                                                 *
    FORM get_variant CHANGING x_var.
      PERFORM f4_alv_layout(ppio_entry) USING i_grid-program
                                     CHANGING x_var.
    ENDFORM.
          FORM get_subsequent_data                                      *
          Retrieve additional data and place into I_HEADER Itab         *
    FORM get_subsequent_data.
    Prime extended table
      i_header = ioheader.
      PERFORM get_serial_number. " Get Sales Order Serial No
      PERFORM get_char_values.   " Get Characteristic Values
      PERFORM build_char_entries." Put Char Values into I_HEADER
    Add to extended table
      APPEND i_header.
    ENDFORM.
          FORM get_serial_number                                        *
          Retrieve the serial number                                    *
    FORM get_serial_number.
      SELECT SINGLE zuonr submi
        INTO (i_header-zuonr,i_header-submi)
        FROM vbak
       WHERE vbeln EQ i_header-kdauf_aufk.
    ENDFORM.
          FORM get_char_values                                          *
          Retrieve the characteristic values for the production order   *
    FORM get_char_values.
    Get Ready
      REFRESH i_config.
    Get Object key
      SELECT SINGLE cuobj
      FROM vbap
      INTO vbap-cuobj
      WHERE vbeln EQ i_header-kdauf_aufk
        AND matnr EQ i_header-plnbez.
    Get characteristic config values
      CALL FUNCTION 'CUCB_GET_CONFIGURATION'
           EXPORTING
                instance                     = vbap-cuobj
           IMPORTING
                configuration                = i_config
           EXCEPTIONS
                invalid_input                = 1
                invalid_instance             = 2
                instance_is_a_classification = 3
                OTHERS                       = 4.
    Not found, no config values will be pulled through
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.
          FORM build_char_entries                                       *
          For each character value. Find the relevent "slot" in the     *
          table by checking the characteristic key against the catalogue*
          stored key
    FORM build_char_entries.
      DATA: la_config LIKE LINE OF i_config,       " i_config header line
            li_values TYPE ibvalue0 OCCURS 0,      " Charact'ic Values Itab
            la_values LIKE LINE OF li_values,      " li_values header line
            l_atwrt LIKE la_values-atwrt,          " Characteristic Value
            l_atinn LIKE la_values-atinn,          " Characteristic Key
            l_key(20),                             " Working built key
            l_entry(20),                           " FieldName to be updated
            l_len LIKE sy-tabix,                   " Length of string
            l_tabix LIKE sy-tabix.                 " Index position of Itab
      FIELD-SYMBOLS: <f_field>.       " This will be the field to update
    Loop on characteristics
      LOOP AT i_config INTO la_config.
    Extract the characteristic values imbedded table
        MOVE la_config-values TO li_values.
    Loop on the characteristics values
        LOOP AT li_values INTO la_values.
    We now have the charecteristic key la_values-atinn
    and the value in la_values-atwrt. However, there may be
    Multiple values for key la_values-atinn
    So if they are the same append to one long string.
    Is it a new value
          IF la_values-atinn EQ l_atinn.
            CONCATENATE l_atwrt '|' la_values-atwrt INTO l_atwrt.
            CONTINUE.
          ENDIF.
    New Value (and not first pass) so save built values
          IF NOT l_atinn IS INITIAL.
    Find the correct field to place the value in.
    This is done by finding the Itab field description in the AVL display
    field Catalogue called "No Data|nnnnnn" where nnnn is the
    characteristic Key
    Build the key
            CONCATENATE c_no_data '|' l_atinn INTO l_key.
    Loop till we find it. This gives us the field name
            LOOP AT i_grid-fieldcat INTO wa_cat WHERE seltext_l = l_key.
    Set up the field name to be amended
              CONCATENATE wa_cat-tabname '-' wa_cat-fieldname INTO l_entry.
              ASSIGN (l_entry) TO <f_field>.
    Update field with the Char value
              MOVE l_atwrt TO <f_field>.
    No need to continue this loop
              EXIT.
            ENDLOOP.
          ENDIF.
    Prime for next value
          l_atinn = la_values-atinn.
          l_atwrt = la_values-atwrt.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
          FORM alv_display                                              *
          Display data in ALV grid                                      *
    FORM alv_display.
    Set up Variant
      i_grid-variant-variant = p_var.     " Variant
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
        i_callback_program             = i_grid-program
       I_CALLBACK_PF_STATUS_SET       =  i_grid-pf_status_set
        i_callback_user_command        = i_grid-user_command
      i_structure_name               = i_grid-structure
      is_layout                      = i_grid-layout
        it_fieldcat                    = i_grid-fieldcat
      IT_EXCLUDING                   = i_grid-excluding
      IT_SPECIAL_GROUPS              = i_grid-special_groups
      IT_SORT                        = i_grid-sort
      IT_FILTER                      = i_grid-filter
      IS_SEL_HIDE                    = i_grid-sel_hide
      I_DEFAULT                      = i_grid-default
        i_save                         = I_grid-save
        is_variant                     = i_grid-variant
      IT_EVENTS                      = i_grid-events
      IT_EVENT_EXIT                  = i_grid-event_exit
      IS_PRINT                       = i_grid-print
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = i_grid-start_column
      I_SCREEN_START_LINE            = i_grid-start_line
      I_SCREEN_END_COLUMN            = i_grid-end_column
      I_SCREEN_END_LINE              = i_grid-end_line
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        = i_grid-exit
      ES_EXIT_CAUSED_BY_USER         = i_grid-user_exit
        TABLES
         t_outtab                      = i_header
       EXCEPTIONS
        program_error                  = 1
        OTHERS                         = 2.
    ALV Failed.
      IF sy-subrc <> 0.
        WRITE: / 'Failed with',sy-subrc.
      ENDIF.
    ENDFORM.
          FORM initialise                                               *
          Set up basic report details                                   *
    FORM initialise.
    ALV controls
      i_grid-program = sy-repid.          " Program Name
      i_grid-user_command = c_command.    " ALV user FORM
      i_grid-save = c_save.               " Save Options
    ALV Variant Details for saved report layouts
      i_grid-variant-report = i_grid-program.
      i_grid-variant-username = sy-uname.
    ENDFORM.
          FORM user_command                                             *
          Routine called by ALV                                         *
    -->  X_UCOMM    Function selected                                  *
    -->  X_SELFIELD Selection field Itab                               *
    FORM user_command USING x_ucomm    LIKE sy-ucomm
                            x_selfield TYPE slis_selfield.
      DATA: l_answer(1).        " Answer returned from popup box
    Only allow drill down on Order number
      CHECK x_selfield-fieldname = 'AUFNR'.
    Get option for display or modify
      CALL FUNCTION 'POPUP_TO_DECIDE'
           EXPORTING
                textline1    = 'Please Choose'
                text_option1 = 'Display'
                text_option2 = 'Modify'
                titel        = 'Production Order'
           IMPORTING
                answer       = l_answer.
    Did they cancel
      CHECK l_answer NE 'A'.
    Set up parameters.
      SET PARAMETER ID 'ANR' FIELD x_selfield-value.
    Display
      IF l_answer = '1'.
        CALL TRANSACTION 'CO03' AND SKIP FIRST SCREEN.
    Modify
      ELSEIF l_answer = '2'.
        CALL TRANSACTION 'CO02' AND SKIP FIRST SCREEN.
      ENDIF.
    *IF rad2 = 'X'.
    If sy-ucomm ='%PC'.
    IF sy-subrc <> 0.
        WRITE: / 'Failed with',sy-subrc.
      else.
      CALL FUNCTION 'POPUP_TO_INFORM'
        EXPORTING
          TITEL         = 'File Transfer Status'
          TXT1          = 'File transfered to location:'
          TXT2          = filename
        TXT3          = ' '
        TXT4          = ' '
        ENDIF.
    endif.
    ENDFORM.
          FORM set_catalogue                                            *
          Retrieve the title and field information from the             *
          Data Dictionary. This will then be amended to the correct     *
          Characteristic titles during the end-of-selection event       *
    FORM set_catalogue.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name         = i_grid-program
                i_internal_tabname     = 'I_HEADER'
                i_structure_name       = c_zioheader
                i_client_never_display = 'X'
           CHANGING
                ct_fieldcat            = i_grid-fieldcat.
    ENDFORM.
          FORM get_char_keys                                            *
          Retrieve the list of characteristic keys                      *
          template of BACKHOE class 300                                 *
    FORM get_char_keys.
      DATA : la_inob TYPE inob.
      SELECT SINGLE * FROM inob INTO la_inob
                     WHERE objek = s_matnr-low.
      IF sy-subrc NE 0.
        MESSAGE e000(z1) WITH
        ' Could not get INOB table for ' s_matnr-low.
      ENDIF.
    Get Major Object key
      SELECT SINGLE clint
        FROM klah
        INTO klah-clint
       WHERE klart = la_inob-klart
         AND class = s_matnr-low.
      IF sy-subrc NE 0.
        MESSAGE e001(z296) WITH c_backhoe c_300.
      ENDIF.
    Use Major key to retrieve Characteristics keys
    This is the template for the headings
      SELECT imerk
        FROM ksml
        INTO TABLE i_imerk
       WHERE clint EQ klah-clint    " Objct Key
         AND lkenz EQ space         " Delete Indicator
         AND datuv LE sy-datum.     " Validity to
      IF sy-subrc NE 0.
        MESSAGE e002(z296) WITH klah-clint.
      ENDIF.
    ENDFORM.
          FORM modify_catalogue_key                                     *
          Change the default "No Data" titles with the characteristic   *
          key values in the form "No Data|nnnnnnn" where nnnnnn is      *
          the characteristic key. This is used as a method of allocating*
          characteristic values to the I_HEADER Itab positions          *
          CHAR_001 to CHAR_100                                          *
    FORM modify_catalogue_key.
      DATA: l_index LIKE sy-tabix,              " Table Index for Read
            l_tabix LIKE sy-tabix,              " Table Index Position
            l_seltext_l LIKE dd03p-scrtext_l.   " Heading Text
    Get into Key Sequence
      SORT i_imerk.
    Loop on catalogue for dummy titles
      LOOP AT i_grid-fieldcat INTO wa_cat WHERE seltext_l(7) = c_no_data.
        l_tabix = sy-tabix.
    Get the next characteristic
        l_index = l_index + 1.
        READ TABLE i_imerk INDEX l_index.
    No Characteristic, No display
        IF sy-subrc NE 0.
          wa_cat-no_out = c_true.
          wa_cat-tech = c_true.
          MODIFY i_grid-fieldcat FROM wa_cat INDEX l_tabix.
          CONTINUE.
        ENDIF.
    Place the char key against the "No Data" title
    so that later we know what values to place against the keys
    the title will become "No Data:nnnnnnnnnn" (nnn = Key)
        CONCATENATE c_no_data '|' i_imerk-imerk INTO wa_cat-seltext_l.
        MODIFY i_grid-fieldcat FROM wa_cat INDEX l_tabix.
      ENDLOOP.
    ENDFORM.
          FORM modify_catalogue_title                                   *
          At this stage the catalogue titles for the characteristics    *
          are in the form "No Data|nnnnn" Where nnnn is the             *
          characteristic key. Using the Key, replace this text with     *
          the real characteristic title
    FORM modify_catalogue_title.
      DATA: l_key(20),                 " Characteristic Key in Alpha form
            l_len LIKE sy-tabix.       " Length of string
    Loop on the characteristic keys
      LOOP AT i_imerk.
    Get the real title
        SELECT SINGLE atbez
          FROM cabnt
          INTO cabnt-atbez
         WHERE atinn EQ i_imerk-imerk.
    Not found, leave alone
        CHECK sy-subrc EQ 0.
    Place key into char form for comparison in loop
        l_key = i_imerk-imerk.
    Now loop on the catalogue to get the key
        LOOP AT i_grid-fieldcat INTO wa_cat WHERE seltext_l+8 = l_key.
    Place the title into the catalogue
          wa_cat-seltext_l = cabnt-atbez.
          wa_cat-seltext_m = cabnt-atbez.
          wa_cat-seltext_s = cabnt-atbez.
          wa_cat-reptext_ddic = cabnt-atbez.
    And update
          MODIFY i_grid-fieldcat FROM wa_cat.
        ENDLOOP.
      ENDLOOP.
    IF rad2 = 'X'.
    LOOP AT i_grid-fieldcat INTO wa_cat.
    *IF wa_cat-fieldname = 'AUFNR'.
    *wa_cat-col_pos = '10'.
    *endif.
    case wa_cat-fieldname.
    when 'AUFNR'.
    wa_cat-fix_column = 'X'.
    when 'CY_SEQNR'.
    wa_cat-fix_column = 'X'.
    when 'ZOUNR'.
    wa_cat-fix_column = 'X'.
    when 'GLTRP'.
    wa_cat-fix_column = 'X'.
    when 'SUBMI'.
    wa_cat-fix_column = 'X'.
    endcase.
    modify  i_grid-fieldcat FROM wa_cat.
    endloop.
    endif.
    ENDFORM.
    *SELECT z099seqno z099heading
          INTO table i_header
          FROM z099 join z100 ON
          z099seqno = z100seqno WHERE
    z100~product = s_matnr.
    *&      Form  download
          Download file to excel
    *FORM download.
    *filename = p_floc .
    *CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  =
       FILENAME                      = filename
       FILETYPE                      = 'ASC'
       APPEND                        = 'X'
      WRITE_FIELD_SEPARATOR         = ','
      HEADER                        = 'l_seltext_l'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
    TABLES
       DATA_TAB                      = i_header
    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.
       WRITE: / 'Failed with',sy-subrc.
    else.
    CALL FUNCTION 'POPUP_TO_INFORM'
       EXPORTING
         TITEL         = 'File Transfer Status'
         TXT1          = 'File transfered to location:'
         TXT2          = filename
        TXT3          = ' '
        TXT4          = ' '
       ENDIF.
    *ENDFORM.                    " download
    *&      Form  upload
          text
    -->  p1        text
    <--  p2        text
    FORM upload.
    *DATA : i_upload TYPE STANDARD TABLE OF alsmex_tabline.
    **data : i_upload like zioheader occurs 0 with header line.
    data file like RLGRAP-FILENAME.
    file = p_floc .
    DATA: BEGIN OF i_upload OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF i_upload.
    DATA: BEGIN OF i_upload1 OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF i_upload1.
    DATA: BEGIN OF t_col OCCURS 0,
           col LIKE alsmex_tabline-col,
           size TYPE i.
    DATA: END OF t_col.
    DATA: zwlen TYPE i,
          zwlines TYPE i.
    DATA: BEGIN OF fieldnames OCCURS 3,
            title(60),
            table(6),
            field(10),
            kz(1),
          END OF fieldnames.
    DATA: tind(4) TYPE n.
    FIELD-SYMBOLS: <fs1>.
    DATA: zwfeld(19).
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = file
        I_BEGIN_COL                   = '1'
        I_BEGIN_ROW                   = '1'
        I_END_COL                     = '200'
        I_END_ROW                     = '6500'
      TABLES
        INTERN                        = i_upload.
    EXCEPTIONS
      INCONSISTENT_PARAMETERS       = 1
      UPLOAD_OLE                    = 2
      OTHERS                        = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    LOOP AT i_upload.
        i_upload1 = i_upload.
        CLEAR i_upload1-row.
        APPEND i_upload1.
      ENDLOOP.
      SORT i_upload1 BY col.
      LOOP AT i_upload1.
        AT NEW col.
          t_col-col = i_upload1-col.
          APPEND t_col.
        ENDAT.
        zwlen = strlen( i_upload1-value ).
        READ TABLE t_col WITH KEY col = i_upload1-col.
        IF sy-subrc EQ 0.
          IF zwlen > t_col-size.
            t_col-size = zwlen.
                             Internal Table, Current Row Index
            MODIFY t_col INDEX sy-tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.
      DESCRIBE TABLE t_col LINES zwlines.
      SORT i_upload BY row col.
    IF kzheader = 'X'.
        LOOP AT i_upload.
          fieldnames-title = i_upload-value.
          APPEND fieldnames.
          AT END OF row.
            EXIT.
          ENDAT.
        ENDLOOP.
    ELSE.
        DO zwlines TIMES.
          WRITE sy-index TO fieldnames-title.
          APPEND fieldnames.
        ENDDO.
    ENDIF.
      SORT i_upload BY row col.
      LOOP AT i_upload.
       IF kzheader = 'X'
        i_upload-row = 1.
          CONTINUE.
       ENDIF.
        tind = i_upload-col.
        CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
        ASSIGN (zwfeld) TO <fs1>.
        <fs1> = i_upload-value.
        AT END OF row.
          APPEND i_upload.
          CLEAR i_upload.
        ENDAT.
      ENDLOOP.
    if sy-subrc = 0.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                =
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = i_grid-program
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = i_grid-fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = i_save
       IS_VARIANT                        = i_grid-variant
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_ADD_FIELDCAT                   =
      IT_HYPERLINK                      =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = i_upload.
    EXCEPTIONS
      PROGRAM_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.
    endif.
    when i execute the program i am getting a short dump
    GETWA_NOT_ASSIGNED
    what might be the problem.
    this is a very urgent question.
    pls suggest me the clear way to over come this problem.

    HI
    use this code for uploading the excel file to internal table....
    data: begin of itab_string occurs 0,
          record type char255,
          end of itab_string.
    data:  L_FILETABLE TYPE FILETABLE,
    L_FILETAB_H TYPE FILETABLE WITH HEADER LINE.
    data: p_file1 type string.
    selection screen .
    PARAMETERS: P_FILE TYPE LOCALFILE.
    initialization.
    at selection-screen on value-request for P_FILE.
    IF THE USER SELECT EXTENTION BUTTON IT WILL OPEN THE LOCAL DIRECTORY FOR SELECTING THE FILE LOCATION.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
       WINDOW_TITLE            =
       DEFAULT_EXTENSION       = 'CSV'
       DEFAULT_FILENAME        = 'C:\Documents and Settings\196093\Desktop\STATUS.csv'
       FILE_FILTER             =
       INITIAL_DIRECTORY        = 'C:\Documents and Settings\196093\Desktop\'
       MULTISELECTION          =
       WITH_ENCODING           =
      CHANGING
        FILE_TABLE              = L_FILETABLE
        RC                      = RC
       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.
    LOOP AT l_filetable INTO L_FILETAB_H.
    P_FILE = L_FILETAB_H-FILENAME.
    move p_file to p_file1.
    EXIT.
    ENDLOOP.
    ENDIF.
    passing the selected file name to gui_upload for loading the data
    into internal table
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = p_file1
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = itab_string
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE I000(Z00) WITH 'PLEASE PROVIDE CORRECT FILE NAME'.
    ENDIF.
    reward points to all helpful answers
    kiran.M

  • Help me out with this program

    hi,
    I am trying to make a login program that connects to an access database with table 'PASSWORD' containing the username and the password.
    I have written the program but i could not continue as i am in fix with few errors which it is giving can anyone help me in doing the coding of this program..
    //***************** Create a DSN named "Login" from the Control Panel ODBC ********//
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.plaf.metal.*;
    import java.sql.*;
    public class Screen extends JFrame implements ActionListener
    JTextField txtuser;
         JPasswordField txtpass;
    public Screen()
    JPanel contentpane=(JPanel)getContentPane();
    contentpane.setLayout(new FlowLayout());
    JLabel username= new JLabel("UserName:");
    JTextField txtuser= new JTextField(18);
    JPassword Field JLabel password= new JLabel("Password:");
              txtpass = new JPasswordField(18);
              txtpass.setEchoChar('*');
    JButton login= new JButton("Login");
              login.addActionListener(this);
              login.setActionCommand("Login");
         JButton cancel= new JButton("Cancel");
              cancel.addActionListener(this);
              cancel.setActionCommand("Cancel");
    contentpane.add(username);
    contentpane.add(txtuser);
    contentpane.add(password);
    contentpane.add(txtpass);
    contentpane.add(login);
    contentpane.add(cancel);
    addWindowListener(new Screen.WindowEventHandler());
    static public void main(String[] args)
    Screen scr= new Screen();
    scr.setSize(new Dimension(300,140));
    scr.setTitle("Login Screen");
    scr.setVisible(true);
    public void actionPerformed(ActionEvent e)
         Connection con = null;
         String query;
         String id=null,pwd=null;
         ResultSet rs;
         Statement stmt;
    /* U Need to Get the Text Box values of ID and Password into "id" and "pwd" variables,
    I tried to Do this as follows , but no success ..I havent worked on SWING class before.
    so u check out the method required to get the TEXT box values into these variables...*/
    id=txtuser.getText();
    pwd=txtpass.getText();
         query = "Select Password from user where ID='"+id+"'";
    if (e.getActionCommand()=="Login")
    try
              Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    catch( ClassNotFoundException ee)
              ee.printStackTrace();
    // Here i m using a DSN "Doctor" if u create other than this name then Specify the name of the DSN here in place of "Login"
         String dsn = "jdbc:odbc:doctor";
    try
                   con = DriverManager.getConnection(dsn);
         catch(Exception ex)
              System.out.println("Exception in Connection " + ex);
    try
         stmt = con.createStatement();
         rs=stmt.executeQuery(query);
    if(pwd==rs.getString(1))
                   System.out.println("This user is valid");
                        //** VALID USER , DO AS PER UR REQUIREMENT
              else
                   System.out.println("This user is invalid");
                   //INVALID USER , DO AS PER UR REQUIREMENT
    rs.close();
         stmt.close();
    catch(Exception ee)
              ee.printStackTrace();
    if (e.getActionCommand()=="Cancel")
    System.out.println("Cancel is pressed");
    public class WindowEventHandler extends WindowAdapter
    public void windowClosing(WindowEvent e)
    System.exit(0);
    Can Anybody Code this for me..
    Thanks in Advance........

    hi,
    i watched your program and i have changed the code as follow as this:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.plaf.metal.*;
    import java.sql.*;
    public class Screen extends JFrame implements ActionListener
    JTextField txtuser;
    JPasswordField txtpass;
    public Screen()
    JPanel contentpane=(JPanel)getContentPane();
    contentpane.setLayout(new FlowLayout());
    JLabel username= new JLabel("UserName:");
    txtuser= new JTextField(18);
    JLabel password= new JLabel("Password:");
    txtpass = new JPasswordField(18);
    txtpass.setEchoChar('*');
    JButton login= new JButton("Login");
    login.addActionListener(this);
    login.setActionCommand("Login");
    JButton cancel= new JButton("Cancel");
    cancel.addActionListener(this);
    cancel.setActionCommand("Cancel");
    contentpane.add(username);
    contentpane.add(txtuser);
    contentpane.add(password);
    contentpane.add(txtpass);
    contentpane.add(login);
    contentpane.add(cancel);
    addWindowListener(new Screen.WindowEventHandler());
    static public void main(String[] args)
    Screen scr= new Screen();
    scr.setSize(new Dimension(300,140));
    scr.setTitle("Login Screen");
    scr.setVisible(true);
    public void actionPerformed(ActionEvent e)
    Connection con = null;
    String query;
    String id=null;
    String pwd=null;
    ResultSet rs;
    Statement stmt;
    String dsn = null;
    String driver_connection = null;
    driver_connection = "sun.jdbc.odbc.JdbcOdbcDriver";
    dsn = "jdbc:odbc:Prove";
    query = "SELECT * FROM user";
    try
    id = txtuser.getText();
    pwd = txtpass.getText();
    if (e.getActionCommand().equals("Login"))
    Class.forName(driver_connection);
    con = DriverManager.getConnection(dsn);
    stmt = con.createStatement();
    rs = stmt.executeQuery(query);
    while(rs.next())
    if(id.equals(rs.getString("ID")) && pwd.equals(rs.getString("PASSWORD")))
    System.out.println("The user is valid");
    return;
    else
    System.out.println("The user is invalid");
    System.exit(0);
    rs.close();
    stmt.close();
    else if(e.getActionCommand()=="Cancel")
    System.out.println("Cancel is pressed");
    WindowEventHandler w = new WindowEventHandler();
    w.windowClosing();
    catch(Exception exception)
    System.out.println("Error: "+exception.getMessage());
    public class WindowEventHandler extends WindowAdapter
    public void windowClosing()
    System.exit(0);
    try it,
    i hope this could help you!!!!

  • Use of Icon in alv report

    Hi Experts,
        How to use icon in the ALV Report ...?
    Suppose My Scenario is i have a Pending PR Report if any line item in the PR is Deleated i want to display delete icon
    Please guide me on this....
    any Kind help would be highly appricated.

    Hello friend,
    please try following codes, it works.
    types: begin of gs_outtab.
       types:   lights               type char1,
                color                type i,
                tabcol               type lvc_t_scol,
                id                   type char25, " Already exist in ICON, Flat Structure
                name                 type icon-name,
                symbol               type icon-id,
           end   of gs_outtab.
    data: gt_outtab type standard table of gs_outtab.
    data: gr_grid   type ref to cl_gui_alv_grid.
    data: gr_container type ref to cl_gui_custom_container,
          gs_layout type lvc_s_layo,
          gt_fieldcat type lvc_t_fcat.
    data: ls_vari   type disvariant.
    data: g_okcode type syucomm.
    data: gt_exc type table of ALV_S_QINF.
    data: text type string.
    selection-screen begin of block gen with frame.
    parameters:
    p_amount type i default 20.
    selection-screen end of block gen.
    selection-screen begin of block dsp with frame.
    parameters:
    p_full   radiobutton group dsp,
    p_grid   radiobutton group dsp.
    selection-screen end of block dsp.
    START-OF-SELECTION.
    END-OF-SELECTION.
       perform select_data.
       IF p_full = 'X'.
         perform display_fullscreen.
       ELSE.
         perform display_grid.
       ENDIF.
    STEP 1: load data *******************************************
    form select_data.
      select * from icon into corresponding fields of table gt_outtab
               up to p_amount rows.
    endform.
    STEP2: build full screen **************************************
    form display_fullscreen .
      data: ls_layout type slis_layout_alv,
            lt_fcat type slis_t_fieldcat_alv,
            ls_fcat type slis_fieldcat_alv.
          ls_layout-lights_tabname   = '1'.
          ls_layout-lights_fieldname = 'LIGHTS'.
          ls_layout-coltab_fieldname =  'TABCOL'.
          clear ls_fcat.
          ls_fcat-fieldname = 'LIGHTS'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Lights'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'COLOR'.
          ls_fcat-inttype = 'I'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Color'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'ID'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Icon'.
          ls_fcat-icon = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'SYMBOL'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Symbol'.
          ls_fcat-symbol = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'NAME'.
          ls_fcat-tech = abap_true.
          append ls_fcat to lt_fcat.
          perform select_data.
          perform set_tooltips.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         IS_LAYOUT                         = ls_layout
         IT_FIELDCAT                       = lt_fcat
         IT_EXCEPT_QINFO                   = gt_exc
        TABLES
          T_OUTTAB                          = gt_outtab
       EXCEPTIONS
         PROGRAM_ERROR                     = 1
         OTHERS                            = 2
       ASSERT sy-subrc = 0.
    endform.
    STEP3: display grid ******************************************
    form display_grid.
      call screen 100.
    endform.
    STEP4: PBO ***************************************************
    module d0100_pbo output.
      perform d0100_pbo.
    endmodule.
    STEP5: PAI ***************************************************
    module d0100_pai input.
      perform d0100_pai.
    endmodule.
    STEP6: PBO form ***********************************************
    form d0100_pbo .
      set pf-status 'D0100'.
      if gr_container is not bound.
        create object gr_container
          exporting
            container_name = 'CONTAINER'.
        create object gr_grid
            exporting i_parent = gr_container.
      data: ls_layout type lvc_s_layo,
            lt_fcat type lvc_t_fcat,
            ls_fcat type lvc_s_fcat.
          ls_layout-excp_fname = 'LIGHTS'.
          ls_layout-ctab_fname =  'TABCOL'.
          clear ls_fcat.
          ls_fcat-fieldname = 'LIGHTS'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Lights'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'COLOR'.
          ls_fcat-inttype = 'I'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Color'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'ID'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Icon'.
          ls_fcat-icon = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'SYMBOL'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Symbol'.
          ls_fcat-symbol = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'NAME'.
          ls_fcat-tech = abap_true.
          append ls_fcat to lt_fcat.
      perform select_data.
      perform set_tooltips.
      data: lt_tooltips type lvc_t_qinf,
            lt_toolb type ui_functions,
            ls_toolb type UI_FUNC.
      ls_toolb = CL_GUI_ALV_GRID=>mc_fc_call_crbatch.
      append ls_toolb to lt_toolb.
      lt_tooltips = gt_exc.
      call method gr_grid->set_table_for_first_display
            exporting is_layout   = ls_layout
                 it_except_qinfo  = lt_tooltips
                 it_toolbar_excluding = lt_toolb
            changing
                  it_fieldcatalog = lt_fcat
                  it_outtab       = gt_outtab.
      endif.
    endform.
    STEP7: PAI form ******************************************************
    form d0100_pai .
      case g_okcode.
        when 'BACK' or 'EXIT' or 'CANC'.
          set screen 0.
          leave screen.
      endcase.
    endform.
    STEP8: Set Tooltip *************************************************
    FORM set_tooltips .
      field-symbols: <outtab> type gs_outtab.
      data: tooltips type ref to cl_salv_tooltips,
            settings type ref to cl_salv_functional_settings,
            ls_styl type lvc_s_styl,
            value type char128,
            text type char40,
            ls_symbol type icon,
            lt_symbol type standard table of icon,
            ls_exc type ALV_S_QINF,
            tabix type sy-tabix,
            col type lvc_s_scol.
      loop at gt_outtab assigning <outtab>.
        tabix = sy-tabix.
        read table lt_symbol index sy-tabix into ls_symbol.
        <outtab>-symbol = ls_symbol-id.
        value = <outtab>-id(3).
        text = <outtab>-name.
        concatenate value '\Q' text '@' into value.
        <outtab>-id = value.
        value = ls_symbol-id.
        text  = ls_symbol-name.
        ls_exc-type = cl_salv_tooltip=>c_type_symbol.
        ls_exc-value = value.
        ls_exc-text = text.
        append ls_exc to gt_exc.
        <outtab>-color = tabix mod 7 + 1.
        <outtab>-lights = tabix mod 3 + 1.
        col-fname = 'COLOR'.
        col-color-col = tabix mod 7 + 1.
        if tabix ge 7.
          col-color-inv = 1.
        endif.
        if tabix ge 14.
          col-color-int = 1.
        endif.
        append col to <outtab>-tabcol.
      endloop.
    ENDFORM.

  • Trafic lights in ALV report

    Hi Masters,
    i have tried my best to Impliment the TRAFIC LIGHTS in my alv report but i could not succeed.
    can i have some input as to how we impliment the TRAFIC LIGHTS CODE in alv report.
    your valuble info is highly appriciated.
    thank you,
    pasala.

    the previous post is the sample code if you want to use ALV via cl_salv_table, but if you want to build ALV using function module REUSE_ALV_GRID_DISPLAY, please try following sample code. It works in my computer. Hope it helps.
    types: begin of gs_outtab.
       types:   lights               type char1,
                color                type i,
                tabcol               type lvc_t_scol,
                id                   type char25, " Already exist in ICON, Flat Structure
                name                 type icon-name,
                symbol               type icon-id,
           end   of gs_outtab.
    data: gt_outtab type standard table of gs_outtab.
    data: gr_grid   type ref to cl_gui_alv_grid.
    data: gr_container type ref to cl_gui_custom_container,
          gs_layout type lvc_s_layo,
          gt_fieldcat type lvc_t_fcat.
    data: ls_vari   type disvariant.
    data: g_okcode type syucomm.
    data: gt_exc type table of ALV_S_QINF.
    data: text type string.
    selection-screen begin of block gen with frame.
    parameters:
    p_amount type i default 20.
    selection-screen end of block gen.
    selection-screen begin of block dsp with frame.
    parameters:
    p_full   radiobutton group dsp,
    p_grid   radiobutton group dsp.
    selection-screen end of block dsp.
    START-OF-SELECTION.
    END-OF-SELECTION.
       perform select_data.
       IF p_full = 'X'.
         perform display_fullscreen.
       ELSE.
         perform display_grid.
       ENDIF.
    STEP 1: load data *******************************************
    form select_data.
      select * from icon into corresponding fields of table gt_outtab
               up to p_amount rows.
    endform.
    STEP2: build full screen **************************************
    form display_fullscreen .
      data: ls_layout type slis_layout_alv,
            lt_fcat type slis_t_fieldcat_alv,
            ls_fcat type slis_fieldcat_alv.
          ls_layout-lights_tabname   = '1'.
          ls_layout-lights_fieldname = 'LIGHTS'.
          ls_layout-coltab_fieldname =  'TABCOL'.
          clear ls_fcat.
          ls_fcat-fieldname = 'LIGHTS'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Lights'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'COLOR'.
          ls_fcat-inttype = 'I'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Color'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'ID'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Icon'.
          ls_fcat-icon = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'SYMBOL'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Symbol'.
          ls_fcat-symbol = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'NAME'.
          ls_fcat-tech = abap_true.
          append ls_fcat to lt_fcat.
          perform select_data.
          perform set_tooltips.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         IS_LAYOUT                         = ls_layout
         IT_FIELDCAT                       = lt_fcat
         IT_EXCEPT_QINFO                   = gt_exc
        TABLES
          T_OUTTAB                          = gt_outtab
       EXCEPTIONS
         PROGRAM_ERROR                     = 1
         OTHERS                            = 2
       ASSERT sy-subrc = 0.
    endform.
    STEP3: display grid ******************************************
    form display_grid.
      call screen 100.
    endform.
    STEP4: PBO ***************************************************
    module d0100_pbo output.
      perform d0100_pbo.
    endmodule.
    STEP5: PAI ***************************************************
    module d0100_pai input.
      perform d0100_pai.
    endmodule.
    STEP6: PBO form ***********************************************
    form d0100_pbo .
      set pf-status 'D0100'.
      if gr_container is not bound.
        create object gr_container
          exporting
            container_name = 'CONTAINER'.
        create object gr_grid
            exporting i_parent = gr_container.
      data: ls_layout type lvc_s_layo,
            lt_fcat type lvc_t_fcat,
            ls_fcat type lvc_s_fcat.
          ls_layout-excp_fname = 'LIGHTS'.
          ls_layout-ctab_fname =  'TABCOL'.
          clear ls_fcat.
          ls_fcat-fieldname = 'LIGHTS'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Lights'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'COLOR'.
          ls_fcat-inttype = 'I'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Color'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'ID'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Icon'.
          ls_fcat-icon = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'SYMBOL'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Symbol'.
          ls_fcat-symbol = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'NAME'.
          ls_fcat-tech = abap_true.
          append ls_fcat to lt_fcat.
      perform select_data.
      perform set_tooltips.
      data: lt_tooltips type lvc_t_qinf,
            lt_toolb type ui_functions,
            ls_toolb type UI_FUNC.
      ls_toolb = CL_GUI_ALV_GRID=>mc_fc_call_crbatch.
      append ls_toolb to lt_toolb.
      lt_tooltips = gt_exc.
      call method gr_grid->set_table_for_first_display
            exporting is_layout   = ls_layout
                 it_except_qinfo  = lt_tooltips
                 it_toolbar_excluding = lt_toolb
            changing
                  it_fieldcatalog = lt_fcat
                  it_outtab       = gt_outtab.
      endif.
    endform.
    STEP7: PAI form ******************************************************
    form d0100_pai .
      case g_okcode.
        when 'BACK' or 'EXIT' or 'CANC'.
          set screen 0.
          leave screen.
      endcase.
    endform.
    STEP8: Set Tooltip *************************************************
    FORM set_tooltips .
      field-symbols: <outtab> type gs_outtab.
      data: tooltips type ref to cl_salv_tooltips,
            settings type ref to cl_salv_functional_settings,
            ls_styl type lvc_s_styl,
            value type char128,
            text type char40,
            ls_symbol type icon,
            lt_symbol type standard table of icon,
            ls_exc type ALV_S_QINF,
            tabix type sy-tabix,
            col type lvc_s_scol.
      loop at gt_outtab assigning <outtab>.
        tabix = sy-tabix.
        read table lt_symbol index sy-tabix into ls_symbol.
        <outtab>-symbol = ls_symbol-id.
        value = <outtab>-id(3).
        text = <outtab>-name.
        concatenate value '\Q' text '@' into value.
        <outtab>-id = value.
        value = ls_symbol-id.
        text  = ls_symbol-name.
        ls_exc-type = cl_salv_tooltip=>c_type_symbol.
        ls_exc-value = value.
        ls_exc-text = text.
        append ls_exc to gt_exc.
        <outtab>-color = tabix mod 7 + 1.
        <outtab>-lights = tabix mod 3 + 1.
        col-fname = 'COLOR'.
        col-color-col = tabix mod 7 + 1.
        if tabix ge 7.
          col-color-inv = 1.
        endif.
        if tabix ge 14.
          col-color-int = 1.
        endif.
        append col to <outtab>-tabcol.
      endloop.
    ENDFORM.

  • Launching programs from python and ncurses

    I've made a little menu launcher with python and ncurses. It works most of the time, but occationally it does nothing when I select a program to launch.
    This is how it works:
    1. A keyboard shortcut launches an xterm window that runs the program.
    2. I select some program, which is launched via this command:
    os.system("nohup " + "program_name" + "> /dev/null &")
    3. ncurses cleans up and python calls "sys.exit()"
    The whole idea with nohup is that the xterm window will close after I select an application, but the application will still start normally (this was a bit of a problem). This works most of the time, but sometimes nothing happens (it never works the first time I try launching a program after starting the computer, the other times are more random).
    So, has anyone got an idea of what's going on or a better solution than the nohup hack?
    The whole code for the menu launcher is below. It's quite hackish, but then again it was just meant for me. The file's called "curmenu.py", and I launch it with an xbindkeys shortcut that runs "xterm -e curmenu.py".
    #!/usr/bin/env python
    import os,sys
    import curses
    ## Variables one might like to configure
    programs = ["Sonata", "sonata", "Ncmpc", "xterm -e ncmpc", "Emacs", "emacs", "Firefox", "swiftfox",\
    "Pidgin", "pidgin", "Screen", "xterm -e screen", "Thunar", "thunar", \
    "Gimp", "gimp", "Vlc", "vlc", "Skype", "skype"]
    highlight = 3
    on_screen = 7
    ## Functions
    # Gets a list of strings, figures out the middle one
    # and highlights it. Draws strings on screen.
    def drawStrings(strings):
    length = len(strings)
    middle = (length - 1)/2
    for num in range(length):
    addString(strings[num], middle, num, length)
    stdscr.refresh()
    def addString(string, middle, iter_step, iter_max):
    if iter_step < iter_max:
    string = string + "\n"
    if iter_step == middle:
    stdscr.addstr(iter_step + 1, 1, string, curses.A_REVERSE)
    else:
    stdscr.addstr(iter_step + 1, 1, string)
    # Returns a list of strings to draw on screen. The
    # strings chosen are centered around position.
    def listStrings(strings, position, on_screen):
    length = len(strings)
    low = (on_screen - 1)/2
    start = position - low
    str = []
    for num in range(start, start + on_screen):
    str = str + [strings[num % length]]
    return str
    ## Start doing stuff
    names = programs[::2]
    longest = max(map(lambda x: len(x), names))
    # Start our screen
    stdscr=curses.initscr()
    # Enable noecho and keyboard input
    curses.curs_set(0)
    curses.noecho()
    curses.cbreak()
    stdscr.keypad(1)
    # Display strings
    drawStrings(listStrings(names, highlight, on_screen))
    # Wait for response
    num_progs = len(names)
    low = (on_screen - 1)/2
    while 1:
    c = stdscr.getch()
    if c == ord("q") or c == 27: # 27 = "Escape"
    break
    elif c == curses.KEY_DOWN:
    highlight = (highlight + 1)%num_progs
    elif c == curses.KEY_UP:
    highlight = (highlight - 1)%num_progs
    elif c == curses.KEY_NPAGE:
    highlight = (highlight + low)%num_progs
    elif c == curses.KEY_PPAGE:
    highlight = (highlight - low)%num_progs
    elif c == 10: # actually "Enter", but hey
    os.system("nohup " + programs[2*highlight + 1] + "> /dev/null &")
    break
    drawStrings(listStrings(names, highlight, on_screen))
    # Close the program
    curses.nocbreak()
    stdscr.keypad(0)
    curses.echo()
    curses.endwin()
    sys.exit()

    Try:
    http://docs.python.org/lib/module-subprocess.html
    Should let you fork programs off into the background.

  • How do I stretch or flare a certain part of a picture like holding a fish to make it look like a comet? I done it once but do not know how I did it.

    I created a stretch of a fish I was holding, but do not remember how I did it. I did it just trying to learn photoshop elements 11. The head stayed normal, but from the gills back I stretched it all the way to side of pic. Any help would be appreciated.
    Thank you,
                    Marvin Engel

    No worries, Pat.
    A string of screen shots...
    Simply select the rectangle. Use the gradient tool to draw a gradient from one end to the other. Likely is white to black like below.
    Open the gradient panel. Right-click on one end stop. Add to swatches.
    I add gradients to the swatches to make it easy to update/change.
    Double-click on the new swatch. You'll get the following dialog box:
    Change to CMYK.
    Change one end stop.
    Change the other:
    I didn't rename it, but I do in practice.
    take care, Mike

Maybe you are looking for

  • Window 8.1

    I upgraded to window 8.1 and now flashplayer is not being very freindly. I keep getting a box that shows some names of programs that is not working or has a problem. It asks, continue or dismiss all. Is there a flashplayer program that will opperate

  • Problem while opening an application to connect to...

    Hello All, I have nokia 5800. I am able to connect to my office wi-fi with this. And after connecting when I do Start Browsing, I am also able to browse sites successfully. But when I go to home screen -> menu -> internet -> facebook, and try to open

  • CUIC reporting in UCCX 9

    Dear Experts, I have 2 issues with CUIC reporting. the first issue is related to filter in the report. for example, for agent detail summary, I want to apply 2 filter, the first one is the agent name, the 2nd one is the call type (incoming, outgoing,

  • Export report to XML not working w/embedded &'s in data

    I saw a post about this from April but no one responded. I'm getting an error trying to export a report to XML when the data contains ampersands. Is there a way around this problem? The XML page cannot be displayed Cannot view XML input using XSL sty

  • System exec function

    could someone give me a hint as to what the 'expected output size' input on System Exec refers to? I'm using it to run another program which will download some data for me to work on with labview. I dont expect it has anything to do with the file siz