Hello ,
I have a loop like this
LOOP AT t_marm INTO p_mattab FROM sy-tabix.
IF p_mattab-matnr NE p_matnr.
CLEAR p_mattab.
EXIT.
ENDIF.
ENDLOOP.
t_marm is of type marm and p_mattab is of type meinh
If we are modifying marm with an include, error is thrown in this loop becoz of unicode.
I want to use field symbols for this .Could anyone please help me in this.
Thanks in advance
Sudha
Hi Sudha,
if you use loop at itab .. assigning <fs> you will save time because nothing is ever copied into a header line but you are working on the table line directly. For this reason you will never use a MODIFY itab. I don't know why it is syntactically allowed although it has no effect and no sense at all.
You will not solve any unicode issues by just replacing the header line/work area with a field-symbol. You must analyze the error reason and resolve it. Field-symbols might help you when they are assigned to components of structure, but I really don't know what the unicode issue is in your case.
Regards,
Clemens
hi,
Field-symbols: <fs-name> as a modified internal tbale type.
LOOP AT t_marm INTO p_mattab FROM sy-tabix asssigning <fs_name>
IF p_mattab-matnr NE p_matnr.
<fs-name>-field = modifiing table field
modify itable.
CLEAR p_mattab.
EXIT.
ENDIF.
ENDLOOP.
I will give you example code. after 10mins
sekhar
hi,
Again Sekar here
you can observe the following code, you might be get some idea........
Data: BEGIN OF i_easte OCCURS 0,
perverbr LIKE easte-perverbr,
logikzw LIKE easts-logikzw,
END OF i_easte.
FIELD-SYMBOLS:
<f_easts> LIKE i_easts.
IF sy-subrc EQ 0.
SELECT perverbr
logikzw
FROM easte
INTO TABLE i_easte
FOR ALL ENTRIES IN i_easts
WHERE logikzw EQ i_easts-logikzw.
ENDIF.
IF NOT i_easte[] IS INITIAL.
LOOP AT i_easts ASSIGNING <f_easts>.
READ TABLE i_easte WITH KEY logikzw = <f_easts>-logikzw.
IF sy-subrc EQ 0.
<f_easts>-perverbr = i_easte-perverbr.
ENDIF.
ENDLOOP.
ENDIF.
You can not solve your unicode problem just by using fieldsysombols. Even fieldsymbols have a type and what you get is a typeconflict. Typeconflicts cant be solved this way.
> t_marm is of type marm and p_mattab is of type meinh
That's your problem right there. Whether you're using a field symbol or a work area the type should be the same (unless you're trying to do the equivalent of a C union, which doesn't appear to make sense here).
Add a comment