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

ALV - Call transction

Hi ,

I am using REUSE_ALV_GRID_DISPLAY to display ALV. My requirement is that when user selects a row and press change button (Custom created) it should take me to PP01.

The issue is in PP01 field PM0D1-SEARK doesnu2019t have Parameter ID. Is there any way to set parameter ID for this field.

Thnx.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 17, 2008 at 11:10 AM

    Hi,

    If there is no parameter ID, try using BDC and use the mode "E".

    Regards,

    Prabhu Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 10:57 AM

    hi,

    you can use SET PARAMETER ID pid FIELD dobj. to assign parameter id.

    Reward if useful.

    Regards

    Susheel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 11:05 AM

    Hi ,

    I can give you one sample alv code. where user can select the record and do forward navigation.

    *&----


    *

    *& Report ZSAND_SUBTOTAL *

    *& *

    &----


    *& *

    *& *

    &----


    REPORT ZSAND_SUBTOTAL LINE-COUNT 65 .

    *&----


    *& Report ZALV_LIST

    *&

    *&----


    *&

    *&

    *&----


    TABLES : mseg.

    TYPE-POOLS : slis.

    DATA : BEGIN OF itab OCCURS 0,

    mblnr LIKE mseg-mblnr,

    matnr LIKE mseg-matnr,

    werks LIKE mseg-werks,

    menge LIKE mseg-menge,

    line_color(4) TYPE c,

    END OF itab.

    DATA : BEGIN OF itab1 OCCURS 0,

    mblnr LIKE mseg-mblnr,

    matnr LIKE mseg-matnr,

    werks LIKE mseg-werks,

    menge LIKE mseg-menge,

    line_color(4) TYPE c,

    END OF itab1.

    data: it_sortcat type slis_sortinfo_alv occurs 1,

    wa_sort like line of it_sortcat.

    DATA: it_header TYPE slis_t_listheader,

    wa_header TYPE slis_listheader.

    data: var1(1).

    DATA var2.

    data:mytabix like sy-tabix.

    data:wtab1 like line of itab,

    wtab2 like line of itab.

    DATA : t_fcat TYPE slis_t_fieldcat_alv,

    t_eve TYPE slis_t_event,

    t_subtot TYPE slis_t_sortinfo_alv,

    subtot LIKE LINE OF t_subtot,

    wa_fcat LIKE LINE OF t_fcat,

    gd_layout TYPE slis_layout_alv.

    DATA : gt_menge LIKE mseg-menge,

    st_menge LIKE mseg-menge.

    data:it_extab type SLIS_t_EXTAB,

    wa_extab like line of it_extab.

    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

    SELECT-OPTIONS : doc FOR mseg-mblnr.

    SELECTION-SCREEN : END OF BLOCK blk1.

    START-OF-SELECTION.

    PERFORM build_cat USING t_fcat.

    PERFORM build_layout.

    PERFORM build_eve.

    perform fill_sort.

    PERFORM get_data.

    PERFORM display.

    *&----


    *& Form build_cat

    *&----


    *text

    *----


    *-->TEMP_FCAT text

    *----


    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.

    wa_fcat-tabname = 'ITAB'.

    wa_fcat-fieldname = 'MBLNR'.

    wa_fcat-seltext_m = 'Material Doc.'.

    APPEND wa_fcat TO temp_fcat.

    CLEAR wa_fcat.

    wa_fcat-tabname = 'ITAB'.

    wa_fcat-fieldname = 'MATNR'.

    wa_fcat-seltext_m = 'Material'.

    APPEND wa_fcat TO temp_fcat.

    CLEAR wa_fcat.

    wa_fcat-tabname = 'ITAB'.

    wa_fcat-fieldname = 'WERKS'.

    wa_fcat-seltext_m = 'Plant'.

    APPEND wa_fcat TO temp_fcat.

    CLEAR wa_fcat.

    wa_fcat-tabname = 'ITAB'.

    wa_fcat-fieldname = 'MENGE'.

    wa_fcat-seltext_m = 'Quantity'.

    wa_fcat-do_sum = 'Y'.

    APPEND wa_fcat TO temp_fcat.

    CLEAR wa_fcat.

    ENDFORM. "build_cat

    *&----


    *& Form build_eve

    *&----


    *text

    *----


    FORM build_eve.

    DATA : wa_eve TYPE slis_alv_event.

    data:mytabix type sy-tabix.

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    EXPORTING

    i_list_type = 0

    IMPORTING

    et_events = t_eve

    EXCEPTIONS

    list_type_wrong = 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.

    READ TABLE t_eve into wa_eve WITH KEY name = slis_ev_top_of_page.

    *INTO wa_eve.

    IF sy-subrc = 0.

    mytabix = sy-tabix.

    MOVE 'TOP_OF_PAGE' TO wa_eve-form.

    append wa_eve to t_eve.

    *modify t_eve from wa_eve index mytabix transporting form.

    ENDIF.

    READ TABLE t_eve into wa_eve WITH KEY name = slis_ev_end_of_page.

    *INTO wa_eve.

    IF sy-subrc = 0.

    mytabix = sy-tabix.

    MOVE 'END_OF_PAGE' TO wa_eve-form.

    append wa_eve to t_eve.

    *modify t_eve from wa_eve index mytabix transporting form.

    ENDIF.

    ENDFORM. "build_eve

    *&----


    *& Form build_layout

    *&----


    *text

    *----


    FORM build_layout.

    *gd_layout-no_input = 'X'.

    gd_layout-colwidth_optimize = 'X'.

    gd_layout-info_fieldname = 'LINE_COLOR'.

    gd_layout-subtotals_text = 'SUBTOTAL'.

    *gd_layout-totals_text = 'TOTAL'.

    gd_layout-EDIT = 'X'.

    ENDFORM. " BUILD_LAYOUT

    *&----


    *& Form get_data

    *&----


    *text

    *----


    FORM get_data.

    SELECT mblnr matnr werks menge FROM mseg INTO CORRESPONDING FIELDS OF

    TABLE itab

    WHERE mblnr IN doc.

    SORT itab BY mblnr.

    sort itab by mblnr matnr.

    read table itab into wtab1 index 1.

    mytabix = 1.

    loop at itab into wtab2 from 2.

    if wtab1-mblnr = wtab2-mblnr and wtab1-matnr = wtab2-matnr.

    wtab1-menge = wtab1-menge + wtab2-menge.

    modify itab from wtab1 index mytabix.

    else.

    modify itab from wtab1 index mytabix.

    clear wtab1.

    mytabix = sy-tabix.

    move wtab2 to wtab1.

    endif.

    clear wtab2.

    endloop.

    delete ADJACENT DUPLICATES from itab comparing mblnr matnr.

    ENDFORM. "get_data

    *&----


    *& Form display

    *&----


    *text

    *----


    FORM display.

    *

    wa_extab-fcode = '&ETA'.

    append wa_extab to it_extab.

    wa_header-typ = 'H'.

    wa_header-info = 'SANDY is Great'.

    append wa_header to it_header.

    clear wa_header.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    • I_INTERFACE_CHECK = ' '

    • I_BYPASSING_BUFFER = ' '

    • I_BUFFER_ACTIVE = ' '

    I_CALLBACK_PROGRAM = 'ZSAND_SUBTOTAL'

    • I_CALLBACK_PF_STATUS_SET = ' '

    I_CALLBACK_USER_COMMAND = 'USERCOMMAND'

    • I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

    • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

    • I_CALLBACK_HTML_END_OF_LIST = ' '

    • I_STRUCTURE_NAME =

    • I_BACKGROUND_ID = ' '

    • I_GRID_TITLE =

    • I_GRID_SETTINGS =

    IS_LAYOUT = gd_layout

    IT_FIELDCAT = t_fcat

    IT_EXCLUDING = it_extab

    • IT_SPECIAL_GROUPS =

    IT_SORT = it_sortcat

    • IT_FILTER =

    • IS_SEL_HIDE =

    • I_DEFAULT = 'X'

    • I_SAVE = ' '

    • IS_VARIANT =

    IT_EVENTS = t_eve[]

    • IT_EVENT_EXIT = 'BUILD_EVE'

    • IS_PRINT =

    • IS_REPREP_ID =

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • IT_ALV_GRAPHICS =

    • IT_HYPERLINK =

    • IT_ADD_FIELDCAT =

    • IT_EXCEPT_QINFO =

    • I_HTML_HEIGHT_TOP =

    • I_HTML_HEIGHT_END =

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    t_outtab = itab

    • 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.

    ENDFORM. "display

    *

    **&----


    ***& Form top_of_page

    *&----


    *

    *text

    *----


    FORM top_of_page.

    if var1 is initial.

    wa_header-typ = 'H'.

    wa_header-info = 'SANDY is Great'.

    append wa_header to it_header.

    clear wa_header.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    IT_LIST_COMMENTARY = it_header

    I_LOGO = 'HR_LOGO'

    • I_END_OF_LIST_GRID =

    .

    var1 = 'X'.

    endif.

    ENDFORM. "top_of_page

    FORM end_of_page.

    if var2 is initial.

    wa_header-typ = 'H'.

    wa_header-info = 'SANDY is Great'.

    append wa_header to it_header.

    clear wa_header.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    IT_LIST_COMMENTARY = it_header

    I_LOGO = 'HR_LOGO'

    • I_END_OF_LIST_GRID =

    .

    var2 = 'X'.

    endif.

    ENDFORM. "top_of_page

    &----


    *& Form fill_sort

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    form fill_sort .

    wa_sort-spos = 1.

    wa_sort-fieldname = 'MBLNR'.

    wa_sort-SUBTOT = 'X'. "subtotals any totals column by this field

    • gd_sortcat-tabname

    APPEND wa_sort TO it_sortcat.

    wa_sort-spos = 2.

    wa_sort-fieldname = 'MATNR'.

    • gd_sortcat-tabname

    APPEND wa_sort TO it_sortcat.

    endform. " fill_sort

    FORM status USING rt_extab TYPE slis_t_extab.

    set pf-status 'ZSTANDARD'.

    endform.

    form USERCOMMAND USING R_UCOMM type sy-ucomm

    rselfield type slis_selfield .

    set parameter id 'MAT' field rselfield-value .

    call transaction 'MM03' and skip first screen.

    endform.

    I hope this program willhelp you out.

    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.