on 03-10-2008 4:50 PM
Hey Folks,
Here is a SmartForm question for ya.
My users are always asking for the unusual. They have a request for me to make a form that includes the long text from an inspection characteristic. Ok, no problem. Wait, they don't want the whole text, just the text from line 2 on. Ok, no problem. Wait, but they still want it formatted the way that it is in the long text. Now I have a problem. If I use the 'Include Text' I can't see how to get all the text minus line 1. If I use a Text Element' I can strip off the first line, but I don't have the option to read tags that use the SAPStyle. I've been banging my head...any ideas? Can I somehow 'cover' or 'scroll' the first line of the 'Include' Text off of the screen? Can I somehow get the 'Text Element' to format using tags? <B></B> stuff like that. Any suggestions would be appreciated, and of course rewarded because everyone loves that.
Thanks,
Greg
Hi,
TABLES: PBIM.
stxh, stxl, stxb - trans tables for text
ttxit - text on text-ids
ttxot - Short texts on text objects
Transaction MD63
SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,
S_WERKS FOR PBIM-WERKS.
DATA: BEGIN OF HTEXT.
INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.
DATA: BEGIN OF LTEXT OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.
DATA: BEGIN OF DTEXT OCCURS 50.
DATA: MATNR LIKE PBIM-MATNR.
INCLUDE STRUCTURE TLINE.
DATA: END OF DTEXT.
DATA: TNAME LIKE THEAD-TDNAME.
SELECT * FROM PBIM WHERE WERKS IN S_WERKS.
MOVE PBIM-BDZEI TO TNAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'PB'
LANGUAGE = 'E'
NAME = TNAME
OBJECT = 'PBPT'
ARCHIVE_HANDLE = 0
IMPORTING
HEADER = HTEXT
TABLES
LINES = LTEXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
LOOP AT LTEXT where sy-tabix > 1.
IF LTEXT-TDLINE NE ''.
MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
MOVE PBIM-MATNR TO DTEXT-MATNR.
APPEND DTEXT.
ENDIF.
ENDLOOP.
ENDSELECT.
LOOP AT DTEXT.
WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.
ENDLOOP.
Change this code and write progrma lines in form and it will solve your problem
REgards
SHiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Shiva, interestingly this is almost exactly what I had already done. So I take off the first line and fill a globally defined table (for me gt_lines, for you dtext). Then in the smartform I created a loop and within that loop created a text node...this is where I'm stuck...if I use an "Text Element" type of text node it doesn't have formatting. Is there a way to do a text node that recognizes the formatting? my table gt_lines is just like your table dtext...any ideas on the output itself? My "Text Element" text node has WA_LINES-TDLINE as the output. (WA_LINES is filled in the loop by GT_LINES). Should I be doing something with WA_LINES-TDFORMAT??
Your insight is appreciated.
Greg
Edited by: Greg Foss on Mar 11, 2008 3:58 PM
hi
if u know from which character No. ur second line begins then try to use this
let F1 is field of ITAB which have long text
then write as &ITAB-F1+(N)&
Note : where N is integer value from where second line starts
like &ITAB-F1+(10)&
OR
post table and field name of required field
reward if helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.