2014 Jan 22 6:56 AM
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
2014 Jan 22 7:00 AM
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.
2014 Jan 22 7:01 AM
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
2014 Jan 22 7:05 AM
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.
2014 Jan 22 7:14 AM
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
2014 Jan 22 8:45 AM
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.
2014 Jan 24 10:25 AM
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
2014 Jan 24 12:13 PM
2014 Jan 24 12:18 PM
2014 Jan 25 7:00 AM
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
2014 Jan 27 6:21 AM
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.
2014 Jan 22 8:51 AM
Hi,
You can set the output length when creating the field catalog, try that way.
regards,
2014 Jan 24 11:02 AM
2014 Jan 24 11:26 AM