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: 

ALV Block Report using multiple tables-Urgent

Former Member
0 Kudos

Hi All,

I have following selection option and parameter:

SELECT-OPTIONS: s_lifnr for lfa1-lifnr obligatory,

s_matnr for mara-matnr,

s_mtart for mara-mtart.

PARAMETERS: p_cng AS CHECKBOX . "For Changed Articles

PARAMETERS: p_uncng AS CHECKBOX "For Unchanged Articles

Using the above details I need to prepare ALV Block Report using three internal tables.

1.Summary Report (Always will be there)

2.Changed Articles Report ( if p_cng = 'X')

3.Unchanged Articles Report ( if p_uncng = 'X')

eg. a) Report heading "Summary Report"

Vendor Name Article Count Article Changed Unchanged V1 X 10 2 8

V2 Y 5 0 5

etc etc

Once Summary report will be over at the end of the report

IF p_cng = 'X' Then disply Changed Articles Report

b) Report Heading "Changed Article Details"

Vendor Name Article Description

V1 X A1 AA

V2 Y A2 BB

etc etc etc etc

ENDIF.

IF p_uncng = 'X' Then disply UnChanged Articles Report

b) Report Heading "UnChanged Article Details"

Vendor Name Article Description

V1 X A6 AA6

V2 Y A7 BB7

etc etc etc

ENDIF.

All data populated in three dii internal table exactly the way I want . Only problem is finding difficult to display in ALV Block Report. I will appreciate if any one can send me sample code ( please exclude DEMO AND Object Oriented method ) of ALV Block Report using multiple tables . I will be happy to reward points.

Thank you very much in Adv.

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Chk whether this sample program helps you.

http://www.geocities.com/mpioud/Z_ALV_LIST_BLOCK.html

5 REPLIES 5

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Chk whether this sample program helps you.

http://www.geocities.com/mpioud/Z_ALV_LIST_BLOCK.html

0 Kudos

Hi Jayanthi,

Thank you very much for u r prompt reply . I saw the prog , really good one. Hope this one will help me.

Cheers.

former_member181962
Active Contributor
0 Kudos

Have a Look at the sample programs:

BALVBT01

BCALV_TEST_BLOCK_LIST

Regards,

ravi

0 Kudos

Hi Ravi,

Thank u very much 4 u r reply. Already hv seen that demo prog but i m little bit confused . The link given by Jayanthi also a good one so trying to simulate .

Cheers,

Former Member
0 Kudos

Hi All,

In ALV Block Report using Define fieldcat I can display Title of the fields which is available in the database but I cant display the Title of those field which is not available in the database. In an internal table say 3 fields from lfa1 and 2 fields type i . Pl find the code below and Adv. Unfortunately I clicked the stop watching button for this topic pl let me know how to disable that.

FORM list_append TABLES ut_table

USING u_no TYPE char1

u_tabname TYPE slis_tabname.

  • Macro definition

DEFINE m_fieldcat.

ls_fieldcat-fieldname = &1.

ls_fieldcat-ref_tabname = &2.

append ls_fieldcat to lt_fieldcat.

END-OF-DEFINITION.

DEFINE m_sort.

ls_sort-fieldname = &1.

ls_sort-up = 'X'.

append ls_sort to lt_sort.

END-OF-DEFINITION.

DATA :

ls_fieldcat TYPE slis_fieldcat_alv,

lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog

ls_sort TYPE slis_sortinfo_alv,

lt_sort TYPE slis_t_sortinfo_alv. " Sort table

DATA:

lt_events TYPE slis_t_event,

ls_event TYPE slis_alv_event,

ls_layout TYPE slis_layout_alv.

ls_layout-group_change_edit = 'X'.

ls_layout-colwidth_optimize = 'X'.

ls_layout-zebra = 'X'.

ls_layout-cell_merge = 'X'.

ls_layout-detail_popup = 'X'.

ls_layout-get_selinfos = 'X'.

ls_layout-max_linesize = '200'.

CASE u_no.

WHEN '1'.

m_fieldcat 'LIFNR' 'LFA1'.

m_fieldcat 'NAME1' 'LFA1'.

m_fieldcat 'TOT_ART' 'TOT_ART'.

"Total No of Article TITLE UNABLE TO DISPLY

m_fieldcat 'TOT_CNG_ART' 'TOT_CNG_ART'.

"Total Unchanged Article

m_fieldcat 'TOT_UNCNG_ART' 'TOT_UNCNG_ART'.

"Total changed Article

m_sort 'LIFNR'.

WHEN '2'."Changed Article

m_fieldcat 'LIFNR' 'LFA1'.

m_fieldcat 'NAME1' 'LFA1'.

m_fieldcat 'MATNR' 'MARA'.

m_fieldcat 'ZBLDESC' 'MARA'.

m_sort 'LIFNR'.

WHEN '3'. "Unchanged Article

m_fieldcat 'LIFNR' 'LFA1'.

m_fieldcat 'NAME1' 'LFA1'.

m_fieldcat 'MATNR' 'MARA'.

m_fieldcat 'ZBLDESC' 'MARA'.

m_sort 'LIFNR'.

ENDCASE.

IF u_no CA '13'.

MOVE 'TOP_OF_PAGE' TO ls_event-name.

CONCATENATE 'TOP_OF_PAGE' u_no INTO ls_event-form.

APPEND ls_event TO lt_events.

ELSE.

MOVE 'TOP_OF_LIST' TO ls_event-name.

CONCATENATE 'TOP_OF_LIST' u_no INTO ls_event-form.

APPEND ls_event TO lt_events.

ENDIF.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

it_fieldcat = lt_fieldcat

is_layout = ls_layout

i_tabname = u_tabname

it_events = lt_events

it_sort = lt_sort

  • i_text =

TABLES

t_outtab = ut_table

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 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. " LIST_APPEND