Application Development 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: 

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

andreas_mann3
Active Contributor
0 Kudos

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