New syntax reading ITab with field symbol

light111New syntax reading internal table with field symbol


The below syntax used to read internal table to a structure but it is also possible read and assign to the field symbol

SELECT  FROM spfli INTO TABLE @DATA(lt_spfli).
 New Syntax
DATA(ls_spflilt_spfli[ carrid ‘AA’ connid ‘0017’ ].
IF sysubrc IS INITIAL.

ENDIF.


New syntax of read and assign field symbol:

SELECT FROM scarr INTO TABLE @DATA(lt_scarr).
IF lt_scarr IS NOT INITIAL.
ASSIGN lt_scarr[ carrid |AA| ] TO FIELDSYMBOL(<fs_scarr>).
WRITEsysubrc.
ENDIF.

Read successful -> sy-subrc = 0 and  field symbol assigned


1

2

Read unsuccessful -> sy-subrc = 4 and  field symbol not assigned

3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s