Application Development and Automation 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: 
Read only

Problem regarding Reading multiple line header text data

Former Member
0 Likes
961

'

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.

8 REPLIES 8
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
905

Can you please paste the code snippet here for the same

Read only

0 Likes
905

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.

Read only

0 Likes
905

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.

Read only

0 Likes
905

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.

Read only

0 Likes
905

hmmm..

Do not use CONDENSE.

After this if you are using ECC 6.0 , use concatenate text line into text respecting blanks.

Read only

digvijay_rai
Participant
0 Likes
905

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

Read only

0 Likes
905

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

Read only

Former Member
0 Likes
905

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