Skip to Content

Blocked ALV report

Hello All

Good day to you. Now i have requiremnt of creating a blocked ALV report, i am having a final internal table with all customer related data with sales office value also. i want to display one sales office data in one block and i need to do the total values for some of the fields for that sales office.

I am trying to use blocked alv but it is not working out for me. what i have done is i have done a loop for the final internal table and i have create at new and at end events for using REUSE_ALV_BLOCK_LIST_APPEND. but still it is not working out for me.

I request you to please check and suggest me accordingly.

Regards

Raj

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Oct 07, 2010 at 11:06 AM

    Refer the standard report BCALV_TEST_BLOCK_LIST

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 07:07 AM

    Hi Raj,

    The block I copied from the standard program

    CLEAR tl_xdata. LOOP AT xdata. APPEND xdata TO tl_xdata. "Append each row AT END OF carrid. CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND' EXPORTING it_fieldcat = xfield is_layout = x_layout i_tabname = 'XDATA' it_events = gt_xevents i_text = text-0b1 TABLES t_outtab = tl_xdata. "Instead of the main internal table, you can use the new internal table. May be field catalog will need adjustment REFRESH tl_xdata. ENDAT. ENDLOOP.

    Hope it helps.

    Sujay

    Sujay

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2010 at 07:16 AM

    can you post your coding?

    A.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 08:24 AM

    Hi,

    Its not working menas?? what problem exactly you have in that. Your not getting output itself or wat? Be much more clear

    Thanks & Regards,

    Vanitha P

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 08:31 AM

    Hi,

    If in case your problem is like output is not being displayed and not showing any error then check out below one.

    After using REUSE_ALV_BLOCK_LIST_APPEND have you called REUSE_ALV_BLOCK_LIST_DISPLAY Function module?? If not trying calling this Function module.

    Regards,

    Vanitha P

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Suay

      As per your instruciton i have modified the code and found that there are 2 blocks dispaying because i have only 2 entries in my internal table but there is no data displaying. only empty blocks are displaying.

      I am here attaching my code , please check

      SORT t_knkk BY vkbur.

      clear t_knkk_temp.

      LOOP AT t_knkk INTO wa_knkk.

      move wa_knkk to wa_knkk_temp.

      append wa_knkk_temp to t_knkk_temp.

      at end of vkbur.

      perform f_append_data_to_alv_block using 'T_KNKK_TEMP' t_knkk_temp.

      ENDAT.

      ENDLOOP.

      FORM f_append_data_to_alv_block USING ix_itabname TYPE c

      ix_iouttab TYPE STANDARD TABLE.

      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

      EXPORTING

      is_layout = wa_layout

      it_fieldcat = t_fieldcat[]

      i_tabname = ix_itabname

      it_events = t_events[]

      • IT_SORT =

      • I_TEXT = ' '

      TABLES

      t_outtab = ix_iouttab[]

      EXCEPTIONS

      program_error = 1

      maximum_of_appends_reached = 2

      OTHERS = 3.

      REFRESH T_KNKK_temp.

      ENDFORM. "f_append_data_to_alv_block

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 09:16 AM

    Hi Nagarjuna

    what I have understood from your query is that you have a report in which you want to display your data in alv with Sales office specific. like

    one sales office data in one block and the total on some fields and then again other sales office and its data.

    if I am correct you can use the following solution.

    define a sort table as mentioned below:

    DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV, " For ALV Sorting.

    WA_SORT TYPE SLIS_SORTINFO_ALV.

    then form the sort table as below:

    FORM SORT .

    *For sorting and subtotal

    WA_SORT-SPOS = 1.

    WA_SORT-FIELDNAME = '<sales office field>'.

    WA_SORT-TABNAME = 'IT_FINAL'. " to be displayed in ALV

    WA_SORT-UP = 'X'.

    APPEND WA_SORT TO IT_SORT.

    CLEAR WA_SORT.

    WA_SORT-SPOS = 2.

    WA_SORT-FIELDNAME = '<field for total>'.

    WA_SORT-TABNAME = 'IT_FINAL'.

    WA_SORT-SUBTOT = 'X'.

    WA_SORT-UP = 'X'.

    APPEND WA_SORT TO IT_SORT.

    CLEAR WA_SORT.

    endform.

    similarly you can add more fields for which you want to do the subtotal.

    Pass this sort table in REUSE_ALV_GRID_DISPLAY.

    i hope this will resolve your issue.

    thanks

    Lalit Gupta

    Add a comment
    10|10000 characters needed characters exceeded

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.