‎2007 Sep 26 5:22 PM
Hi Guys,
When i am clicking 'Change Layout' button in the final Output of ALV grid.I am getting the output Heading Multiple Times.The code is Below.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
*i_Save = 'X'
it_fieldcat = t_fieldcatalog
it_events = I_events
TABLES
t_outtab = i_MBEW_out.
Title
Form top_of_page.
i_header_str-typ = 'H'.
I_header_Str-info = Text-035.
append I_header_str to t_header.
clear I_header_str.
Date
I_header_str-typ = 'S'.
I_header_str-key = Text-036.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO I_header_str-info. "todays date
append I_header_str to t_header.
clear: I_header_str.
CLEAR i_line_event_str.
i_line_event_str-name = 'TOP_OF_PAGE'.
APPEND i_line_event_str TO i_events.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
EndForm. "top_of_page
Can anybody tell me what's the Problem?
Thanks,
Gopi.
‎2007 Sep 26 5:46 PM
Hi,
You need to clear and refresh t_header in the subroutine top_of_page.
Form top_of_page.
<b>clear t_header.
refresh t_header.</b>
i_header_str-typ = 'H'.
I_header_Str-info = Text-035.
append I_header_str to t_header.
clear I_header_str.
Date
I_header_str-typ = 'S'.
I_header_str-key = Text-036.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO I_header_str-info. "todays date
append I_header_str to t_header.
clear: I_header_str.
CLEAR i_line_event_str.
i_line_event_str-name = 'TOP_OF_PAGE'.
APPEND i_line_event_str TO i_events.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
EndForm. "top_of_page
Thanks,
Sriram Ponna.
‎2007 Sep 26 5:46 PM
Hi,
You need to clear and refresh t_header in the subroutine top_of_page.
Form top_of_page.
<b>clear t_header.
refresh t_header.</b>
i_header_str-typ = 'H'.
I_header_Str-info = Text-035.
append I_header_str to t_header.
clear I_header_str.
Date
I_header_str-typ = 'S'.
I_header_str-key = Text-036.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO I_header_str-info. "todays date
append I_header_str to t_header.
clear: I_header_str.
CLEAR i_line_event_str.
i_line_event_str-name = 'TOP_OF_PAGE'.
APPEND i_line_event_str TO i_events.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
EndForm. "top_of_page
Thanks,
Sriram Ponna.
‎2007 Sep 26 5:52 PM
Hi Sriram,
Thanks,
I am having other Q'n.When the final Output is Displayed in the Grid.
We have "Change Laoyout" Button.In that " Columnset" is there What's the purpose of that one and How to use that one.
My requirement is I have to display the Output and also I have to provide user so that he can select the Field which he need apart from Basic Layout thru Change Layout Button.
My Functional asked me to do like this Below is the Requirement
" I need to see the other columns which need to be provided for users to select. Many columns are listed in the output attached to functional spec.
Pl. get all these columns into the <b>'columnset'</b> list to be chosen as needed.
Some examples of the missing columns are
Def grid val
Def category
Spl proc class
With qty str
Material origin
Origin group
Overhead group
Profit center
Plant sp mat status
Sp proc costing"So can please tell me how to do?
Thanks,
Gopi.
‎2007 Sep 26 7:00 PM
Hi,
If you need to have some columns/fields in the column set of change layout.
You need to use the below code :
While filling you fieldcatalog you need to add code as below :
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'WAERS'.
gs_fieldcat-seltext_s = 'Doc Curr'.
gs_fieldcat-seltext_l = 'Doc Curr'.
gs_fieldcat-seltext_m = 'Doc Curr'.
gs_fieldcat-fix_column = 'X'.
gs_fieldcat-outputlen = '4'.
gs_fieldcat-tabname = 'GT_OUTPUT'.
gs_fieldcat-no_out = 'X'.
APPEND gs_fieldcat TO gt_fieldcat.Assuming gt_fieldcat is your fieldcatlog, and WAERS is the field that need to in columnset of change layout for that fields you need to use no_out = 'X'.
Thanks,
Sriram Ponna.
Message was edited by:
Sriram Ponna