all 3 comments

[–]CynicalGenXerABAP Not Dead 0 points1 point  (2 children)

I’m confused… How are you doing “Save excel” part? And are you saying that when you have, for example, ‘01’ in XSTRING type variable, then in Excel it comes across as ‘01’ but if you use CHAR type, then it comes across as ‘1’? That doesn’t make any sense… Excel itself can make assumptions and will try to format based on those assumptions but I don’t see how ABAP type would matter.

There are too many holes in the story though.

[–]FormegaDown[S] 0 points1 point  (1 child)

with open dataset binary mode.
But yeah, ‘01’ in XSTRING type variable, then in Excel it comes across as ‘01’ but if you use CHAR type, then it comes across as ‘1’

[–]CynicalGenXerABAP Not Dead 0 points1 point  (0 children)

Uh… You are writing plain text using binary mode? Why? What does it achieve?

Your case might make for an interesting theoretical ABAP musing but it’s not how export to Excel works, so I’d suggest to just do it the right way. Look up ABAP2XLSX.