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

How to put a sy-vline after a value without having space in between

Former Member
0 Likes
1,068

Hi,

In my list output, I want to print a sy-vline after a value without any blank space in between.

Eg.

Current Output: abcd | sdaasfd | 2143 |

Requird Output: abcd|sdaasfd|2143|

Please Advise.

Rgards,

shobhit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
647

Hi Shobhit,

Try using concatenate as

CONCATENATE 'abcd'

sy-vline

'sdaasfd'

sy-vline

'2143'

sy-vline.

INTO x.

Write 😕 x.

Thanks and Warm Regards.

Pras

4 REPLIES 4
Read only

Former Member
0 Likes
648

Hi Shobhit,

Try using concatenate as

CONCATENATE 'abcd'

sy-vline

'sdaasfd'

sy-vline

'2143'

sy-vline.

INTO x.

Write 😕 x.

Thanks and Warm Regards.

Pras

Read only

0 Likes
647

Hi,

You could also try this to delete blank gaps in a char variable.

CONDENSE x NO-GAPS.

Or if you are making differents Write, try this:

write: 'A' no-gap, sy-vline no-gap, 'B'.

Output; A|B

Cheers,

Jordi Pons

Message was edited by: Jordi Pons

Read only

Former Member
0 Likes
647

Pl. try with '|' (pipe) instead of using sy-vline..

Read only

andreas_mann3
Active Contributor
0 Likes
647

Hi shobhit,

WRITE: / 'abcd' NO-GAP, sy-vline NO-GAP...

as Jordi writes is correct.

but if you've big structures with 10 or 20 fields it's

better to code it dynamic:

data h_field type string.
DO.
  ASSIGN COMPONENT sy-index OF STRUCTURE rec TO <f>.
  IF sy-subrc <> 0.
    EXIT.
  ENDIF.
  CONCATENATE h_field <f> sy-vline INTO h_field.
ENDDO.

WRITE: / h_field COLOR 6.

regards Andreas