Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Feild Symbols

Former Member
0 Likes
738

Hi Experts,

I am Working on ECC 6.0 . I am using feild symbol in my program.

FIELD-SYMBOLS: <FS> TYPE ANY.

LOOP AT IT_ITEM_LOG INTO WA_ITEM_LOG.

AT NEW SORT.

CONCATENATE 'text-00' WA_ITEM_LOG-SORT INTO LV_TEXT.

*No sy-subrc check required

ASSIGN (LV_TEXT) TO <FS>.

WRITE: <FS>.

SKIP 1.

ENDAT.

WRITE: / WA_ITEM_LOG-MATNR,

19 WA_ITEM_LOG-MEINS,

24 WA_ITEM_LOG-MAKTX,

56 WA_ITEM_LOG-REVLV.

AT END OF SORT.

ULINE.

ENDAT.

ENDLOOP.

but it is going to short dump . When i analysed the dump it i s saying that '"Field symbol has not yet been assigned "

Can any one help me to sort out this issue.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
714

Hi,

in the following statement,

ASSIGN (LV_TEXT) TO <FS>.

remove the braces. automatically it will work.

if you give the value within the braces means dynamically passing the values.

- Selva

5 REPLIES 5
Read only

Former Member
0 Likes
714

REPORT demo_field_symbols_dynami_as_3 .

DATA: BEGIN OF s,

a TYPE c VALUE '1',

b TYPE c VALUE '2',

c TYPE c VALUE '3',

d TYPE c VALUE '4',

e TYPE c VALUE '5',

f TYPE c VALUE '6',

g TYPE c VALUE '7',

h TYPE c VALUE '8',

END OF s.

DATA off TYPE i.

FIELD-SYMBOLS <fs> TYPE ANY.

ASSIGN s-a TO <fs>.

DO 4 TIMES.

off = sy-index - 1.

IF <fs> IS ASSIGNED.

ASSIGN <fs>+off(1) TO <fs>.

IF <fs> IS ASSIGNED.

WRITE <fs>.

ENDIF.

ENDIF.

ENDDO.

Read only

matt
Active Contributor
0 Likes
714

>

> CONCATENATE 'text-00' WA_ITEM_LOG-SORT INTO LV_TEXT.

CONCATENATE 'TEXT-00' wa_item_log-sort INTO lv_text.

May be more effective. But I'm not sure that you can use text elements in this way.

matt

Read only

Former Member
0 Likes
714

Hi Pavan,

Try This it my solve your problem.

FIELD-SYMBOLS: <FS> TYPE ANY.

LOOP AT IT_ITEM_LOG INTO WA_ITEM_LOG.

AT NEW SORT.

CONCATENATE 'text-00' WA_ITEM_LOG-SORT INTO LV_TEXT.

*No sy-subrc check required

ASSIGN LV_TEXT TO <FS>.

WRITE: <FS>.

SKIP 1.

ENDAT.

WRITE: / WA_ITEM_LOG-MATNR,

19 WA_ITEM_LOG-MEINS,

24 WA_ITEM_LOG-MAKTX,

56 WA_ITEM_LOG-REVLV.

AT END OF SORT.

ULINE.

ENDAT.

ENDLOOP.

Try this exaple Program in SE38:

Program : demo_field_symbols_stat_assign

Plzz Reward if useful,

Mahi.

Read only

Former Member
0 Likes
715

Hi,

in the following statement,

ASSIGN (LV_TEXT) TO <FS>.

remove the braces. automatically it will work.

if you give the value within the braces means dynamically passing the values.

- Selva

Read only

harimanjesh_an
Active Participant
0 Likes
714

Hi pavan,

FIELD-SYMBOLS: <FS> TYPE ANY.

LOOP AT IT_ITEM_LOG INTO WA_ITEM_LOG.

AT NEW SORT.

CONCATENATE 'text-00' WA_ITEM_LOG-SORT INTO LV_TEXT.

*No sy-subrc check required

ASSIGN LV_TEXT TO <FS>.

WRITE: <FS>.

SKIP 1.

ENDAT.

WRITE: / WA_ITEM_LOG-MATNR,

19 WA_ITEM_LOG-MEINS,

24 WA_ITEM_LOG-MAKTX,

56 WA_ITEM_LOG-REVLV.

AT END OF SORT.

ULINE.

ENDAT.

ENDLOOP.

Dont use (LV_TEXT) instead just use LV_TEXT.

Reward me if useful......

Harimanjesh AN