cancel
Showing results for 
Search instead for 
Did you mean: 

new-line code in mapping table

aidan_mulcahy
Active Participant
0 Kudos

Hi,

we have a mapping table that stores the footers of all our companies.

These have text like " <b.>Company Name...</>.....".

(Note: ignore the '.' after the '<b' in the previous - I needed it here so I could display the command in SDN- it is not in the text on our system). This works fine and the appropriate section is in bold.

The question I have is that one of our companies needs the footer to have a second line so I need some sort of '<>' command to force a new line.

I have tried <cr>, <br>, \n and
n.

Does anyone know how to do this?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

Not sure if I understood your problem, try using

<BR></BR>

to goto new line.

Regards,

Sesh

aidan_mulcahy
Active Participant
0 Kudos

thanks for the reply.

I think you understand it correctly but I have tried that already and it didn't work.

Just to re-iterate.....

e.g.

say the requirement is to display:

Company name, 1 main street, New York.

Reg number 12345678

but I have one field (ztable-description) to store it in so I need something like.....

ztable-description = Company name, 1 main street, New York. <cr> Reg number 12345678

where '<cr>' would be Carraige Return.

thanks again.

0 Kudos

Hi,

Try this

ztable-description = 'Company name, 1 main street, New York'

concatenate ztable-description CL_ABAP_CHAR_UTILITIES=>CR_LF   'Reg number 12345678' into ztable-description.

Regards,

Sesh

aidan_mulcahy
Active Participant
0 Kudos

Sesh,

thanks for your help. I managed to get it working. Not the most elegant bit of code but it works:


...
    FIELD-SYMBOLS <fs> TYPE ANY.
    ASSIGN '0' TO <fs>.
    SEARCH l_text FOR '\NL'. "I decided to call it '\NL'
    IF sy-subrc = 0.
      SPLIT l_text AT '\NL' INTO l_text2 l_text3.
      ASSIGN l_index TO <fs>.
      IF NOT l_text2 IS INITIAL.
        WHILE NOT l_text2+l_n(80) IS INITIAL.
          l_index = l_index + 1.
          CONCATENATE 'DESC' <fs> INTO l_desc.
          READ TABLE outtab WITH KEY = l_desc.
          outtab-value = l_text2+l_n(80).
          MODIFY outtab INDEX sy-tabix.
          CLEAR outtab.
          l_n = l_n + 80.
          l_wa_o_text-tdformat = '*'.
          CONCATENATE l_wa_o_text-tdline '&' l_desc '&' INTO l_wa_o_text-tdline.
        ENDWHILE.
        APPEND l_wa_o_text TO l_o_text.
      ENDIF.
...
      APPEND l_wa_o_text TO l_o_text.
....
      CALL FUNCTION 'CREATE_TEXT'
        EXPORTING
          fid         = 'ST'
          flanguage   = sy-langu
          fname       = 'ZDYNAMIC_TEST'
          fobject     = 'TEXT'
          save_direct = 'X'
        TABLES
          flines      = l_o_text
        EXCEPTIONS
          no_init     = 1
          no_save     = 2
          OTHERS      = 3.

outtab passed back to SAPScript....

SAPScript Code:


INCLUDE 'ZDYNAMIC_TEST' OBJECT TEXT ID 'ST' PARAGRAPH 'Z2'.

Thanks.

Answers (0)