Skip to Content
0
Former Member
Dec 11, 2006 at 01:41 PM

Field symbols

38 Views

Could any one help me in solving the below problem..

In the below code , Im getting the problem ' <b>The data object "WA_LFC1" does not have a component called "<COMP1>".</b> '

FORM check_bal USING wa_lfc1 STRUCTURE gt_lfc1

lf_count TYPE n

lf_end_month.

FIELD-SYMBOLS: <comp1> TYPE ANY.

DATA: lf_field1(5) TYPE c.

DATA: lf_char TYPE c.

DO.

DO 3 TIMES.

CASE sy-index.

WHEN '1'.

lf_char = 'S'.

WHEN '2'.

lf_char = 'H'.

WHEN '3'.

lf_char = 'U'.

ENDCASE.

CONCATENATE 'UM' lf_count lf_char INTO lf_field1.

ASSIGN lf_field1 TO <comp1>.

IF NOT <b>wa_lfc1-<comp1></b> = ''.

gf_balance = 'X'.

ENDIF.

ENDDO.

lf_count = lf_count + 1.

IF lf_count > '12' OR gf_balance = 'X'.

EXIT.

ENDIF.

ENDDO.

ENDFORM. " CHECK_BAL

What actually Im try to do is..

I have populated an internal table 'ITAB_LFC1' from LFC1 table.

Now I have to check the values(whether they are blank) of all the fields

(UM01S, UM01H, UM01U

UM02S, UM02H, UM02U

-

-

-

-

UM16S, UM16H, UM16U).

Instead of writing a very big 'IF' statement specifying all the above fields in it,

Im doing like above ..

Please help.

Thanks in advance.