Skip to Content
author's profile photo Former Member
Former Member

alv runtime error

Hallow I do a simple alv report that I take from se 83 example

And I have RUNTIME ERROR what it can be

What I doing wrong mybe I forget somtihg .

<b>This is the

Error analysis</b>

You attempted to access an unassigned field symbol

(data segment 32820).

This error may occur if

- You address a typed field symbol before it has been set with

ASSIGN

- You address a field symbol that pointed to the line of an

internal table that was deleted

- You address a field symbol that was previously reset using

UNASSIGN or that pointed to a local field that no

longer exists

- You address a global function interface, although the

respective function module is not active - that is, is

not in the list of active calls. The list of active calls

can be taken from this short dump.

<b>This is Source Code Extract</b>

macro_cell_data_get

<ls_fcat>

<ls_data>

<l_field_value>

ls_lvc_data-value.

new API

if ir_salv_adapter is bound.

clear ls_lvc_data-style.

or

if g_gui_type ne 1.

if <ls_fcat>-key eq abap_true.

ls_lvc_data-style = alv_style_color_int_key.

elseif l_style_color is initial

and ( <ls_fcat>-emphasize is initial or

<ls_fcat>-emphasize = '$' ).

if <ls_stin>-counter is initial.

ls_lvc_data-style = alv_style_color_normal.

else.

. <b>this is my definition in the program</b>

&----


*& Module PBO OUTPUT

&----


  • text

----


MODULE pbo OUTPUT.

SET PF-STATUS 'MAIN100'.

IF g_custom_container IS INITIAL.

CREATE OBJECT g_custom_container

EXPORTING container_name = g_container.

CREATE OBJECT grid1

EXPORTING i_parent = g_custom_container.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'YHR_EX_TEKEN_STR'

CHANGING

it_outtab = teken_itab.

ENDIF.

ENDMODULE. " PBO OUTPUT

&----


*& Module PAI INPUT

&----


  • text

----


MODULE pai INPUT.

  • to react on oi_custom_events:

  • call method cl_gui_cfw=>dispatch.

CASE ok_code.

WHEN 'EXIT'.

PERFORM exit_program.

WHEN OTHERS.

  • do nothing

ENDCASE.

CLEAR ok_code.

ENDMODULE. " PAI INPUT

----


  • FORM EXIT_PROGRAM *

----


FORM exit_program.

  • CALL METHOD G_CUSTOM_CONTAINER->FREE.

  • CALL METHOD CL_GUI_CFW=>FLUSH.

LEAVE PROGRAM.

ENDFORM. "EXIT_PROGRAM

Thankes for your time and answers

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 09:40 AM

    Hello,

    U need to assign the field symbol to any structure before u process the field symbol.

    Like this

    <b>1. ASSIGN f TO <fs>.

    2. ASSIGN COMPONENT idx/name OF STRUCTURE struc TO <fs>.

    3. ASSIGN LOCAL COPY OF ... f TO<fs>.

    4. Dynamic ASSIGN

    a. ASSIGN (f) TO <fs>.

    b. ASSIGN TABLE FIELD (f) TO <fs>.

    c. ASSIGN LOCAL COPY OF MAIN TABLE FIELD (f) TO <fs>.

    d. ASSIGN LOCAL COPY OF ... (f) TO <fs>.

    5. ASSIGN dref->* TO <fs>.</b>

    If useful reward.

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 09:48 AM

    Hi,

    To declare a field symbol, use the statement

    FIELD-SYMBOLS <FS> [<type>|STRUCTURE <s> DEFAULT <wa>].

    For field symbols, the angle brackets are part of the syntax. They identify field symbols in the program code.

    If you do not specify any additions, the field symbol <FS> can have data objects of any type assigned to it. When you assign a data object, the field symbol inherits its technical attributes. The data type of the assigned data object becomes the actual data type of the field symbol.

    Check the sample code:

    TYPES: BEGIN OF line,

    col1 TYPE c,

    col2 TYPE c,

    END OF line.

    DATA: wa TYPE line,

    itab TYPE HASHED TABLE OF line WITH UNIQUE KEY col1,

    key(4) TYPE c VALUE 'COL1'.

    FIELD-SYMBOLS <fs> TYPE ANY TABLE.

    ASSIGN itab TO <fs>.

    READ TABLE <fs> WITH TABLE KEY (key) = 'X' INTO wa.

    Hope this helps.

    keerthi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2007 at 10:33 AM

    field symbol errors in ALV are usually down to fieldcat columns incorrectly defined. Check your internal table fields of the table you pass to the alv FM against the columns defined in the fieldcat

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.