‎2015 Jul 28 3:16 PM
Dear Team,
I have a requirement where i need to display the long text in the output table in the last column like the below format:
Here is the text1
Line 2
Line 3
Line 4
Is it possible to populate the above format in the class CL_GUI_ALV_GRID- >set_table_for_first_display.
Currently, I have used the word wrap functionality and populated inside the internal table but not sure how to proceed further in the fieldcatalog,
I have checked in the other threads they mentioned about the Reuse_alv_list_display and Reuse_alv_grid_dispaly.
Sorry I am new to this ALV coding. Thanks for your time in advance, Can you please help me.
Thanks,
Pavi
‎2015 Jul 28 9:16 PM
Hi Pavithrra,
what you want is not possible.
You wont be able to word wrap texts inside a specific cell in ALV.
I kindly suggest a cell first N chars and with a hotspot function. When clicked you open a popup with the complete text.
Regards,
Frisoni
‎2015 Jul 28 4:27 PM
‎2015 Jul 29 1:59 PM
‎2015 Jul 28 9:16 PM
Hi Pavithrra,
what you want is not possible.
You wont be able to word wrap texts inside a specific cell in ALV.
I kindly suggest a cell first N chars and with a hotspot function. When clicked you open a popup with the complete text.
Regards,
Frisoni
‎2015 Jul 29 11:49 AM
THanks Guilherme Frisoni. Currently, I am doing in the similar way as you said but do you have any sample code to show the text in the hotspot. I have concatenated them inside the cell.
Regards,
Pavithrra
‎2015 Jul 29 3:19 PM
Hi Pavithrra,
you can use this FM:
CALL FUNCTION 'ISU_POPUP_TEXT_EDIT'
EXPORTING
x_title = 'Title'
x_no_change = 'X'
CHANGING
xy_texttab = gt_text
EXCEPTIONS
general_fault = 1
OTHERS = 2.
Where GT_TEXT is a table with your text, similar to text table returned in READ_TEXT FM.
Regards,
Frisoni
‎2015 Jul 29 8:56 AM
Hi,
Try to append the internal table as required.
TYPES:
BEGIN of ty_tab,
order type c,
item type c,
END OF ty_tab,
BEGIN OF ty_final.
INCLUDE type ty_tab.
TYPES: text type string,
END OF ty_final.
DATA: it_tab type table of ty_tab,
wa_tab like line of it_tab,
it_final type table of ty_final,
wa_final like line of it_final,
lv_flag type c.
START-OF-SELECTION.
DO 5 TIMES.
wa_tab-order = 1.
wa_tab-item = sy-index.
append wa_tab to it_tab.
ENDDO.
SORT it_tab by order ascending.
loop at it_tab into wa_tab.
CLEAR lv_flag.
MOVE-CORRESPONDING wa_tab to wa_final.
AT END OF order.
PERFORM get_text using wa_tab-order
changing lv_flag.
ENDAT.
IF lv_flag IS INITIAL.
APPEND wa_final to it_final.
CLEAR wa_final.
ENDIF.
endloop.
FORM GET_TEXT USING value(P_WA_TAB_ORDER)
CHANGING P_LV_FLAG.
wa_final-text = 'Service Engineer Name'.
append wa_final to it_final.
wa_final-text = 'ABC'.
append wa_final to it_final.
P_LV_FLAG = 'X'.
ENDFORM. " GET_TEXT
Hope it helpful.
Regards,
Venkat.
‎2015 Jul 29 10:09 AM
Hi,
In class: CL_GUI_ALV_GRID there is attribute : CO_WEBSTYLE_WRAP
it might be helpful for you
‎2015 Jul 29 12:56 PM
Thanks Venkat for your time. I will try this option also in a separate program.