Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Can't assign field syombl

Hi experts.

I programmed below. But(t_field) doesn't assign TO <fs>.

What is the problem?? I hope any expert tell me why and how.

Have a good day

&----


*& Report *

&----


REPORT z3_graph_test .

INCLUDE z3_graph_test_f01.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-010.

PARAMETERS : p_count TYPE i DEFAULT 1 OBLIGATORY.

SELECTION-SCREEN END OF BLOCK block1.

DATA : p_titl(10) .

START-OF-SELECTION.

p_titl = 'test'.

PERFORM date_make_include USING p_count.

&----


*& Include Z3_GRAPH_TEST_F01 *

&----


&----


*& Form date_make_include

&----


  • text

----


  • -->P_P_COUNT text

----


FORM date_make_include USING p_count.

DATA : t_wotnr TYPE p,

t_field(8) TYPE c,

t_num(2) TYPE n,

t_date LIKE sy-datum.

FIELD-SYMBOLS <fs> TYPE ANY.

t_date = sy-datum.

CLEAR t_num.

DO p_count TIMES.

ADD 1 TO t_num.

CALL FUNCTION 'DAY_IN_WEEK'

EXPORTING

datum = t_date

IMPORTING

wotnr = t_wotnr.

IF t_wotnr = 7.

t_date = t_date - 1.

ENDIF.

BREAK-POINT.

CONCATENATE 'T_DATE' t_num INTO t_field .

ASSIGN (t_field) TO <fs>.

IF sy-subrc = 0 .

MOVE t_date TO <fs>.

ENDIF.

t_date = t_date - 1.

ENDDO.

ENDFORM. " date_make_include

Tags:
Former Member
replied

for the assign to work t_field must contain a valid variable name. On the first pass it will contain 'T_DATE01' and I can't see any variable with such a name.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question