‎2008 Nov 07 6:09 AM
<<Moderator message: please use a meaningful subject in future>>
Dear all,
My requirement is, suppose in my alv's input screen i m giving some input (data) and based on that I am getting my output in my output screen. Now I want my input screen data should also be displayed in the header of the ALV.
How I will do that.
Please help.
Regards,
Abhay.
Edited by: Matt on Nov 7, 2008 7:56 AM
Edited by: Matt on Nov 7, 2008 7:58 AM
‎2008 Nov 07 6:21 AM
Hi Abhay,
Try using the TYPE-POOLS concept.
Use TYPE-POOLS: SLIS.
In this use SLIS_T_LISTHEADER.
Here u will find the fields TYP,KEY,INFO to get the Selection-screen Input to ALV OUTPUT header.
After coding the above u need to call the FM 'REUSE_ALV_COMMENTARY_WRITE'
and pass the Top of page to IT_LIST_COMMENTARY.
Regards,
SuryaKiran
‎2008 Nov 07 6:16 AM
Hi,
Try like this....
ls_line TYPE slis_listheader,
gt_list_top_of_page TYPE slis_t_listheader, "FOR TOP OF PAGE
FORM gen_top .
ls_line-typ = 'S'.
ls_line-info = s_datbi-low.----------->give your selection screen field name
APPEND ls_line TO gt_list_top_of_page.
CLEAR ls_line.
ls_line-typ = 'A'.
ls_line-info = s_datbi-low..----------->give your selection screen field name
APPEND ls_line TO gt_list_top_of_page.
CLEAR: ls_line.
* PERFORM generate_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page
i_logo = 'DEB'.
ENDFORM. " GEN_TOP
pass gen_top to your alv grid...
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'GEN_TOP' " in caps...
Regards
Debarshi
‎2008 Nov 07 6:17 AM
Hi Abhay,
Please use alv_commentry_write FM to write header for a ALV
pass selection screen values to this FM
Kiran
‎2008 Nov 07 6:21 AM
Hi Abhay,
Try using the TYPE-POOLS concept.
Use TYPE-POOLS: SLIS.
In this use SLIS_T_LISTHEADER.
Here u will find the fields TYP,KEY,INFO to get the Selection-screen Input to ALV OUTPUT header.
After coding the above u need to call the FM 'REUSE_ALV_COMMENTARY_WRITE'
and pass the Top of page to IT_LIST_COMMENTARY.
Regards,
SuryaKiran
‎2008 Nov 07 6:32 AM
hi... if ur calling ALV using SLIS, u can go throug following code to display header..... in following code P_BUKRS is selection screen field.
DATA : IT_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
PERFORM BUILD_HEADER.
PERFORM BUILD_FCAT.
PERFORM DISPLAY.
*&---------------------------------------------------------------------*
*& Form BUILD_HEADER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM BUILD_HEADER .
WA_HEADER-TYP = 'H'. " H = Header, S = Selection, A = Action
WA_HEADER-INFO ='Customer Refund Report'.
APPEND WA_HEADER TO IT_HEADER.
CLEAR: WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = 'Company Code :'.
WA_HEADER-INFO = P_BUKRS.
APPEND WA_HEADER TO IT_HEADER.
CLEAR: WA_HEADER.
*& Form DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM DISPLAY.
WA_SORT-FIELDNAME = 'SWENR'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO SORT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZRE_REFUND_REPORT'
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
*I_CALLBACK_TOP_OF_PAGE = 'HEADER'*
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FCAT
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
IT_SORT = SORT
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
* 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.
ENDFORM. "DISPLAY
*&---------------------------------------------------------------------*
*& Form HEADER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_HEADER
I_LOGO = 'BPTP_LOGO'
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
ENDFORM. "HEADER