Re:ALV Header Text
Hi,
i am using Reuse_alv_grid_display FM to display the output.I want my header-text in the following format.
STORAGE LOCATION
Mat no L1 L2 L3 Total Quantity.
i am giving in the fieldcatalog 4 fields Mat no, L1,L2,L3,,Quantity as seltext_m.
How can i give the storage location as text above three storage locations.
is there any option to display two lines for header text fields.
Please help me..its urgent.
Thanks
Hi,
you can do this using top of page.
see the following example.
DATA : tevents TYPE slis_t_event,
waevents TYPE slis_alv_event .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0 "simple list
IMPORTING
et_events = tevents.
READ TABLE tevents INTO waevents
WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
waevents-form = 'PAGEHEADER'.
MODIFY tevents FROM waevents INDEX sy-tabix.
ENDIF.
*& Form PAGEHEADER
To display heading inoutbuy
FORM pageheader .
DATA : theader TYPE slis_t_listheader,
waheader TYPE slis_listheader.
waheader-typ = 'H'.
waheader-info = 'Inoutbuy' .
APPEND waheader TO theader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = theader.
ENDFORM. "PAGEHEADER
Regards,
Ruchika
Reward if useful...........
Similar Messages
-
Rename alv header text in webdynpro abap
Hi ,
I have created two attribute PART_NUMBER and TERM_CODE in context level with type CHAR10.
AND in ALV header PART_NUMBER and TERM_CODE is displaying, which is coming from context level.
i want to rename the header of ALV to PARTNUMBER and TERMCODE.
could any one send me the sampls code or any solution?
Thanks
RaksharFirst get access to the ALV Model object for your ALV usage:
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data l_salv_wd_table type ref to iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv( ).
data l_table type ref to cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
Then access the column you want to change the header on. In addition to setting the text of the header of the column, you must also force off the data dictionary binding for the field property text.
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
data l_header type ref to cl_salv_wd_column_header.
l_header = l_column->get_header( ).
l_header->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
l_header->set_text( `Posting Date` ). -
REG: Set default width of the ALV header Text
Hi,
The issue which is reported is .
We have a Custom Z program which needs to display the ALV Output. And also there is a scope to change the Layout,
Now in one of the fields, there is
LOAD_NUMBER.
The length of this header is set to 11 in the Change Layout screen,
Now the issue is, If i want to change the layout and set the default width to 15 char and then save it
1)The ALV layout is saving with the Width as 15 and now i can see
*|LOAD_NUMBER<space><space><space><space>|*
|_________________________________________|
|_________________________________________|
|_________________________________________|
But when i re execute the Z Program, the first time when i go to the Change ALV Output screen, then i still see 11 as the default width,
*EITHER *
I want to get the default width what i have saved previously
OR
I want to set the default width to 15
Please give me suggestions or clues to handle such situations.
NOTE The ALV used is Blocked ALV.
Thanks
SriHi SRIKANTH,
ALV has a very weird feature: The layout is stored in some buffering tables that can not be accessed directly by the user. The buffer is re-generated only once a day when the layout changes.
Just run report BALVBUFDEL once, this may change it.
With ALV, I use the column width optimization feature avoiding trouble like this.
FORM alv_layout CHANGING ps_layout TYPE lvc_s_layo.
ps_layout-sel_mode = 'A'.
ps_layout-cwidth_opt =
ps_layout-zebra = abap_true.
ENDFORM. " ALV_LAYOUT
Regards,
Clemens -
Hellow experts,
I have one ALV GRid and i need to put the Headeing , I ned Out Put Like Below * this is heading i want
Student Marit Report From Date1 To Date 2
StdudentID Day1 day2
112 20 23
I m using Fiekld catalog and below is my alv code
DATA: alv_container TYPE REF TO cl_gui_docking_container.
DATA : CDINUM TYPE KDPOS.
DATA : gr_aggr TYPE REF TO cl_salv_aggregations.
*SET_COL_HEADER_STYLE
DATA: alv_grid TYPE REF TO cl_gui_alv_grid.
DATA:alv_grid_ref type ref to CL_GUI_ALV_GRID.
DATA: layout TYPE lvc_s_layo.
DATA: fieldcat TYPE lvc_t_fcat.
DATA : w_repid LIKE sy-repid.
this is ALV Exporting data
DATA: variant TYPE disvariant.
DATA: repid TYPE sy-repid.
repid = sy-repid.
variant-report = sy-repid.
variant-username = sy-uname. layout-zebra = 'X'.
*BREAK-POINT.
layout-edit_mode = 'X'. CHECK alv_container IS INITIAL.
CREATE OBJECT alv_container
EXPORTING repid = repid
dynnr = sy-dynnr
side = alv_container->dock_at_left
extension = 1500.
CREATE OBJECT alv_grid
EXPORTING
i_parent = alv_container.
PERFORM get_fieldcatalog.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
is_layout = layout
is_variant = variant
i_structure_name = 'I_ALV2'
CHANGING
it_outtab = i_alv2[]
it_fieldcatalog = fieldcat[].
ENDMODULE.
As per my above code i m not using 'REUSE_ALV_GRID_DISPLAY function.
PLz advoice me within my code.
Edited by: Neha.Servade on Dec 19, 2011 10:40 AMThanks To All ,
My Issue is Solved
I wrote the below code only
layout-grid_title = 'Production Report From'
Thats it -
Setting ALV Header text doesn't work
I'm trying to set different titles on my headers of the ALV table. To do this I do the following during the WDDOINIT of the COMPONENTCONTROLLER.
CALL METHOD WD_THIS->GO_ALV_EINSTELL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMNS
RECEIVING
VALUE = lt_columns
LOOP AT lt_columns INTO ls_column.
CASE ls_column-ID.
WHEN 'SETTING_ID'.
CALL METHOD LS_COLUMN-R_COLUMN->SET_FIXED_POSITION
EXPORTING
VALUE = CL_WD_ABSTR_TABLE_COLUMN=>E_FIXED_POSITION-LEFT
CALL METHOD LS_COLUMN-R_COLUMN->SET_POSITION
EXPORTING
VALUE = '2'
CALL METHOD LS_COLUMN-R_COLUMN->GET_HEADER
RECEIVING
VALUE = lo_header
IF NOT ( lo_header IS BOUND ).
CALL METHOD LS_COLUMN-R_COLUMN->CREATE_HEADER
RECEIVING
VALUE = lo_header
ENDIF.
CALL METHOD LO_HEADER->SET_TEXT
EXPORTING
VALUE = 'Einstellung'
WHEN 'EVENT_TYPE'.
ENDCASE.
ENDLOOP.
The debugger shows me that the different titles are updated but when it gets displayed I see the old DDIC titles. Any ideas on how to fix this?I hope you want to change the name of ALV column in the display.
Try following code for the same:
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv_table( ). " Value from the prop tab of the view
DATA: l_value TYPE REF TO cl_salv_wd_config_table.
l_value = l_ref_interfacecontroller->get_model( ).
DATA l_column TYPE REF TO cl_salv_wd_column.
DATA l_header TYPE REF TO cl_salv_wd_column_header.
l_column = l_value->if_salv_wd_column_settings~get_column( 'MATNR' ). " Name of column you want to change
l_header = l_column->get_header( ).
l_header->set_ddic_binding_field( ).
l_header->set_text( `Material Nuber` ). " Name that is to be displayed
Regards,
Saket.
Edited by: Saket Abhyankar on Jan 13, 2010 3:32 PM
Edited by: Saket Abhyankar on Jan 13, 2010 3:48 PM -
Vertical text in ALV header (WD4A)
HI,
Can anybody tell me how I can display ALV header text in WD4A as vertical text ?
Cheers, JohnHi,
DATA:
lr_alv_header TYPE REF TO cl_salv_wd_column_header.
Get the column reference of the ALV column.
CALL METHOD lr_column->set_width
EXPORTING
value = '70'.
lr_alv_header = lr_column->get_header( ).
lr_alv_header->set_text( 'Header' ).
lr_column->set_resizable( abap_true ).
lr_alv_header->set_header_text_wrapping( abap_true ). -
How to wrap the heading text in alv.
HI all,
I need help, how to wrap the heading text in alv.
can any help ... plz..
Advanced Thanks
Regards
GUhapriyanHello GuhaPriyan,
I assume that you're referring to the ALV Grid's title. The maximum length for this title is 70 characters and this would generally fit in the one line.
Are you intending to wrap it because you purposefully want the text to come in two lines? In that case, I'm not sure that it's possible.
But otherwise, there's an option in the Layout called SMALLTITLE. You can set this attribute so that the title would be displayed in a amaller font and hopefully, all of your text shows up on the screen.
Regards,
Anand Mandalika. -
Hi this is saroj.
i am new to alv reports.i have done a alv report by using FMs events_get,commentary_write,grid_display.
i am getting the data but i am not getting the header text of report and logo.
my coding is like this.
tables: kna1.
types: begin of it,
end of it.
data: it_field type slis_t_fieldcat_alv,
wa_field type slis_fieldcat_alv,
it_event type slis_t_event,
wa_event type slis_alv_event,
it_list type slis_t_listheader,
wa_list type slis_listheader,
repid type sy-repid.
perform select.
perform event.
perform header.
perform logo using it_list.
perform display.
in subroutine event:
reuse_alv_events_get
exporting
i_list_type = 0.
importing
et_events = it_event.
wa_event-name = 'top_of_page'.
wa_event-form = 'logo'.
append wa_event to it_event.
in subroutine header:
wa_list-typ = 'H'.
WA_LIST-INFO = 'SOME TEXT'.
APPEND WA_LIST TO IT_LIST.
IN SUBROUTINE LOGO.
REUSE_ALV_COMMENTARY_WRITE
EXPORTING
IT_LIST_COMMENTARY = 'IT_LIST'
I_LOGO = 'ENJOYSAP_LOGO'.
my issue is that i am getting the data but i am not getting the header text and logo.
please solve the issue.please give sample code.
regards
saroj kanta
Edited by: Julius Bussche on Aug 15, 2009 7:03 AMHi Saroj,
Try this
***Declarations,
*STEP1*
DATA : gt_events TYPE slis_t_event, " Internal table to capture various events in ALV
gs_events TYPE slis_alv_event.
*STEP2*
Perform event.
FORM event .
CLEAR : gt_events[],
gs_events.
*PASS THE VALUE AS FOLLOWS*
gs_events-name = slis_ev_top_of_page.
gs_events-form = slis_ev_top_of_page.
APPEND gs_events TO gt_events.
ENDFORM.
*STEP3*
*DECLARE TOP OF PAGE AS BELOW.*
**& Form TOP_OF_PAGE*
FORM top_of_page. "#EC CALLED
CONSTANTS: lc_header TYPE char1 VALUE 'H',
lc_selection TYPE char1 VALUE 'S'.
DATA: ls_header TYPE slis_listheader,
lt_header TYPE slis_t_listheader.
*-- Report Title
CLEAR ls_header.
REFRESH lt_header.
ls_header-typ = lc_header.
ls_header-key = 'Report :'(015). "Report
ls_header-info = sy-title.
APPEND ls_header TO lt_header.
*-- Client
ls_header-typ = lc_selection.
ls_header-key = 'Client :'(012). "Client
ls_header-info = sy-mandt.
APPEND ls_header TO lt_header.
CLEAR ls_header.
*-- User ID
ls_header-typ = lc_selection.
ls_header-key = 'User ID :'(013). "User ID
ls_header-info = sy-uname.
APPEND ls_header TO lt_header.
CLEAR ls_header.
*-- Date (MM/DD/YYYY)
ls_header-typ = lc_selection.
ls_header-key = 'Date :'(014). "Date
WRITE sy-datum TO ls_header-info.
APPEND ls_header TO lt_header.
CLEAR ls_header.
*-- Time
ls_header-typ = lc_selection.
ls_header-key = 'Time :'(016). "Time
WRITE sy-uzeit TO ls_header-info.
APPEND ls_header TO lt_header.
CLEAR ls_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lt_header.
ENDFORM. "top_of_page
Regards,
Vimal.
Edited by: Julius Bussche on Aug 15, 2009 7:04 AM
Added code tags... -
Displaying Header Text in ALV report.
HI Gurus,
I have one sales order which has header Text.
I am displaying that Header Text in my ALV report.
But while displaying in the ALV grid, the text is not coming full.
I have taken the datatype of the column of the ALV grid is string, Still the Header text is not come full.
Please help me.
Thanks in advance.Hi,
If the header text is morethan 60 characters, you can't print with REUSE_ALV_COMMENTARY_WRITE. To overcome above limit we can use dynamic document, which can be implemented through the class CL_DD_DOCUMENT. As dynamic documents use HTML viewer control so instead of triggering the TOP_OF_PAGE event we should trigger event of HTML TOP_OF_PAGE.
First create a subroutine for top of page in HTML format and send that name in I_CALLBACK_HTML_TOP_OF_PAGE parameter of ALV function module. The input parameter for this subroutine will be a variable of class CL_DD_DOCUMENT.
* FORM html_top_of_page *
FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
data: l_text(255) type c.
l_text = '*******************************Hellooooooooooooooooooo************************'.
CALL METHOD top->add_text EXPORTING text = 'Hello world '
sap_style = 'heading' .
CALL METHOD top->add_gap EXPORTING width = 200.
CALL METHOD top->add_picture EXPORTING picture_id = 'ENJOYSAP_LOGO'.
CALL METHOD top->NEW_LINE( ).
CALL METHOD top->add_text EXPORTING
text = l_text.
ENDFORM.
* Display ALV grid
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE' " Use this event
i_callback_program = g_repid
i_structure_name = 'STRUCTURE'
TABLES
t_outtab = gt_outtab.
Regards
Bala Krishna -
Direct navigation of header text of vd53 from alv
Hi expert
I have created one alv report based on the delivery level.The user need to know the hader text information of VD53.I alredy developed click event in the report.The problem is user need so many navigation reach the header text.The user want to navigate directly to the header text.
Please give any soln for this
Regards
ManojHi Manoj,
U have to make a BDC recording VD53 upto that particular screen. now in the click event make a call transaction for the BDC recording in Error mode.
This will help user to navigate to the particular screen without interacting.
Amitava -
Header Text for Field Catalog ALV Grid doubt ..
Hi everybody
I have an ALV Grid List Report (REUSE_ALV_LIST_DISPLAY)
but i have a trouble: the header texts for the fields are always truncated to 10 positions.
The code for fill the Field Catalog are:
CLEAR l_field_cat.
l_field_cat-COL_POS = 2.
l_field_cat-FIELDNAME = 'AVERAGE'.
l_field_cat-TABNAME = 'T_REPORT'.
l_field_cat-REF_TABNAME = 'RPSCO'.
l_field_cat-REF_FIELDNAME = 'WLP00'.
l_field_cat-SELTEXT_S = TEXT-004. <- 'AverageAmount' 20 lenght
l_field_cat-DDICTXT = 'S'.
l_field_cat-KEY = ' '.
l_field_cat-KEY_SEL = ' '.
APPEND l_field_cat TO p_field_cat.
But, although the column appears with 20 characters lenght, the header text appears 'AverageAmo', and it is in the same way for all the fields, even with fields with 40 characters lenght.
What am i doing incorrect ?
Thanks in Advanced
FrankThat is because of field I_field_cat-SELTEXT_S.
This will always display 10 char long text.
To avoid truncating you can specify length for the header.
Try this
x_fieldcat-seltext_l = TEXT-004.
x_fieldcat-outputlen = 20.
x_fieldcat-ddictxt = c_l.
Message was edited by: Ashish Gundawar
Message was edited by: Ashish Gundawar -
Hi friends,
I make one header alv ok I want and take one variable count in my program so I want to display its value in ALV HEADER
Total Target Qty:
Total EMP. Efficiency
Total Machine Effi.
I take may header like this and pass thre text here.ok Now I want to display value of this three.
Total Trget Qty: 2.23 like that.
CLEAR st_line.
st_line-typ = 'S'.
CONCATENATE 'Total Target Qty: ' count ' ' INTO st_line-info.
APPEND st_line TO t_list_top_of_page.
So I took like this in header count is my variable in which I take value.
So how can we pass the value in ALV Header please tell me.
its urgent so.
Thnaks in Advance.
Prashant.HI DHWANI,
*& Report ZPP_RE_EMP_DETAILS
*& This Report is used to check the Employee Performance And Used Machine Quantity
*& Rqueirement By Santhosh
*& Developed By Prashant On Date 01.02.2008
*& Created By: Prashant Brahmbhatt
*& Creation Date: 20080201
*& Module: PP (Production & Plannig)
*& Changed By Changed Date Reason
REPORT zpp_re_emp_details.
TABLES:zpplan.
TYPE-POOLS:slis.
DATA:BEGIN OF itab OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
iserh LIKE zpplan-iserh,
quaty LIKE zpplan-quaty,
plan_qty LIKE zpplan-plan_qty,
act_prod LIKE zpplan-act_prod,
temp TYPE c,
tar_qty(10) TYPE c,
ach_qty(10) TYPE c,
mch_eff(10) TYPE c,
a(10) TYPE c,
END OF itab.
DATA:BEGIN OF temp OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
iserh LIKE zpplan-iserh,
quaty LIKE zpplan-quaty,
plan_qty LIKE zpplan-plan_qty,
act_prod LIKE zpplan-act_prod,
temp TYPE c,
tar_qty(10) TYPE c,
ach_qty(10) TYPE c,
mch_eff(10) TYPE c,
a(10) TYPE c,
END OF temp.
DATA:BEGIN OF itab_t OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
iserh LIKE zpplan-iserh,
quaty LIKE zpplan-quaty,
plan_qty LIKE zpplan-plan_qty,
act_prod LIKE zpplan-act_prod,
temp TYPE c,
tar_qty(10) TYPE c,
ach_qty(10) TYPE c,
mch_eff(10) TYPE c,
a(10) TYPE c,
END OF itab_t.
DATA:BEGIN OF itab1 OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
act_prod LIKE zpplan-act_prod,
quaty LIKE zpplan-quaty,
planned LIKE zpplan-planned,
iserh LIKE zpplan-iserh,
temp TYPE c,
tar_qty TYPE p DECIMALS 2,
ach_qty TYPE p DECIMALS 2,
mch_eff TYPE p DECIMALS 2,
END OF itab1.
DATA: wa LIKE itab1.
DATA:BEGIN OF itab2 OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
act_prod LIKE zpplan-act_prod,
quaty LIKE zpplan-quaty,
planned LIKE zpplan-planned,
iserh LIKE zpplan-iserh,
temp TYPE c,
tar_qty(10) TYPE p DECIMALS 2,
ach_qty(10) TYPE p DECIMALS 2,
mch_eff(10) TYPE p DECIMALS 2,
count(10) TYPE c,
END OF itab2.
DATA: a(10) TYPE c,
b(10) TYPE c,
count(10) TYPE c,
count1(10) TYPE c.
c(2) TYPE p DECIMALS 2.
DATA:t_fcat TYPE slis_t_fieldcat_alv,
t_events TYPE slis_t_event,
t_list_top_of_page TYPE slis_t_listheader,
t_list_end_of_page TYPE slis_t_listheader.
CONSTANTS:c_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
CONSTANTS:c_formname_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
DATA: st_line TYPE slis_listheader.
SELECTION-SCREEN
SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
*PARAMETERS:shftin LIKE zpplan-shftin.
SELECT-OPTIONS:date FOR zpplan-zdate,
shftin FOR zpplan-shftin,
werks FOR zpplan-werks.
SELECTION-SCREEN:END OF BLOCK blk1.
ALV CALL
INITIALIZATION.
PERFORM build_fieldcatalog USING t_fcat .
PERFORM event_call.
PERFORM head_built USING t_events.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM display_alv.
*& Form build_fieldcatalog
text
-->P_T_FCAT text
FORM build_fieldcatalog USING temp_fcat TYPE slis_t_fieldcat_alv.
DATA:w_fcat TYPE slis_fieldcat_alv.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'MNAME'.
w_fcat-seltext_m = 'Machine Name'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'SHFTIN'.
w_fcat-seltext_m = 'Emp No'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ZDATE'.
w_fcat-seltext_m = 'Pos Date'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'QUATY'.
w_fcat-seltext_m = 'Quantity'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ACT_PROD'.
w_fcat-seltext_m = 'Actual Quantity'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ISERH'.
w_fcat-seltext_m = 'Down Time'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'TAR_QTY'.
w_fcat-seltext_m = 'Target Qty.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ACH_QTY'.
w_fcat-seltext_m = 'EMP Effec.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'MCH_EFF'.
w_fcat-seltext_m = 'Machine Effec.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'COUNT'.
w_fcat-seltext_m = 'Machine Effec.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
ENDFORM. " build_fieldcatalog
*& Form event_call
text
--> p1 text
<-- p2 text
FORM event_call .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = t_events
EXCEPTIONS
LIST_TYPE_WRONG = 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. " event_call
*& Form data_retrieval
text
--> p1 text
<-- p2 text
FORM data_retrieval .
IF shftin <> ''.
SELECT zdate werks mname shftin INTO CORRESPONDING FIELDS OF TABLE
temp FROM zpplan
WHERE shftin IN shftin
AND zdate IN date
AND werks IN werks.
ELSE.
SELECT zdate werks mname INTO CORRESPONDING FIELDS OF TABLE
temp FROM zpplan
WHERE zdate IN date
AND werks IN werks.
ENDIF.
SORT temp BY mname zdate shftin.
DELETE ADJACENT DUPLICATES FROM temp.
SORT temp BY mname shftin zdate.
DELETE ADJACENT DUPLICATES FROM temp.
APPEND temp.
LOOP AT temp.
SELECT zdate werks mname shftin act_prod quaty iserh FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab_t
WHERE mname = temp-mname
AND zdate = temp-zdate
AND werks = temp-werks.
LOOP AT itab_t.
MOVE-CORRESPONDING itab_t TO itab.
APPEND itab.
ENDLOOP.
ENDLOOP.
*******************************************8
SELECT zdate werks mname shftin act_prod quaty iserh FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab
FOR ALL ENTRIES IN temp
WHERE zdate = temp-zdate AND
werks = temp-werks
AND mname = temp-mname.
SELECT zdate werks mname shftin act_prod quaty iserh FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab
WHERE zdate IN date AND
werks IN werks AND
shftin = shftin.
SORT itab BY mname zdate.
DELETE ADJACENT DUPLICATES FROM itab.
LOOP AT itab.
MOVE-CORRESPONDING itab TO itab1.
COLLECT itab1.
ENDLOOP.
LOOP AT itab1.
itab1-tar_qty = itab1-tar_qty + ( itab1-quaty / 3 ).
IF ( itab1-tar_qty NE 0 ).
itab1-ach_qty = ( itab1-ach_qty + itab1-act_prod / itab1-tar_qty ) * 100.
ELSE.
itab1-ach_qty = 0 * 100.
ENDIF.
itab1-mch_eff = ( ( 8 - itab1-iserh ) / 8 ) * 100.
MODIFY itab1 TRANSPORTING tar_qty ach_qty mch_eff.
ENDLOOP.
LOOP AT itab1.
READ TABLE itab1 INDEX 1 INTO wa.
IF itab1-mname = wa-mname.
itab1-zdate = wa-zdate.
itab2-shftin = itab1-shftin.
itab2-mname = itab1-mname.
itab2-zdate = itab1-zdate.
itab2-quaty = itab2-quaty + itab1-quaty.
itab2-act_prod = itab2-act_prod + itab1-act_prod.
itab2-iserh = itab2-iserh + itab1-iserh.
itab2-tar_qty = itab2-tar_qty + itab1-tar_qty.
itab2-ach_qty = itab2-ach_qty + itab1-ach_qty.
itab2-mch_eff = itab2-mch_eff + itab1-mch_eff.
ELSE.
APPEND itab2.
CLEAR itab2.
MOVE-CORRESPONDING itab1 TO wa.
itab2-shftin = itab1-shftin.
itab2-mname = itab1-mname.
itab2-zdate = itab1-zdate.
itab2-quaty = itab2-quaty + itab1-quaty.
itab2-act_prod = itab2-act_prod + itab1-act_prod.
itab2-iserh = itab2-iserh + itab1-iserh.
itab2-tar_qty = itab2-tar_qty + itab1-tar_qty.
itab2-ach_qty = itab2-ach_qty + itab1-ach_qty.
itab2-mch_eff = itab2-mch_eff + itab1-mch_eff.
ENDIF.
ENDLOOP.
APPEND itab2.
LOOP AT itab2.
IF ( itab2-tar_qty NE 0 ).
itab2-ach_qty = ( itab2-ach_qty + itab2-act_prod / itab2-tar_qty(10) ) * 100.
ELSE.
itab2-ach_qty = 0 * 100.
ENDIF.
itab2-mch_eff = ( ( 8 - itab2-iserh ) / 8 ) * 100.
MODIFY itab2 TRANSPORTING tar_qty ach_qty mch_eff.
ENDLOOP.
APPEND itab2.
LOOP AT itab2.
count = sy-tfill.
a = a + itab2-tar_qty.
b = b + itab2-ach_qty.
ENDLOOP.
CLEAR itab2.
itab2-tar_qty = a.
itab2-ach_qty = b.
APPEND itab2.
CLEAR itab2.
count = a / sy-tfill.
count1 = b / sy-tfill.
itab2-tar_qty = count.
itab2-ach_qty = count1.
itab2-tar_qty = count.
APPEND itab2.
ENDFORM. " data_retrieval
*& Form head_built
text
-->P_T_EVE text
FORM head_built USING p_t_eve TYPE slis_t_event.
count = a / sy-tfill.
DATA: ls_event TYPE slis_alv_event.
REFRESH t_list_top_of_page.
READ TABLE p_t_eve WITH KEY name = slis_ev_top_of_page INTO ls_event.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO ls_event-form.
MODIFY p_t_eve FROM ls_event INDEX sy-tabix.
ENDIF.
CLEAR st_line.
st_line-typ = 'S'.
st_line-key = 'Total Target Qty: '.
st_line-info = count.
APPEND st_line TO t_list_top_of_page.
CLEAR st_line.
st_line-typ = 'S'.
st_line-info = count.
CONCATENATE 'Avg Target Qty.' count ' ' INTO st_line-info.
APPEND st_line TO t_list_top_of_page.
CLEAR st_line.
st_line-typ = 'S'.
st_line-key = 'Avg.EMP Efficiency: '.
st_line-info = count1.
APPEND st_line TO t_list_top_of_page.
CLEAR st_line.
st_line-typ = 'S'.
st_line-key = 'Avg. Machine Efficincy: '.
st_line-info = count.
APPEND st_line TO t_list_top_of_page.
REFRESH t_list_end_of_page.
READ TABLE p_t_eve WITH KEY name = slis_ev_end_of_list INTO ls_event.
IF sy-subrc = 0.
MOVE c_formname_end_of_page TO ls_event-form.
MODIFY p_t_eve FROM ls_event INDEX sy-tabix.
ENDIF.
CLEAR st_line.
st_line-typ = 'S'.
CONCATENATE 'END OF PAGE' ' ' INTO st_line-info.
APPEND st_line TO t_list_end_of_page.
ENDFORM. " head_built
*& Form top-of-page
text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_top_of_page
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "top-of-page
*& Form display_alv
text
--> p1 text
<-- p2 text
FORM display_alv .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = 'ZPP_RE_EMP_DETAILS'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
i_background_id = 'ALV_BACKGROUND'
i_grid_title = 'EMP Information'
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = t_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = t_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 = itab2
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_alv -
How to get Different language in ALV header
Hi Experts,
Please help to get the Header text in other language other than English.
I want to get Combodian language to be in the header so that the user can understand by looking at the header.Its is also required for the top of page event.
If any translations required in future is there any option to change that header
Pleas help me,
Thanks in advance.
Regards,
Shalem.I think whatever header you want to mention that should be specified in fieldcatalogue. So in whichever format/language you are specifying in fieldcatalgue in that format/language only it will be displayed in alv.
Best Regards,
Vibha
*Please mark all the helpful answers -
User Exit / BADI for Header Text in IW21
Dear All,
I have an requirement to update a header text of IW21 (Creating Notification) with some condition, ie., Header Text should be updated with different text (some information along with entered text) depends on Notification type and Functional Location.
Is there any User Exit / Badi to do this ?
Could any one help on this regard ?
Thanks and Regards,Hi,
Below are the exits for the Transaction Code - IW21.
Exit Name Description
IWO10026 User check on setting status 'Do not perform'
IWO10027 User exit: Generate user-defined settlement rule
IWOC0002 PM/SM notification: Check whether status change is allowed
IWOC0003 PM/SM authorization check of ref. object and planner group
IWOC0004 Change single-level list editing PM/QM/SM ALV settings
IWOC0001 Create PM/SM notification: Determine reference object
Check each which can server your purpose.
May be EXIT_SAPMIWO0_020 might suit your purpose.
Regards,
Vijay V -
FM to display full header text in a pop up window
1 . I have a ALV report which displays first line of a headr text for a perticular sales doc.
if i click on a header text i should see the complete header text for that particular sales doc. in a pop up window.
is there any FM to do so .
please repond quickly . its urgent
i will award full points to all attempters.Hi,
For your reference-
Re: How to create POPUP windows (from ALV report)
You can have a look at a standard program where pop-up functionality is used.
BCALV_GRID_AND_POPUP
<b>Reward Points if Helpful!!</b>
Maybe you are looking for
-
How do I keep my new finder window preference set to open a certain folder on the server?
Since switching to Lion, my new finder window preference keeps resetting itself to default. When I open a new finder window I want it to be a certain folder on our server. This setting was persistent in Snow Leopard. Now I have to keep setting it bac
-
Is there a way to connect an old Apple II keyboard (ADB) to my USB iMac?
I just found some old Apple ADB-equipped keyboards (closets are scary places) and would like to find a cable connector that would allow me to use the keyboards with our Mac Mini and iMac (equipped with USB only). Is such available? and, does it work
-
Chrome and Opera- Aw Snap/ Crashing Error on Literally Everything!
I bought the new Mac Pro this past summer and have never been able to get Chrome or Opera (latest versions of each) to work. I have performed the steps suggested in the Google Help Center, including renaming the "Default" folder in Application Suppor
-
USB727 Windows 7 x64 Blue Screen of Death BSOD
Hi, Every time I use my Verizon USB727 on Windows 7 x64, after removing, when I try and suspend (sleep) my laptop I get a BSOD. I have a Lenovo T500. I am running in NDIS mode. This worked great under Vista x32. If I shutdown my laptop before removin
-
Hi, We have just finish apply/update our SAP Netweaver WebAS 6.40 (Java) with the support package (SP25). When we test our application, we encountered the following exception com.sap.engine.services.jndi.persistent.exceptions.NamingException: Error g