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

values from alv hierarchical list display

hi all,

i need to display sme values from vbak and vbap tables in ALV hierarchical list display.if i click on the sales order of the header, it should directly go to the second screen of transaction VA03 with the sales details displayed..

i got the parameter id, how can i assign the selected sales order value to this parameter id?...

regards,

Hamsa Priya

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 04:41 AM

    Hi,

    Check this example..Marked in bold..

    TYPE-POOLS: slis.

    DATA: BEGIN OF itab OCCURS 0,

    vbeln TYPE vbeln,

    expand,

    END OF itab.

    DATA: BEGIN OF itab1 OCCURS 0,

    vbeln TYPE vbeln,

    posnr TYPE posnr,

    matnr TYPE matnr,

    netpr TYPE netpr,

    END OF itab1.

    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.

    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.

    s_fieldcatalog-col_pos = '1'.

    s_fieldcatalog-fieldname = 'VBELN'.

    s_fieldcatalog-tabname = 'ITAB'.

    s_fieldcatalog-rollname = 'VBELN'.

    s_fieldcatalog-outputlen = '12'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '1'.

    s_fieldcatalog-fieldname = 'VBELN'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'VBELN'.

    s_fieldcatalog-outputlen = '12'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '2'.

    s_fieldcatalog-fieldname = 'POSNR'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'POSNR'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '3'.

    s_fieldcatalog-fieldname = 'MATNR'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'MATNR'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '4'.

    s_fieldcatalog-fieldname = 'NETPR'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'NETPR'.

    s_fieldcatalog-do_sum = 'X'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    DATA: s_layout TYPE slis_layout_alv.

    s_layout-subtotals_text = 'SUBTOTAL TEXT'.

    s_layout-key_hotspot = 'X'.

    s_layout-expand_fieldname = 'EXPAND'.

    SELECT vbeln UP TO 100 ROWS

    FROM

    vbak

    INTO TABLE itab

    WHERE vbeln > '0060000040'.

    IF NOT itab[] IS INITIAL.

    SELECT vbeln posnr matnr netpr

    FROM vbap

    INTO TABLE itab1

    FOR ALL ENTRIES IN itab

    WHERE vbeln = itab-vbeln.

    ENDIF.

    DATA: v_repid TYPE syrepid.

    v_repid = sy-repid.

    DATA: s_keyinfo TYPE slis_keyinfo_alv.

    s_keyinfo-header01 = 'VBELN'.

    s_keyinfo-item01 = 'VBELN'.

    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

    EXPORTING

    i_callback_program = v_repid

    <b> i_callback_user_command = 'USER_COMMAND'</b>

    is_layout = s_layout

    it_fieldcat = t_fieldcatalog

    i_tabname_header = 'ITAB'

    i_tabname_item = 'ITAB1'

    is_keyinfo = s_keyinfo

    TABLES

    t_outtab_header = itab

    t_outtab_item = itab1

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

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

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

    ENDIF.

    <b>FORM user_command USING ucomm LIKE sy-ucomm

    selfield TYPE slis_selfield.

    IF ucomm = '&IC1' AND selfield-fieldname = 'VBELN'.

    READ TABLE itab INDEX selfield-tabindex.

    IF sy-subrc = 0.

    • document

    SET PARAMETER ID 'AUN' FIELD itab-vbeln.

    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

    ENDIF.

    ENDIF.

    ENDFORM.</b>

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 04:30 AM

    Hi,

    Use the following piece of code:

    CASE p_ucomm.

    WHEN '&IC1'.

    CASE wa_field.

    WHEN 'VBELN'.

    l_vbeln = wa_value.

    SET PARAMETER ID 'VBELN' FIELD l_vbeln.

    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 04:35 AM

    try with this

    AT LINE-SELECTION.

    GET CURSOR FIELD w_me23 VALUE w_ebeln.

    SET PARAMETER ID 'BES' FIELD w_ebeln.

    IF w_me23 = 'W_EBELN'.

    CALL TRANSACTION 'ME23N'.

    ENDIF.

    add marks if helpful

    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.