12-02-2021 4:00 PM
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.
12-02-2021 4:00 PM
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.
12-02-2021 4:55 PM
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?
12-02-2021 5:56 PM
You are invited to read the documentation
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abentext_symbols.htm
12-02-2021 6:41 PM
12-03-2021 12:12 PM
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.
12-03-2021 6:07 PM
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.