Long text in alv
Hi,
Iam trying to display alv list with one internal table(itab1).
I have another itab2 which is having very long text and which is appended as 4 lines.
Now i want to combine this itab2 into itab1 to dispaly long text.
Can any one explain me how to append this data.Here is the code.
My object is to put long text in the ALV list.Iam using QM02 transaction to get the data.
REPORT YQM_NOTIFICATION MESSAGE-ID ZM NO STANDARD PAGE HEADING
LINE-SIZE 255.
TYPE-POOLS: SLIS.
TABLES: QPCT,
QPGT,
QMEL,
QMMA,
IHPA.
DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
ITAB_EXTAB TYPE SLIS_T_EXTAB.
DATA: IT_FIELD TYPE SLIS_T_FIELDCAT_ALV,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_EXCLU TYPE SLIS_T_EXTAB,
GS_EXTAB TYPE SLIS_EXTAB.
DATA : F_TDOBJECT LIKE THEAD-TDOBJECT,
F_TDNAME LIKE THEAD-TDNAME,
F_TDID LIKE THEAD-TDID,
ITAB_LINES LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF ITAB OCCURS 10,
DESC(72) TYPE C,
END OF ITAB.
DATA: BEGIN OF T_HDR OCCURS 0,
GROUP LIKE QPGT-CODEGRUPPE,
CODE LIKE QPCT-CODE,
TEXT LIKE QPCT-KURZTEXT,
NAME LIKE QPGT-KURZTEXT,
END OF T_HDR.
DATA: BEGIN OF T_DET OCCURS 0,
SNO TYPE I,
QMNUM LIKE QMEL-QMNUM, " NOTIFICATION NUMBER(REF NO)
REFNUM LIKE QMEL-REFNUM, " CONTRACT NO
PARNR LIKE IHPA-PARNR,
QMTXT LIKE QMEL-QMTXT,
QMGRP LIKE QMEL-QMGRP,
QMCOD LIKE QMEL-QMCOD,
OBJNR LIKE QMEL-OBJNR,
DESC(72),
END OF T_DET.
DATA: SNO TYPE I.
DATA: V_REPID TYPE SY-REPID.
SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:S_QMNUM FOR QMEL-QMNUM,
S_QMART FOR QMEL-QMART,
S_QMDAT FOR QMEL-QMDAT.
SELECTION-SCREEN END OF BLOCK A1.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM 2000_GET_MAIN.
PERFORM DISPLAY_ALV.
END-OF-SELECTION.
*& FORM DISPLAY_ALV
TEXT
FORM DISPLAY_ALV.
PERFORM FIELD_CAT USING FIELDCAT.
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IT_FIELDCAT = FIELDCAT
IT_EXCLUDING = ITAB_EXTAB
TABLES
T_OUTTAB = T_DET
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.
ENDFORM. "DISPLAY_ALV
*& FORM FIELD_CAT
TEXT
-->P_FIELDCAT TEXT
FORM FIELD_CAT USING P_FIELDCAT.
FIELD CATELOG FOR ALV DISPLAY.
DATA: I_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR I_FIELDCAT.
I_FIELDCAT-FIELDNAME = 'SNO'.
I_FIELDCAT-TABNAME = 'T_DET'.
I_FIELDCAT-NO_OUT = ' '.
I_FIELDCAT-SELTEXT_L = 'S.NO'.
I_FIELDCAT-OUTPUTLEN = 4.
APPEND I_FIELDCAT TO FIELDCAT.
I_FIELDCAT-FIELDNAME = 'QMNUM'.
I_FIELDCAT-TABNAME = 'T_DET'.
I_FIELDCAT-NO_OUT = ' '.
I_FIELDCAT-SELTEXT_L = 'REF.NO'.
I_FIELDCAT-OUTPUTLEN = 18.
APPEND I_FIELDCAT TO FIELDCAT.
I_FIELDCAT-FIELDNAME = 'REFNUM'.
I_FIELDCAT-TABNAME = 'T_DET'.
I_FIELDCAT-NO_OUT = ' '.
I_FIELDCAT-SELTEXT_L = 'CONTRACT NO'.
I_FIELDCAT-OUTPUTLEN = 18.
APPEND I_FIELDCAT TO FIELDCAT.
I_FIELDCAT-FIELDNAME = 'PARNR'.
I_FIELDCAT-TABNAME = 'T_DET'.
I_FIELDCAT-NO_OUT = ' '.
I_FIELDCAT-SELTEXT_L = 'A-DIV'.
I_FIELDCAT-OUTPUTLEN = 10.
APPEND I_FIELDCAT TO FIELDCAT.
I_FIELDCAT-FIELDNAME = 'QMTXT'.
I_FIELDCAT-TABNAME = 'T_DET'.
I_FIELDCAT-NO_OUT = ' '.
I_FIELDCAT-SELTEXT_L = 'DESCRIPTION'.
I_FIELDCAT-OUTPUTLEN = 25.
APPEND I_FIELDCAT TO FIELDCAT.
I_FIELDCAT-FIELDNAME = 'DESC'.
I_FIELDCAT-TABNAME = 'T_DET'.
I_FIELDCAT-NO_OUT = ' '.
I_FIELDCAT-SELTEXT_L = 'DEFECT'.
I_FIELDCAT-OUTPUTLEN = 100.
APPEND I_FIELDCAT TO FIELDCAT.
ENDFORM. "FIED_CAT
*& FORM GET_DATA
TEXT
FORM GET_DATA.
*TO GET HEADER
SELECT CODEGRUPPE CODE KURZTEXT FROM QPCT INTO TABLE T_HDR.
LOOP AT T_HDR.
SELECT SINGLE * FROM QPGT WHERE CODEGRUPPE = T_HDR-GROUP.
IF SY-SUBRC = 0.
T_HDR-NAME = QPGT-KURZTEXT.
MODIFY T_HDR.
CLEAR T_HDR.
ENDIF.
ENDLOOP.
*TO GET DETAILS
SELECT QMNUM REFNUM QMDAT QMTXT OBJNR QMGRP QMCOD FROM QMEL
INTO CORRESPONDING FIELDS OF TABLE T_DET
WHERE QMNUM IN S_QMNUM AND
QMART IN S_QMART AND
QMDAT IN S_QMDAT.
LOOP AT T_DET.
SELECT SINGLE * FROM IHPA WHERE OBJNR = T_DET-OBJNR.
IF SY-SUBRC = 0.
T_DET-PARNR = IHPA-PARNR.
MODIFY T_DET.
CLEAR T_DET.
ENDIF.
ENDLOOP.
LOOP AT T_DET.
DELETE T_HDR WHERE GROUP NE T_DET-QMGRP.
ENDLOOP.
LOOP AT T_DET.
SNO = SNO + 1.
T_DET-SNO = SNO.
MODIFY T_DET.
CLEAR T_DET.
ENDLOOP.
CLEAR : ITAB.
REFRESH : ITAB.
LOOP AT T_DET.
F_TDID = 'LTQM'.
F_TDNAME = T_DET-QMNUM.
F_TDOBJECT = 'QMEL'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = F_TDID
LANGUAGE = SY-LANGU
NAME = F_TDNAME
OBJECT = F_TDOBJECT
TABLES
LINES = ITAB_LINES.
DESCRIBE TABLE ITAB_LINES LINES SY-TFILL.
IF SY-TFILL > 0.
LOOP AT ITAB_LINES.
ITAB-DESC = ITAB_LINES-TDLINE.
<b>APPEND ITAB</b>. "itab2
CLEAR ITAB.
ENDLOOP.
ENDIF.
ENDLOOP.
<b>LOOP AT ITAB.</b>
T_DET-DESC = ITAB-DESC.
MODIFY T_DET.
CLEAR T_DET. "itab1
<b>ENDLOOP.</b>
ENDFORM. "GET_DATA<b></b><b></b><b></b>
points guaranteed
cheers
kaki
Hi again,
1. I don't think it is directly possible in alv.
2. bcos Notification is a simple field
3. But Description ?
This is fetched into an INTERNAL Table
having many rows.
3. One option is :
The internal table which uare displaying
in alv (lets say ITAB)
Populate it with some home-grown logic.
4. lets say u have 3 Notifications
each having Descriptions of 5 lines.
ie 3 x 5 = 15 lines
5. So loop thru all descriptions
and populate both fields one by one.
itab should something like this -
make the notification field blank
for lines starting from 2 (for each notification)
6. NOT001 line1
line2
lin3
line4
NOT002 line 1
line 2
line 3
line 4
NOT0003 line1
line2
etc etc.
I hope it helps.
Regards,
Amit M.
Similar Messages
-
Display a Long Text in ALV report
Hi,
I want to display the PO header long text in ALV Report that is 255 character width.
Please help me out how to do this.
please it is very urgent
Thanks and regards
KrishnaUse READ_TEXT and concatenate the first lines of the text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = lv_name " purchase order with leading zeroes
object = 'EKKO'
TABLES
lines = t_lines
EXCEPTIONS
OTHERS = 8.
Regards -
Alv- displaying long text in alv output
hi,
as per my requirement, i need to be display long text (length >1000 characters) in alv list or alv grid.
i get the entaire long text and keep it in final internal table and pass it to alv functional module, but it unable to display the compleate long text( in alv-grid).
the alv list displays the complete long text but not in the row, it displays in the second rown and few field labes of long text and its previous field label are displayed in impro[per order.
is there any possible way to display long text in alv.
regards,
revooriHi Ashok,
try to pass the below while filling your long text.
wa_fieldcat-seltext_l = 'Your Long Text'.
wa_fieldcat-ddictxt = 'L'.
for more info check below
Long Text --- 1000 characters
hope it works
Thnaks!
Edited by: Prasanth on Mar 8, 2009 4:03 PM -
Hi ,
I wanted to display a long text in my grid. Suppose I have a field's long text having field length 3000.
It is varying for other fields.
Anybody will tell me how to display the whole long text in alv grid.hi,
if it is a heading then in the field catlog u can do it.
i don know th length limitation.
fieldcatalog-fieldname = 'EBELP'.
<b> fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-seltext_s = 'PO Item'.
fieldcatalog-seltext_l = 'PO Item'.</b>
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
rgds
Anver -
Display the long text in alv by using function modules
Hi all,
How to display the long text in alv by using function modules ?
Send me any sample code.
Thanks in advance
krupali.Hello KR,
Use READ_TEXT and concatenate the first lines of the text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = lv_name " purchase order with leading zeroes
object = 'EKKO'
TABLES
lines = t_lines
EXCEPTIONS
OTHERS = 8.
You can loop at t_lines and concatenate header in to some other field.
Best Regards,
Sasidhar Reddy Matli.
Edited by: Sasidhar Reddy Matli on Aug 13, 2008 12:25 PM -
i want to print a description in text mode which is 5-6 lines some times it have a blank line also so
how to print in ALV .i m using READ_TEXT function but sumtime it not works when text exceed 4-5 lines
what i sud do.hi,
there is another way u can use yours internal table field like long text field. that is.
parameters: salno type vbak-vbeln.
data: begin of itab occurs 0,
vbeln type vbak-vbeln,
matnr type vbap-matnr,
longtext type thead occurs 0,
end of itab.
data: itabstxl type standard table of stxl with header line.
select single vbakvbeln vbapmatnr into (itab-vbeln, itab-matnr)
from vbak inner join vbap
on vbakvbeln = vbapvbeln
where vbak~vbeln = salno.
select single tdobject tdname tdid tdspras from stxl
into (itabstxl-tdobject,itabstxl-tdname,itabstxl-tdid,itabstxl-tdspras)
where relid = 'TX'
and tdobject = 'VBBK'
and tdname = salno "YOUR OWN TDNAME e,g
and tdid = 'Z003'
and tdspras = 'EN'.
call function 'READ_TEXT'
exporting
CLIENT = SY-MANDT
id = itabstxl-tdid
language = itabstxl-tdspras
name = itabstxl-tdname
object = itabstxl-tdobject
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines = itab-longtext
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
break abaper.
I HOPE THIS WILL SOLVE THIS WILL SOLVE THE PROBLEM OF THE OTHERS AS WELL. -
How to display Long text in alv output
Hi,
I have developed an ALV report.It is displaying the output.
There is another requirment for alv output text field as below
From the long text fields show only the first 20 characters and afterwards the long text icon. If the icon is clicked open the long text display screen.
Please give your suggestion how to work on this requirement.
Thanks in advanceHi,
Create a hotspot for the long text column of ALV.
When user clicks on the hotspot, handle the event to display long text screen.
You may refer sample program of hotspot ALV :
Goto SE38
Type BCALV*
Click F4
search for HOTSPOT or EVENTS & you will get a sample program.
Best regards,
Prashant -
How to display long text in alv
Hi ,
I need to display the long text of particular object on ALV, with 30 char each line .
I have long text in one internal table, master table have one to maany relation with longtext table and long text contains 120 character in each line.
i need to display long text using 30 char in each line on alv. could you please suggest the soution ????
format is like
ponumber date longtext
1234 03/04/05 this is PO is created
for materail which have
shortage in plant.hope u r expecting this..
optimize = 'X'
if u use OUTPUTLEN it is fixed size for that specific field, and also it reflects for next fields, to avoid that again have to mention OUTPUTLEN = 'X' for next field.
With OPTIMIZE = 'X' it will adjust based on the size.
regards...
santhosh reddy
Message was edited by:
Santhosh Reddy -
Standard Purchase Order Long Text In ALV Report
Hi Gurus,
I am able to get the charecter space for long text in the ALV report but i could not able to get the text in that space out put.
I have used ekko and ekpo tables.
Please provide me the code are solution to display the Text in that particular space.
Thanks,
SRHi all,
I am able to see the PO text, But when i moved it to production system i find
1) it is taking too much time to execute. 2) I find the first PO text in the purchase document is getting repeated for all other purchase documents in the run where their is no Po text .
Please help me how to restrict the repeated Text.
And also to improve the performance
regards,
dileep -
Long Text In ALV - Exporting to Excel sheet
Hi,
Currently my ALV report reads the text using READ_TEXT fm and it displays only the first line of the text in the report.
To the see the remaining lines of the text, user needs to double click on the text in the report and it creates another ALV report with one column showing all the lines of that particular text.
Now the problem is when user exports the report in excel sheet, obviously only the first line of the text is downloaded in the excel file. User wants all the lines to be downloaded but at the same time, it should be line by line in a single cell not in a single line.
LIKE
Col-1 Col2
XXXXX XXXXXXXXXXXXX
XXXXXXXXXXXX
XXXXXXXXX
YYYYY YYYYYYYYYYYY
YYYYYYYYYYY
YYYYYYYY
So How can i create a report like this? and also the number of lines of the text will vary.
Thanks,
EzhilHi,
Here's my suggestion: Install OpenOffice.org and ask SAP to deliver good integration with OpenOffice.org.
Alternative suggestion: re-install SAP Gui on the PC where the integration is not working. If that does not help, re-install Microsoft Office as well.
Here's my comment: I think you should ask this question in a different forum, e.g. in the Duet forum. That may not be the correct forum either, but as it is a Microsoft/SAP integration technology forum, someone there may know the solution.
Regards,
Raj. -
How to make single column scrollable in ALV report (for long Text)
I have a 20 columns which we need to display in ALV grid, including one column for long text. In long text column currently it showing 40 character. I tried to change output length of field catalog but it's not working.
Can any one help me ....
Thanks
Guru
Message was edited by:
gurusharan mandalhi,
pls remeove if u give like this in the layout.
gd_layout-colwidth_optimize = 'X'.
rgds
Anver -
Urgent : ALV , how to display long text in colum field
Dear All,
Have mada an ALV report, but in some column have to show long text like.
"Qty of Processed Finished Goods receive with wt/length/pieces / units "
but while display of ALV it's showing only :
" Qty of Processed Finished Goods receive with wt/length/p "
Plz tell is it possible to show all the contents in that field, even in multiple row. like :
"Qty of Processed Finished
Goods receive with wt/length/pieces
/ units "
Looking forward to your earliest response.
Regards,
Gulrez AlamHi,
In your field catelog
w_fieldcat-tabname = 'Internal table name'.
w_fieldcat-fieldname = 'Field of the internal table'.
w_fieldcat-outputlen = '90'.----Here you have to increse the length
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'Qty of Processed Finished Goods receive
with wt/length/pieces / units '.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.
Pls. reward if useful... -
How to display long text in SAP Query ALV layout? It only show 129 char now
I have a SAP Query which show a remark field(Max length more than 500 char), but it only show max length 129 char now. In fact, the lenght of remark field text is more than 300, and i had debug the source code, the field text value do is correct, its length do is 376.
Do anybody can help me solve the issue, let the query ALV layout can show the long text field value?
thanks very much in addvance.Hi,
ALV can show only a restrict value length around 128 characters, many experts said that we can not extend. many suggestions is split text into some column.
Regards, -
How to call "long text" of master inspection characteristic in ALV
Dear All,
we have created customized QM report in ALV which shows Result, Valuation and Short text for each MIC against each inspection lot. Can we call long text also in the ALV.
Please guide how to call it in ALV?just implement some function on the ALV toolbar, read the long with FM READ_TEXT and show it to the user e.g. using CATSXT_SIMPLE_TEXT_EDITOR.
-
Show long text for Quality Notification when double click field in alv
I have an ALV grid called using a FM and I am using the user command routine to do somthing when a particular cell is clicked. I want to call up the root cause text from the action box of the QN via QM03 . I am building a BDC table to call with a CALL transaction but when I write my BDC up to that point, the program is running the BDC but not going to the point where the long text is displayed is i am in mode 'N'.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
READ TABLE itab INDEX rs_selfield-tabindex.
CASE r_ucomm.
WHEN '&IC1'.
CASE rs_selfield-fieldname.
* When double click on root cause, display root cause long text
WHEN 'ZZ_URCOD'.
PERFORM display_root_cause_text.
CALL TRANSACTION 'QM03' USING gt_bdc MODE 'N'.
ENDCASE.
ENDFORM. "user_command
FORM display_root_cause_text .
FREE gt_bdc.
PERFORM fill_bdc USING 'SAPLIQS0' '0200' 'X'.
PERFORM fill_bdc USING 'RIWO00-QMNUM' itab-qmnum space.
PERFORM fill_bdc USING 'SAPLIQS0' '7200' 'X'.
PERFORM fill_bdc USING 'BDC_OKCODE' '=10\TAB03' space.
PERFORM fill_bdc USING 'SAPLIQS0' '7200' 'X'.
PERFORM fill_bdc USING 'BDC_CURSOR'
'QMICON-LTURSACHE(01)' space.
PERFORM fill_bdc USING 'BDC_OKCODE' '=UX01' space.
ENDFORM. " DISPLAY_ROOT_CAUSE_TEXT
Any one have any suggestions of know of a BAPI that I can achieve the same thing?
Thanks
Larissa MaryniukHello,
also try to use the messages clause (of type BDCMSGCOLL).
This will return the system messages.
call transaction 'XXXX' using BDCTAB
mode 'P'
messages into MSG_TAB.
Try to change the mode from 'N' to 'P' and try to place a breakpoint and check what happens.
Alternatively, you can read the Quality Notification text using FM READ_TEXT, and then show this data to the user in pop-up, rather than calling the tx.
Hope this helps.
Maybe you are looking for
-
Hi All, Background job related info. not getting retrieved when using function module 'SAPWL_READ_STATISTIC_FILES' (version SAP ECC 5.0 compatible) in our SAP ECC 6.0 whereas if I use 'SWNC_STAD_READ_STATRECS' I'm getting the required info. Can anyon
-
Hii . I want some of my users to avoid psotings to document type SA ,please guide hot wo do that. Wiating for your feedback. Cheers.
-
Hi, I'm currently in the process of creating an online quiz for students as a revision aid. I have started programming using NLP and using tokenisers in order to recognize the form of question! and have been able to make a question. I now need some h
-
I dont know if this has been posted in the forum (here) before but maybe its time again. http://www.apple.com/aperture/specs/raw.html
-
HT4061 I want to see live video on tv? How can I do this.
I'm trying to connect to my tv so i can view espn now and i'm unable. if i play a movie from the ipad i can view it. Why can't i view the live tv.