‎2008 Oct 28 10:10 AM
Hi all,
is it possible to modify the internal table records without using modify,update,insert keywords
‎2008 Oct 28 10:48 AM
Hello Swamy
Below you find sample coding for your problem:
DATA: lt_knb1 TYPE knb1.
FIELD-SYMBOLS: <ls_knb1> TYPE knb1.
FIELD-SYMBOLS: <ls_record> TYPE any,
<ls_fld> TYPE any.
" Typed field symbol
LOOP AT lt_knb1 ASSIGNING <ls_knb1>.
<ls_knb1>-ernam = syst-uname. " directly modifies itab contents
ENDLOOP.
" Untyped field-symbol
LOOP AT lt_itab ASSIGNING <ls_record>.
DO.
ASSIGN COMPONENT syst-index OF STRUCTURE <ls_record> TO <ld_fld>.
IF ( syst-subrc NE 0 ).
EXIT.
ENDIF.
<ld_fld> = "...". " directly modifies itab contents
ENDDO.
ENDLOOP.
Regards
Uwe
‎2008 Oct 28 10:11 AM
hi,
use fieldsymbols..
search in SCN for examples on fieldsymbols..
rgds.,
subash
‎2008 Oct 28 10:48 AM
Hello Swamy
Below you find sample coding for your problem:
DATA: lt_knb1 TYPE knb1.
FIELD-SYMBOLS: <ls_knb1> TYPE knb1.
FIELD-SYMBOLS: <ls_record> TYPE any,
<ls_fld> TYPE any.
" Typed field symbol
LOOP AT lt_knb1 ASSIGNING <ls_knb1>.
<ls_knb1>-ernam = syst-uname. " directly modifies itab contents
ENDLOOP.
" Untyped field-symbol
LOOP AT lt_itab ASSIGNING <ls_record>.
DO.
ASSIGN COMPONENT syst-index OF STRUCTURE <ls_record> TO <ld_fld>.
IF ( syst-subrc NE 0 ).
EXIT.
ENDIF.
<ld_fld> = "...". " directly modifies itab contents
ENDDO.
ENDLOOP.
Regards
Uwe