Skip to Content
author's profile photo Former Member
Former Member

button in ALV grid display

Hi frenz,

I have a requirement in PS module.The problem is, i am fetching 'lessons learned from the project' from CJ20N tcode which i have to display in ALV.If it is one line or two line i can display in the ALV but if it is of 1 or 2 pages ? here i have to place an icon or button for that and upon clicking that it shud go to that long text(cj20n tcode).pls help me .

reward is guaranteed.

BR,

ANIl.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2006 at 06:09 AM

    frenz plssssssssss help

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2006 at 03:43 PM

    Hello Anil

    Here is an example of how to display the long text of a PSP project.

    *&---------------------------------------------------------------------*
    *& Report  ZUS_SDN_PS_LONGTEXT_DISPLAY
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    REPORT  zus_sdn_ps_longtext_display.
    
    
    DATA:
      go_docking     TYPE REF TO cl_gui_docking_container,
      go_textedit    TYPE REF TO cl_gui_textedit,
    *
      gd_name        TYPE thead-tdname,
      gs_header      TYPE thead,
      gd_langu       TYPE thead-tdspras,
      gt_lines       TYPE STANDARD TABLE OF tline.
    
    
    PARAMETERS:
      p_pspnr    TYPE prps-pspnr.
    
    
    
    
    START-OF-SELECTION.
    
    * Get the text object
      gs_header-tdid = 'LTXT'.  " long text
      gs_header-tdspras = syst-langu.
      CONCATENATE syst-langu p_pspnr
          INTO gs_header-tdname.
      gs_header-tdobject = 'PMS'.
    
    
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
    *     CLIENT                        = SY-MANDT
          id                            = gs_header-tdid
          language                      = gs_header-tdspras
          name                          = gs_header-tdname
          object                        = gs_header-tdobject
    *     ARCHIVE_HANDLE                = 0
    *     LOCAL_CAT                     = ' '
    *   IMPORTING
    *     HEADER                        =
        TABLES
          lines                         = gt_lines
        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.
    
    
      CALL SCREEN '0100'.
    
    
    END-OF-SELECTION.
    *&---------------------------------------------------------------------*
    *&      Module  STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE status_0100 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
    
      IF ( go_textedit IS NOT BOUND ).
        CREATE OBJECT go_docking
           EXPORTING
             parent                      = cl_gui_container=>screen0
    *        REPID                       =
    *        DYNNR                       =
    *        SIDE                        = DOCK_AT_LEFT
    *        EXTENSION                   = 50
    *        STYLE                       =
    *        LIFETIME                    = lifetime_default
    *        CAPTION                     =
    *        METRIC                      = 0
            RATIO                       = 90
    *        NO_AUTODEF_PROGID_DYNNR     =
    *        NAME                        =
          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 go_textedit
          EXPORTING
    *        MAX_NUMBER_CHARS       =
    *        STYLE                  = 0
            wordwrap_mode          =
                c_textedit_control=>wordwrap_at_windowborder
    *        WORDWRAP_POSITION      =
            wordwrap_to_linebreak_mode =
               c_textedit_control=>true
    *        FILEDROP_MODE          = DROPFILE_EVENT_OFF
            parent                 = go_docking
    *        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.
    
        CALL METHOD go_textedit->set_text_as_r3table
          EXPORTING
            table           = gt_lines
          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.
    
        CALL METHOD go_textedit->set_enable
          EXPORTING
            enable            = CL_GUI_cfw=>false
           EXCEPTIONS
             CNTL_ERROR        = 1
             CNTL_SYSTEM_ERROR = 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_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_0100  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE user_command_0100 INPUT.
    
      SET SCREEN 0. LEAVE SCREEN.
    
    ENDMODULE.                 " USER_COMMAND_0100  INPUT

    Dynpro '0100' has no elements with the following flow logic:

    PROCESS BEFORE OUTPUT.
     MODULE STATUS_0100.
    *
    PROCESS AFTER INPUT.
     MODULE USER_COMMAND_0100.

    You simply add the button on your ALV list. When the user pushes this button you have to handle event BUTTON_CLICK. There you could call a function module containing the sample code above (has to be adjusted a little bit) which displays the long text.

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 10:26 AM

    u have to handle the user_command event.

    example:

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    I_CALLBACK_PROGRAM = sy-repid

    I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS1'

    I_CALLBACK_USER_COMMAND = 'ACTION'

    IS_LAYOUT = LAYOUT

    IT_FIELDCAT = FIELDCAT[]

    IT_SORT = SORT[]

    IT_EVENTS = events[]

    TABLES

    T_OUTTAB = T_ITAB.

    &----


    *& Form set_pf_status1

    &----


    • text

    ----


    • -->RT_EXTAB text

    ----


    FORM set_pf_status1 USING rt_extab TYPE slis_t_extab.

    SET PF-STATUS 'STANDARD'.

    ENDFORM. "SET_PF_STATUS1

    &----


    *& Form ACTION

    &----


    • text

    ----


    • -->UCOMM text

    • -->SEL text

    ----


    FORM ACTION USING UCOMM TYPE SYUCOMM SEL TYPE SLIS_SELFIELD.

    CASE UCOMM.

    WHEN 'ATORDER'.

    perform atorder.

    REFRESH FIELDCAT1.

    ENDCASE.

    ENDFORM. "ACTION

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 04:31 AM

    hiii..

    I don't know much about PS..

    Can I know whether u need help in placing a button in the grid and performing an action based on its function code..

    Regards..

    Simy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 04:33 AM

    Hii..

    Do u want it to happen in a grid ctrl (OOPs).

    If so notify..

    I'll help to my maximum then..

    If it is using Function Module I think they have already answered ur query..

    regards..

    Message was edited by: Simy Abraham

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.