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

urgent requirement to develop a blocked

hi all

can any one will send an example for blocked alvs

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 Jun 18, 2008 at 01:40 PM

    REPORT ZPR_02.

    TYPE-POOLS: SLIS.

    ----


    • Tables Declaration.

    ----


    TABLES: MARA.

    ----


    *Internal tables and data declaration.

    ----


    DATA: BEGIN OF IT_MARA OCCURS 0,

    MATNR LIKE MARA-MATNR,

    MTART LIKE MARA-MTART,

    MBRSH LIKE MARA-MBRSH,

    END OF IT_MARA,

    BEGIN OF IT_MARC OCCURS 0,

    MATNR LIKE MARC-MATNR,

    WERKS LIKE MARC-WERKS,

    EKGRP LIKE MARC-EKGRP,

    END OF IT_MARC,

    BEGIN OF IT_MARD OCCURS 0,

    MATNR LIKE MARD-MATNR,

    WERKS LIKE MARD-WERKS,

    LGORT LIKE MARD-LGORT,

    LABST LIKE MARD-LABST,

    END OF IT_MARD.

    DATA: WA_FIELD_CAT TYPE SLIS_FIELDCAT_ALV,

    IT_FIELD_CAT1 TYPE SLIS_T_FIELDCAT_ALV,

    IT_FIELD_CAT2 TYPE SLIS_T_FIELDCAT_ALV,

    IT_FIELD_CAT3 TYPE SLIS_T_FIELDCAT_ALV,

    WA_KEYINFO TYPE SLIS_KEYINFO_ALV,

    IT_LAYOUT TYPE SLIS_LAYOUT_ALV,

    IT_EVENTS1 TYPE SLIS_T_EVENT WITH HEADER LINE,

    IT_EVENTS2 TYPE SLIS_T_EVENT WITH HEADER LINE,

    IT_EVENTS3 TYPE SLIS_T_EVENT WITH HEADER LINE.

    ----


    *Selection Screen.

    ----


    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.

    ----


    *Start Of selection.

    ----


    START-OF-SELECTION.

    *Selecting the data.

    PERFORM SELECT_DATA.

    *Populating the field catelogue.

    PERFORM BUILD_FIELD_CAT.

    *Displaying the final output.

    PERFORM DISPLY_OUTPUT.

    &----


    *& Form Select_data

    &----


    • Selecting the data.

    ----


    FORM SELECT_DATA .

    SELECT MATNR

    MTART

    MBRSH FROM MARA

    INTO TABLE IT_MARA

    WHERE MATNR IN S_MATNR.

    IF NOT IT_MARA[] IS INITIAL.

    SELECT MATNR

    WERKS

    EKGRP FROM MARC

    INTO TABLE IT_MARC

    FOR ALL ENTRIES IN IT_MARA

    WHERE MATNR EQ IT_MARA-MATNR.

    ENDIF.

    IF NOT IT_MARC[] IS INITIAL.

    SELECT MATNR

    WERKS

    LGORT

    LABST FROM MARD

    INTO TABLE IT_MARD

    FOR ALL ENTRIES IN IT_MARC

    WHERE MATNR = IT_MARC-MATNR

    AND WERKS = IT_MARC-WERKS.

    ENDIF.

    ENDFORM. " Select_data

    &----


    *& Form Build_field_cat

    &----


    • Populating the field catelogue.

    ----


    FORM BUILD_FIELD_CAT .

    DEFINE M_FIELDCAT1.

    WA_FIELD_CAT-TABNAME = &1.

    WA_FIELD_CAT-FIELDNAME = &2.

    WA_FIELD_CAT-SELTEXT_L = &3.

    APPEND WA_FIELD_CAT TO IT_FIELD_CAT1.

    END-OF-DEFINITION.

    DEFINE M_FIELDCAT2.

    WA_FIELD_CAT-TABNAME = &1.

    WA_FIELD_CAT-FIELDNAME = &2.

    WA_FIELD_CAT-SELTEXT_L = &3.

    APPEND WA_FIELD_CAT TO IT_FIELD_CAT2.

    END-OF-DEFINITION.

    DEFINE M_FIELDCAT3.

    WA_FIELD_CAT-TABNAME = &1.

    WA_FIELD_CAT-FIELDNAME = &2.

    WA_FIELD_CAT-SELTEXT_L = &3.

    APPEND WA_FIELD_CAT TO IT_FIELD_CAT3.

    END-OF-DEFINITION.

    M_FIELDCAT1 'MARA' 'MATNR' 'Material No'.

    M_FIELDCAT1 'MARA' 'MTART' 'Material type'.

    M_FIELDCAT1 'MARA' 'MBRSH' 'Industry Sector'.

    M_FIELDCAT2 'MARC' 'MATNR' 'Material No'.

    M_FIELDCAT2 'MARC' 'WERKS' 'Plant'.

    M_FIELDCAT2 'MARC' 'EKGRP' 'Purchasing Group'.

    M_FIELDCAT3 'MARD' 'MATNR' 'Material No'.

    M_FIELDCAT3 'MARD' 'WERKS' 'Plant'.

    M_FIELDCAT3 'MARD' 'LGORT' 'Storage Loc'.

    M_FIELDCAT3 'MARD' 'LABST' 'Valued Stock'.

    IT_EVENTS1-NAME = 'TOP_OF_PAGE'.

    IT_EVENTS1-FORM = 'F_TOP_OF_PAGE_ONE'.

    APPEND IT_EVENTS1.

    CLEAR IT_EVENTS1.

    IT_EVENTS2-NAME = 'TOP_OF_PAGE'.

    IT_EVENTS2-FORM = 'F_TOP_OF_PAGE_TWO'.

    APPEND IT_EVENTS2.

    CLEAR IT_EVENTS2.

    IT_EVENTS3-NAME = 'TOP_OF_PAGE'.

    IT_EVENTS3-FORM = 'F_TOP_OF_PAGE_THREE'.

    APPEND IT_EVENTS3.

    CLEAR IT_EVENTS3.

    ENDFORM. " Build_field_cat

    &----


    *& Form disply_output

    &----


    • Displaying the final output.

    ----


    FORM DISPLY_OUTPUT .

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

    EXPORTING

    I_CALLBACK_PROGRAM = SY-REPID.

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = IT_LAYOUT

    IT_FIELDCAT = IT_FIELD_CAT1[]

    I_TABNAME = 'IT_MARA'

    IT_EVENTS = IT_EVENTS1[]

    • IT_SORT = IT_SORT

    • I_TEXT = ' '

    TABLES

    T_OUTTAB = IT_MARA .

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = IT_LAYOUT

    IT_FIELDCAT = IT_FIELD_CAT2[]

    I_TABNAME = 'IT_MARC'

    IT_EVENTS = IT_EVENTS2[]

    • IT_SORT = IT_SORT

    • I_TEXT = ' '

    TABLES

    T_OUTTAB = IT_MARC .

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = IT_LAYOUT

    IT_FIELDCAT = IT_FIELD_CAT3[]

    I_TABNAME = 'IT_MARD'

    IT_EVENTS = IT_EVENTS3[]

    • IT_SORT = IT_SORT

    • I_TEXT = ' '

    TABLES

    T_OUTTAB = IT_MARD .

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

    • EXPORTING

    • I_INTERFACE_CHECK = ' '

    • IS_PRINT = IS_PRINT

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER

    • ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER

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

    &----


    *& Form top_of_page_one

    &----


    • text

    ----


    FORM F_TOP_OF_PAGE_ONE.

    WRITE: / 'Header details (MARA)'.

    ENDFORM. "top_of_page_one

    &----


    *& Form top_of_page_one

    &----


    • text

    ----


    FORM F_TOP_OF_PAGE_TWO.

    WRITE: / 'Item details (MARC)'.

    ENDFORM. "top_of_page_one

    &----


    *& Form top_of_page_one

    &----


    • text

    ----


    FORM F_TOP_OF_PAGE_THREE.

    WRITE: / 'Item details (MARD)'.

    ENDFORM. "top_of_page_one

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 01:40 PM

    Hi,

    Check the link below:

    http://www.saptechnical.com/Tutorials/ALV/BlockedList/DemoPrg.htm

    Hope this would be helpful..

    Regards,

    Sharath

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 01:46 PM

    hi

    go to this link it explain u properly gud example

    http://saptechnical.com/Tutorials/ALV/BlockedList/DemoPrg.htm

    PLZ REWARD POINTS

    CHeers

    Snehi

    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.