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 deal with a too long variable?

Former Member
0 Kudos

Hi all,

In ABAP programming editor, the length of a line is limitted. So if a variable is too long to show in one line the variable will be separated into more than one line. Then we'll not pass through the syntax check. My question is how to deal with this situation. Thank you!

10 REPLIES 10

former_member221770
Contributor
0 Kudos

Hi Zhang,

What version of SAP are you on? If you are on 4.6 or higher, use transaction SE80 to write your code. When in SE80, hit the following menu path: Utilities->Settings.

Then click onthe "ABAP Editor" Tab, then the "Editor" sub tab. Now make sure you select the Front End Editor. This should change your ABAP editor to have the same lookand feel of a MS Word document. Hopefully when you are in this mode, you willbe able to compile your code.

Otherwise let us know.

Cheers,

Pat.

PS. Kindly assign Reward Points to the posts you find helpful.

0 Kudos

Hi Patrick,

I think you didn't get my meaning. I've done as you decribed but this isn't the problem. What's more, thank you!

0 Kudos

y dont u try like this...

declare some

x like root_structure-child_structure.

y like x-structure_information

etc

can u plz try like this

regards

gv

0 Kudos

Hi Venkat,

I thought about this way. I just want to know if there's some better way to resolve this in ABAP language.

Thank you!

0 Kudos

then u hv to use field symbols for ur requirement.

regards

gv

Former Member
0 Kudos

Hi,

If you want to assign a long text, more than 70 characters, to a char variable, then you can use CONCATENATE stmt.

concatenate

'70 chars'

'70 chars'

into field.

Svetlin

0 Kudos

Hi Rusev,

In fact, I'm not going to CONCATENATE a list of objects but there is such a long variable name that can't be fitted into one line. This situation may arise when the depth of a structure is too deep, which may look like root_structure-child_structure-structure_information....

What's more, thanks for your attention!

Former Member
0 Kudos

Hi

You can use field symbols as well

Cheers.

Former Member
0 Kudos

hi, you can achieve it like this, very simple.

data: str(1000) type c value

'1111111111' &

'2222222222' &

'3333333333'.

thanks

0 Kudos

ok, this is one choice when dealing with long variable value!