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

Error in ALV

Dear Guru's,

I need your help.

I have written a code to display three ALV's in a single screen. But the method "set_table_for_first_display" is giving me a dump "GETWA_NOT_ASSIGNED".

I have shown the code here. Please help me out. I have used OO Concept.

{ls_fieldcatalog-fieldname = 'Rank'.

ls_fieldcatalog-ref_field = 'RANK'.

ls_fieldcatalog-ref_table = 'ZOVERALL'.

ls_fieldcatalog-DD_ROLL = 'RANK'.

APPEND ls_fieldcatalog to lt_fieldcatalog.

CLEAR ls_fieldcatalog.

ls_fieldcatalog-fieldname = 'Personnel No'.

ls_fieldcatalog-ref_field = 'PERNR'.

ls_fieldcatalog-ref_table = 'PA0001'.

ls_fieldcatalog-DD_ROLL = 'PERNR_D'.

APPEND ls_fieldcatalog to lt_fieldcatalog.

CLEAR ls_fieldcatalog.

ls_fieldcatalog-fieldname = 'Object ID'.

ls_fieldcatalog-ref_field = 'OBJID'.

ls_fieldcatalog-ref_table = '/SHSPE60/L001H71'.

ls_fieldcatalog-DD_ROLL = 'HROBJID'.

APPEND ls_fieldcatalog to lt_fieldcatalog.

CLEAR ls_fieldcatalog.

ls_fieldcatalog-fieldname = 'Score'.

ls_fieldcatalog-ref_field = 'ZTOT'.

ls_fieldcatalog-ref_table = 'ZOVERALL'.

APPEND ls_fieldcatalog to lt_fieldcatalog.

CLEAR ls_fieldcatalog.

ls_fieldcatalog-fieldname = 'Total'.

ls_fieldcatalog-ref_field = 'ZTOT'.

ls_fieldcatalog-ref_table = 'ZOVERALL'.

APPEND ls_fieldcatalog to lt_fieldcatalog.

CLEAR ls_fieldcatalog.

  • Set event handler

SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.

  • SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2.

  • SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3.

  • Display data

CALL METHOD go_grid1->set_table_for_first_display

CHANGING

it_outtab = it_overall

IT_FIELDCATALOG = LT_FIELDCATALOG

EXCEPTIONS

OTHERS = 4.

IF sy-subrc <> '0'.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.}

The o/p table is IT_OVERALL. But is has no dictionary structure it has 5 fields mentioned below.

With Warm Regards

Vijay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 12:05 PM

    Hi

    Check the name of the fields passed to field catalog and the ITAB.

    Make sure both are same

    Regards

    SHiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 12:44 PM

    Hi,

    ls_fieldcatalog-fieldname = 'Rank'.
    ls_fieldcatalog-ref_field = 'RANK'.
    ls_fieldcatalog-ref_table = 'ZOVERALL'.
    ls_fieldcatalog-DD_ROLL = 'RANK'.  *check this line RANK is a DDROLL or ref_field?*
    APPEND ls_fieldcatalog to lt_fieldcatalog.
    
    CLEAR ls_fieldcatalog.
    ls_fieldcatalog-fieldname = 'Personnel No'.
    ls_fieldcatalog-ref_field = 'PERNR'.
    ls_fieldcatalog-ref_table = 'PA0001'.
    ls_fieldcatalog-DD_ROLL = 'PERNR_D'.
    APPEND ls_fieldcatalog to lt_fieldcatalog.
    
    CLEAR ls_fieldcatalog.
    ls_fieldcatalog-fieldname = 'Object ID'.
    ls_fieldcatalog-ref_field = 'OBJID'.
    ls_fieldcatalog-ref_table = '/SHSPE60/L001H71'.
    ls_fieldcatalog-DD_ROLL = 'HROBJID'.
    
    APPEND ls_fieldcatalog to lt_fieldcatalog.
    CLEAR ls_fieldcatalog.
    ls_fieldcatalog-fieldname = 'Score'.
    ls_fieldcatalog-ref_field = 'ZTOT'.
    ls_fieldcatalog-ref_table = 'ZOVERALL'.
    
    APPEND ls_fieldcatalog to lt_fieldcatalog.
    CLEAR ls_fieldcatalog.
    ls_fieldcatalog-fieldname = 'Total'.
    ls_fieldcatalog-ref_field = 'ZTOT'.
    ls_fieldcatalog-ref_table = 'ZOVERALL'.
    
    
    APPEND ls_fieldcatalog to lt_fieldcatalog.
    CLEAR ls_fieldcatalog.
    
    
    Set event handler 
    SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
    
    SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2. 
    SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3. 
    
    Display data 
    
    CALL METHOD go_grid1->set_table_for_first_display
    
    CHANGING
    it_outtab = it_overall
    IT_FIELDCATALOG = LT_FIELDCATALOG
    EXCEPTIONS
    OTHERS = 4.
    IF sy-subrc '0'.
    
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO 
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 
    ENDIF.}
    
    The o/p table is IT_OVERALL. But is has no dictionary structure it has 5 fields mentioned below.
    
    {TYPES: BEGIN OF ty_overall,
    RANK TYPE I,
    pernr type pernr_d,
    objid type HROBJID,
    WEIGH TYPE P DECIMALS 2,
    TOTAL TYPE P DECIMALS 2,
    END OF ty_overall.
    
    DATA: IT_overall TYPE TABLE OF ty_overall,
    WA_overall TYPE ty_overall.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 12:02 PM

    Hello,

    Is your object go_grid1 initialized i.e. does it has any value.

    Thanks,

    Jayant

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 22, 2008 at 12:25 PM

    Hello Vijay,

    AFAIK you have to create a GUI Container and attach the same to your program. Please refer to the program BCALV_GRID_DEMO for details.

    I think you have not declared a container & are trying to display your grid 😊)

    BR,

    Suhas

    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.