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: 

Can I declare data type using "TEXT-###"?

Former Member
0 Kudos

So I'm doing a self-learning as instructed by my employer.

I need to display the following using text symbols:

text-001 <Employee Number> text-002 <First Name> text-003 <Last Name> text-004 <Birthdate> text-005 <Dream Salary> text-006 <Hobby>

The instruction is:

Copy the previous program and display the following using variables with the correct data types(Which is provided below)

The previous program's instruction is just to display the following without data types:

text-001 <Employee Number> text-002 <First Name> text-003 <Last Name> text-004 <Birthdate> text-005 <Dream Salary> text-006 <Hobby>

and my code is for the previous program is:

**The |{ }| is necessary as instructed by the course.

WRITE: |{ text-001 }|,
/ |{ text-002 }|,
/ |{ text-003 }|,
/ |{ text-004 }|,
/ |{ text-005 }|,
/ |{ text-006 }|,

Now, with with the current program code:

DATA: text_001 TYPE STRING,
text_002 TYPE STRING,
text_003 TYPE STRING,
text_004 TYPE STRING,
text_005 TYPE STRING,
text_006 TYPE STRING.
text_001 = text-001.
text_002 = text-002.
text_003 = text-003.
text_004 = text-004.
text_005 = text-005.
text_006 = text-006.
WRITE: text_001,
/ text_002,
/ text_003,
/ text_004,
/ text_005,
/ text_006.

It actually displays as what is instructed but the computer check says it is not correct. Am I missing something is like proper data type declaration?

I'm a first time coder. Apologies.

6 REPLIES 6

former_member763929
Participant
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with Community Q&A , as the overview provides tips for preparing questions that draw responses from our members.

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your Profile you encourage readers to respond.

abo
Active Contributor

I don't really understand why you copy the text symbols to a string, you may use them directly.

More to the point: do those symbols exist?

horst_keller
Product and Topic Expert
Product and Topic Expert

Sandra_Rossi
Active Contributor
0 Kudos
WRITE 'this is a translatable text'(001).

I never use TEXT-001.

matt
Active Contributor
0 Kudos

The computer check says it's incorrect, but it runs? What computer check?

Couple of points: |{ text-001 }| makes text-001 into a string. Also don't use text-nnn, use 'This is my text'(nnn) instead.

Former Member
0 Kudos

c5e08e0478aa4727abc4482f5be390b2 Apologies as I forgot to include the instruction which is:

Copy previous program and display the following using variables with the correct data types. Text symbols should be assigned to the values listed below. text-001 <Employee Number> text-002 <First Name> text-003 <Last Name> text-004 <Birthdate> text-005 <Dream Salary>

text-006 <Hobby>

Not sure if I understand your answer correctly.