04-09-2010 4:51 AM
Dear Friends.
I have getting sales text against the material code
so i want to display it in alv list
i using string type variable to store the sales text
but when i run the alv report it came only 127 characters.
are there any limitations in alv field catalog displaying?
Thanks in advance.
Nelson Rodrigo
04-09-2010 5:23 AM
In ALV coulmn width is restricted to max of 128 chars
You may need to split the text by 127 each and display. other wise place a button in the app toolbar and user need to select the
line and click on the button will display long text using fm EDIT_TEXT
a®
04-09-2010 6:04 AM
Use FM RKD_WORD_WRAP to split the sales text into multiple lines and then display in ALV
04-09-2010 6:05 AM
Dear a®s
Thanks for the information, otherwise i down with that.
any how please help me to implement your solution, (splitting and use button with EDIT_TEXT)
Thanks in Advance
04-09-2010 6:40 AM
Dear Kanwardeep
FM RKD_WORD_WRAP can only for 3 lines
so from that i can only get 125 * 3 = 375
according to my logic there are 1000 length text to split.
Thanks
04-09-2010 6:45 AM
Please check
[Split|;
you can find lot of thread related to creating a button in alv by using REUSE or CL_GUI_ALV_GRID
a®
04-09-2010 6:56 AM
Since your requirement is to display 1000 char text, may b you would like to display this text after each line is printed in the ALV using event AFTER_LINE_OUTPUT. Using this, after a record is displayed the sales text for that record will be displayed.
Or You can use the approach suggested by a®s
Edited by: Kanwardeep Singh Gill on Apr 9, 2010 7:56 AM
04-09-2010 7:13 AM
dear Kanwardeep
can you please let me know how can i use AFTER_LINE_OUTPUT and where
thanks
04-09-2010 7:17 AM
Nelson,
You just have to pass the event AFTER_LINE_OUTPUT in the it_events table in the REUSE_ALV_GRID_DISPLAY FM
write a form for this event as below:
FORM AFTER_LINE_OUTPUT.
Here you can read the text using FM READ_TEXT and then write simple write statements to display the text.
Also here, u can have access to the internal table passed to the ALV FM and the current record that was displayed.
ENDFORM.
Edited by: Kanwardeep Singh Gill on Apr 9, 2010 8:18 AM
04-09-2010 7:36 AM
04-09-2010 7:51 AM
Dear Friends,
Sorry! according to my knowledge still i unable to do that.
04-09-2010 7:53 AM
04-09-2010 7:57 AM
Dear
actually i want to use alv out put.
if possible please send some sample code for me. if its not harm for you.
04-09-2010 9:33 AM
Here's a sample code for ur reference
I hope it will solve ur problem.
REPORT ZAFTER_LINE_OUTPUT.
type-pools:slis.
DATA :I_CATALOG TYPE STANDARD TABLE OF slis_fieldcat_alv WITH HEADER LINE,
I_VBAP TYPE STANDARD TABLE OF VBAP with header line,
I_EVENTS TYPE STANDARD TABLE OF slis_alv_event with header line,
slis_lineinfo TYPE slis_lineinfo.
*Data selection
SELECT VBELN
MATNR
ARKTX UP TO 40 ROWS
FROM VBAP
INTO CORRESPONDING FIELDS OF TABLE I_VBAP.
*Populate events
I_EVENTS-NAME = 'AFTER_LINE_OUTPUT'.
I_EVENTS-FORM = 'AFTER_LINE_OUTPUT'.
APPEND I_EVENTS.
CLEAR I_EVENTS.
*Populate field catalog
I_CATALOG-FIELDNAME = 'VBELN'.
I_CATALOG-ref_tabname = 'VBAK'.
I_CATALOG-col_pos = 1.
I_CATALOG-ref_fieldname = 'VBELN'.
APPEND I_CATALOG.
CLEAR I_CATALOG.
I_CATALOG-FIELDNAME = 'MATNR'.
I_CATALOG-ref_tabname = 'VBAK'.
I_CATALOG-col_pos = 2.
I_CATALOG-ref_fieldname = 'MATNR'.
APPEND I_CATALOG.
CLEAR I_CATALOG.
*Call ALV list
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_STRUCTURE_NAME = 'VBAK'
IT_FIELDCAT = I_CATALOG[]
IT_EVENTS = I_EVENTS[]
TABLES
T_OUTTAB = I_VBAP[]
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 AFTER_LINE_OUTPUT
&----
text
----
FORM AFTER_LINE_OUTPUT USING P_slis_lineinfo LIKE slis_lineinfo.
CLEAR I_VBAP.
READ TABLE I_VBAP INDEX P_slis_lineinfo-TABINDEX.
IF SY-SUBRC EQ 0.
SKIP 1.
WRITE: / I_VBAp-ARKTX .
SKIP 1.
ENDIF.
ENDFORM. "AFTER_LINE_OUTPUT