‎2009 May 26 10:31 AM
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
‎2009 May 26 10:34 AM
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,
‎2009 May 26 10:36 AM
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
‎2009 May 26 10:44 AM
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.
‎2009 May 26 10:38 AM
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
‎2009 May 26 10:39 AM
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
‎2009 May 26 10:40 AM
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. " SORTCATRegards
Vishnu Gupta
‎2009 May 26 11:04 AM
Hi you can print the heading uing the function module reuse_alv_comentary _write function module.
‎2009 May 27 10:34 AM
Check the standard report BALVHD01_GROUP for Hierarchical sequential ALV