Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV GRID REPORT ISSUE

Former Member
0 Likes
1,611

Dear Experts,

When I am trying show a header line for a grid alv report some text are missing in the output.

because i declaed my it_heading type slis_t_listheader,

                                 wa_hading like line of it_heading.   OR  WA_HEADING TYPE SLIS_LISTHEADING.

THEN i PASS WA_HEADING-INFO = 'MY LONG TEXT LINE'.

AS INFO HAS 60 IN SIZE ITS NOT SHOWING THE REST TEXTS IN OUTPUT. BUT AS IT IS A STANDARD I CAN NOT CHANGE THE INFO VALUE.sO IS THERE ANY OTHER WAYS TO CHANGE THE SIZE TO GET MY EXACT TEXT LINE ON OUT PUT HEADER ??

kIND rEGARDS,

AJIT

Dear Experts,

When I am trying show a header line for a grid alv report some text are missing in the output.

because i declaed my it_heading type slis_t_listheader,

                                 wa_hading like line of it_heading.   OR  WA_HEADING TYPE SLIS_LISTHEADING.

THEN i PASS WA_HEADING-INFO = 'MY LONG TEXT LINE'.

AS INFO HAS 60 IN SIZE ITS NOT SHOWING THE REST TEXTS IN OUTPUT. BUT AS IT IS A STANDARD I CAN NOT CHANGE THE INFO VALUE.sO IS THERE ANY OTHER WAYS TO CHANGE THE SIZE TO GET MY EXACT TEXT LINE ON OUT PUT HEADER ??

kIND rEGARDS,

AJIT

13 REPLIES 13
Read only

former_member187748
Active Contributor
0 Likes
1,578

Hi Ajit,

you can use the tline concept

DATA:BEGIN OF DT_LINES OCCURS 0,

        TDFORMAT LIKE TLINE-TDFORMAT,                 

        TDLINE LIKE TLINE-TDLINE,                     

        END OF DT_LINES.


and you can do one thing, either create an internal table with a field with sufficient length

and populate your text there, by simple looping and appending your internal table data.

Read only

sivaprasad_paruchuri
Active Participant
0 Likes
1,578

hi,

u can use reuse_alv_commentary_write function module for displaying header details ...use this link as referance

http://scn.sap.com/thread/1304365

regards,

SIva

Read only

former_member187748
Active Contributor
0 Likes
1,578

Do as sujjested,

create a variable of type string

DATA : ltext TYPE string.

then you can loop into the internal table text field and concatenate it to ltext

and show your output as ltext.

Or why not you use the READ_TEXT function module to read the long text.

From where you wants to read your long text , please explain.

Read only

Former Member
0 Likes
1,578

Hi Ajit,

please use this code...

***********ALV DECLERATIONS**********

DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,

           gw_fieldcat TYPE slis_fieldcat_alv,

           gt_header TYPE slis_t_listheader,

          gw_header TYPE slis_listheader,

          gt_event TYPE slis_t_event,

          gw_event LIKE LINE OF gt_event,

         gw_layout TYPE slis_layout_alv.

Write ur logic ....

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

     EXPORTING

       i_callback_program          = sy-repid

       i_callback_html_top_of_page = 'F_TOP_OF_PAGE'   " Note Important

       it_fieldcat                 = gt_fieldcat

     TABLES

       t_outtab                    = gt_final

     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.



FORM f_top_of_page USING r_top TYPE REF TO cl_dd_document. " Use this subroutine

   DATA: s_tab TYPE sdydo_text_table,

         c_area TYPE REF TO cl_dd_area,

         text TYPE sdydo_text_element,

         date1 TYPE sy-datum.

   TYPES: BEGIN OF tab_text,

          text TYPE sdydo_text_element,

          END OF tab_text.

   DATA: i_text TYPE TABLE OF tab_text,

         w_text TYPE tab_text.

   DATA: lv_month(2) TYPE c,

         lv_year(4) TYPE c,

         lv_month_name TYPE t247-ktx.

   CALL FUNCTION 'CACS_DATE_GET_YEAR_MONTH'

     EXPORTING

       i_date  = pnpdisbd

     IMPORTING

       e_month = lv_month

       e_year  = lv_year.

   SELECT SINGLE ktx FROM t247

                     INTO lv_month_name

                     WHERE mnr EQ lv_month

                     AND  spras = sy-langu.

   CALL METHOD r_top->initialize_document.

   CALL METHOD r_top->vertical_split

     EXPORTING

       split_area  = r_top

       split_width = '80%'

     IMPORTING

       right_area  = c_area.

   CALL METHOD c_area->add_text

     EXPORTING

       text_table   = s_tab

       fix_lines    = 'X'

       sap_fontsize = cl_dd_document=>medium

       sap_emphasis = cl_dd_document=>strong.

   CALL METHOD r_top->add_gap

     EXPORTING

       width = 80.

   text = 'Heading Heading  Heading  Heading  Heading  Heading  '.

   CALL METHOD r_top->add_text

     EXPORTING

       text         = text

       sap_style    = 'HEADING'

       sap_emphasis = 'STRONG'.

   CALL METHOD r_top->new_line.

   CALL METHOD r_top->new_line.

   CALL METHOD r_top->add_gap

     EXPORTING

       width = 90.

   CONCATENATE 'Report for Month of '

                lv_month_name '-'

                lv_year

                INTO text SEPARATED BY space.

   CALL METHOD r_top->add_text

     EXPORTING

       text         = text

       sap_fontsize = 'MEDIUM'

       sap_emphasis = 'STRONG'.

ENDFORM. 



Hope it is useful


Thanks,

Vijay SR

Read only

Former Member
0 Likes
1,578

Hi Ajit,      

you may use below code:

**** ALV grid call  Which you have already implement

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

      i_callback_program     = g_repid  " report id

      i_callback_top_of_page = c_top_of_page  " sub rouintine for header.

      *is_layout              = lwa_layout

      it_fieldcat            = g_fieldcat[]   "  your fieldcate log table

    TABLES

      t_outtab               = g_final   " your final output table

    EXCEPTIONS

      program_error          = 1

      OTHERS                 = 2.

  IF sy-subrc <> 0.

* Implement suitable error handling here

  ENDIF.

**   form c_top_of_page

Form c_top_of_page .

  gwa_header-typ  = 'H'.   

  gwa_header-key  = text-001.  " Text-001 "  'MY LONG TEXT LINE'

  APPEND gwa_header TO gt_header.
  CLEAR: gwa_header.
* to display header
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = g_header.

endform.

Asad.

Read only

0 Likes
1,578

Dear Arsad,

If I ll use the wa-key, its not showing anything evenif my text-001 having of length 150. I checked the the length of key is 20 only.

But if i checked with wa-info then the line is showing but upto 60 char only because info having only 60 in length.

please you cna check also.

Regards,

Ajit

Read only

0 Likes
1,578

This message was moderated.

Read only

0 Likes
1,578

What is the lenght of your TEXT?

Read only

0 Likes
1,578

Dear Arsad,

I did as per your suggestion, but I am facing the same problem because lenghth of key is 20 and info is 60 but my text length is 138.

Please do replay if u got my problem or else I ll explain you again.

Kind Regards,

Ajit

Read only

0 Likes
1,578

Hi Ajit,

as of now, do not have any other alernative for your issue.

by the way request you to atleast write my name correclty.

that is ASAD and not Arsad.

thanks.

Asad.

Read only

narendar_naidu
Active Participant
0 Likes
1,578

Hi,

You can set the output length when creating the field catalog, try that way.

regards,

Read only

Former Member
0 Likes
1,578

This message was moderated.

Read only

0 Likes
1,578

Thank you Ashrita...