‎2009 Apr 17 7:43 AM
'
Hi experts,
I have to read multiple line from header text and show it on ALV report.
Problem is that as where there was ENTER pressing at the time of entering the data in header text, when I read it, there it comes ## against the enter and it doesn't remove by either SPLIT or Delete Command.
So just suggest how I do this.
Thanks in advance.
Manoj kr.
‎2009 Apr 17 7:45 AM
‎2009 Apr 17 8:01 AM
The code is as follows
DATA : name LIKE stxh-tdname.
DATA : line LIKE tline OCCURS 10 WITH HEADER LINE,
transporter LIKE line-tdline,
text TYPE string .
DATA: potext1 TYPE string.
name = '012009021900000001AREA'.
SELECT COUNT( * ) FROM stxh
WHERE tdobject = 'ZDAILY'
AND tdname = name
AND tdid = '123'
AND tdspras = 'EN'.
IF sy-subrc = 0.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = '123'
language = 'E'
name = name
object = 'ZDAILY'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
lines = line
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
ENDIF.
**
**
LOOP AT line.
CONDENSE line.
IF sy-tabix > 1.
CONCATENATE text
line-tdline
INTO text.
ELSE.
text = line-tdline.
ENDIF.
ENDLOOP.
‎2009 Apr 17 8:04 AM
Try this:
describe table line lines lv_line.
LOOP AT line.
CONDENSE line.
IF lv_line GT 1.
CONCATENATE text
line-tdline
INTO text.
ELSE.
text = line-tdline.
ENDIF.
ENDLOOP.
‎2009 Apr 17 8:13 AM
I have tried it
but in Text the values comes like this
mbai##meri jaan##ssss##RES_CHILD_R1##PRES_CHILD_R2##NEAR_MISS_R1##NEAR_MISS_R2##CHILD_SITE_R1##CHILD_SITE_R2
##FIRST_AID_R1##FIRST_
I have to show this Text value in ALV Report
and i have to show it without ##, bcoz it comes against for Enter.
and when I make
SPLIT text AT '##' INTO v_str1 v_str2.
then through it also ## is not removing.
so how i remove ## from Text.
‎2009 Apr 17 8:20 AM
hmmm..
Do not use CONDENSE.
After this if you are using ECC 6.0 , use concatenate text line into text respecting blanks.
‎2009 Apr 17 2:17 PM
Hi manoj ,
you can use REPLACE all OCCURRENCEs of '#' IN string WITH space in the text which you have get
.
then split the string in the parts as many you wants .
the string is here the text which you will get from the Loop of tline .
Regards
Digvijay Rai
‎2009 Apr 29 2:26 PM
The correct answer is
try to use cl_abap_char_utilities=>newline for comparing. Normally you can split your string at cl_abap_char_utilities=>newline or ...=>cr_lf.
if lv_text ca cl_abap_char_utilities=>newline." here lv_text contains the value in my text edit
Its works.
By manoj
‎2009 Apr 29 2:28 PM
Try this
try to use cl_abap_char_utilities=>newline for comparing. Normally you can split your string at cl_abap_char_utilities=>newline or ...=>cr_lf.
if lv_text ca cl_abap_char_utilities=>newline." here lv_text contains the value in my text edit