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

getting runtime error in ALV ...

Former Member
0 Likes
590

Hi,

I am calling function REUSE_ALV_GRID_DISPLAY to display my data in an ALV grid... this code was working fine and so I used it for a different set of data but now it is throwing a runtime error saying ..

GETWA_NOT_ASSIGNED

Field symbol has not yet been assigned.

I dont understand why I am getting this and how to resolve this...my sample code is pasted below..

REPORT ZFB12TEST.

TABLES: BKPF.

TYPE-POOLS: slis.

DATA: BEGIN OF bkpf_rec OCCURS 0,

bukrs LIKE BKPF-BUKRS,

blart LIKE BKPF-BLART,

cpudt LIKE BKPF-CPUDT,

budat LIKE BKPF-budat,

belnr LIKE BKPF-BELNR,

gjahr LIKE BKPF-GJAHR,

END OF bkpf_rec.

DATA migo_data LIKE bkpf_rec occurs 0 with header line.

DATA: it_cat TYPE slis_t_fieldcat_alv,

wa_lay TYPE slis_layout_alv.

FIELD-SYMBOLS: <fs_cat> LIKE LINE OF it_cat.

SELECT-OPTIONS: so_bukrs FOR BKPF-BUKRS,

so_blart FOR BKPF-BLART,

so_cpudt FOR BKPF-CPUDT,

so_budat FOR BKPF-budat,

so_belnr FOR BKPF-BELNR,

so_gjahr FOR BKPF-GJAHR.

*include bdcrecx1.

start-of-selection.

SELECT bukrs blart cpudt budat belnr gjahr into table bkpf_rec from bkpf

where bukrs IN

so_bukrs and blart in so_blart and cpudt in so_cpudt and budat in

so_budat and belnr in so_belnr and gjahr in so_gjahr.

loop at bkpf_rec.

move-corresponding bkpf_rec to migo_data.

append migo_data.

endloop.

DATA: it_sortcat type slis_sortinfo_alv occurs 1,

wa_sort like line of it_sortcat.

wa_sort-spos = 1.

wa_sort-fieldname = 'bukrs'.

wa_sort-subtot = 'X'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sortcat.

wa_sort-spos = 2.

wa_sort-fieldname = 'belnr'.

wa_sort-subtot = 'X'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sortcat.

wa_lay-zebra = 'X'.

data: tmp_fc type slis_fieldcat_alv .

tmp_fc-reptext_ddic = 'CC'.

tmp_fc-fieldname = 'bukrs'.

tmp_fc-tabname = 'migo_data'.

tmp_fc-outputlen = 10.

tmp_fc-do_sum = space.

append tmp_fc to it_cat.

tmp_fc-reptext_ddic = 'Document number'.

tmp_fc-fieldname = 'belnr'.

tmp_fc-tabname = 'migo_data'.

tmp_fc-outputlen = 20.

tmp_fc-do_sum = space.

append tmp_fc to it_cat.

tmp_fc-reptext_ddic = 'Entry date'.

tmp_fc-fieldname = 'cpudt'.

tmp_fc-tabname = 'migo_data'.

tmp_fc-outputlen = 20.

tmp_fc-do_sum = space.

append tmp_fc to it_cat.

tmp_fc-reptext_ddic = 'Posting date'.

tmp_fc-fieldname = 'budat'.

tmp_fc-tabname = 'migo_data'.

tmp_fc-outputlen = 20.

tmp_fc-do_sum = space.

append tmp_fc to it_cat.

tmp_fc-reptext_ddic = 'Doc type'.

tmp_fc-fieldname = 'blart'.

tmp_fc-tabname = 'migo_data'.

tmp_fc-outputlen = 10.

tmp_fc-do_sum = space.

append tmp_fc to it_cat.

tmp_fc-reptext_ddic = 'Fiscal year'.

tmp_fc-fieldname = 'gjahr'.

tmp_fc-tabname = 'migo_data'.

tmp_fc-outputlen = 10.

tmp_fc-do_sum = space.

append tmp_fc to it_cat.

LOOP AT it_cat ASSIGNING <fs_cat>.

CLEAR <fs_cat>-key.

ENDLOOP.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_grid_title = 'Invoice selected'

is_layout = wa_lay

it_fieldcat = it_cat

it_sort = it_sortcat

TABLES

t_outtab = MIGO_DATA

EXCEPTIONS

program_error = 1

OTHERS = 2.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
557

Please capitalize all of your fields when building the field catalog.



You have this....

*
*
tmp_fc-reptext_ddic = 'Fiscal year'.
tmp_fc-fieldname = 'gjahr'.
tmp_fc-tabname = 'migo_data'.
tmp_fc-outputlen = 10.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.
*
*
It should be this....

*
*

tmp_fc-reptext_ddic = 'Fiscal year'.
<b>tmp_fc-fieldname = 'GJAHR'.
tmp_fc-tabname = 'MIGO_DATA'.</b>
tmp_fc-outputlen = 10.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.





REgards,

Rich Heilman

Read only

0 Likes
557

When building your sort catalog, make sure to include the tabname.



  wa_sort-spos = 1.
  wa_sort-fieldname = 'BUKRS'.
<b>  wa_sort-tabname = 'MIGO_DATA'.</b>
  wa_sort-subtot = 'X'.
  wa_sort-up = 'X'.
  append wa_sort to it_sortcat.

  wa_sort-spos = 2.
  wa_sort-fieldname = 'BELNR'.
<b>  wa_sort-tabname = 'MIGO_DATA'.</b>
  wa_sort-subtot = 'X'.
  wa_sort-up = 'X'.
  append wa_sort to it_sortcat.



Please make sure to award points and mark your post as solved. Thanks.

REgards,

Rich HEilman

Message was edited by: Rich Heilman

Message was edited by: Rich Heilman

Read only

Former Member
0 Likes
557

Look at:

Rob

Read only

Former Member
0 Likes
557

hi, you should aware that the runtime you wrote in your topic is inconsistent with the code you offer.

If runtime error is GETWA_NOT_ASSIGNED, please check the following code:


LOOP AT it_cat ASSIGNING <fs_cat>.
CLEAR <fs_cat>-key.
ENDLOOP.

but according to your code, you problem is due to the field name you fill in fieldcategory. They must be <b>Upper Case</b>. Because ALV read them in runtime, and runtime only recognize the Upper Case letter.

thanks