Application Development 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: 

Displaying table using call function 'REUSE_ALV_GRID_DISPLAY'

Former Member
0 Kudos
700

I have created a table which has product code, product description, and product level. I am trying to display it using REUSE_ALV_GRID_DISPLAY. When I Check it, I get the following error message: "PVS2" is not an internal table - the "Occurs n" specification is missing.

Is it possible to copy PVS2 into another table, and then display that table using REUSE_ALV_GRID_DISPLAY?

I have patched together code from sdn, a client program, and my own code and I am starting to get confused. So, please help me.

Regards,

Al Lal


REPORT  YABHINAV16.

* program to display products at chosen level *

Tables: T179, T179t.

types:  begin of hierarchy,
        prodh type t179-prodh,
        vtext type t179t-vtext,
        stufe type t179-stufe,
        end of hierarchy.

types: begin of text,
prodh type t179t-prodh,
vtext type t179t-vtext,
end of text.

data: pvs type standard table of hierarchy initial size 0.
data: pvs2 type hierarchy.
data: it_text type standard table of text,
wa_text type text.




TYPE-POOLS:SLIS.

*For ALV

DATA: GT_FLD TYPE SLIS_T_FIELDCAT_ALV,
      GT_EV TYPE SLIS_T_EVENT,
      GT_HDR TYPE SLIS_T_LISTHEADER,
      GT_SORT TYPE SLIS_T_SORTINFO_ALV.

DATA: WA_FLD TYPE SLIS_FIELDCAT_ALV,
      WA_EV TYPE SLIS_ALV_EVENT,
      WA_HDR TYPE SLIS_LISTHEADER,
      WA_SORT TYPE SLIS_SORTINFO_ALV,
      WA_LAYOUT TYPE SLIS_LAYOUT_ALV.

DEFINE FLD.
  WA_FLD-FIELDNAME   = &1.
  WA_FLD-TABNAME     = &2.
  WA_FLD-OUTPUTLEN   = &3.
  WA_FLD-SELTEXT_L   = &4.
  WA_FLD-SELTEXT_M   = &5.
  WA_FLD-SELTEXT_S   = &6.
  WA_FLD-COL_POS     = &7.
  WA_FLD-FIX_COLUMN  = &8.
  WA_FLD-DO_SUM      = &9.
  APPEND WA_FLD TO GT_FLD.
  CLEAR WA_FLD.
END-OF-DEFINITION.


CONSTANTS: C_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
           C_USER_COMMAND            TYPE  SLIS_FORMNAME  VALUE 'USER_COMMAND'.
DATA: MTRL LIKE SY-REPID,
      TITLE LIKE SY-TITLE.




select-options level for t179-stufe no intervals.

start-of-selection.

Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.

select prodh vtext from t179t into corresponding fields of table it_text for all entries in pvs where prodh = pvs-prodh.

end-of-selection.

sort pvs by prodh.
sort it_text by prodh.

loop at pvs into pvs2.
  read table it_text into wa_text with key prodh = pvs2-prodh.
  if sy-subrc eq 0.
    pvs2-vtext = wa_text-vtext.
    write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.
  endif.
*  modify pvs2.
endloop.

perform BUILD_FIELDCAT.
perform GRID_DISPLAY.

form BUILD_FIELDCAT .
    FLD 'PRODH'   'PVS2'   '20'     'Product Hierarchy'        ' ' ' '  '1'  ''   '' .
    FLD 'VTEXT'   'PVS2'   '40'     'Description '        ' ' ' '  '3'  ''   '' .
    FLD 'STUFE'   'PVS2'    '5'    'Level'        ' ' ' '  '2'  ''   '' .
endform.                    " BUILD_FIELDCAT

form GRID_DISPLAY .
  call function 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = MTRL
      I_CALLBACK_USER_COMMAND = 'C_USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE  = C_TOP
      I_STRUCTURE_NAME        = 'PVS2'
      IS_LAYOUT               = WA_LAYOUT
      IT_FIELDCAT             = GT_FLD
      IT_SORT                 = GT_SORT
      I_DEFAULT               = 'X'
      I_SAVE                  = 'U'
      IT_EVENTS               = GT_EV
    TABLES
      T_OUTTAB                = PVS2[]
    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.                    " GRID_DISPLAY

12 REPLIES 12

Former Member
0 Kudos
314

Hi,

Change the line..

data: pvs2 type hierarchy.

into

data: pvs2 type standard table of hierarchy with header line.

Reward if helpful.

Regards.

Former Member
0 Kudos
314

Hi form the variabnle declaraion it seems

your internal table is pvs and pvs2 is a work area.

data: pvs type standard table of hierarchy initial size 0. "internal Table

data: pvs2 type hierarchy. "work Arae

so fill the values from pvs2 to pvs and then pass pvs to function module for alv.

0 Kudos
314

>

> Hi form the variabnle declaraion it seems

>

> your internal table is pvs and pvs2 is a work area.

>

> data: pvs type standard table of hierarchy initial size 0. "internal Table

> data: pvs2 type hierarchy. "work Arae

>

> so fill the values from pvs2 to pvs and then pass pvs to function module for alv.

I am really embarrased to admit this, but I have been trying to do this but I keep getting errors. So I would really appreciate it if someone can give me the code to fil the values from pvs2 into pvs.

I have only been teaching myself ABAP a few hours a day, for about one week, and I am still struggling.

Thanks,

Al Lal

0 Kudos
314

Hi,

Change the line..

data: pvs2 type hierarchy.

into

data: pvs2 type standard table of hierarchy with header line.

This is how you move the values from one itab to another. Here contents of pvs2 is moved to pvs.

pvs[]

=

pvs2[].

please have the last 3 statemtns in a single line.

Reward if helpful.

Regards.

Edited by: Akshay Raj on Mar 18, 2008 6:15 AM

0 Kudos
314

>

> Hi,

>

> Change the line..

>

> data: pvs2 type hierarchy.

>

> into

>

> data: pvs2 type standard table of hierarchy with header line.

>

>

> This is how you move the values from one itab to another. Here contents of pvs2 is moved to pvs.

>

> pvs[]

> =

> pvs2[].

>

> please have the last 3 statemtns in a single line.

>

> Reward if helpful.

>

> Regards.

>

> Edited by: Akshay Raj on Mar 18, 2008 6:15 AM

I am getting no output lines.

Please, someone give the correct code.

Al Lal

Former Member
0 Kudos
314

Hi,

You have pass internal table name to the function module 'REUSE_ALV_GRID_DISPLAY' in its tables parameters.In your case its pvs and not pvs2.

PVS2 is just a work area.

Hope this will help.

Regards

Shibin

Former Member
0 Kudos
314

Hi,

in reuse_alv_grid_display function module.

change

T_OUTTAB                = PVS[]

instead of T_OUTTAB = PVS2[]

rgds,

bharat.

Former Member
0 Kudos
314

TYPE-POOLS : SLIS.

DATA : BEGIN OF WA_T001,

BUKRS LIKE T001-BUKRS,

BUTXT LIKE T001-BUTXT,

ORT01 LIKE T001-ORT01,

END OF WA_T001,

IT_T001 LIKE TABLE OF WA_T001.

DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FCAT LIKE LINE OF IT_FCAT.

DATA : V_NAME LIKE SY-REPID.

SELECT BUKRS BUTXT ORT01 FROM T001 INTO TABLE IT_T001 UP TO 15 ROWS. V_NAME = SY-REPID.

CALL FUCTION MODULE 'REUSE_ALV_FIELDCATLOG_MERGE. EXPORTING I_CALBACK_PROGRAM =

V_NAME I_INTERAL_TABNAME = 'WA_T001' I_INCLNAME = V_NAME CHANGING CT_FIELDCAT =

IT_FCAT.

CALL FUNCTION MODULE "REUSE_ALV_GRID_DISPLAY"

EXPORTING

I_CALLBACK_PROGRAM = V_NAME

IT_FCAT = IT_FCAT.

TABLES

T_OUTTAB = IT_T001

SY-REPID IS THE SYSTEM VARIABLE WHICH IS HAVING THE ABAP PROGRAM

OR CURRENT MAIN PROGRAM.

----- Sample Progam -


----


***INCLUDE YRVR058_DEST_WISE_SUMMARY_DF01 .

----


&----


*& Form DISPLAY_DATA

&----


  • text *-- Rajesh Vasudeva

----


  • --> p1 text

  • <-- p2 text

----


FORM DISPLAY_DATA .

IF ITAB[] IS NOT INITIAL.

PERFORM F_APPEND_BLOCK.

ELSE.

MESSAGE 'Data not found for the selection

criteria' TYPE 'S'.

LEAVE LIST-PROCESSING.

ENDIF.

ENDFORM. " display_data

&----


*& Form f_append_block

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM F_APPEND_BLOCK .

DATA : L_WA_SORT TYPE SLIS_SORTINFO_ALV, "For

sort

L_WA_EVENTS TYPE SLIS_ALV_EVENT. "For

events

  • Event (Top of List)

CLEAR L_WA_EVENTS.

L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.

L_WA_EVENTS-FORM = C_TOPOFPAGE.

APPEND L_WA_EVENTS TO I_EVENTS_PART.

  • Event (Top of Page)

CLEAR L_WA_EVENTS.

L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.

L_WA_EVENTS-FORM = 'F_DISPLAY_HEADER_PARTA'(031).

"f_display_header_part

APPEND L_WA_EVENTS TO I_EVENTS_PART.

  • Event (End of List)

CLEAR L_WA_EVENTS.

L_WA_EVENTS-NAME = SLIS_EV_END_OF_LIST.

L_WA_EVENTS-FORM = C_END_OF_LIST.

APPEND L_WA_EVENTS TO I_EVENTS_PART.

  • Set Layout Zebra

STRUCT_LAYOUT-ZEBRA = 'X'.

STRUCT_LAYOUT-NUMC_SUM = 'X'.

STRUCT_LAYOUT-TOTALS_TEXT = 'TOTAL:'(032).

  • set field catalog

PERFORM F_FIELD_CATALOG_PART.

ASSIGN ITAB[] TO <F_OUTTAB>.

V_PART = 'A'. "initiating list is A

PERFORM F_DISPLAY_BLOCK USING STRUCT_LAYOUT

I_FIELD_CAT_PART[]

C_TAB

I_EVENTS_PART[]

I_SORT_PART[].

ENDFORM. " f_append_block

&----


*& Form f_field_catalog_part

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM F_FIELD_CATALOG_PART .

REFRESH I_FIELD_CAT_PART.

CLEAR I_FIELD_CAT_PART.

PERFORM F_CREATE_CATALOG USING :

*Month

C_TAB 'MONTH' 'MONTH' SPACE 'L' 7

I_FIELD_CAT_PART[],

*OBD

*C_TAB 'VBELN' 'Delivery' SPACE 'L' 12

I_FIELD_CAT_PART[],

*DATE

C_TAB 'WADAT_IST' 'Date' SPACE 'L' 10

I_FIELD_CAT_PART[],

*Destination

C_TAB 'CITY1' 'Destination' SPACE 'L' 25

I_FIELD_CAT_PART[],

*Qty By Road

C_TAB 'NTGEW_ROAD' 'Road Quantity' SPACE 'R' 16

I_FIELD_CAT_PART[],

*Rail Qty

C_TAB 'NTGEW_RAIL' 'Rail Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[],

*Total Qty C_TAB 'TOT' 'Total Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[], *RR/Trk No.

C_TAB 'EXTI2' 'Truck/RR No.' SPACE 'L' 17 I_FIELD_CAT_PART[].

ENDFORM. " f_field_catalog_part

&----


*& Form f_DISPLAY_block

&----


  • text

----


  • -->P_STRUCT_LAYOUT text

  • -->P_I_FIELD_CAT_PART[] text

  • -->P_C_TAB text

  • -->P_I_EVENTS_PART[] text

  • -->P_I_SORT_PART[] text

----


FORM F_DISPLAY_BLOCK USING FP_LAYOUT TYPE

SLIS_LAYOUT_ALV

FP_I_FCAT TYPE

SLIS_T_FIELDCAT_ALV

VALUE(FP_TABNAME) TYPE

ANY

FP_I_EVENTS TYPE

SLIS_T_EVENT

FP_I_SORT TYPE

SLIS_T_SORTINFO_ALV.

DATA: V_REPID TYPE SYREPID,

"current Program id

C_SAVE TYPE CHAR1 VALUE 'A'.

"variant save

V_REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = V_REPID

IS_LAYOUT = FP_LAYOUT

IT_FIELDCAT = FP_I_FCAT[]

IT_SORT = FP_I_SORT[]

I_SAVE = C_SAVE "variant

save

IT_EVENTS = FP_I_EVENTS[]

TABLES

T_OUTTAB = <F_OUTTAB>

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. " f_DISPLAY_block

&----


*& Form f_create_catalog

&----


  • text

----


  • -->P_C_TAB text

  • -->P_0085 text

  • -->P_0086 text

  • -->P_SPACE text

  • -->P_0088 text

  • -->P_5 text

  • -->P_I_FIELD_CAT_PART[] text

----


FORM F_CREATE_CATALOG USING FP_I_TABNAME TYPE

SLIS_TABNAME

FP_I_FIELDNAME TYPE SLIS_FIELDNAME

FP_I_SELTEXT TYPE

SCRTEXT_L

FP_I_DOSUM TYPE

CHAR1

FP_I_JUST TYPE C

FP_I_OUTPUTLEN TYPE

OUTPUTLEN

FP_I_FCAT TYPE

SLIS_T_FIELDCAT_ALV.

  • Record for field catalog

DATA: L_REC_FCAT TYPE SLIS_FIELDCAT_ALV.

L_REC_FCAT-TABNAME = FP_I_TABNAME.

L_REC_FCAT-FIELDNAME = FP_I_FIELDNAME.

L_REC_FCAT-SELTEXT_L = FP_I_SELTEXT.

L_REC_FCAT-DO_SUM = 'X'.

*l_rec_fcat-do_sum = ' '.

L_REC_FCAT-JUST = FP_I_JUST.

L_REC_FCAT-OUTPUTLEN = FP_I_OUTPUTLEN.

L_REC_FCAT-DECIMALS_OUT = '2'.

L_REC_FCAT-KEY = '1'.

APPEND L_REC_FCAT TO FP_I_FCAT.

ENDFORM. " f_create_catalog

***********************************************************************

  • Subroutines for Headings

***********************************************************************

&----


*& Form f_display_header_partA

&----


  • Display header for report for Part A

----


&----


*& Form top_of_page

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM TOP_OF_PAGE .

SKIP 1.

WRITE:/25 ' Name of Company ',80 'RUN DATE' ,

SY-DATUM.

  • SKIP 1.

  • WRITE:/60 'RUN DATE' , SY-DATUM.

SKIP 1.

DATA: YR(4) TYPE N,

FIN_PRD(10) TYPE C.

IF S_DTABF-LOW+4(2) LT '04'.

YR = S_DTABF-LOW+0(4) - 1.

CONCATENATE YR '-' S_DTABF-LOW+2(2) INTO FIN_PRD.

ELSE.

YR = S_DTABF-LOW+0(4) + 1.

CONCATENATE S_DTABF-LOW0(4) '-' YR2(2) INTO

FIN_PRD.

ENDIF.

WRITE:/5 'DETAILS OF THE MONTH/DATE WISE DESPATCHES

MADE BY ROAD/RAIL DURING THE YEAR ' , FIN_PRD .

SKIP 1.

  • WRITE 😕 'SALES OFFICE : ' , P_SALES,' ' , RNAME.

  • SKIP 1.

ENDFORM. " DISPLAY_DATA

Award Points If Useful...

Former Member
0 Kudos
314

Hi,

Refer to the following sample code. This is a simple example for ALV display.

&----


*& Form build_catalog

&----


  • To populate the field catalog

----


FORM build_catalog.

PERFORM populate_catalog USING:

'AUFNR' 'GT_DISPLAY' text-t04,

'WERKS' 'GT_DISPLAY' text-t05,

'PLNBEZ' 'GT_DISPLAY' text-t06,

'PRDHA' 'GT_DISPLAY' text-t07,

'AUART' 'GT_DISPLAY' text-t08,

'FEVOR' 'GT_DISPLAY' text-t09,

'DISPO' 'GT_DISPLAY' text-t10,

'ERDAT' 'GT_DISPLAY' text-t11,

'FTRMP' 'GT_DISPLAY' text-t12,

'FTRMI' 'GT_DISPLAY' text-t13,

'GSTRS' 'GT_DISPLAY' text-t14,

'GSTRI' 'GT_DISPLAY' text-t15,

'GLTRS' 'GT_DISPLAY' text-t16,

'GLTRI' 'GT_DISPLAY' text-t17.

ENDFORM. " build_catalog

&----


*& Form populate_catalog

&----


  • To populate field catalog

----


  • -->lp_fld_nam field name

  • -->lp_tabb_nam table name

  • -->lp_sel_txt selection text

----


FORM populate_catalog USING lp_fld_nam

lp_tab_nam

lp_sel_txt.

  • Local data declaration

DATA lwa_catalog TYPE slis_fieldcat_alv.

  • Passing values to the catalog table

lwa_catalog-fieldname = lp_fld_nam.

lwa_catalog-tabname = lp_tab_nam.

lwa_catalog-seltext_m = lp_sel_txt.

  • Appending it to the catalog table

APPEND lwa_catalog TO gt_catalog.

CLEAR lwa_catalog.

ENDFORM. "populate_catalog

FORM display_output .

gf_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gf_repid

it_fieldcat = gt_catalog

TABLES

t_outtab = gt_display

EXCEPTIONS

program_error = 1

OTHERS = 2.

endform.

Reward if helpful.

Regards,

Ramya

Former Member
0 Kudos
314

Hi,

Just change the name to PSV[] from PSV2[] in the function module

"REUSE_ALV_GRID_DISPLAY" parameter "T_OUTTAB".

AND use either grid display or

loop at pvs into pvs2.

read table it_text into wa_text with key prodh = pvs2-prodh.

if sy-subrc eq 0.

pvs2-vtext = wa_text-vtext.

write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.

endif.

  • modify pvs2.

endloop.

if u use both u can get the output first in GRID format,

and normal display while click on back from grid display.

Reward,if it is useful.

Thanks,

Chandu.

Former Member
0 Kudos
314

Hi i have made some changes in your program and now its working fine. Please check the code and run the same code it will work ......if still u have any problem pls let me know

Tables: T179, T179t.

types: begin of hierarchy,

prodh type t179-prodh,

vtext type t179t-vtext,

stufe type t179-stufe,

end of hierarchy.

types: begin of text,

prodh type t179t-prodh,

vtext type t179t-vtext,

end of text,

*Table to collect the data to be displayed.

BEGIN OF ty_final,

prodh TYPE T179-prodh,

vtext TYPE T179t-vtext ,

END OF ty_final.

data: i_final type standard table of ty_final .

data: pvs type standard table of hierarchy .

data: pvs2 type hierarchy.

data: it_text type standard table of text,

wa_text type text.

TYPE-POOLS:SLIS.

*For ALV

DATA: GT_FLD TYPE SLIS_T_FIELDCAT_ALV,

GT_EV TYPE SLIS_T_EVENT,

GT_HDR TYPE SLIS_T_LISTHEADER,

GT_SORT TYPE SLIS_T_SORTINFO_ALV.

DATA: WA_FLD TYPE SLIS_FIELDCAT_ALV,

WA_EV TYPE SLIS_ALV_EVENT,

WA_HDR TYPE SLIS_LISTHEADER,

WA_SORT TYPE SLIS_SORTINFO_ALV,

WA_LAYOUT TYPE SLIS_LAYOUT_ALV.

DATA:

w_i_lines TYPE i ,

ws_fieldcat TYPE slis_fieldcat_alv,

lt_fieldcat TYPE slis_t_fieldcat_alv.

DEFINE FLD.

WA_FLD-FIELDNAME = &1.

WA_FLD-TABNAME = &2.

WA_FLD-OUTPUTLEN = &3.

WA_FLD-SELTEXT_L = &4.

WA_FLD-SELTEXT_M = &5.

WA_FLD-SELTEXT_S = &6.

WA_FLD-COL_POS = &7.

WA_FLD-FIX_COLUMN = &8.

WA_FLD-DO_SUM = &9.

APPEND WA_FLD TO GT_FLD.

CLEAR WA_FLD.

END-OF-DEFINITION.

CONSTANTS: C_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',

C_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.

DATA: MTRL LIKE SY-REPID,

TITLE LIKE SY-TITLE.

DATA: ws_repid LIKE sy-repid.

select-options level for t179-stufe no intervals.

start-of-selection.

Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.

select prodh vtext from t179t into corresponding fields of table it_text for all entries in pvs where prodh = pvs-prodh.

end-of-selection.

sort pvs by prodh.

sort it_text by prodh.

loop at pvs into pvs2.

read table it_text into wa_text with key prodh = pvs2-prodh.

if sy-subrc eq 0.

pvs2-vtext = wa_text-vtext.

  • write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.

endif.

APPEND pvs2 TO i_final.

endloop.

perform BUILD_FIELDCAT.

perform GRID_DISPLAY.

form BUILD_FIELDCAT .

  • FLD 'PRODH' 'PVS2' '20' 'Product Hierarchy' ' ' ' ' '1' '' '' .

  • FLD 'VTEXT' 'PVS2' '40' 'Description ' ' ' ' ' '3' '' '' .

  • FLD 'STUFE' 'PVS2' '5' 'Level' ' ' ' ' '2' '' '' .

ws_fieldcat-col_pos = '1'.

ws_fieldcat-fieldname = 'PRODH'.

ws_fieldcat-tabname = 'I_FINAL'.

ws_fieldcat-seltext_l = 'PRO. Hierarchy'.

APPEND ws_fieldcat TO lt_fieldcat.

CLEAR: ws_fieldcat.

ws_fieldcat-col_pos = '2'.

ws_fieldcat-fieldname = 'VTEXT'.

ws_fieldcat-tabname = 'I_FINAL'.

ws_fieldcat-seltext_l = 'Description'.

APPEND ws_fieldcat TO lt_fieldcat.

CLEAR: ws_fieldcat.

endform. " BUILD_FIELDCAT

form GRID_DISPLAY .

call function 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = ws_repid

is_layout = wa_layout

it_fieldcat = lt_fieldcat[]

TABLES

t_outtab = i_final.

  • I_CALLBACK_PROGRAM = MTRL

  • I_CALLBACK_USER_COMMAND = 'C_USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = C_TOP

  • I_STRUCTURE_NAME = 'PVS2'

  • IS_LAYOUT = WA_LAYOUT

  • IT_FIELDCAT = GT_FLD

  • IT_SORT = GT_SORT

  • I_DEFAULT = 'X'

  • I_SAVE = 'U'

  • IT_EVENTS = GT_EV

  • TABLES

  • T_OUTTAB = i_final[].

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

Former Member
0 Kudos
314

Hi Abhinav,

You have declared internal table PVS2 as follows-

data: PVS2 type hierarchy.

Now what happens PVS2 is not considered as an internal table but

considered as structure.

So you have to declare the the internal table as follows-

data: PVS2 type standard table of hierarchy initial size 0.

I think this may remove your problem.

Ok take care and bye.