Application Development and Automation 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: 
Read only

Header data in ALV

Former Member
0 Likes
850

Hi,

I've got a requirement, wherein I need to display a few fields of the ALV page, as the header data, and the remaining as line items. How do I do. I'm able to get all the data fields to a ALV report, how do I go?? Please help me.

Thank you, in Advance.

Arun Krishna

8 REPLIES 8
Read only

shishupalreddy
Active Contributor
0 Likes
817

Hello,

Develop Hierarchical ALV Report using RESUE_ALV_HIER_SEQ* DISPLAY Function module ...

where u need to populate two internal tables with Header data and Item data and prepare one fieldcatalog .

Regards,

Read only

Former Member
0 Likes
817

you can use the FM shown below for displayin the Header and Detail records in ALV as shown below..

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

i_callback_program = repid

it_fieldcat = fieldcat

i_default = ' '

i_save = 'A'

is_variant = ls_variant

i_tabname_header = header

i_tabname_item = detail

i_structure_name_header = header

i_structure_name_item = detail

is_keyinfo = ls_keyinfo

TABLES

t_outtab_header = lt_header

t_outtab_item = lt_detail

EXCEPTIONS

program_error = 1

OTHERS = 2.

Hope this helps

Read only

0 Likes
817

Hi There,

Use the Function module REUSE_ALV_HIERSEQ_LIST_DISPLAY.

To this function module, pass the Internal table with Header data to t_outtab_header and the internal table to t_outtab_item under TABLES.

Apart from that you will have to pass the Keyinformation to is_keyinfo under EXPORTING, this is where you will say how the Header Details and Item details are linked.

go to SE37 type in the Function Module name and click on "WHERE USED-LIST" icon and select programs and you will get a list of standard or custom program which have used this function module.

you can refer to these program to get a clear idea... and this is the best way to learn the useage of any new FM.

Regards,

S.Dakshna Nagaratnam.

Read only

Former Member
0 Likes
817

Hi,

If you mean by header and line item as follows:-

PO number 1 PO date Po Type

PO line item 1 Qty 1

PO line item 2 Qty 2

PO line item 3 Qty 3

PO number 2 PO date Po Type

PO line item 1 Qty 1

PO line item 2 Qty 2

PO line item 3 Qty 3

You can get a similar output using hierachial ALV.

Kindly check the program BCALV_TEST_HIERSEQ_LIST.

Regards,

Ankur Parab

Read only

Former Member
0 Likes
817

Hi,

Use this Function Module REUSE_ALV_HIERSEQ_LIST_DISPLAY. You need to have two internal table, one is for Header data and another one for Item data. Just pass it the required parameters you will get the desired result. If you have anything let me know.

Regards

Thiru

Read only

Former Member
0 Likes
817

Hi,

Try this code .



DATA : WA_SORT      TYPE SLIS_SORTINFO_ALV,
           IT_SORT      TYPE SLIS_T_SORTINFO_ALV ,

PERFORM SORTCAT USING 'FISTL'  'X' 'X'.     " Here Fistl is your header field. you can use as many header field as you want

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = SY-REPID
          IS_LAYOUT = GS_LAYOUT
          IT_FIELDCAT              = IT_FIELDCAT
          IT_SORT                  = IT_SORT
        TABLES
          T_OUTTAB                 = IT_CONS
        EXCEPTIONS
          PROGRAM_ERROR            = 1
          OTHERS                   = 2.



*&---------------------------------------------------------------------*
*&      Form  SORTCAT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->VALUE(FIELD_NAME)  text
*      -->VALUE(SORTED)      text
*      -->VALUE(SUB_TOT)     text
*----------------------------------------------------------------------*
FORM SORTCAT  USING    VALUE(FIELD_NAME)
*                       VALUE(SORT_POS)
                       VALUE(SORTED)
                       VALUE(SUB_TOT).

  WA_SORT-FIELDNAME = FIELD_NAME.
*  LN_SORTCAT-SPOS = SORT_POS.
  WA_SORT-UP = SORTED.
  WA_SORT-SUBTOT = SUB_TOT.

  APPEND WA_SORT TO IT_SORT.
  CLEAR WA_SORT.

ENDFORM.                    " SORTCAT

Regards

Vishnu Gupta

Read only

Former Member
0 Likes
817

Hi you can print the heading uing the function module reuse_alv_comentary _write function module.

Read only

Former Member
0 Likes
817

Check the standard report BALVHD01_GROUP for Hierarchical sequential ALV