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: 

REUSE_ALV_GRID_DISPLAY Details(&ETA)

Former Member
0 Kudos

Dear.

I have a problem that in the pop-up window after doulble click one item in ALV list, there are not display whole field of ALV LIST.

Could you help me?

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi,

Do you know this , the Poup Doesn't show the columns <b>which are Blank or don't have value or Zeroes or 0.00</b>all these columns it will exclude and show the rest of the columns.

did you observe this.if not check it.

Regards

vijay

6 REPLIES 6

Former Member
0 Kudos

HI You Seob Koh,

Just check this sample code,

report ZXX_alvexer5 .

type-pools:slis.

*FIELDCATALOG

data : it_fieldcat type slis_t_fieldcat_alv,

it_fieldcat1 type slis_t_fieldcat_alv.

*BILLING MASTER TABLE

data: begin of itab occurs 0,

vbeln like vbrk-vbeln,

waerk like vbrk-waerk,

vkorg like vbrk-vkorg,

fkdat like vbrk-fkdat,

netwr like vbrk-netwr,

end of itab.

data: begin of itab1 occurs 0,

vbeln like vbrp-vbeln,

posnr like vbrp-posnr,

fkimg like vbrp-fkimg,

vrkme like vbrp-vrkme,

netwr like vbrp-netwr,

matnr like vbrp-matnr,

arktx like vbrp-arktx,

end of itab1.

data: it_vbrp like itab1 occurs 0 with header line.

select vbeln

waerk

vkorg

fkdat

netwr

up to 100 rows

from vbrk

into table itab.

if sy-subrc = 0.

sort itab by vbeln .

select

vbeln

posnr

fkimg

vrkme

netwr

matnr

arktx

into table itab1

from vbrp

for all entries in itab

where vbeln = itab-vbeln.

endif.

data: x_fieldcat type slis_fieldcat_alv.

x_fieldcat-fieldname = 'VBELN'.

x_fieldcat-tabname = 'ITAB'.

x_fieldcat-col_pos = 1.

append x_fieldcat to it_fieldcat.

clear x_fieldcat.

x_fieldcat-fieldname = 'WAERK'.

x_fieldcat-tabname = 'ITAB'.

x_fieldcat-col_pos = 2.

append x_fieldcat to it_fieldcat.

clear x_fieldcat.

clear x_fieldcat.

x_fieldcat-fieldname = 'VKORG'.

x_fieldcat-tabname = 'ITAB'.

x_fieldcat-col_pos = 3.

append x_fieldcat to it_fieldcat.

clear x_fieldcat.

clear x_fieldcat.

x_fieldcat-fieldname = 'FKDAT'.

x_fieldcat-tabname = 'ITAB'.

x_fieldcat-col_pos = 4.

append x_fieldcat to it_fieldcat.

clear x_fieldcat.

clear x_fieldcat.

x_fieldcat-fieldname = 'NETWR'.

x_fieldcat-tabname = 'ITAB'.

x_fieldcat-col_pos = 5.

append x_fieldcat to it_fieldcat.

clear x_fieldcat.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = sy-repid

i_callback_pf_status_set = 'POPUP'

i_callback_user_command = 'HANDLE_USER_COMMAND'

it_fieldcat = it_fieldcat

tables

t_outtab = itab

exceptions

program_error = 1

others = 2.

if sy-subrc = 0.

endif.

&----


*& Form POPUP

&----


  • text

----


  • -->P_EXTAB text

----


form popup using p_extab type slis_t_extab.

*- Pf status

set pf-status 'POPUP'.

endform. " POPUP

&----


*& Form HANDLE_USER_COMMAND

&----


  • text

----


  • -->R_UCOMM text

  • -->RS_SELFIELD text

----


form handle_user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

clear it_vbrp[]

.

if rs_selfield-fieldname = 'VBELN'.

read table itab index rs_selfield-tabindex.

loop at itab1 where vbeln = itab-vbeln.

move-corresponding itab1 to it_vbrp.

append it_vbrp.

endloop.

perform interactive_report.

endif.

endcase.

endform. "HANDLE_USER_COMMAND

&----


*& Form interactive_report

&----


  • text

----


form interactive_report .

x_fieldcat-fieldname = 'VBELN'.

x_fieldcat-seltext_l = 'BILLING DOC'.

x_fieldcat-tabname = 'IT_VBRP'.

x_fieldcat-col_pos = 1.

append x_fieldcat to it_fieldcat1.

clear x_fieldcat.

x_fieldcat-fieldname = 'POSNR'.

x_fieldcat-seltext_l = 'ITEM'.

x_fieldcat-tabname = 'IT_VBRP'.

x_fieldcat-col_pos = 2.

append x_fieldcat to it_fieldcat1.

clear x_fieldcat.

x_fieldcat-fieldname = 'FKIMG'.

x_fieldcat-seltext_m = 'INV QTY'.

x_fieldcat-tabname = 'IT_VBRP'.

x_fieldcat-col_pos = 3.

append x_fieldcat to it_fieldcat1.

clear x_fieldcat.

x_fieldcat-fieldname = 'VRKME'.

x_fieldcat-seltext_m = 'SALES UNIT'.

x_fieldcat-tabname = 'IT_VBRP'.

x_fieldcat-col_pos = 4.

append x_fieldcat to it_fieldcat1.

clear x_fieldcat.

x_fieldcat-fieldname = 'NETWR'.

x_fieldcat-seltext_m = 'NET PRICE'.

x_fieldcat-tabname = 'IT_VBRP'.

x_fieldcat-col_pos = 5.

append x_fieldcat to it_fieldcat1.

clear x_fieldcat.

x_fieldcat-fieldname = 'MATNR'.

x_fieldcat-seltext_m = 'MATERIAL'.

x_fieldcat-tabname = 'IT_VBRP'.

x_fieldcat-col_pos = 6.

append x_fieldcat to it_fieldcat1.

clear x_fieldcat.

x_fieldcat-fieldname = 'ARKTX'.

x_fieldcat-seltext_m = 'SALES ORDER'.

x_fieldcat-tabname = 'IT_VBRP'.

x_fieldcat-col_pos = 7.

append x_fieldcat to it_fieldcat1.

clear x_fieldcat.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = sy-repid

it_fieldcat = it_fieldcat1

tables

t_outtab = it_vbrp

exceptions

program_error = 1

others = 2.

if sy-subrc = 0.

endif.

endform. " interactive_report

Please reward if it helps,

Regards

Laxmi.

Former Member
0 Kudos

hi,

check this sample code.

&----


tables: vbrk,vbrp.

&----


*& type-pools declaration

&----


type-pools: slis.

&----


*& data declaration

&----


data: g_repid type sy-repid.

DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara

WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,

WA_LAYOUT TYPE SLIS_LAYOUT_ALV,

WA_EVENT TYPE SLIS_ALV_EVENT,

T_EVENT TYPE SLIS_T_EVENT.

DATA: V_VBELN LIKE VBRK-VBELN,

V_MATNR LIKE VBRP-MATNR.

DATA: BEGIN OF IT_VBRK OCCURS 0,

VBELN LIKE VBRK-VBELN,

WAERK LIKE VBRK-WAERK,

VKORG LIKE VBRK-VKORG,

FKDAT LIKE VBRK-FKDAT,

BUKRS LIKE VBRK-BUKRS,

NETWR LIKE VBRK-NETWR,

END OF IT_VBRK.

DATA: BEGIN OF IT_vbrp OCCURS 0,

VBELN LIKE VBRP-VBELN,

POSNR LIKE VBRP-POSNR,

FKIMG LIKE VBRP-FKIMG,

VRKME LIKE VBRP-VRKME,

NETWR LIKE VBRP-NETWR,

MATNR LIKE VBRP-MATNR,

ARKTX LIKE VBRP-ARKTX,

END OF IT_vbrp.

&----


*& selection screen

&----


selection-screen begin of block b with frame title text-001.

select-options: s_vbeln for vbrk-vbeln,

s_fkdat for vbrk-fkdat,

s_matnr for vbrp-matnr.

selection-screen end of block b.

**INITIALIZATION.

INITIALIZATION.

G_REPID = SY-REPID.

s_fkdat-low = SY-DATUM - 200.

S_FKDAT-HIGH = SY-DATUM.

APPEND S_FKDAT.

***AT SELECTION-SCREEN.

AT SELECTION-SCREEN.

IF NOT S_VBELN IS INITIAL.

SELECT SINGLE VBELN FROM VBRK

INTO V_VBELN

WHERE VBELN IN S_VBELN.

IF SY-SUBRC <> 0.

MESSAGE E001(ZZ2).

ENDIF.

ENDIF.

IF NOT S_MATNR IS INITIAL.

SELECT SINGLE MATNR FROM MARA

INTO V_MATNR

WHERE MATNR IN S_MATNR.

IF SY-SUBRC <> 0.

MESSAGE E001(ZZ2).

ENDIF.

ENDIF.

***START-OF-SELECTION.

START-OF-SELECTION.

PERFORM GET_DATA_VBRK.

&----


*& Form GET_DATA_VBRK

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_DATA_VBRK .

SELECT VBELN

WAERK

VKORG

FKDAT

BUKRS

NETWR

INTO TABLE IT_VBRK

FROM VBRK

WHERE VBELN IN S_VBELN

AND FKDAT IN S_FKDAT.

ENDFORM. " GET_DATA_VBRK

&----


*& Form GET_DATA_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_DATA_VBRP .

SELECT VBELN

POSNR

FKIMG

VRKME

NETWR

MATNR

ARKTX

FROM VBRP

INTO TABLE it_vbrp

WHERE VBELN = IT_VBRK-VBELN.

ENDFORM. " GET_DATA_VBRP

***END-OF-SELECTION.

END-OF-SELECTION.

perform event_list.

PERFORM GET_FIELD_CATALOG.

PERFORM LIST_DISP .

FORM LIST_DISP .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = G_REPID

  • I_CALLBACK_PF_STATUS_SET = 'POPUP'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

  • I_CALLBACK_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 = WA_LAYOUT

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • 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

  • 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 = IT_VBRK

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

&----


*& Form GET_FIELD_CATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_FIELD_CATALOG .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = G_REPID

I_INTERNAL_TABNAME = 'IT_VBRK'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = G_REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = IT_FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

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

&----


*& Form event_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM event_list .

CLEAR WA_EVENT.

WA_EVENT-NAME = 'USER_COMMAND'.

WA_EVENT-FORM = 'USER_COMMAND'.

APPEND WA_EVENT TO T_EVENT.

CLEAR WA_EVENT.

ENDFORM. " event_list

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN '&IC1'.

READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.

PERFORM GET_DATA_VBRP.

PERFORM BUILD_FIELDCATALOG_VBRP .

PERFORM DISPLAY_ALV_VBRP.

ENDCASE.

ENDFORM.

&----


*& Form BUILD_FIELDCATALOG_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM BUILD_FIELDCATALOG_VBRP .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = G_REPID

I_INTERNAL_TABNAME = 'IT_VBRP'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = G_REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = IT_FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

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

&----


*& Form DISPLAY_ALV_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM DISPLAY_ALV_VBRP .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = G_REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_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 =

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • 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

  • 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 = IT_VBRP

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.

reward if helpful.

regards,

keerthi.

former_member188685
Active Contributor
0 Kudos

Hi,

Do you know this , the Poup Doesn't show the columns <b>which are Blank or don't have value or Zeroes or 0.00</b>all these columns it will exclude and show the rest of the columns.

did you observe this.if not check it.

Regards

vijay

0 Kudos

Dear

But you know in case of SE16, we could see every field in POP-UP even zero or 0.00, blank.

Would you explain it to me?

Former Member
0 Kudos

Dear

But you know in case of SE16, we could see every field in POP-UP even zero or 0.00, blank.

Would you explain it to me?

0 Kudos

Hi,

Yes in SE16 it is showing all of them, But in The ALV Report the situation is Not that what you expected. I don't know the Exact Reason.But Did you checked it in the Report what i explained. it is not showing the Blank values,Zeroes,0.00 s.

Regards

vijay