2009 Jan 08 11:16 AM
Hi everybody,
I have a question regarding text-symbols. I implemented a form routine which should add error messages to an internal table. This internal table will be output at the end of my program using the "write" command.
The form-routine looks like the following:
form add_error_2_log using p_error_code.
data: lv_text(8) type c.
concatenate 'text-' p_error_code into lv_text.
gs_log-msgtx = lv_text.
append gs_log to gt_log.
endform.
If I output my table now using the "write" command I only get my text-symbol number as a result e.g. text-t48.
Is there any way how I can get the text of the text symbol for the output?
Thanks in advance and regards!
Martin
2009 Jan 08 11:32 AM
Hi Martin
Use field symbols to solve this.
form add_error_2_log using p_error_code.
data: lv_text(8) type c.
FIELD SYMBOLS : <FS> TYPE ANY.
concatenate 'text-' p_error_code into lv_text.
Assign (lv_text) TO <FS>.
gs_log-msgtx = <FS>.
append gs_log to gt_log.
endform.
Thanks
Pushpraj
2009 Jan 08 11:32 AM
Hi Martin
Use field symbols to solve this.
form add_error_2_log using p_error_code.
data: lv_text(8) type c.
FIELD SYMBOLS : <FS> TYPE ANY.
concatenate 'text-' p_error_code into lv_text.
Assign (lv_text) TO <FS>.
gs_log-msgtx = <FS>.
append gs_log to gt_log.
endform.
Thanks
Pushpraj
2009 Jan 08 11:42 AM
2009 Jan 14 4:11 PM
I have implemented the solution you suggested and it worked fine so far. But now I get return code 4 during assigning the the variable to the field symbol. But I don't know why. The character variable which I want assign is not empty. Do you have any suggested what could cause this error?
Thanks and regards,
Martin
2009 Jan 14 4:40 PM