Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

dump during alv report execution

Former Member
0 Likes
2,165

Hi Guru's,

Please help me out in this issue..

Runtime Errors         DYN_TABLE_ILL_COMP_VAL

Except.                CX_SY_DYN_TABLE_ILL_COMP_VAL

ABAP Program           SAPLKKBL

Program looks as follows

REPORT  ZMOD_DEMO1 no STANDARD PAGE HEADING.

TYPE-POOLS : slis.

TYPES : BEGIN OF ty_ekko,

          ebeln TYPE ebeln,

          bsart TYPE bsart,

          bstyp TYPE bstyp,

          ernam TYPE ernam,

         END OF ty_ekko,

         BEGIN OF ty_ekpo,

          ebeln TYPE ebeln,

          ebelp TYPE ebelp,

          matnr TYPE matnr,

          netwr TYPE netwr,

         END OF ty_ekpo,

         BEGIN OF ty_mara,

          matnr TYPE matnr,

          mtart TYPE mtart,

        END OF ty_mara,

        BEGIN OF ty_out,

         ebeln TYPE ekko-ebeln,

         ebelp type ebelp,

         ernam TYPE ernam,

         bstyp TYPE bstyp,

         netwr TYPE netwr,

         matnr TYPE matnr,

         mtart TYPE mtart,

        END OF ty_out.

DATA : w_ekko TYPE ty_ekko,

        w_ekpo TYPE ty_ekpo,

        w_mara TYPE ty_mara,

        w_out  TYPE ty_out,

        t_ekko TYPE STANDARD TABLE OF ty_ekko,

        t_ekpo TYPE STANDARD TABLE OF ty_ekpo,

        t_mara TYPE STANDARD TABLE OF ty_mara,

        t_out  TYPE STANDARD TABLE OF ty_out.

DATA : t_field TYPE slis_t_fieldcat_alv,

        w_field TYPE slis_fieldcat_alv,

        t_sort TYPE slis_t_sortinfo_alv,

        w_sort TYPE slis_sortinfo_alv,

        w_layout TYPE slis_layout_alv,

        w_disvariant TYPE disvariant.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS : s_ebeln FOR w_ekko-ebeln.

SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

   SELECT ebeln

          bsart

          bstyp

          ernam

     FROM ekko

     INTO TABLE t_ekko

     WHERE ebeln IN s_ebeln.

   IF sy-subrc = 0.

     SELECT ebeln

            ebelp

            matnr

            netwr

       FROM ekpo

       INTO TABLE t_ekpo

       FOR ALL ENTRIES IN t_ekko

       WHERE ebeln = t_ekko-ebeln.

     IF sy-subrc = 0.

       SELECT matnr

              mtart

         FROM mara

         INTO TABLE t_mara

         FOR ALL ENTRIES IN t_ekpo

         WHERE matnr = t_ekpo-matnr.

     ENDIF.

   ENDIF.

END-OF-SELECTION.

   LOOP AT t_ekko INTO w_ekko.

     READ TABLE t_ekko INTO w_ekko WITH KEY ebeln = w_ekpo-ebeln.

     IF sy-subrc = 0.

*      w_out-vbeln = w_vbak-vbeln.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

         EXPORTING

           input  = w_ekko-ebeln

         IMPORTING

           output = w_out-ebeln.

       w_out-bstyp = w_ekko-bstyp.

       w_out-ernam = w_ekko-ernam.

       w_out-ebelp = w_ekpo-ebelp.

       w_out-matnr = w_ekpo-matnr.

       w_out-netwr = w_ekpo-netwr.

       READ TABLE t_mara INTO w_mara WITH KEY matnr = w_ekpo-matnr.

       IF sy-subrc = 0.

         w_out-mtart = w_mara-mtart.

       ENDIF.

     ENDIF.

     APPEND w_out TO t_out.

   ENDLOOP.

   PERFORM fill_fieldcatlog USING : 'eBELN' 'Purchase Order',

                                    'bstyp' 'PO Type',

                                    'ernam' 'Created by',

                                    'eblep' 'Item',

                                    'NETWR' 'Net Qty',

                                    'MATNR' 'Material',

                                    'NETWR' 'Net price',

                                    'MTART' 'Mat Group'.

   w_sort-fieldname = 'eBELN'.

   w_sort-up = 'X'.

   w_sort-subtot = 'X'.

   APPEND w_sort TO t_sort.

   w_layout-colwidth_optimize = 'X'.

   DATA : lv_prog TYPE sy-repid.

   lv_prog = sy-repid.

   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

    i_callback_program                = lv_prog

*   I_CALLBACK_PF_STATUS_SET          = ' '

*   I_CALLBACK_USER_COMMAND           = ' '

    i_callback_top_of_page            = 'TOP_OF_PAGE1'

*   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                         = w_layout

      it_fieldcat                       = t_field

*   IT_EXCLUDING                      =

*   IT_SPECIAL_GROUPS                 =

    it_sort                           = t_sort

*   IT_FILTER                         =

*   IS_SEL_HIDE                       =

*   i_default                         = 'X'

    i_save                            = 'X'

    is_variant                        = w_disvariant

*   IT_EVENTS                         =

*   IT_EVENT_EXIT                     =

*   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

*   I_HTML_HEIGHT_TOP                 = 0

*   I_HTML_HEIGHT_END                 = 0

*   IT_ALV_GRAPHICS                   =

*   IT_HYPERLINK                      =

*   IT_ADD_FIELDCAT                   =

*   IT_EXCEPT_QINFO                   =

*   IR_SALV_FULLSCREEN_ADAPTER        =

* IMPORTING

*   E_EXIT_CAUSED_BY_CALLER           =

*   ES_EXIT_CAUSED_BY_USER            =

     TABLES

       t_outtab                          = t_out

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

*&---------------------------------------------------------------------*

*&      Form  FILL_FIELDCATLOG

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM fill_fieldcatlog USING : p_pos TYPE sy-cucol

                               p_field TYPE slis_fieldname

                               p_text TYPE dd03p-scrtext_m.

   w_field-col_pos = p_pos.

   w_field-fieldname = p_field.

   IF p_field = 'NETWR'.

     w_field-do_sum = 'X'.

   ENDIF.

   w_field-seltext_s = p_text.

   APPEND w_field TO t_field.

   CLEAR w_field.

ENDFORM.                    " FILL_FIELDCATLOG

*&---------------------------------------------------------------------*

*&      Form  top_of_page1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM top_of_page1.

   DATA : lt_list TYPE slis_t_listheader,

          lw_list TYPE slis_listheader.

   lw_list-typ = 'H'.

   lw_list-info = 'Purchase Order Details'.

   APPEND lw_list TO lt_list.

   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

     EXPORTING

       input  = s_ebeln-low

     IMPORTING

       output = s_ebeln-low.

   lw_list-typ = 'S'.

   lw_list-key = 'Purchase Order'.

   CONCATENATE s_ebeln-low 'to' s_ebeln-high INTO lw_list-info SEPARATED BY space.

   APPEND lw_list TO lt_list.

   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

     EXPORTING

       it_list_commentary       = lt_list

*   I_LOGO                   =

*   I_END_OF_LIST_GRID       =

*   I_ALV_FORM               =

        .

ENDFORM.                    "top_of_page1

Hi Guru's,

Please help me out in this issue..

Runtime Errors         DYN_TABLE_ILL_COMP_VAL

Except.                CX_SY_DYN_TABLE_ILL_COMP_VAL

ABAP Program           SAPLKKBL

Program looks as follows

REPORT  ZMOD_DEMO1 no STANDARD PAGE HEADING.

TYPE-POOLS : slis.

TYPES : BEGIN OF ty_ekko,

          ebeln TYPE ebeln,

          bsart TYPE bsart,

          bstyp TYPE bstyp,

          ernam TYPE ernam,

         END OF ty_ekko,

         BEGIN OF ty_ekpo,

          ebeln TYPE ebeln,

          ebelp TYPE ebelp,

          matnr TYPE matnr,

          netwr TYPE netwr,

         END OF ty_ekpo,

         BEGIN OF ty_mara,

          matnr TYPE matnr,

          mtart TYPE mtart,

        END OF ty_mara,

        BEGIN OF ty_out,

         ebeln TYPE ekko-ebeln,

         ebelp type ebelp,

         ernam TYPE ernam,

         bstyp TYPE bstyp,

         netwr TYPE netwr,

         matnr TYPE matnr,

         mtart TYPE mtart,

        END OF ty_out.

DATA : w_ekko TYPE ty_ekko,

        w_ekpo TYPE ty_ekpo,

        w_mara TYPE ty_mara,

        w_out  TYPE ty_out,

        t_ekko TYPE STANDARD TABLE OF ty_ekko,

        t_ekpo TYPE STANDARD TABLE OF ty_ekpo,

        t_mara TYPE STANDARD TABLE OF ty_mara,

        t_out  TYPE STANDARD TABLE OF ty_out.

DATA : t_field TYPE slis_t_fieldcat_alv,

        w_field TYPE slis_fieldcat_alv,

        t_sort TYPE slis_t_sortinfo_alv,

        w_sort TYPE slis_sortinfo_alv,

        w_layout TYPE slis_layout_alv,

        w_disvariant TYPE disvariant.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS : s_ebeln FOR w_ekko-ebeln.

SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

   SELECT ebeln

          bsart

          bstyp

          ernam

     FROM ekko

     INTO TABLE t_ekko

     WHERE ebeln IN s_ebeln.

   IF sy-subrc = 0.

     SELECT ebeln

            ebelp

            matnr

            netwr

       FROM ekpo

       INTO TABLE t_ekpo

       FOR ALL ENTRIES IN t_ekko

       WHERE ebeln = t_ekko-ebeln.

     IF sy-subrc = 0.

       SELECT matnr

              mtart

         FROM mara

         INTO TABLE t_mara

         FOR ALL ENTRIES IN t_ekpo

         WHERE matnr = t_ekpo-matnr.

     ENDIF.

   ENDIF.

END-OF-SELECTION.

   LOOP AT t_ekko INTO w_ekko.

     READ TABLE t_ekko INTO w_ekko WITH KEY ebeln = w_ekpo-ebeln.

     IF sy-subrc = 0.

*      w_out-vbeln = w_vbak-vbeln.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

         EXPORTING

           input  = w_ekko-ebeln

         IMPORTING

           output = w_out-ebeln.

       w_out-bstyp = w_ekko-bstyp.

       w_out-ernam = w_ekko-ernam.

       w_out-ebelp = w_ekpo-ebelp.

       w_out-matnr = w_ekpo-matnr.

       w_out-netwr = w_ekpo-netwr.

       READ TABLE t_mara INTO w_mara WITH KEY matnr = w_ekpo-matnr.

       IF sy-subrc = 0.

         w_out-mtart = w_mara-mtart.

       ENDIF.

     ENDIF.

     APPEND w_out TO t_out.

   ENDLOOP.

   PERFORM fill_fieldcatlog USING : 'eBELN' 'Purchase Order',

                                    'bstyp' 'PO Type',

                                    'ernam' 'Created by',

                                    'eblep' 'Item',

                                    'NETWR' 'Net Qty',

                                    'MATNR' 'Material',

                                    'NETWR' 'Net price',

                                    'MTART' 'Mat Group'.

   w_sort-fieldname = 'eBELN'.

   w_sort-up = 'X'.

   w_sort-subtot = 'X'.

   APPEND w_sort TO t_sort.

   w_layout-colwidth_optimize = 'X'.

   DATA : lv_prog TYPE sy-repid.

   lv_prog = sy-repid.

   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

    i_callback_program                = lv_prog

*   I_CALLBACK_PF_STATUS_SET          = ' '

*   I_CALLBACK_USER_COMMAND           = ' '

    i_callback_top_of_page            = 'TOP_OF_PAGE1'

*   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                         = w_layout

      it_fieldcat                       = t_field

*   IT_EXCLUDING                      =

*   IT_SPECIAL_GROUPS                 =

    it_sort                           = t_sort

*   IT_FILTER                         =

*   IS_SEL_HIDE                       =

*   i_default                         = 'X'

    i_save                            = 'X'

    is_variant                        = w_disvariant

*   IT_EVENTS                         =

*   IT_EVENT_EXIT                     =

*   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

*   I_HTML_HEIGHT_TOP                 = 0

*   I_HTML_HEIGHT_END                 = 0

*   IT_ALV_GRAPHICS                   =

*   IT_HYPERLINK                      =

*   IT_ADD_FIELDCAT                   =

*   IT_EXCEPT_QINFO                   =

*   IR_SALV_FULLSCREEN_ADAPTER        =

* IMPORTING

*   E_EXIT_CAUSED_BY_CALLER           =

*   ES_EXIT_CAUSED_BY_USER            =

     TABLES

       t_outtab                          = t_out

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

*&---------------------------------------------------------------------*

*&      Form  FILL_FIELDCATLOG

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM fill_fieldcatlog USING : p_pos TYPE sy-cucol

                               p_field TYPE slis_fieldname

                               p_text TYPE dd03p-scrtext_m.

   w_field-col_pos = p_pos.

   w_field-fieldname = p_field.

   IF p_field = 'NETWR'.

     w_field-do_sum = 'X'.

   ENDIF.

   w_field-seltext_s = p_text.

   APPEND w_field TO t_field.

   CLEAR w_field.

ENDFORM.                    " FILL_FIELDCATLOG

*&---------------------------------------------------------------------*

*&      Form  top_of_page1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM top_of_page1.

   DATA : lt_list TYPE slis_t_listheader,

          lw_list TYPE slis_listheader.

   lw_list-typ = 'H'.

   lw_list-info = 'Purchase Order Details'.

   APPEND lw_list TO lt_list.

   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

     EXPORTING

       input  = s_ebeln-low

     IMPORTING

       output = s_ebeln-low.

   lw_list-typ = 'S'.

   lw_list-key = 'Purchase Order'.

   CONCATENATE s_ebeln-low 'to' s_ebeln-high INTO lw_list-info SEPARATED BY space.

   APPEND lw_list TO lt_list.

   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

     EXPORTING

       it_list_commentary       = lt_list

*   I_LOGO                   =

*   I_END_OF_LIST_GRID       =

*   I_ALV_FORM               =

        .

ENDFORM.                    "top_of_page1

12 REPLIES 12
Read only

Former Member
0 Likes
1,993

Check the value that you have assigned to t_sort internal table. Try passing the fieldname as 'ebeln'.

~Srini

Read only

Former Member
0 Likes
1,993

all the fields that you are passing to fill_fieldcatlog routine should be in capital. it should be BSTYP,  ERNAM & EBELP.

Read only

Former Member
0 Likes
1,993

When you fill the field name in the field catalog all field names should be captialized.

   PERFORM fill_fieldcatlog USING : 'eBELN' 'Purchase Order',

                                    'bstyp' 'PO Type',

                                    'ernam' 'Created by',

                                    'eblep' 'Item',

                                    'NETWR' 'Net Qty',

                                    'MATNR' 'Material',

                                    'NETWR' 'Net price',

                                    'MTART' 'Mat Group'.

Regards,

Steve

Read only

Former Member
0 Likes
1,993

just use the salv_om model, there is no field catalog at all! It will use the dictionary definitions by default and it is easy to change them if necessary.

You can find a basic example here: http://zevolving.com/2008/09/salv-table-1-normal-alv-table-display/

You can also search for a SAP package (*SALV_OM*), which has several examples with it.

Also, it is ok to use an INNER JOIN. It is more efficient and easier to read than a bunch of "select for all entries in" statements. Every time you have a select it has to open a connection to the database, find the results and transfer them back.

Read only

former_member209120
Active Contributor
0 Likes
1,993

Hi Pavan Kumar,

Just make changes like this

TYPE-POOLS : slis.



TYPES : BEGIN OF ty_ekko,

           ebeln TYPE ebeln,

           bsart TYPE bsart,

           bstyp TYPE bstyp,

           ernam TYPE ernam,

          END OF ty_ekko,



          BEGIN OF ty_ekpo,

           ebeln TYPE ebeln,

           ebelp TYPE ebelp,

           matnr TYPE matnr,

           netwr TYPE netwr,

          END OF ty_ekpo,



          BEGIN OF ty_mara,

           matnr TYPE matnr,

           mtart TYPE mtart,

         END OF ty_mara,



         BEGIN OF ty_out,

          ebeln TYPE ekko-ebeln,

          ebelp type ebelp,

          ernam TYPE ernam,

          bstyp TYPE bstyp,

          netwr TYPE netwr,

          matnr TYPE matnr,

          mtart TYPE mtart,

         END OF ty_out.



DATA : w_ekko TYPE ty_ekko,

         w_ekpo TYPE ty_ekpo,

         w_mara TYPE ty_mara,

         w_out  TYPE ty_out,



         t_ekko TYPE STANDARD TABLE OF ty_ekko,

         t_ekpo TYPE STANDARD TABLE OF ty_ekpo,

         t_mara TYPE STANDARD TABLE OF ty_mara,

         t_out  TYPE STANDARD TABLE OF ty_out.





DATA : t_field TYPE slis_t_fieldcat_alv,

         w_field TYPE slis_fieldcat_alv,



         t_sort TYPE slis_t_sortinfo_alv,

         w_sort TYPE slis_sortinfo_alv,



         w_layout TYPE slis_layout_alv,

         w_disvariant TYPE disvariant.



SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS : s_ebeln FOR w_ekko-ebeln.

SELECTION-SCREEN END OF BLOCK b1.



START-OF-SELECTION.



    SELECT ebeln

           bsart

           bstyp

           ernam

      FROM ekko

      INTO TABLE t_ekko

      WHERE ebeln IN s_ebeln.

    IF sy-subrc = 0.

      SELECT ebeln

             ebelp

             matnr

             netwr

        FROM ekpo

        INTO TABLE t_ekpo

        FOR ALL ENTRIES IN t_ekko

        WHERE ebeln = t_ekko-ebeln.

      IF sy-subrc = 0.

        SELECT matnr

               mtart

          FROM mara

          INTO TABLE t_mara

          FOR ALL ENTRIES IN t_ekpo

          WHERE matnr = t_ekpo-matnr.

      ENDIF.

    ENDIF.



END-OF-SELECTION.



    LOOP AT t_ekko INTO w_ekko.

      READ TABLE t_ekko INTO w_ekko WITH KEY ebeln = w_ekpo-ebeln.

      IF sy-subrc = 0.

*      w_out-vbeln = w_vbak-vbeln.



        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

          EXPORTING

            input  = w_ekko-ebeln

          IMPORTING

            output = w_out-ebeln.



        w_out-bstyp = w_ekko-bstyp.

        w_out-ernam = w_ekko-ernam.



        w_out-ebelp = w_ekpo-ebelp.

        w_out-matnr = w_ekpo-matnr.

        w_out-netwr = w_ekpo-netwr.



        READ TABLE t_mara INTO w_mara WITH KEY matnr = w_ekpo-matnr.

        IF sy-subrc = 0.

          w_out-mtart = w_mara-mtart.

        ENDIF.

      ENDIF.

      APPEND w_out TO t_out.

    ENDLOOP.





    PERFORM fill_fieldcatlog USING : 'EBELN' 'Purchase Order',

                                     'BSTYP' 'PO Type',

                                     'ERNAM' 'Created by',

                                     'EBLEP' 'Item',

                                     'NETWR' 'Net Qty',

                                     'MATNR' 'Material',

                                     'NETWR' 'Net price',

                                     'MTART' 'Mat Group'.



    w_sort-fieldname = 'EBELN'.

    w_sort-up = 'X'.

    w_sort-subtot = 'X'.

    APPEND w_sort TO t_sort.



    w_layout-colwidth_optimize = 'X'.



    DATA : lv_prog TYPE sy-repid.



    lv_prog = sy-repid.



    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

     EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

     i_callback_program                = lv_prog

*   I_CALLBACK_PF_STATUS_SET          = ' '

*   I_CALLBACK_USER_COMMAND           = ' '

     i_callback_top_of_page            = 'TOP_OF_PAGE1'

*   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                         = w_layout

       it_fieldcat                       = t_field

*   IT_EXCLUDING                      =

*   IT_SPECIAL_GROUPS                 =

     it_sort                           = t_sort

*   IT_FILTER                         =

*   IS_SEL_HIDE                       =

*   i_default                         = 'X'

     i_save                            = 'X'

     is_variant                        = w_disvariant

*   IT_EVENTS                         =

*   IT_EVENT_EXIT                     =

*   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

*   I_HTML_HEIGHT_TOP                 = 0

*   I_HTML_HEIGHT_END                 = 0

*   IT_ALV_GRAPHICS                   =

*   IT_HYPERLINK                      =

*   IT_ADD_FIELDCAT                   =

*   IT_EXCEPT_QINFO                   =

*   IR_SALV_FULLSCREEN_ADAPTER        =

* IMPORTING

*   E_EXIT_CAUSED_BY_CALLER           =

*   ES_EXIT_CAUSED_BY_USER            =

      TABLES

        t_outtab                          = t_out

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

*&---------------------------------------------------------------------*

*&      Form  FILL_FIELDCATLOG

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM fill_fieldcatlog USING : p_pos TYPE sy-cucol

                                p_field TYPE slis_fieldname

                                p_text TYPE dd03p-scrtext_m.





    w_field-col_pos = p_pos.

    w_field-fieldname = p_field.

    IF p_field = 'NETWR'.

      w_field-do_sum = 'X'.

    ENDIF.

    w_field-seltext_s = p_text.

    APPEND w_field TO t_field.

    CLEAR w_field.



ENDFORM.                    " FILL_FIELDCATLOG





*&---------------------------------------------------------------------*

*&      Form  top_of_page1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM top_of_page1.



    DATA : lt_list TYPE slis_t_listheader,

           lw_list TYPE slis_listheader.



    lw_list-typ = 'H'.

    lw_list-info = 'Purchase Order Details'.

    APPEND lw_list TO lt_list.



    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

      EXPORTING

        input  = s_ebeln-low

      IMPORTING

        output = s_ebeln-low.





    lw_list-typ = 'S'.

    lw_list-key = 'Purchase Order'.

    CONCATENATE s_ebeln-low 'to' s_ebeln-high INTO lw_list-info SEPARATED BY space.

    APPEND lw_list TO lt_list.



    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

      EXPORTING

        it_list_commentary       = lt_list

*   I_LOGO                   =

*   I_END_OF_LIST_GRID       =

*   I_ALV_FORM               =

         .

ENDFORM.                    "top_of_page1

Read only

0 Likes
1,993

Hi Ramesh

It would be better to post only the code change that you are suggesting, instead of posting entire modified code.

For example, you have changed below lines:

PERFORM fill_fieldcatlog USING : 1  'eBELN' 'Purchase Order',

2  'bstyp' 'PO Type',

3  'ernam' 'Created by',

5  'eblep' 'Item',

...

w_sort-fieldname = 'eBELN'.

to this:

PERFORM fill_fieldcatlog USING : 1  'EBELN' 'Purchase Order',

2  'BSTYP' 'PO Type',

3  'ERNAM' 'Created by',

5  'EBLEP' 'Item',

...

w_sort-fieldname = 'EBELN'.

Read only

Former Member
0 Likes
1,993

Hi Pavan, Please try to use global structures(create in se11), other than using local structure, in alv.

Read only

Former Member
0 Likes
1,993

Hi Guru's

Programs has been executed but not getting desired output...

the following output as follows. unable to get the desired figures on the output.

Read only

0 Likes
1,993

Hello

May people have already suggested good information.

One thing i suggest is to debug the code

put break point and go into the code

especially

Steps:

  • check the internal table
  • check the fieldcatalog that its populated accordingly!!
  • does the output match the fieldcatalog?

generally display issue is due to the field catalog

your top of page callback seems to work at least you can see that there is the header in your ALV

Read only

0 Likes
1,993

hi pavan , change accordingly


LOOP AT t_ekko INTO w_ekko. "  change here as loop at t_ekpo into wa_ekpo

Suresh


  


Read only

former_member206479
Participant
0 Likes
1,993

Hi Pavan,

Please look into your internal table LOOP.

   LOOP AT t_ekko INTO w_ekko.

     READ TABLE t_ekko INTO w_ekko WITH KEY ebeln = w_ekpo-ebeln.

     IF sy-subrc = 0.

*      w_out-vbeln = w_vbak-vbeln.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

         EXPORTING

           input  = w_ekko-ebeln

         IMPORTING

           output = w_out-ebeln.

       w_out-bstyp = w_ekko-bstyp.

       w_out-ernam = w_ekko-ernam.

       w_out-ebelp = w_ekpo-ebelp.

       w_out-matnr = w_ekpo-matnr.

       w_out-netwr = w_ekpo-netwr.

       READ TABLE t_mara INTO w_mara WITH KEY matnr = w_ekpo-matnr.

       IF sy-subrc = 0.

         w_out-mtart = w_mara-mtart.

       ENDIF.

     ENDIF.

     APPEND w_out TO t_out.

   ENDLOOP.

You need to loop t_ekpo not t_ekko. please change the code like below Highlighted

LOOP AT t_ekpo INTO w_ekpo.

     READ TABLE t_ekko INTO w_ekko WITH KEY ebeln = w_ekpo-ebeln.

     IF sy-subrc = 0.

*      w_out-vbeln = w_vbak-vbeln.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

         EXPORTING

           input  = w_ekko-ebeln

         IMPORTING

           output = w_out-ebeln.

       w_out-bstyp = w_ekko-bstyp.

       w_out-ernam = w_ekko-ernam.

       w_out-ebelp = w_ekpo-ebelp.

       w_out-matnr = w_ekpo-matnr.

       w_out-netwr = w_ekpo-netwr.

       READ TABLE t_mara INTO w_mara WITH KEY matnr = w_ekpo-matnr.

       IF sy-subrc = 0.

         w_out-mtart = w_mara-mtart.

       ENDIF.

     ENDIF.

     APPEND w_out TO t_out.

   clear : w_mara,w_ekpo,w_ekko.

   ENDLOOP.

Regards,

Venkat

Read only

0 Likes
1,993

Dear venkat,

thanks for your suggestion and problem has been resolved and getting output.

cheers.