Skip to Content
author's profile photo Former Member
Former Member

writing selections in alv list header

Hi,

in alv list header i have to show the values entered in selection screen.

ex.

Current year : 2008

current period : 03

report ID : R_123

company code : I BT AA to BB

I BT CC to DD

I EQ FF

in the above example first three are parameters and company code is select-option, for parameters i can display what i want, but for company code( which is select option) it is showing only first line and not showing other lines.

at the time of filling list header table for select-option, i am looping the select-option, first i am filling with typ, key and info and for other i am filling only info, if i fill typ, key also for other recoreds also it is showing the company code in all lines as below ....

company code : I BT AA to BB

company code : I BT CC to DD

company code : I EQ FF

can any one suggest to get the list header as shown at the begining....

thanks,

bhushan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2008 at 01:00 PM

    Hi,

    Use FM RS_COVERPAGE_SELECTIONS & then

    loop at LOOP AT mtab_sel_options.

    to print the desired selection parameters.

    I hope this helps,

    Regards

    Raju Chitale

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2008 at 01:06 PM

    go through the program BALVST02_GRID and code

    accordinglyor check the sample code.

    DATA: i_events TYPE slis_t_event.

    DATA: i_header TYPE slis_t_listheader.

    PERFORM f3000_build_header CHANGING i_header.

    PERFORM f4000_events_init CHANGING i_events.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = report_id

    is_layout = i_layout

    it_fieldcat = i_fieldcat

    i_save = 'A'

    it_events = i_events

    TABLES

    t_outtab = i_data

    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 f3000_build_header USING i_header TYPE slis_t_listheader.

    DATA: gs_line TYPE slis_listheader.

    CLEAR gs_line.

    gs_line-typ = 'H'.

    gs_line-info = 'This is line of type HEADER'.

    APPEND gs_line TO i_header.

    CLEAR gs_line.

    gs_line-typ = 'S'.

    gs_line-key = 'STATUS 1'.

    gs_line-info = 'This is line of type STATUS'.

    APPEND gs_line TO i_header.

    gs_line-key = 'STATUS 2'.

    gs_line-info = 'This is also line of type STATUS'.

    APPEND gs_line TO i_header.

    CLEAR gs_line.

    gs_line-typ = 'A'.

    gs_line-info = 'This is line of type ACTION'.

    APPEND gs_line TO i_header.

    ENDFORM. " f3000_build_header

    &----


    *& Form f4000_events_init

    &----


    FORM f4000_events_init CHANGING i_events TYPE slis_t_event.

    DATA: line_event TYPE slis_alv_event.

    CLEAR line_event.

    line_event-name = 'TOP_OF_PAGE'.

    line_event-form = 'F4100_TOP_OF_PAGE'.

    APPEND line_event TO i_events.

    ENDFORM. " f3000_events_init

    -


    FORM F4100_TOP_OF_PAGE *

    -


    FORM f4100_top_of_page.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = i_header.

    ENDFORM.

    Check this thread

    i-need-to-print-logo-in-alv-grid

    <REMOVED BY MODERATOR>

    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 4:30 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2008 at 01:07 PM

    Hi,

    Check this sample code. Here plant and date are selection screen paramters.

    • Plant

    lwa_header-typ = 'S'.

    lwa_header-key = text-t47.

    • If the select option for plant is 'EQ'

    LOOP AT s_werks. "#EC *

    IF s_werks-option = 'EQ'.

    lwa_plant-werks = s_werks-low.

    APPEND lwa_plant TO lt_plant.

    CLEAR lwa_plant.

    • If the select option for plant is 'BT'

    ELSEIF s_werks-option = 'BT'.

    CONCATENATE s_werks-low

    text-t50

    s_werks-high

    INTO lf_plant.

    lwa_header-info = lf_plant.

    APPEND lwa_header TO gt_header.

    CLEAR lwa_header.

    ENDIF.

    ENDLOOP.

    IF s_werks-option = 'EQ'.

    READ TABLE lt_plant INTO lwa_plant INDEX 1.

    lwa_header-info = lwa_plant-werks.

    APPEND lwa_header TO gt_header.

    CLEAR lwa_header.

    LOOP AT lt_plant INTO lwa_plant FROM 2.

    lwa_header-typ = 'S'.

    lwa_header-key = ''.

    lwa_header-info = lwa_plant-werks.

    APPEND lwa_header TO gt_header.

    CLEAR: lwa_header.

    ENDLOOP.

    ENDIF.

    • Post date Range

    lwa_header-typ = 'S'.

    lwa_header-key = text-t33.

    • If the select option for post date is 'EQ'

    LOOP AT s_budat. "#EC *

    IF s_budat-option = 'EQ'.

    CONCATENATE s_budat-low+6(2) '.'

    s_budat-low+4(2) '.'

    s_budat-low(4) INTO lf_range.

    • For multiple values

    IF lf_date_tmp IS INITIAL.

    lwa_date-date = lf_range.

    APPEND lwa_date TO lt_date.

    ELSE.

    lwa_date-date = lf_range.

    APPEND lwa_date TO lt_date.

    ENDIF.

    • If the select option for post date is 'BT'

    ELSEIF s_budat-option = 'BT'.

    CONCATENATE s_budat-low+6(2) '.'

    s_budat-low+4(2) '.'

    s_budat-low(4) text-t49

    s_budat-high+6(2) '.'

    s_budat-high+4(2) '.'

    s_budat-high(4) INTO lf_range .

    lwa_header-info = lf_range.

    CLEAR lf_range.

    ENDIF.

    ENDLOOP.

    IF s_budat-option = 'EQ'.

    READ TABLE lt_date INTO lwa_date INDEX 1.

    lwa_header-info = lwa_date-date.

    APPEND lwa_header TO gt_header.

    CLEAR: lwa_header.

    LOOP AT lt_date INTO lwa_date FROM 2.

    lwa_header-typ = 'S'.

    lwa_header-key = ''.

    lwa_header-info = lwa_date-date.

    APPEND lwa_header TO gt_header.

    CLEAR: lwa_header.

    ENDLOOP.

    ENDIF.

    • Appending work area to the header table

    APPEND lwa_header TO gt_header.

    CLEAR lwa_header.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_header.

    <REMOVED BY MODERATOR>

    Regards,

    Ramya

    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 4:30 PM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      i got the solution,

      previously at the time of filling second value of select-option i am clearing the typ and key and i am filling only info. Now i am filling typ, key and info for first line and filling typ and info for other values....

      thanks,

      bhushan

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.