Display Standard Text in ALV

Dear Experts,
I have a requirement where the user wants me to display the standard text in SO10 using ALV.
The text must be displayed exactly like how the user maintaned in SO10.
What is the best way? The user do not want the solution to have a button in the text field, and pop up screen in alv to display the text.

The problem not related to the data retrieval.
Its about how to display the text in ALV. I dont wantto display the text in single line in alv coz it gonna be very long and will no longer in original format.
Edited by: Castelloz Alfonso on Sep 24, 2009 7:59 AM

Similar Messages

  • How to use Standard Text in ALV

    How to use Standard Text in ALV header part? Can you please help me by giving the answer?

    Hi ,
           You can read the Standard text using read_text function module and then print in LV header part.

  • Alv- displaying long text in alv output

    hi,
              as per my requirement, i need to be display long text (length >1000 characters) in alv list or alv grid.
    i get the entaire long text and keep it in final internal table and pass it to alv functional module,  but  it unable to display the compleate long text( in alv-grid).
    the alv list displays the complete long text but not in the row, it displays in the second rown and few field labes of long text and its previous field label are displayed in impro[per order.
    is there any possible way to display long text in alv.
    regards,
    revoori

    Hi Ashok,
    try to pass the below while filling your long text.
    wa_fieldcat-seltext_l  = 'Your Long Text'.
    wa_fieldcat-ddictxt = 'L'.
    for more info check below
    Long Text --- 1000 characters
    hope it works
    Thnaks!
    Edited by: Prasanth on Mar 8, 2009 4:03 PM

  • To display standard text in purchase requistion item text.

    Hi,
    My requirement is display standard text in purchase requisition item text(text type 02).  Please let me know where should i write the code and what it the code?
    Thanks
    Alka
    Moderator message: please work yourself first on your requirement, if necessary return with specific problems that have not been frequently solved before, remember these forums are not a replacement for ABAP training.
    Edited by: Thomas Zloch on Dec 1, 2010 11:52 AM

    Hi Kiran,
    As you stated its correct that the deletion indicator has to be set only after the document is closed. But your case is different, how did that deletion indicator got set for that "Purchase Requisitions".
    As per my knowledge is that the deletion flag ca be changed, but not the deletion indicator. In case if I get soem thing I will respond to you.
    Also I got this from SAP:
    Set the indicator if you wish to archive documents using the one-step procedure.
    Do not set the indicator if you wish to carry out your archiving using the two-step procedure.
    --Thanks
    Pankaj.K.S

  • ISR ADOBE - Unable to display standard text

    Hi,
      I have a scenario to display standard text in ISR(Internal Service Request) Adobe through webdynpro abap(Manual Correspondence PSCD - TRM application). When I tested the Adobe form in SFP txn directly, I could see the standard text, but when I test through webdynpro abap, it is not displaying standard text.
      Has anybody got some idea if this is the problem with ISR or something to be done?
    PS: I tried to display today's date through global variable defined in adobe interface, it gets displayed in SFP, but not in webdynpro(i.e.using ISR).
    Thanks.
    VR
    Edited by: AMARA555 on Apr 24, 2010 2:36 PM

    Hi Amara,
          Please recheck whether you have done the "Compare Form fields".
    Also, if you have made some changes to the form, then you should regenerate the form and again do "Compare Form fields".
    Dont do "Compare Form fields" while saving and activating the Form even when prompted as it may give inconsistencies.
    Also, as a cross-check try to create an independant Webdynpro application and call this Form(or only that particular standard text) in that application instead of calling in ISR. This way you can validate if the problem is with ISR.
    Hope this helps.

  • Display additional Text in ALV Grid

    Hello,
    I have an ALV Grid display and need to display additional information on the top of the list. I have used the grid-title, but the field is defined as 70 characters and thats not enough.
    Is it possible to display more text with alv grid?
    Regards Michael

    Hi Ravi,
    I´m creating my alv object orientated and I don´t know, how to manage that now. Can You explain me, where and how I have to do it?
    My Dynpro has one custom container and I´m calling the method SET_TABLE_FOR_FIRST_DISPLAY in PBO.
    And I need the comment to be printed with the ALV by pressing the print button in the toolbar of the ALV
    Thank You!
    Message was edited by: Michael Schmidt

  • Problem in display of text in ALV report

    Dear experts,
    I am working on a MM Report in which I need to display Material Basic data text maintained in MM01,02 Tcodes through ALV report.
    I have declared a string type variable for the Basic data text in the Final Internal Table.
    For reading the Standard text I am using Read_Text FM, from which I am looping the Text internal table and concatenating it into
    String variable.
    What I notice is all the content beyond 255 chars is not getting displayed, Even when the ALV report is downloaded to Excel file.
    Can you suggest some approach to over come this issue.
    Regards,
    Murthy

    Hi,
    Use the below code
    Data : lt_content  TYPE TABLE OF tline,
              lw_content   TYPE tline.
    Data : lt_text Type Table of solisti1,
              lw_text TYPE solisti1.
    CALL FUNCTION 'READ_TEXT'
        EXPORTING
          client                  = sy-mandt
          id                        = lv_id
          language            = tdspras
          name                  = lv_name
          object                 = lv_object
          archive_handle  = 0
          local_cat            = ' '
        TABLES
          lines                   = lt_content
        EXCEPTIONS
          id                      = 1
          language          = 2
          name                = 3
          not_found        = 4
          object               = 5
          reference_check = 6
          wrong_access_to_archive = 7
          OTHERS                  = 8.
    loop at lt_content into lw_content.
      lw_text-line = lw_content-tdline.
      APPEND lw_text TO lt_text.
      CLEAR: lw_content, lw_text.
    endloop.
    Now your whole text is in "lt_text".
    Regards,
    Avish Mittal

  • Problem displaying 'Total' text in ALV grid

    My ALV works and displays correct output. However, I am struggling to display the text 'Total' on position in the last row of the grid. The total is for the salary. My code is below..
    I have looked on numerous sites and forums for assistance.
    *& Report  ZALV
    REPORT  ZALV.
    TABLES: ZCONTACT.
    TYPE-POOLS: slis. "slis contains all of the ALV data types.
    DATA: "fieldcatALOG TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           it_zcontact TYPE TABLE OF zcontact,"declares an internal table of type ZCONTACT
           alv_prog_name LIKE sy-repid,
           g_variant TYPE disvariant,
           gx_variant TYPE disvariant,
           g_save TYPE c VALUE 'X',
           it_fieldcat TYPE slis_t_fieldcat_alv,"declares field catalog table of line type alv
           wa_fieldcat TYPE slis_fieldcat_alv, "declares the work area of the field catalog
           it_list_top_of_page TYPE slis_t_listheader,
           izontact TYPE TABLE OF zcontact,
           h1(10) TYPE c VALUE 'Toatall',
            "i_logo TYPE OT.
           gt_events     TYPE slis_t_event,
           gd_prntparams TYPE slis_print_alv,
           text(40) type c,
           wa_layout TYPE slis_layout_alv.
    **Selection Screen details
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    PARAMETERS: variant like disvariant-variant.
    SELECTION-SCREEN END OF BLOCK B1.
    **Getting default variant
    INITIALIZATION.
    gx_variant-report = sy-repid.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
       I_SAVE = G_SAVE
       CHANGING
         CS_VARIANT = GX_VARIANT
       EXCEPTIONS
         NOT_FOUND = 2.
    IF SY-SUBRC = 0.
       VARIANT = GX_VARIANT-VARIANT.
       ENDIF.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM DISPLAY_ALV_REPORT.
      "PERFORM build_alv_header
    FORM BUILD_FIELDCATALOG.
    *Build field catalog
    wa_fieldcat-fieldname = 'ID'.
    wa_fieldcat-seltext_m = 'ID'.
    wa_fieldcat-col_pos   = 0.
    wa_fieldcat-outputlen = 10.
    wa_fieldcat-emphasize  = 'X'.
    wa_fieldcat-key       = 'X'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'LASTNAME'.
    wa_fieldcat-seltext_m = 'LASTNAME'.
    wa_fieldcat-col_pos   = 1.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FIRSTNAME'.
    wa_fieldcat-seltext_m = 'FIRSTNAME'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'DOB'.
    wa_fieldcat-seltext_m = 'DOB'.
    wa_fieldcat-col_pos = 3.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'TEL'.
    wa_fieldcat-seltext_m = 'Tel'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'ADDRESS'.
    wa_fieldcat-seltext_m = 'ADDRESS'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'OCCUPATION'.
    wa_fieldcat-seltext_m = 'OCCUPATION'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'WEIGHT'.
    wa_fieldcat-seltext_m = 'WEIGHT'.
    wa_fieldcat-do_sum    = 'X'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'AGE'.
    wa_fieldcat-seltext_m = 'AGE'.
    wa_fieldcat-do_sum   = 'X'.        "Display column total
    APPEND wa_fieldcat TO it_fieldcat.
    "CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'SALARY'.
    wa_fieldcat-seltext_m = 'SALARY'.
    wa_fieldcat-do_sum    = 'X'.
    wa_fieldcat-cfieldname = 'CURRENCYKEY'.
    APPEND wa_fieldcat TO it_fieldcat.
    wa_fieldcat-fieldname = 'CURRENCY'.
    wa_fieldcat-seltext_s = 'CURRENCY'.
    APPEND wa_fieldcat TO it_fieldcat.
    "CLEAR wa_fieldcat.
    ENDFORM. "BUILDING THE FIELD CATALOG
    **FORM layout.
    *wa_layout-colwidth_optimize = 'X'.
    *wa_layout-totals_text ='TOTAL'.
    *wa_layout-zebra = 'X'.
    *ENDFORM.
    "ls_layout-cell_merge = 'X'.
    FORM DISPLAY_ALV_REPORT.
    alv_prog_name = sy-repid.
    *Pass data and field catalog to ALV function module to display ALV list
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           it_fieldcat            = it_fieldcat[]
           i_callback_program     = alv_prog_name
           is_layout              = wa_layout
           i_callback_top_of_page =  'TOP_OF_PAGE'
           i_callback_user_command =  'USER_COMMAND'
           i_structure_name       =  'ZCONTACT'
           i_save                 = 'X'
           it_events               = gt_events
           is_print                = gd_prntparams
           is_variant             = g_variant
           "is_layout     = ls_layout
    TABLES
           t_outtab      = it_zcontact
    EXCEPTIONS
           program_error = 1
           OTHERS        = 2.
    WRITE: H1 UNDER 'SALARY'.
    ENDFORM.
    **Fetch data from the database
    FORM DATA_RETRIEVAL.
    SELECT * FROM zcontact INTO TABLE it_zcontact.
    ENDFORM.
    FORM top_of_page.
    *ALV Header declarations
       DATA: it_listheader TYPE slis_t_listheader,
             wa_listheader TYPE slis_listheader,
             t_line like wa_listheader-info,
             ld_lines TYPE I,
             ld_linesc(10) TYPE C.
    wa_listheader-typ = 'H'.
    wa_listheader-info = 'Contact Details'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-info = sy-repid.
    wa_listheader-key = 'Program Name:'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-info = sy-uname.
    wa_listheader-key = 'User Name:'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-key = 'Run Date :'.
    CONCATENATE sy-datum+6(2)
                 sy-datum+4(2)
                 sy-datum(4)
                 INTO wa_listheader-info
                 SEPARATED BY '/'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-key = 'Time :'.
    CONCATENATE sy-uzeit(2)
                 sy-uzeit+2(2)
                 sy-uzeit+4(2)
                 INTO wa_listheader-info
                 SEPARATED BY ':'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
       CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
           it_list_commentary = it_listheader[]
           i_logo = 'KLOGO'.
    ENDFORM.                    "top_of_page

    I did this but still i cant display the total text..I have reposted my code. please assist. Im only missing that total label
    *& Report  ZALV
    REPORT  ZALV.
    TABLES: ZCONTACT.
    TYPE-POOLS: slis. "slis contains all of the ALV data types.
    TYPES: BEGIN OF t_zcontact,
         text(40) TYPE c, "storing the total text
       mandt TYPE mandt,
       id TYPE zcontactid,
       lastname type zcontactlname,
       firstname TYPE zcontactfname,
       dob TYPE zdateofbirth,
       tel TYPE ztel,
       address TYPE zaddress,
       occupation TYPE zoccup,
       weight type zweight,
       age TYPE zage,
       salary TYPE zsalary,
       ecurrency TYPE curcy,
       END OF t_zcontact.
    TYPES: BEGIN OF wa_zcontact,
       mandt TYPE mandt,
       id TYPE zcontactid,
       lastname type zcontactlname,
       firstname TYPE zcontactfname,
       dob TYPE zdateofbirth,
       tel TYPE ztel,
       address TYPE zaddress,
       occupation TYPE zoccup,
       weight type zweight,
       age TYPE zage,
       salary TYPE zsalary,
       ecurrency TYPE curcy,
       END OF wa_zcontact.
    TYPES:
    i_zcontact TYPE STANDARD TABLE OF t_zcontact." INITIAL SIZE 0.
       DATA: itt_zcontact TYPE STANDARD TABLE OF wa_zcontact INITIAL SIZE 0,
             wat_zcontact TYPE wa_zcontact.
    DATA: "it_zcontact TYPE TABLE OF zcontact,"declares an internal table of type ZCONTACT
           gd_repid LIKE sy-repid,
           g_variant TYPE disvariant,
           gx_variant TYPE disvariant,
           g_save TYPE c VALUE 'X',
           fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,"declares field catalog table of line type alv
            gd_tab_group type slis_t_sp_group_alv,
            gd_prntparams TYPE slis_print_alv,
           fieldcat TYPE slis_fieldcat_alv, "declares the work area of the field catalog
           it_list_top_of_page TYPE slis_t_listheader,
           i_zcontact TYPE TABLE OF zcontact,
           "h1(10) TYPE c VALUE 'Toatall',
            "i_logo TYPE OT.
           gt_events TYPE slis_t_event,
           gd_layout TYPE slis_layout_alv."work area for the alv layout
    data: it_sortcat type slis_sortinfo_alv occurs 1,
             wa_sort LIKE LINE OF it_sortcat.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM DISPLAY_ALV_REPORT.
      PERFORM BUILD_LAYOUT.
      perform build_sortcat.
      PERFORM sub_add_text.
      "PERFORM build_events.
      PERFORM top-of-page.
      "PERFORM build_alv_header.
      END-OF-SELECTION.
    *DATA: gd_layout TYPE slis_layout_alv.
    *      gd_layout-totals_text = 'TOTAL'.
    **Selection Screen details
    *SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    *PARAMETERS: variant like disvariant-variant.
    *SELECTION-SCREEN END OF BLOCK B1.
    ***Getting default variant
    *INITIALIZATION.
    *gx_variant-report = sy-repid.
    *CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    *EXPORTING
    *  I_SAVE = G_SAVE
    *  CHANGING
    *    CS_VARIANT = GX_VARIANT
    *  EXCEPTIONS
    *    NOT_FOUND = 2.
    *IF SY-SUBRC = 0.
    *  VARIANT = GX_VARIANT-VARIANT.
    *  ENDIF.
    FORM BUILD_FIELDCATALOG.
    *Build field catalog
    fieldcatalog-fieldname = 'ID'.
    fieldcatalog-seltext_m = 'ID'.
    fieldcatalog-col_pos   = 2.
    fieldcatalog-outputlen = 10.
    fieldcatalog-datatype = 'CHAR'.
      "fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
    fieldcatalog-emphasize  = 'X'.
    fieldcatalog-key       = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'LASTNAME'.
    fieldcatalog-seltext_m = 'LASTNAME'.
    fieldcatalog-col_pos   = 3.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'FIRSTNAME'.
    fieldcatalog-seltext_m = 'FIRSTNAME'.
      fieldcatalog-col_pos = 4.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'DOB'.
    fieldcatalog-seltext_m = 'DOB'.
    fieldcatalog-col_pos = 5.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'TEL'.
    fieldcatalog-seltext_m = 'Tel'.
      fieldcatalog-col_pos = 6.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'ADDRESS'.
    fieldcatalog-seltext_m = 'ADDRESS'.
      fieldcatalog-col_pos = 7.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'OCCUPATION'.
    fieldcatalog-seltext_m = 'OCCUPATION'.
      fieldcatalog-col_pos = 8.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'WEIGHT'.
    fieldcatalog-seltext_m = 'WEIGHT'.
    "fieldcatalog-do_sum    = 'X'.
      fieldcatalog-col_pos = 9.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'AGE'.
    fieldcatalog-seltext_m = 'AGE'.
    "fieldcatalog-do_sum   = 'X'.        "Display column total
      fieldcatalog-col_pos = 10.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'SALARY'.
    fieldcatalog-seltext_m = 'SALARY'.
    fieldcatalog-do_sum    = 'X'.
    fieldcatalog-outputlen = 15.
    fieldcatalog-datatype ='CURR'.
      fieldcatalog-col_pos = 11.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    "fieldcatalog-fieldname = 'ECURRENCY'.
    "fieldcatalog-seltext_s = 'ECURRENCY'.
    "APPEND fieldcatalog TO fieldcatalog.
    "CLEAR fieldcatalog.
       fieldcatalog-fieldname   = 'TEXT'.
       fieldcatalog-col_pos = 0.
       "fieldcatalog-seltext_m   = 'TEXT'.
       fieldcatalog-tech        = 'X'.
       fieldcatalog-no_out      = 'X'.
       append fieldcatalog to fieldcatalog.
       clear  fieldcatalog.
    ENDFORM.
    *&      Form  build_sortcat
    *       Build Sort catalog
    FORM build_sortcat .
       "wa_sort-spos      = 1.
       wa_sort-fieldname = 'TEXT'.
       "wa_sort-SUBTOT    = 'X'. "subtotals any totals column by this field
       wa_sort-up        = 'X'.
       APPEND wa_sort TO it_sortcat.
       CLEAR wa_sort.
    ENDFORM.                    " build_sortcat
    FORM BUILD_LAYOUT.
    *gd_layout-no_input = 'X'.
    *gd_layout-colwidth_optimize = 'X'.
    *gd_layout-totals_text  =  'Totals'(201).
    *"gd_LAYOUT-coltab_fieldname = 'SALARY'.
    gd_layout-no_totalline = 'X'.
    ENDFORM.
    *IF sy-subrc = 0.
    *      LOOP AT fieldcatalog INTO fieldcat.
    *        IF fieldcat-fieldname = 'WEIGHT' OR
    *          fieldcat-fieldname = 'AGE'.
    **         Summation for WEIGHT & AGE
    *          fieldcat-do_sum = 'X'.
    *          MODIFY fieldcatalog FROM fieldcat TRANSPORTING do_sum.
    *        ENDIF.
    *        IF fieldcat-fieldname = 'TEXT'.
    **         Hide this field so that it can display it's content i.e.
    **         Total text in Subtotal level
    *          fieldcat-tech = 'X'.
    *          fieldcat-no_out = 'X'.
    *          MODIFY fieldcatalog FROM fieldcat TRANSPORTING tech no_out.
    *        ENDIF.
    *        CLEAR fieldcat.
    *      ENDLOOP.
    *    ENDIF.
    *ENDFORM. "BUILDING THE FIELD CATALOG
    *form build_events.
    *  data: ls_event type slis_alv_event.
    *  call function 'REUSE_ALV_EVENTS_GET'
    *       exporting
    *            i_list_type = 0
    *       importing
    *            et_events   = gt_events[].
    *  read table gt_events with key name =  slis_ev_top_of_page
    *                           into ls_event.
    *  if sy-subrc = 0.
    *    move 'TOP-OF-PAGE' to ls_event-form.
    *    append ls_event to gt_events.
    *  endif.
    *    read table gt_events with key name =  slis_ev_end_of_list
    *                           into ls_event.
    *  if sy-subrc = 0.
    *    move 'END_OF_LIST' to ls_event-form.
    *    append ls_event to gt_events.
    *  endif.
    *endform.                    " BUILD_EVENTS
    "ls_layout-cell_merge = 'X'.
    FORM DISPLAY_ALV_REPORT.
    gd_repid = sy-repid.
    *Pass data and field catalog to ALV function module to display ALV list
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           it_fieldcat         = fieldcatalog[]
           it_sort  =  it_sortcat
           i_callback_program     = gd_repid
           is_layout              = gd_layout
           i_callback_top_of_page =  'TOP-OF-PAGE'
           i_callback_user_command =  'USER_COMMAND'
           i_structure_name       =  'ZCONTACT'
           i_save                 = 'X'
           it_events               = gt_events
           is_print                = gd_prntparams
           is_variant             = g_variant
           "is_layout     = ls_layout
    TABLES
           t_outtab      = itt_zcontact
    EXCEPTIONS
           program_error = 1
           OTHERS        = 2.
    "WRITE: 'TOTAL' UNDER 'ID'.
    ENDFORM.
    **Fetch data from the database
    FORM DATA_RETRIEVAL.
    "DATA: ld_subtot(1) type c.
    SELECT * FROM zcontact INTO TABLE itt_zcontact UP TO 10 ROWS.
    ENDFORM.
    FORM sub_add_text.
    *Populate field with text value
       DATA:
       wt_zcontact TYPE t_zcontact,
       last TYPE zcontact-ID,
       l_text(40) type c,
       num type n.
    loop at itt_zcontact into wat_zcontact.
    * Populate final table
       wt_zcontact-TEXT = 'Total salary:  '.
       "ld_subtot = ld_subtot + 1.
       "wat_zcontact-text = ld_subtot.
         modify itt_zcontact FROM wat_zcontact.
         clear wat_zcontact.
       "APPEND wat_zcontact TO itt_zcontact.
    endloop.
    ENDFORM.
    FORM top-of-page.
    *ALV Header declarations
       DATA: it_listheader TYPE slis_t_listheader,
             wa_listheader TYPE slis_listheader,
             t_line like wa_listheader-info,
             ld_lines TYPE I,
             ld_linesc(10) TYPE C.
    wa_listheader-typ = 'H'.
    wa_listheader-info = 'Contact Details'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-info = sy-repid.
    wa_listheader-key = 'Program Name:'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-info = sy-uname.
    wa_listheader-key = 'User Name:'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-key = 'Run Date :'.
    CONCATENATE sy-datum+6(2)
                 sy-datum+4(2)
                 sy-datum(4)
                 INTO wa_listheader-info
                 SEPARATED BY '/'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-key = 'Time :'.
    CONCATENATE sy-uzeit(2)
                 sy-uzeit+2(2)
                 sy-uzeit+4(2)
                 INTO wa_listheader-info
                 SEPARATED BY ':'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
       CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
           it_list_commentary = it_listheader[]
           i_logo = 'KLOGO'.
    ENDFORM.                    "top_of_page

  • How to display Long text in alv output

    Hi,
    I have developed an ALV report.It is displaying the output.
    There is another requirment for alv output text field as below
    From the long text fields show only the first 20 characters and afterwards the long text icon. If the icon is clicked open the long text display screen.
    Please give your suggestion how to work on this requirement.
    Thanks in advance

    Hi,
    Create a hotspot for the long text column of ALV.
    When user clicks on the hotspot, handle the event to display long text screen.
    You may refer sample program of hotspot ALV :
    Goto SE38
    Type BCALV*
    Click F4
    search for HOTSPOT or EVENTS & you will get a sample program.
    Best regards,
    Prashant

  • How to display long text in alv

    Hi ,
    I need to display the long text of particular object on ALV, with 30 char each line .
    I have long text in one internal table, master table have one to maany relation with longtext table and long text contains 120 character in each line.
    i need to display long text using 30 char in each line on alv. could you please suggest the soution ????
    format is like
    ponumber date         longtext 
        1234    03/04/05   this is PO is created
                                  for materail which have
                                  shortage in plant.

    hope u r expecting this..
    optimize = 'X'
    if u use OUTPUTLEN it is fixed size for that specific field, and also it reflects for next fields, to avoid that again have to mention OUTPUTLEN = 'X' for next field.
    With OPTIMIZE = 'X'  it will adjust based on the size.
    regards...
    santhosh reddy
    Message was edited by:
            Santhosh Reddy

  • How to Display  Formatted Text  IN ALV Column?

    HI experts ,
    I am displaying  ALV with Multiple Column's , One of the Column is TEXT(Fomatted text).
    When ALV is Displayed  TEXT Column Comes as Continues TEXT . and is Not Formatted .
    Now when i want to edit this text i am Calling another View  which contains text edit . This Text edit will display correct Formatted Text . but when i save it and Come back to ALV again i do see continues text .
    Is there  any way where in i can display  the Formatted text in ALV Column ?
    Any body have any clue with this ...
    Thanks in Advance
    Patil
    Edited by: Badarinarayan Patil on Feb 22, 2008 3:45 PM

    Hi Juergen,
    I found Your blog and found it  really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
    I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
    Some suggestion will be greatly appreciated.
    Thankyou
    Simone

  • Displaying subtotal text in alv using the fm reuse_alv_grid_display

    Hi,
    Can someone help me with this, I am having some problem in displaying the subtotal text in subtotal field in alv. I tried populating the layout of the alv with the text that will be displayed on the output but nothing happens. Is is possible to display the subtotal text in alv using the fm reuse_alv_grid_display? If so, what are the things that I must consider to display the subtotal text in alv output.
    Please help me with this. I promise to give you points if you resolve this problem.
    Thanks,
    Gie

    Hi ,
         Make it use in your code and let me know if u have any concerns...
        Use "Subtotal_text" in events table.
    here GTOTAL is field in itab on which we sortindf data, and use your own field on which field u want to sort...
    refresh gt_event.
    clear gw_event.
    call function 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         i_list_type = 0
       IMPORTING
         et_events   = gt_event.
    Subtotal
    read table gt_event with key name = slis_ev_subtotal_text into gw_event.
    if sy-subrc = 0.
       move 'SUBTOTAL_TEXT' to gw_event-form.
       append gw_event to gt_event.
    endif.
         form subtotal_text using uw_subtot_line type ty_main
                    uv_subtottxt type slis_subtot_text.  "#EC CALLED
    if uv_subtottxt-criteria = 'GTOTAL'.
       uv_subtottxt-display_text_for_subtotal = 'TOTAL'.
    endif.
         *FORM build_sort .
    refresh gt_sort.
    gw_sort-spos      = 1.
    gw_sort-fieldname = 'GTOTAL'.
    gw_sort-tabname   = 'GT_MAIN'.
    gw_sort-up        = 'X'.
    gw_sort-subtot    = 'X'.
    APPEND gw_sort TO gt_sort.
    CLEAR gw_sort.
    Reward points once its useful..

  • Display Subtotal Text  in ALV

    Hi,
    I have done the subtotal and total operation in ALV report.
    I wanted to display the text like
    Subtotal: _______
    Total     : _______
    I tried to give the text in th layout like..
    GD_LAYOUT-TOTALS_TEXT = 'Total'.
    GD_LAYOUT-subtotals_text = 'SubTotal'.
    i passed this layout in REUSE_ALV_GRID_DISPLAY
    but i am not getting the text in the output. what is wrong?
    Can any one please tell me to place the text?
    Regards,
    Elanthendral.

    Hi,
    Check out the layout work area declaration and passing part. What u have mentioned should work. Try to debug and find it.
    Find below the sample code.
    DATA: wa_layout       TYPE slis_layout_alv, "Layout structure
    END-OF-SELECTION.
       PERFORM build_layout.
    FORM build_layout .
    wa_layout-ZEBRA = 'X'.
    wa_layout-NO_VLINE = 'X'.
    wa_layout-NO_HLINE = 'X'.
    wa_layout-CELL_MERGE = 'X'.
    wa_layout-EDIT = 'X'.
    wa_layout-WINDOW_TITLEBAR = ''.
    wa_layout-NO_ULINE_HS = 'X'.
    wa_layout-LIGHTS_FIELDNAME = ''.
    wa_layout-LIGHTS_TABNAME = ''.
    wa_layout-LIGHTS_ROLLNAME = ''.
    wa_layout-LIGHTS_CONDENSE = 'X'.
    wa_layout-NO_TOTALLINE = 'X'.
    wa_layout-NO_SUBTOTALS = 'X'.
    wa_layout-TOTALS_BEFORE_ITEMS = 'X'.
    wa_layout-TOTALS_ONLY = 'X'.
    wa_layout-TOTALS_TEXT = ''.
    wa_layout-SUBTOTALS_TEXT = ''.
    wa_layout-BOX_FIELDNAME = ''.
    wa_layout-BOX_TABNAME = ''.
    wa_layout-BOX_ROLLNAME = ''.
    wa_layout-CONFIRMATION_PROMPT = 'X'.
    wa_layout-HEADER_TEXT = ''.
    ENDFORM.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'           EXPORTING
            i_callback_program      = gf_repid
            is_layout               = gwa_layout
            it_fieldcat             = gt_catalog
          TABLES
            t_outtab                = gt_line
          EXCEPTIONS
            program_error           = 1
            OTHERS                  = 2.
    Regards,
    ramya

  • Displaying Header Text in ALV report.

    HI Gurus,
    I have one sales order which has header Text.
    I am displaying that Header Text in my ALV report.
    But while displaying in the ALV grid, the text is not coming full.
    I have taken the datatype of the column of the ALV grid is string, Still the Header text is not come full.
    Please help me.
    Thanks in advance.

    Hi,
        If the header text is morethan 60 characters, you can't print with REUSE_ALV_COMMENTARY_WRITE. To overcome above limit we can use dynamic document, which can be implemented through the class CL_DD_DOCUMENT. As dynamic documents use HTML viewer control so instead of triggering the TOP_OF_PAGE event we should trigger event of HTML TOP_OF_PAGE.
    First create a subroutine for top of page in HTML format and send that name in I_CALLBACK_HTML_TOP_OF_PAGE parameter of ALV function module. The input parameter for this subroutine will be a variable of class CL_DD_DOCUMENT.
    *       FORM html_top_of_page                                     *
    FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
      data: l_text(255) type c.
    l_text = '*******************************Hellooooooooooooooooooo************************'.
      CALL METHOD top->add_text EXPORTING text = 'Hello world '
                                          sap_style = 'heading' .
      CALL METHOD top->add_gap EXPORTING width = 200.
      CALL METHOD top->add_picture EXPORTING picture_id = 'ENJOYSAP_LOGO'.
      CALL METHOD top->NEW_LINE( ).
      CALL METHOD top->add_text EXPORTING
      text = l_text.
    ENDFORM.
    * Display ALV grid
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'     " Use this event
              i_callback_program          = g_repid
              i_structure_name            = 'STRUCTURE'
         TABLES
              t_outtab                    = gt_outtab.
    Regards
    Bala Krishna

  • How to display subtotal text in alv report for particular group of values

    Hi,
    if material number falls 1 to 10 then i considered be calculate and display subtotal qty amount with subtotal text " Total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with subtotal text "total of the mat2". if material number falls 21 to 30 then i don't want to display any subtotal and At last grand total also is not required.
    Please help me asap

    just check the thread...
    Can we modify a sub-total in ALV

Maybe you are looking for

  • List of the different Oracle SOA exceptions by component

    Hello all, I was wondering if anyone can point me to where I can find the API or list of exceptions for the core Oracle SOA components ( BPEL, ESB, Business Rules, Web Services Manager and BAM). Thank you.

  • How to install software on MDS 9509 Switch

    Hi, One of our MDS 9509 switches has died. This used to be supported externally but has now been brought in house. A replacement box is due to arrive soon but I will nee to update the software to the same version that the old box was using and apply

  • Passing xml to rpc webservice

    We need to pass a fairly large xml file to our webservice. In the wsdl file we use anyType and the webservice method the parameter type is XmlObject. This seems to work except for the additional namespaces added as attributes to the first element. Th

  • Accessing file structure on hard disc

    hello all, this is regarding a e-learning project in flash we have several course modules stored in individual folders on the hard disc. each course module had it's individual xml file which describes the module title,description, etc at the root lev

  • Tcode for Exchangerate01  idoc

    HI Guis, What is the tcode to generate standard idoc for  Exchange_rate. Regds, Santhosh