Application Development 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: 

SALEX TEXT Display in ALV

Former Member
0 Kudos

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

13 REPLIES 13

former_member194669
Active Contributor
0 Kudos

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

0 Kudos

Use FM RKD_WORD_WRAP to split the sales text into multiple lines and then display in ALV

0 Kudos

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

0 Kudos

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

0 Kudos

Please check

[Split|;

you can find lot of thread related to creating a button in alv by using REUSE or CL_GUI_ALV_GRID

0 Kudos

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

0 Kudos

dear Kanwardeep

can you please let me know how can i use AFTER_LINE_OUTPUT and where

thanks

0 Kudos

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

0 Kudos

0 Kudos

Dear Friends,

Sorry! according to my knowledge still i unable to do that.

0 Kudos

Were you able to execute the AFTER_LINE_OUTPUT Event?

0 Kudos

Dear

actually i want to use alv out put.

if possible please send some sample code for me. if its not harm for you.

0 Kudos

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