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

REUSE_ALV_HIERSEQ_LIST_DISPLAY

Hi,

in the is_keyinfo field i m passing the i_keyinfo internal table, which has the following data: -

DATA: i_keyinfo TYPE STANDARD TABLE OF slis_keyinfo_alv,

wa_keyinfo type slis_keyinfo_alv.

wa_keyinfo-header01 = 'EBELN'.

wa_keyinfo-item01 = 'EBELN'.

wa_keyinfo-header02 = ' '.

wa_keyinfo-item02 = 'VBELN'.

wa_keyinfo-header03 = ' '.

wa_keyinfo-item03 = 'POSNR'.

wa_keyinfo-header04 = ' '.

wa_keyinfo-item04 = 'KWMENG'.

wa_keyinfo-header05 = ' '.

wa_keyinfo-item05 = 'PKWMENG'.

append wa_keyinfo to i_keyinfo.

where EBELN is the key in both the internal tables...

But I am getting a dump - "The function module interface allows you to specify only

fields of a particular type under "IS_KEYINFO".

The field "I_KEYINFO" specified here is a different

field type"

could any1 help me out on this....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 29, 2007 at 12:14 PM

    Hi, Check this sample code.

    report ztest_alv_hierarcy.

    type-pools: slis.

    data:l_params type pri_params,

    l_valid type c.

    types: begin of ty_vbak,

    vbeln type vbeln,

    erdat type erdat,

    netwr type netwr,

    waerk type waerk,

    end of ty_vbak.

    types: begin of ty_vbap,

    check,

    vbeln type vbeln,

    posnr type posnr,

    arktx type arktx,

    netwr type netwr,

    end of ty_vbap.

    &----


    data: w_vbak type ty_vbak.

    data: t_vbak type standard table of ty_vbak with header line.

    data: w_vbap type ty_vbap.

    data: t_vbap type standard table of ty_vbap with header line.

    &----


    data: w_fcat type slis_fieldcat_alv.

    data: t_fcat type slis_t_fieldcat_alv.

    data: it_events type slis_t_event,

    x_event type slis_alv_event.

    &----


    constants: c_vbak type slis_tabname value 'W_VBAK'.

    constants: c_vbap type slis_tabname value 'W_VBAP'.

    &----


    data: w_keyinfo type slis_keyinfo_alv.

    w_keyinfo-header01 = 'VBELN'.

    w_keyinfo-item01 = 'VBELN'.

    &----


    w_fcat-col_pos = 1.

    w_fcat-fieldname = 'VBELN'.

    w_fcat-seltext_m = 'ORDER NO'.

    w_fcat-tabname = 'W_VBAK'.

    append w_fcat to t_fcat.

    w_fcat-col_pos = 2.

    w_fcat-fieldname = 'ERDAT'.

    w_fcat-seltext_m = 'DATE'.

    w_fcat-tabname = 'W_VBAK'.

    append w_fcat to t_fcat.

    w_fcat-col_pos = 3.

    w_fcat-fieldname = 'NETWR'.

    w_fcat-seltext_m = 'ORDER VALUE'.

    w_fcat-tabname = 'W_VBAK'.

    append w_fcat to t_fcat.

    w_fcat-col_pos = 4.

    w_fcat-fieldname = 'CHECK'.

    w_fcat-seltext_m = 'Select'.

    w_fcat-tabname = 'W_VBAP'.

    w_fcat-checkbox = 'X'.

    w_fcat-input = 'X'.

    w_fcat-edit = 'X'.

    append w_fcat to t_fcat.

    clear w_fcat.

    w_fcat-col_pos = 5.

    w_fcat-fieldname = 'POSNR'.

    w_fcat-seltext_m = 'ITEM NO'.

    w_fcat-tabname = 'W_VBAP'.

    append w_fcat to t_fcat.

    w_fcat-col_pos = 7.

    w_fcat-fieldname = 'ARKTX'.

    w_fcat-seltext_l = 'DESCRIPTION'.

    w_fcat-tabname = 'W_VBAP'.

    append w_fcat to t_fcat.

    w_fcat-col_pos = 8.

    w_fcat-fieldname = 'NETWR'.

    w_fcat-seltext_m = 'ITEM VALUE'.

    w_fcat-tabname = 'W_VBAP'.

    append w_fcat to t_fcat.

    &----


    select-options: ordno for w_vbap-vbeln.

    &--


    SELEC HEADER DATA AND SORT--


    select vbeln

    erdat

    netwr

    up to 10 rows

    from vbak

    into corresponding fields of table t_vbak

    where vbeln in ordno.

    delete t_vbak where vbeln = ''.

    sort t_vbak by vbeln.

    &--


    SELEC ITEM DATA AND SORT--


    select

    vbeln

    posnr

    arktx

    netwr

    from vbap

    into corresponding fields of table t_vbap

    for all entries in t_vbak

    where vbeln = t_vbak-vbeln.

    sort t_vbap by posnr.

    x_event-form = 'END_OF_LIST'.

    x_event-name = 'END_OF_LIST'.

    append x_event to it_events.

    call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

    exporting

    i_callback_program = sy-repid

    it_fieldcat = t_fcat

    i_tabname_header = c_vbak

    i_tabname_item = c_vbap

    is_keyinfo = w_keyinfo

    it_events = it_events

    tables

    t_outtab_header = t_vbak

    t_outtab_item = t_vbap.

    Regards

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2007 at 12:16 PM

    Im Keyinfo you need to specify only the common key to header and item table.

    replace the same as shown below.

    wa_keyinfo-header01 = 'EBELN'.

    wa_keyinfo-item01 = 'EBELN'.

    wa_keyinfo-header02 = ' '.

    wa_keyinfo-item02 = 'VBELN'.

    wa_keyinfo-header03 = ' '.

    wa_keyinfo-item03 = 'POSNR'.

    wa_keyinfo-header04 = ' '.

    wa_keyinfo-item04 = 'KWMENG'.

    wa_keyinfo-header05 = ' '.

    wa_keyinfo-item05 = 'PKWMENG'.

    append wa_keyinfo to i_keyinfo.

    to

    wa_keyinfo-header01 = 'EBELN'.

    wa_keyinfo-item01 = 'EBELN'.

    append wa_keyinfo to i_keyinfo.

    I expect the Program will work Fine.

    Reward if useful.

    Vijai

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 29, 2007 at 12:20 PM

    HI,

    IS_KEYINFO is not an internal table, its a structure

    you cannot append it..

    <b>eg:

    • define keyinfo

    CLEAR GS_KEYINFO.

    GS_KEYINFO-HEADER01 = 'NAME'.

    GS_KEYINFO-ITEM01 = 'CONTROL_NAME'.

    GS_KEYINFO-HEADER02 = SPACE.

    GS_KEYINFO-ITEM02 = SPACE.</b>

    The IS_KEYINFO Type below

    types: begin of slis_keyinfo_alv,

    header01 type slis_fieldname,

    item01 type slis_fieldname,

    header02 type slis_fieldname,

    item02 type slis_fieldname,

    header03 type slis_fieldname,

    item03 type slis_fieldname,

    header04 type slis_fieldname,

    item04 type slis_fieldname,

    header05 type slis_fieldname,

    item05 type slis_fieldname,

    end of slis_keyinfo_alv.

    Pass your values as mentioned in the example above in bold.

    rewards if useful,

    regards,

    nazeer

    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.