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: 

not getting output in ALV

Former Member
0 Kudos

hi guys,

iam doing ALV report,its an simple report,but not getting output,just blank screen is coming.

could anyone show me how to pass parameters to filedcatalog and display function modules.

i

4 REPLIES 4

Former Member
0 Kudos

hi,

plz refer the links.

you will get all material.

1. Please give me general info on ALV.

http://www.sapfans.com/forums/viewtopic.php?t=58286

http://www.sapfans.com/forums/viewtopic.php?t=76490

http://www.sapfans.com/forums/viewtopic.php?t=20591

http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.

2. How do I program double click in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=11601

http://www.sapfans.com/forums/viewtopic.php?t=23010

3. How do I add subtotals (I have problem to add them)...

http://www.sapfans.com/forums/viewtopic.php?t=20386

http://www.sapfans.com/forums/viewtopic.php?t=85191

http://www.sapfans.com/forums/viewtopic.php?t=88401

http://www.sapfans.com/forums/viewtopic.php?t=17335

4. How to add list heading like top-of-page in ABAP lists?

http://www.sapfans.com/forums/viewtopic.php?t=58775

http://www.sapfans.com/forums/viewtopic.php?t=60550

http://www.sapfans.com/forums/viewtopic.php?t=16629

5. How to print page number / total number of pages X/XX in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)

6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.

http://www.sapfans.com/forums/viewtopic.php?t=64320

http://www.sapfans.com/forums/viewtopic.php?t=44477

7. How can I set the cell color in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=52107

8. How do I print a logo/graphics in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=81149

http://www.sapfans.com/forums/viewtopic.php?t=35498

http://www.sapfans.com/forums/viewtopic.php?t=5013

9. How do I create and use input-enabled fields in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=84933

http://www.sapfans.com/forums/viewtopic.php?t=69878

10. How can I use ALV for reports that are going to be run in background?

http://www.sapfans.com/forums/viewtopic.php?t=83243

http://www.sapfans.com/forums/viewtopic.php?t=19224

11. How can I display an icon in ALV? (Common requirement is traffic light icon).

http://www.sapfans.com/forums/viewtopic.php?t=79424

http://www.sapfans.com/forums/viewtopic.php?t=24512

12. How can I display a checkbox in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=88376

http://www.sapfans.com/forums/viewtopic.php?t=40968

http://www.sapfans.com/forums/viewtopic.php?t=6919

Go thru these programs they may help u to try on some hands on

ALV Demo program

BCALV_DEMO_HTML

BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode

BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode

BCALV_GRID_DEMO Simple ALV Control Call Demo Program

BCALV_TREE_DEMO Demo for ALV tree control

BCALV_TREE_SIMPLE_DEMO

BC_ALV_DEMO_HTML_D0100

Regards,

Roshani

Former Member
0 Kudos

Hi,

Check the code below:

*Tables

DATA: i_alv_cat TYPE TABLE OF lvc_s_fcat,

ls_alv_cat LIKE LINE OF i_alv_cat,

PARAMETER: p_tknum TYPE yyle0003-tknum.

DATA: BEGIN OF g_scandata OCCURS 0.

INCLUDE STRUCTURE yyle0003.

DATA: END OF g_scandata.

DATA: g_itab1 TYPE TABLE OF yyle0003.

DATA: wa_itab1 LIKE g_scandata.

*

TYPES: BEGIN OF itab2,

tknum TYPE yyle0003-tknum,

vhilm TYPE yyle0003-vhilm,

quantity TYPE yyle0003-quantity,

END OF itab2.

DATA: g_itab3 TYPE TABLE OF itab2.

DATA: wa_itab3 TYPE itab2.

DATA: g_itab4 TYPE TABLE OF itab2.

DATA: wa_itab4 TYPE itab2.

DATA: gv_wa TYPE REF TO data.

******************Start of Internal Table Definition *******************

DATA:

g_custom_container_0100 TYPE REF TO cl_gui_custom_container,

g_alv_grid_0100 TYPE REF TO cl_gui_alv_grid,

g_container_0100 TYPE scrfname VALUE 'LIST',

g_mylayout TYPE lvc_s_layo,

ok_code LIKE sy-ucomm.

FIELD-SYMBOLS :<f_fs> TYPE table,

<f_fs1> TYPE table,

<f_fs3> TYPE ANY,

<f_fs4> TYPE ANY,

<f_field> TYPE ANY,

<f_fs5> TYPE ANY.

FIELD-SYMBOLS: <fs_wa> TYPE ANY.

DATA: l_var TYPE i,

l_i TYPE i.

DATA: l_var1 TYPE char20,

l_var2 TYPE char20.

SELECT *

FROM yyle0003

INTO TABLE g_scandata

WHERE tknum EQ p_tknum.

SORT g_scandata BY tknum vhilm.

LOOP AT g_scandata INTO wa_itab1.

MOVE-CORRESPONDING wa_itab1 TO wa_itab3.

APPEND wa_itab3 TO g_itab3.

ENDLOOP.

LOOP AT g_itab3 INTO wa_itab3.

COLLECT wa_itab3 INTO g_itab4.

ENDLOOP.

SORT g_itab4 BY tknum vhilm.

DELETE ADJACENT DUPLICATES FROM g_itab4 COMPARING vhilm.

DESCRIBE TABLE g_itab4 LINES l_var.

  • To BUILD Field Catalog.

l_i = '2'.

ls_alv_cat-fieldname = 'TKNUM'.

ls_alv_cat-col_pos = 1.

ls_alv_cat-coltext ='ShipmentNo.'.

APPEND ls_alv_cat TO i_alv_cat.

LOOP AT g_scandata.

IF l_var >= 1.

ls_alv_cat-fieldname = g_scandata-vhilm.

ls_alv_cat-col_pos = l_i.

ls_alv_cat-coltext = g_scandata-vhilm.

APPEND ls_alv_cat TO i_alv_cat.

l_i = l_i + 1.

ENDIF.

ENDLOOP.

  • create Field Catalog Dynamically

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = i_alv_cat

IMPORTING

ep_table = d_ref.

ASSIGN d_ref->* TO <f_fs>.

CREATE DATA gv_wa LIKE LINE OF <f_fs>.

ASSIGN gv_wa->* TO <fs_wa>.

DELETE ADJACENT DUPLICATES FROM <f_fs> COMPARING ALL FIELDS.

FIELD-SYMBOLS: <f_fs2> TYPE itab2,

<f_fs6> TYPE ANY,

<f_fs7> TYPE ANY.

DATA: l_var3 TYPE char15.

LOOP AT g_itab4 ASSIGNING <f_fs2>.

ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <f_fs2> TO <f_fs6>.

ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <fs_wa> TO <f_fs7>.

<f_fs7> = <f_fs6>.

ASSIGN COMPONENT 'VHILM' OF STRUCTURE <f_fs2> TO <f_fs3>.

ASSIGN COMPONENT 3 OF STRUCTURE <f_fs2> TO <f_fs4>.

MOVE <f_fs3> TO l_var1.

ASSIGN COMPONENT l_var1 OF STRUCTURE <fs_wa> TO <f_fs5>.

<f_fs5> = <f_fs4>.

AT END OF <f_fs2>-tknum.

APPEND <fs_wa> TO <f_fs>.

ENDAT.

ENDLOOP.

CALL SCREEN 0100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'ZVKS'.

SET TITLEBAR 'ZVKS'.

CHECK sy-ucomm IS INITIAL.

  • SET PF-STATUS 'LIST'.

  • SET TITLEBAR 'LIST'.

SORT g_scandata BY tknum vhilm.

CREATE OBJECT g_custom_container_0100

EXPORTING container_name = g_container_0100

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

CREATE OBJECT g_alv_grid_0100

EXPORTING i_parent = g_custom_container_0100.

g_mylayout-grid_title = 'Display Scanning data'.

CALL METHOD g_alv_grid_0100->set_table_for_first_display

  • EXPORTING

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

  • I_CONSISTENCY_CHECK =

  • I_STRUCTURE_NAME =

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

  • IS_LAYOUT =

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

CHANGING

it_outtab = <f_fs>

it_fieldcatalog = i_alv_cat.

  • IT_SORT =

  • IT_FILTER =

  • EXCEPTIONS

  • INVALID_PARAMETER_COMBINATION = 1

  • PROGRAM_ERROR = 2

  • TOO_MANY_LINES = 3

  • others = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE user_command_0100 INPUT.

CALL METHOD cl_gui_cfw=>dispatch.

CASE sy-ucomm.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'CANC'.

LEAVE TO SCREEN 0.

WHEN OTHERS.

ENDCASE.

CLEAR ok_code.

ENDMODULE. " USER_COMMAND_0100 INPUT

Regards

Kannaiah

Former Member
0 Kudos

Hi Venugopal,

Pls chk the following:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_STRUCTURE_NAME = ' <Name of structure to be passed>'

I_GRID_TITLE = '<Title of the grid>'

IS_LAYOUT = it_layout

IT_FIELDCAT = IT_FIELDCAT[]

TABLES

T_OUTTAB = <Name of Table which has values to be displayed>

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

call the build_fieldcat before calling reuse...

Example of fieldcatalog is....

FORM BUILD_FIELDCAT .

CLEAR IT_FIELDCAT[].

IT_FIELDCAT-FIELDNAME = '<fieldname>'.

IT_FIELDCAT-SELTEXT_M = ' <selection text>'.

IT_FIELDCAT-COL_POS = 0.

IT_FIELDCAT-OUTPUTLEN = '30'.

append it_fieldcat.

.................

.................

CLEAR IT_FIELDCAT[].

IT_FIELDCAT-FIELDNAME = '<fieldname>'.

IT_FIELDCAT-SELTEXT_M = ' <selection text>'.

IT_FIELDCAT-COL_POS = n.

IT_FIELDCAT-OUTPUTLEN = '30'.

end form.

call the layout also before calling alv...

layout is built as follows....

form build_layout.

*ls_layout-grid_title = <title>.

  • ls_layout-info_fname = 'ROWCOLOR'.

it_layout-no_input = 'X'.

it_layout-colwidth_optimize = 'X'.

it_layout-totals_text = 'Totals'(201).

endform. " build_layout

hope this shd solve the problem!

reward points

regards,

Naveenan.

Former Member
0 Kudos

Hi Venugopal,

Plz copy paste ur coding in forum, so that

its easy to find the error.

<b>Regards,

jackie.</b>