Reg : Gird Title In REUSE_ALV_GRID_DISPLAY
Hi Friends,
I am working with ALV Grid Display . In that my requirement is i need keep the grid title at 30th column out of 60 colums.
So i am providing space infront of grid title like this : ' ALV Grid' but after 75 characters space it is going to dump.
So how can i rectify this problem . Please help me.
Thanks ,
Laxmi
Hi,
Laxmi
just go through the following piece of code..
REPORT alv_top_of_page.
TABLES : t001.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
TYPES : BEGIN OF ty_comp.
INCLUDE STRUCTURE t001.
TYPES : END OF ty_comp.
DATA: wa_layout TYPE slis_layout_alv.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : it_comp TYPE TABLE OF ty_comp.
INITIALIZATION.
w_repid = sy-repid.
START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE it_comp.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'IT_COMP'
i_inclname = w_repid
CHANGING
ct_fieldcat = it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_comp
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form html_top_of_page
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
DATA: text TYPE sdydo_text_element.
CALL METHOD document->add_gap
EXPORTING
width = 100.
text = 'Company Code Data'.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'HEADING'.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
text = 'User Name : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-uname.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->add_gap
EXPORTING
width = 50.
text = 'Date : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-datum.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->add_gap
EXPORTING
width = 50.
text = 'Time : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-uzeit.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
ENDFORM. "HTML_TOP_OF_PAGE
i hope u will get the solution...
Thansk
Ashu
Similar Messages
-
Titles in REUSE_ALV_GRID_DISPLAY
let's try somting else.
i can do title <mantr> in 1 cell
and under to saparate to 3 cell and put there 3 fields
like in excel
example
matnr |
<b>123344</b> |
<i>2</i>|<i>3</i>|<i>5</i> |HI
You have not mentioned clearly what is your requirement actually what you want to print actually in the title of REUSE_ALV_GRID_DISPLAY
REPORT ZALV_GRID.
TABLES :vbap.
type-pools : slis.
data i_events TYPE slis_t_event.
DATA : my_alv TYPE REF TO cl_gui_alv_grid.
TYPES : BEGIN OF itab,
vbeln LIKE vbap-vbeln,
arktx LIKE vbap-arktx,
END OF itab.
TYPES : itab1 TYPE TABLE OF itab.
DATA : display TYPE itab1.
DATA : fcat TYPE SLIS_T_FIELDCAT_ALV.
DATA : wa LIKE LINE OF FCAT.
DATA WA1 LIKE VBAP.
DATA: container TYPE REF TO cl_gui_custom_container.
data report_id like sy-repid.
SELECT-OPTIONS s_vbeln FOR vbap-vbeln.
report_id = sy-repid.
SELECT * FROM vbap INTO CORRESPONDING FIELDS OF TABLE display WHERE
vbeln IN s_vbeln.
wa-fieldname = 'VBELN'.
wa-tabname = 'VBAP'.
wa-key = 'X'.
WA-HOTSPOT = 'X'.
wa-text_fieldname = 'Doc no.'.
APPEND wa TO fcat.
CLEAR wa.
wa-fieldname = 'ARKTX'.
wa-tabname = 'VBAP'.
wa-text_fieldname = 'Item Text'.
APPEND wa TO fcat.
PERFORM f0650_build_event USING 'USER_COMMAND'
'F0750_USER_COMMAND'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY '
EXPORTING
I_CALLBACK_PROGRAM = report_id
IT_FIELDCAT = FCAT
IT_EVENTS = i_events
TABLES
t_outtab = DISPLAY
FORM f0650_build_event USING value(w_c_event_name)
value(w_c_event_form).
DATA: f0650_wa_event TYPE slis_alv_event.
CLEAR f0650_wa_event.
f0650_wa_event-name = w_c_event_name.
f0650_wa_event-form = w_c_event_form.
APPEND f0650_wa_event TO i_events.
ENDFORM.
FORM f0750_user_command USING w_ucomm TYPE sy-ucomm
w_selfield TYPE slis_selfield.
CASE w_ucomm.
WHEN '&IC1'.
READ TABLE DISPLAY INTO WA1 INDEX w_selfield-tabindex.
MESSAGE E000 WITH
' You have no authorization to view the report'.
call transaction 'SE11'.
ENDCASE.
ENDFORM.
End of Program
Try out this report,i hope this will help you to solve your problem
Thanks
Mrutyunjaya Tripathy -
How to get the multiple lines on the header part in ALV
HI all,
In my program i am using the ALV- Grid functionality through methods. I have 2 different layouts in the same screen , for this i have 2 containers and i am displaying the title through the gird title now i need to add the few more lines under the title .
Please suggest me, how can i proceede now.
Thanks
GiridharHi,
check this sample code, i did it using splitter container. check it, it is weel documented to know what are required ....
REPORT ZTEST_ALV_TOP MESSAGE-ID ZZ .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: L_VALID TYPE C,
V_FLAG,
V_DATA_CHANGE,
V_ROW TYPE LVC_S_ROW,
V_COLUMN TYPE LVC_S_COL,
V_ROW_NUM TYPE LVC_S_ROID.
DATA: IT_ROW_NO TYPE LVC_T_ROID,
X_ROW_NO TYPE LVC_S_ROID.
DATA:BEGIN OF ITAB OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
CELLCOLOR TYPE LVC_T_SCOL, "required for color
DROP(10),
END OF ITAB.
"The Below Definitions Must.....
DATA:
* Reference to document
DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,
* Reference to split container
DG_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
* Reference to grid container
DG_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER,
* Reference to html container
DG_HTML_CNTRL TYPE REF TO CL_GUI_HTML_VIEWER,
* Reference to html container
DG_PARENT_HTML TYPE REF TO CL_GUI_CONTAINER.
"up to here
* CLASS lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
**Hot spot Handler
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
**Double Click Handler
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO,
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE "event handler
OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
* END_OF_LIST FOR EVENT end_of_list "event handler
* OF CL_GUI_ALV_GRID
* IMPORTING E_DYNDOC_ID.
ENDCLASS. "lcl_event_handler DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Handle Hotspot Click
METHOD HANDLE_HOTSPOT_CLICK .
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW_ID.
V_COLUMN = E_COLUMN_ID.
V_ROW_NUM = ES_ROW_NO.
* MESSAGE I000 WITH V_ROW 'clicked'.
CLEAR IT_ROW_NO[].
X_ROW_NO-ROW_ID = V_ROW.
APPEND X_ROW_NO TO IT_ROW_NO .
CALL METHOD G_GRID->SET_SELECTED_ROWS
EXPORTING
IT_ROW_NO = IT_ROW_NO.
ENDMETHOD. "lcl_event_handler
*Handle Double Click
METHOD HANDLE_DOUBLE_CLICK.
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW.
V_COLUMN = E_COLUMN.
V_ROW_NUM = ES_ROW_NO.
IF E_COLUMN = 'VBELN'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ENDIF.
IF E_COLUMN = 'POSNR'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN."
ENDIF.
ENDMETHOD. "handle_double_click
* METHOD END_OF_LIST. "implementation
** Top-of-page event
* PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
* ENDMETHOD. "top_of_page
METHOD TOP_OF_PAGE. "implementation
* Top-of-page event
PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
ENDMETHOD. "top_of_page
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*& Global Definitions
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM,
G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST',
GS_LAYOUT TYPE LVC_S_LAYO.
data: v_lines type i.
data: v_line(3) type c.
*- Fieldcatalog for First and second Report
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT,
LS_VARI TYPE DISVARIANT.
* START-OF_SELECTION
START-OF-SELECTION.
SELECT VBELN
POSNR
FROM LIPS
UP TO 20 ROWS
INTO CORRESPONDING FIELDS OF TABLE ITAB.
describe table itab lines v_lines.
END-OF-SELECTION.
IF NOT ITAB[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.
*& Form CREATE_AND_INIT_ALV
* text
FORM CREATE_AND_INIT_ALV .
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
"attention.....from here
"split your container here...into two parts
"create the container
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER1.
"this is for top of page
* Create TOP-Document
CREATE OBJECT DG_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
* Create Splitter for custom_container
CREATE OBJECT DG_SPLITTER
EXPORTING PARENT = G_CUSTOM_CONTAINER
ROWS = 2
COLUMNS = 1.
* Split the custom_container to two containers and move the reference
* to receiving containers g_parent_html and g_parent_grid
"i am allocating the space for grid and top of page
CALL METHOD DG_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = DG_PARENT_HTML.
CALL METHOD DG_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = DG_PARENT_GRID.
* CALL METHOD DG_SPLITTER->GET_CONTAINER
* EXPORTING
* ROW = 2
* COLUMN = 1
* RECEIVING
* CONTAINER = DG_PARENT_HTML.
* CALL METHOD DG_SPLITTER->GET_CONTAINER
* EXPORTING
* ROW = 1
* COLUMN = 1
* RECEIVING
* CONTAINER = DG_PARENT_GRID.
"you can set the height of it
* Set height for g_parent_html
CALL METHOD DG_SPLITTER->SET_ROW_HEIGHT
EXPORTING
ID = 1
HEIGHT = 5.
"from here as usual..you need to specify parent as splitter part
"which we alloted for grid
CREATE OBJECT G_GRID
EXPORTING I_PARENT = DG_PARENT_GRID.
* Set a titlebar for the grid control
CLEAR GS_LAYOUT.
GS_LAYOUT-GRID_TITLE = TEXT-003.
GS_LAYOUT-ZEBRA = SPACE.
GS_LAYOUT-CWIDTH_OPT = 'X'.
GS_LAYOUT-NO_ROWMARK = 'X'.
GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
* SET HANDLER G_HANDLER->END_OF_LIST FOR G_GRID.
SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
DATA: LS_CELLCOLOR TYPE LVC_S_SCOL. "required for color
DATA: L_INDEX TYPE SY-TABIX.
"Here i am changing the color of line 1,5,10...
"so you can change the color of font conditionally
LOOP AT ITAB.
L_INDEX = SY-TABIX.
IF L_INDEX = 1 OR L_INDEX = 5 OR L_INDEX = 10.
LS_CELLCOLOR-FNAME = 'VBELN'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
LS_CELLCOLOR-FNAME = 'POSNR'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
ENDIF.
ENDLOOP.
* setting focus for created grid control
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
EXPORTING
CONTROL = G_GRID.
* Build fieldcat and set editable for date and reason code
* edit enabled. Assign a handle for the dropdown listbox.
PERFORM BUILD_FIELDCAT.
PERFORM SET_DRDN_TABLE.
* Optionally restrict generic functions to 'change only'.
* (The user shall not be able to add new lines).
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
**Vaiant to save the layout
LS_VARI-REPORT = SY-REPID.
LS_VARI-HANDLE = SPACE.
LS_VARI-LOG_GROUP = SPACE.
LS_VARI-USERNAME = SPACE.
LS_VARI-VARIANT = SPACE.
LS_VARI-TEXT = SPACE.
LS_VARI-DEPENDVARS = SPACE.
**Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
"do these..{
* Initializing document
CALL METHOD DG_DYNDOC_ID->INITIALIZE_DOCUMENT.
* Processing events
CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = DG_DYNDOC_ID.
"end }
* Set editable cells to ready for input initially
CALL METHOD G_GRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ENDFORM. "CREATE_AND_INIT_ALV
*& Form EXCLUDE_TB_FUNCTIONS
* text
* -->PT_EXCLUDE text
FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
* Only allow to change data not to create new entries (exclude
* generic functions).
DATA LS_EXCLUDE TYPE UI_FUNC.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
*& Form build_fieldcat
* Fieldcatalog
FORM BUILD_FIELDCAT .
DATA: L_POS TYPE I.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-HOTSPOT = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Item'(025).
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Drop'(025).
X_FIELDCAT-FIELDNAME = 'DROP'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-DRDN_HNDL = '1'.
X_FIELDCAT-DRDN_ALIAS = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
ENDFORM. " build_fieldcat
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF G_CUSTOM_CONTAINER IS INITIAL.
**Initializing the grid and calling the fm to Display the O/P
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form SET_DRDN_TABLE
* text
FORM SET_DRDN_TABLE.
DATA:LT_DRAL TYPE LVC_T_DRAL,
LS_DRAL TYPE LVC_S_DRAL.
LOOP AT ITAB .
* First listbox (handle '1').
IF SY-INDEX = 1.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = ' '.
LS_DRAL-INT_VALUE = ' '.
ELSE.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = ITAB-POSNR.
LS_DRAL-INT_VALUE = ITAB-POSNR.
ENDIF.
APPEND LS_DRAL TO LT_DRAL.
ENDLOOP.
**Setting the Drop down table for Reason Code
CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
EXPORTING
IT_DROP_DOWN_ALIAS = LT_DRAL.
ENDFORM. " set_drdn_table
*& Form EVENT_TOP_OF_PAGE
* text
* -->DG_DYNDOC_ID text
FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
"this is more clear.....check it
"first add text, then pass it to comentry write fm
DATA : DL_TEXT(255) TYPE C. "Text
* Populating header to top-of-page
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = 'Test Report'
SAP_STYLE = CL_DD_AREA=>HEADING.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move program ID
CONCATENATE 'Program Name :' SY-REPID
INTO DL_TEXT SEPARATED BY SPACE.
* Add Program Name to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move User ID
CONCATENATE 'User ID :' SY-UNAME INTO DL_TEXT SEPARATED BY SPACE
* Add User ID to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move count (no of records).
move v_lines to v_line.
CONCATENATE 'No of records :' v_line INTO DL_TEXT SEPARATED BY SPACE.
* Add Client to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move date
WRITE SY-DATUM TO DL_TEXT.
CONCATENATE 'Date :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
* Add Date to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move time
WRITE SY-UZEIT TO DL_TEXT.
CONCATENATE 'Time :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
* Add Time to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
* Populating data to html control
PERFORM HTML.
ENDFORM. " EVENT_TOP_OF_PAGE
*& Form ADD_TEXT
* To add Text
FORM ADD_TEXT USING P_TEXT TYPE SDYDO_TEXT_ELEMENT.
* Adding text
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = P_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING.
ENDFORM. " ADD_TEXT
*& Form HTML
* text
FORM HTML.
DATA : DL_LENGTH TYPE I, " Length
DL_BACKGROUND_ID TYPE SDYDO_KEY VALUE SPACE. " Background_id
* Creating html control
IF DG_HTML_CNTRL IS INITIAL.
CREATE OBJECT DG_HTML_CNTRL
EXPORTING
PARENT = DG_PARENT_HTML.
ENDIF.
* Reuse_alv_grid_commentary_set
CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
EXPORTING
DOCUMENT = DG_DYNDOC_ID
BOTTOM = SPACE
IMPORTING
LENGTH = DL_LENGTH.
* Get TOP->HTML_TABLE ready
CALL METHOD DG_DYNDOC_ID->MERGE_DOCUMENT.
* Set wallpaper
CALL METHOD DG_DYNDOC_ID->SET_DOCUMENT_BACKGROUND
EXPORTING
PICTURE_ID = DL_BACKGROUND_ID.
* Connect TOP document to HTML-Control
DG_DYNDOC_ID->HTML_CONTROL = DG_HTML_CNTRL.
* Display TOP document
CALL METHOD DG_DYNDOC_ID->DISPLAY_DOCUMENT
EXPORTING
REUSE_CONTROL = 'X'
PARENT = DG_PARENT_HTML
EXCEPTIONS
HTML_DISPLAY_ERROR = 1.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Error in displaying top-of-page'(036).
ENDIF.
ENDFORM. " HTML
Regards
vijay -
Reg: ALV (REUSE_ALV_GRID_DISPLAY)
Hi Experts,
I need to know how to give drop down list in one of the field in my ALV.
I found some posting in sdn, but that are related to OOPS concepts.
But i am using REUSE function module.
Can you please provide me the solution how to achecive drop down list in ALV using REUSE_ALV_GRID_DISPLAY.
Thanks
Vijay.RHi Vijayendran,
There is only oops method available to create drop down list in ALV.
Go through the program below and modify your program accordingly.
Only thing that you have to do is to create container for your alv and use this container for displaying drop down list.
This program displays a dropdown list in one of the fields of the ALV.
*& Report Z_LISTBOX_ALV
*& Program to display a dropdown list in ALV.
REPORT z_listbox_alv.
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_rating,
task(20) TYPE c,
rating TYPE i,
weightage(2) TYPE c,
comments(40) TYPE c,
END OF ty_rating.
DATA: g_alvgrid TYPE REF TO cl_gui_alv_grid,
g_alv_container TYPE REF TO cl_gui_custom_container,
int_fieldcat TYPE lvc_t_fcat,
ok_code TYPE sy-ucomm.
DATA: int_outputdata TYPE TABLE OF ty_rating.
INITIALIZATION.
START-OF-SELECTION.
* call new screen for displaying the oop alv
CALL SCREEN 1100.
* Double click on the screen, it takes you the screen painter (SE51). Create
* Custom Container on the screen and name is as u2018CONTAINERu2019. Set the Ok-Code
* the screen as u2018OK_CODEu2019. Also create a GUI status named 'STANDARD' and
* in set Ok-code '&F03' for the back button.
* The screen 1100 thus gets created to hold the grid ALV.
* In the PBO of the screen, call the modules to set pf-status, title and
* to display the ALV list.
* In case we have an interactive ALV or for additional functionalities we can
* create OK-CODES and based on the user command we do the coding in the PAI.
*& Module STATUS_0600 OUTPUT
* set the PF status of the screen. Called in PBO of screen.
MODULE status_0600 OUTPUT.
SET PF-STATUS 'STANDARD'.
ENDMODULE. " STATUS_0600 OUTPUT
*& Module DISPLAY_ALV OUTPUT
* Displays the alv list. Called in PBO of screen.
MODULE display_alv OUTPUT.
* get the data.
PERFORM retrieve_data.
* prepare fieldcatalog for displaying the alv
PERFORM prepare_fieldcatalog.
* create a container to display the list
CREATE OBJECT g_alv_container
EXPORTING
container_name = 'CONTAINER'.
* create a reference for the alv
CREATE OBJECT g_alvgrid
EXPORTING
i_parent = g_alv_container.
* prepare a listbox for the rating column
PERFORM fill_dropdown.
* call the method to display the list
CALL METHOD g_alvgrid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = 'X'
i_save = 'X'
CHANGING
it_outtab = int_outputdata
it_fieldcatalog = int_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. "DISPLAY_ALV OUTPUT
*& Form PREPARE_FIELDCATALOG
* prepares fieldcatalog
FORM prepare_fieldcatalog .
DATA: lws_fieldcat TYPE lvc_s_fcat.
CLEAR int_fieldcat.
CLEAR lws_fieldcat.
lws_fieldcat-col_pos = 1.
lws_fieldcat-fieldname = 'TASK'.
lws_fieldcat-scrtext_m = 'TASK'.
APPEND lws_fieldcat TO int_fieldcat.
CLEAR lws_fieldcat.
lws_fieldcat-col_pos = 2.
lws_fieldcat-fieldname = 'RATING'.
lws_fieldcat-edit = 'X'.
lws_fieldcat-scrtext_m = 'RATING'.
lws_fieldcat-just = 'L'.
lws_fieldcat-outputlen = '6'.
lws_fieldcat-drdn_hndl = '1'. "handle for listbox
APPEND lws_fieldcat TO int_fieldcat.
CLEAR lws_fieldcat.
lws_fieldcat-col_pos = 3.
lws_fieldcat-fieldname = 'WEIGHTAGE'.
lws_fieldcat-scrtext_m = 'WEIGHTAGE'.
lws_fieldcat-outputlen = '9'.
APPEND lws_fieldcat TO int_fieldcat.
CLEAR lws_fieldcat.
lws_fieldcat-col_pos = 4.
lws_fieldcat-fieldname = 'COMMENTS'.
lws_fieldcat-scrtext_m = 'COMMENTS'.
lws_fieldcat-edit = 'X'.
APPEND lws_fieldcat TO int_fieldcat.
ENDFORM. " PREPARE_FIELDCATALOG
*& Form RETRIEVE_DATA
* retreives the data to be displayed
FORM retrieve_data .
DATA: lws_outputdata TYPE ty_rating.
CLEAR int_outputdata.
CLEAR lws_outputdata.
lws_outputdata-task = 'proj. related'.
lws_outputdata-weightage = '20'.
APPEND lws_outputdata TO int_outputdata.
CLEAR lws_outputdata.
lws_outputdata-task = 'process. related'.
lws_outputdata-weightage = '10'.
APPEND lws_outputdata TO int_outputdata.
CLEAR lws_outputdata.
lws_outputdata-task = 'knowledge mgnt.'.
lws_outputdata-weightage = '30'.
APPEND lws_outputdata TO int_outputdata.
ENDFORM. " RETRIEVE_DATA
*& Form FILL_DROPDOWN
* prepares the listbox to be displayed and assigns it to the alv
FORM fill_dropdown .
DATA: lint_dropdown TYPE lvc_t_drop,
lws_dropdown TYPE lvc_s_drop.
CLEAR lint_dropdown.
CLEAR lws_dropdown.
lws_dropdown-handle = '1'.
lws_dropdown-value = '5'.
APPEND lws_dropdown TO lint_dropdown.
CLEAR lws_dropdown.
lws_dropdown-handle = '1'.
lws_dropdown-value = '4'.
APPEND lws_dropdown TO lint_dropdown.
CLEAR lws_dropdown.
lws_dropdown-handle = '1'.
lws_dropdown-value = '3'.
APPEND lws_dropdown TO lint_dropdown.
CLEAR lws_dropdown.
lws_dropdown-handle = '1'.
lws_dropdown-value = '2'.
APPEND lws_dropdown TO lint_dropdown.
CLEAR lws_dropdown.
lws_dropdown-handle = '1'.
lws_dropdown-value = '1'.
APPEND lws_dropdown TO lint_dropdown.
CALL METHOD g_alvgrid->set_drop_down_table
EXPORTING
it_drop_down = lint_dropdown.
ENDFORM. " FILL_DROPDOWN
*& Module HANDLE_GOBACK INPUT
* handles 'back' button. Called in PAI of the screen.
MODULE handle_goback INPUT.
IF ok_code EQ '&F03'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
Get back to me for any clarification.
Regards,
Bhavesh -
Reuse_alv_grid_display TITLE problem after refresh
All,
I have a alv report using fm reuse_alv_grid_display. While calling initially this fm i am passing the grid tile in I_GRID_TITLE parameter. its displaying in grid, then after user click on the app toolbar button , i am doing some filteration , then coming back to grid the TITLE is missing in display
Any Info . below is the code snipet
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'F_PF_STATUS_SET'
i_callback_user_command = gc_user_com
i_grid_title = gv_gtitle "<< passing initially
then in User_command i am filering some values on the basis of button clicked (Button placed in app toolbar)
FORM f_user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield .
WHEN '&EXP'.
perform f_expand.
p_selfield-refresh = 'X'. "<<<----- refresh the grid
code for f_expand
form f_expand.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET' " Getting current layout
IMPORTING
es_layout = ls_layout
et_filter = lt_filter
es_grid_scroll = ls_grid_scroll
es_print = ls_print
EXCEPTIONS
OTHERS = 1.
" Here doing some filteration. ie append some values to IT_FILTER table for enabling then filter
perform f_set_fltr_val_exp using lt_filter[].
ls_layout-colwidth_optimize = gc_x.
read table gt_sfieldcat into gv_fieldcat
with key fieldname = 'REGIO'.
if sy-subrc eq 0.
gv_fieldcat-no_out = ' '.
modify gt_sfieldcat from gv_fieldcat index sy-tabix.
endif.
* Set the grid title to include the parameters and the report type
CONCATENATE text-027 p_bukrs text-028 p_perio
text-029 p_gjahr
INTO gv_gtitle SEPARATED BY space.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
EXPORTING
is_layout = ls_layout
it_fieldcat = gt_sfieldcat
it_sort = gt_sort
it_filter = lt_filter
is_grid_scroll = ls_grid_scroll
is_print = ls_print
EXCEPTIONS
OTHERS = 0.
endform. " F_expand
a®Hi All,
Thanks for your replies. I have done all that has been said. My problem is that when the user double clicks on the ALV without pressing the sort button in the ALV display, the index provided in the user-command subroutine is the same as the index of the record in the internal table. But, when the user sorts dynamically when the ALV is displayed and then double clicks, the index of the record provided by ALV is different from the index of that record in the internal table.
For example, when the ALV grid is shown a record is in the 1st row, and when the user double clicks now, the index of this record provided is 1 which is same as the index in the internal table.
But, after the user sorts in the display, if this record moves to the 5th row, the index provided by ALV will become 5, but, actually the index in the internal table is still 1.
Hope I have clarified my problem.
Thanks,
Sridhar -
Reg: REUSE_ALV_GRID_DISPLAY
Hi Friends,
I am using REUSE_ALV_GRID_DISPLAY Function Module to display the report.I need SAVE button Should be enabled.
I have done coding as below.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'DELETE_ENTRIES'
i_callback_pf_status_set = 'SET_PF_STATUS'
is_layout = ls_layout
it_fieldcat = i_fieldcat[]
i_save = 'A'
TABLES
t_outtab = i_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.
Pls. give me suugestion how can i achieve the save button should enable.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'DELETE_ENTRIES'
i_callback_pf_status_set = 'SET_PF_STATUS'
is_layout = ls_layout
it_fieldcat = i_fieldcat[]
i_save = 'A'
TABLES
t_outtab = i_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.
add a subroutine with name 'SET_PF_STATUS'
form SET_PF_STATUS.
set pf-status 'MYSTATUS'.
endform.
Create a status MYSTATUS by copying the STANDARD status of the program and standard alv example and then add save button on the application toolbar for the MYSTATUS pf-status.
Regards,
Ravi -
Reg. title bar.....have ur points.
Hi all,
I am using SET TITLEBAR 'MYTITLE' WITH 'HELLO FRIENDS' in dialog programming.
Now thing is "HELLO FRIENDS" is not displayed on the title.
Pleas assist me ....
<b>Have ur points.</b>
Regards,
pradeep phogatwhen you double click on PBO -> it creates new module,here you will have pf-status as well title bar.
just uncomment title bar -> give some name with singlle quotation -> save and activate.
now double click on name -> here -> give the text -> save -> activate it.
note : Please activate all screens in dialog programs ( Including pbo screen), if you did not activate then you will not get it
Thanks
Seshu -
Hi All,
I have problem with BSP table title display for one of the field.
The current code of
<%-- -
Create table for line item----
--%>
<htmlb:tableView id = "tv_eban"
table = "<%= it_final %>" >
</htmlb:tableView>
</htmlb:tabStripItem>
</htmlb:tabStrip>
The table field titles are defined and comes by default. From where does the sap table title text is coming. Here can we now update to display the new title for one of the new table field.
Thanks in advance. Please let me know if you need any further details.
From
Reddy.Hi Readdy,
The column title of the BSP application comes from each data-element's field label of your table columns.
For example, let us assume that internal table contains two columns, say
col1 type char10
col2 type char50
where,
col1 and col2 are column names of the internal table and
char10 and char50 are data elements associated with col1 and col2 respectively.
Now when you display this structure in a table view then by default the title is got from the data element. The field label in the data element is used for this purpose.
In our example, the char10 field label is blank and char50 filed label is 'c'. So by default the col1 title will be blank and col2 title will be 'c'. (Don't worry i have cross-checked it).
There are three ways where you could give your own title
1. Provide a correct data element to the columns with correct field labels.
2. Change the BSP code by providing the title as given below,
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:content design="design2003">
<htmlb:page title = "Table view column defult title text ">
<htmlb:form>
<htmlb:tableView id="tv1" table="<%= itab %>">
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName="col1" title="Column 1"></htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName="col2" title="Column 2"></htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
</htmlb:form>
</htmlb:page>
</htmlb:content>
3. To implement a iterator for this table view and change the title. (This has loads of features in order to modify the table view display).
Hope it helps! Please search in the sdn forums for more intresting ways of using the tableview tag. As suggested by SAP Mentor Graham Robinson, please look into the example BSP application for more information.
Regards,
Maheswaran
Edited by: Maheswaran B on Mar 8, 2010 5:02 PM -
Reg:: Determing the Site Title Change date
Hi Techys,
I have created a SharePoint 2013 team site on 07-july-2014, and according to the customer requirement I have granted the permissions for some users. But, today(05-Aug-2014) I have recognized someone has changed the site tile. Now, I would like to know
who was changed the site title and when it was happen.
This is a huge escalation from my customer, could you plz help me....
Many Thanks,
MadhuIf you have enabled audit log then you can view the reports, if you haven't enabled it then you can not get the details that who has updated the site title. You can view audit log reports from top level site settings --> Site Collection Administration
--> Audit Log Reports.
If it is not enabled then you have enable it for getting audit reports (for future use). Check below link for reference.
http://sureshpydi.blogspot.com/2013/05/audit-log-reports-in-sharepoint-2013.html
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer. -
Reg passing parameter to shared portlet title
Hi,
I have a custom favorites portlet on each page.I need to mention the corresponding display name of the page on the favourites portlet header on each page.
Is there any API to capture the display name of the page on the portlet header.
Thanks
-VipulHi,
You want the page name to also be visible in your portlet header?
I searched this form and found these threads
page group name detection in java portlet
Getting Page ID
But indeed, there's not much info on it
hope it will work, im curious about aswell -
Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY
how to handle Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY????
For example Alv has displayed 400 entries if user checks 4 entries and wants to donwload only those 4 entries from ALV using Copy to local file option then how should it be done. please provide some help...REPORT YHRMR_LTC_TAXABLE NO STANDARD PAGE HEADING LINE-SIZE 120.
TYPE-POOLS: SLIS.
Start of Data Declaration *
DATA: G_PLVAR TYPE PLVAR.
DATA: P_MONTH TYPE TFMATAGE.
DATA: TOTAL_NO TYPE I.
DATA: TOTAL_NO_SUM TYPE I.
DATA: COUNT_15 TYPE I.
DATA: COUNT_15_SUM TYPE I.
DATA: COUNT_LTC TYPE I.
DATA: COUNT_LTC_SUM TYPE I.
DATA: COUNT_ERROR_IT15 TYPE I.
DATA: COUNT_ERROR_IT15_SUM TYPE I.
DATA: COUNT_ERROR_LTC TYPE I.
DATA: COUNT_ERROR_LTC_SUM TYPE I.
DATA: COUNT_ENTRY_IT15 TYPE I.
DATA: COUNT_ENTRY_IT15_SUM TYPE I.
--LOCAL TABLE TYPE--
DATA: T_DATA_LTC LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
DATA: T_DATA_LTC_NEW LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
DATA: T_PA0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
DATA: T_P0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF T_FINAL OCCURS 0,
CHECK_BOX(1),
MANDT TYPE MANDT,
PERNR TYPE PERSNO,
ABKRS TYPE ABKRS,
PERSK TYPE PERSK,
WAGETYPE TYPE LGART,
LTCSTART TYPE YAJAHR,
LTCEND TYPE YYAJAHR,
FLAG TYPE YCHAR1,
SEQNR TYPE SEQNR,
LEVSTART TYPE URBEG,
LEVEND TYPE BDATU_052R,
PAYDATE TYPE YBEGDA,
AMOUNTPAY TYPE AMUNT,
TAXYR TYPE PHK_TAXYR,
DOCUNO TYPE YCHAR20,
DOCUDATE TYPE YENDDA,
VOUCHNO TYPE YCHAR20,
APDATE TYPE BPS_APPDA,
CANCEL_MOD TYPE YCANCELMOD,
LTC_IND TYPE ATZH1,
APPL_TAG TYPE YAPPTAG,
CANCEL_DATE TYPE AEDTM,
CANCEL_USER TYPE AENAM,
LASTCHANGE TYPE AEDTM,
USERNAME TYPE AENAM,
END OF T_FINAL.
DATA: BEGIN OF T_PA0001 OCCURS 0,
PERNR LIKE PA0001-PERNR,
ABKRS LIKE PA0001-ABKRS,
END OF T_PA0001.
--Message Part Declaration--
DATA: BEGIN OF T_SUCCESS OCCURS 0,
PERNR TYPE PERSNO,
MESSAGE(50) TYPE C,
END OF T_SUCCESS.
DATA: BEGIN OF T_ERROR OCCURS 0,
PERNR TYPE PERSNO,
MESSAGE(50) TYPE C,
END OF T_ERROR.
--TABLE TYPE OF SLIS TYPE-GROUP--
DATA: G_FLD TYPE SLIS_T_FIELDCAT_ALV,
G_EV TYPE SLIS_T_EVENT,
G_SORT TYPE SLIS_T_SORTINFO_ALV,
G_LST TYPE SLIS_T_LISTHEADER.
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT,
GD_REPID LIKE SY-REPID.
--STRUCTURE TYPE OF SLIS TYPE-GROUP--
DATA: L_EV TYPE SLIS_ALV_EVENT.
CONSTANTS : C_PF TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
C_UCOM TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
*---- Start Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
DATA: L_ENDDATE LIKE SY-DATUM.
*---- End Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
End of Data Declaration *
Start of Selection screen Parameters *
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-002.
*START CHANGE BY SHAYARI ON 18.02.2008, CMR No.:- J/08/02/323
PARAMETERS:P_ABKRS LIKE PA0001-ABKRS OBLIGATORY.
*END CHANGE BY SHAYARI ON 18.02.2008, CMR No.:- J/08/02/323
*START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-006 FOR FIELD P_LES.
PARAMETER P_LES RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
*END CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-003 FOR FIELD P_ONE.
PARAMETER P_ONE RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-004 FOR FIELD P_TWO.
PARAMETER P_TWO RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-005 FOR FIELD P_MORE.
PARAMETER P_MORE RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK A.
End of Selection screen Parameters *
*Get Plan Version
CALL FUNCTION 'RH_GET_PLVAR'
IMPORTING
PLVAR = G_PLVAR.
PERFORM CLEAR.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
IV_DATE = SY-DATUM
IMPORTING
EV_MONTH_BEGIN_DATE =
EV_MONTH_END_DATE = L_ENDDATE.
SELECT *
FROM YHRMT_LTC
INTO TABLE T_DATA_LTC
WHERE FLAG = '1'
AND WAGETYPE = '1640'
AND LEVEND LE L_ENDDATE
AND PAYDATE GE '20080101'.
If SY-SUBRC <> 0.
MESSAGE I398(00) with 'No Records to display '.
ENDIF.
DELETE T_DATA_LTC WHERE LEVEND = '00000000'.
*START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
*For Less Than One Month from Leave End Date
IF P_LES = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH LT '1'.
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
*For One Month from Leave End Date
ELSEIF P_ONE = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH EQ '1' AND P_MONTH LT '2'.
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
*For Two Month from Leave End Date
ELSEIF P_TWO = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH EQ '2' AND P_MONTH LT '3'.
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
*For More than Two Month from Leave End Date
ELSEIF P_MORE = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH GT '2' .
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
ENDIF.
****Payroll Area Put
SELECT PERNR ABKRS FROM PA0001
INTO CORRESPONDING FIELDS OF TABLE T_PA0001
FOR ALL ENTRIES IN T_FINAL
WHERE PERNR = T_FINAL-PERNR
AND ABKRS = P_ABKRS
AND BEGDA LE SY-DATUM
AND ENDDA GE SY-DATUM.
LOOP AT T_FINAL.
READ TABLE T_PA0001 WITH KEY PERNR = T_FINAL-PERNR.
IF SY-SUBRC = 0.
T_FINAL-ABKRS = T_PA0001-ABKRS.
MODIFY T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
CLEAR T_FINAL.
DELETE T_FINAL WHERE ABKRS = ''.
*Output Form ALV List
PERFORM ALV.
*& Form ALV
FORM ALV .
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_EVENT.
PERFORM DISPLAY_DATA.
ENDFORM. " ALV
*& Form BUILD_FIELDCATALOG
FORM BUILD_FIELDCATALOG .
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'PERNR'.
FIELDCATALOG-SELTEXT_M = 'Personnel number'.
FIELDCATALOG-COL_POS = 1.
FIELDCATALOG-OUTPUTLEN = 17.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'ABKRS'.
FIELDCATALOG-SELTEXT_M = 'Payroll Area'.
FIELDCATALOG-COL_POS = 2.
FIELDCATALOG-OUTPUTLEN = 17.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LTCSTART'.
FIELDCATALOG-SELTEXT_M = 'LTC Start year'.
FIELDCATALOG-COL_POS = 3.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LTCEND'.
FIELDCATALOG-SELTEXT_M = 'LTC End year'.
FIELDCATALOG-COL_POS = 4.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LEVSTART'.
FIELDCATALOG-SELTEXT_M = 'Start of leave'.
FIELDCATALOG-COL_POS = 5.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LEVEND'.
FIELDCATALOG-SELTEXT_M = 'End of leave'.
FIELDCATALOG-COL_POS = 6.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'AMOUNTPAY'.
FIELDCATALOG-SELTEXT_M = 'Amount'.
FIELDCATALOG-DO_SUM = 'X'.
FIELDCATALOG-COL_POS = 7.
FIELDCATALOG-OUTPUTLEN = 13.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'PAYDATE'.
FIELDCATALOG-SELTEXT_M = 'Payment Date'.
FIELDCATALOG-COL_POS = 8.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'APPL_TAG'.
FIELDCATALOG-SELTEXT_M = 'Application Tag '.
FIELDCATALOG-COL_POS = 9.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
*Check Box Field Add
CLEAR GD_LAYOUT.
GD_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
GD_LAYOUT-BOX_TABNAME = 'T_FINAL'.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_EVENT
FORM BUILD_EVENT .
*Event Handler
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = G_EV
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ELSE.
READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_PF_STATUS_SET.
IF SY-SUBRC = 0.
MOVE C_PF TO L_EV-FORM.
MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
ENDIF.
READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_USER_COMMAND.
IF SY-SUBRC = 0.
MOVE C_UCOM TO L_EV-FORM.
MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
ENDIF.
ENDIF.
ENDFORM. " BUILD_EVENT
*& Form DISPLAY_DATA
FORM DISPLAY_DATA .
GD_REPID = SY-REPID.
CLEAR I_EVENTS. REFRESH I_EVENTS.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_PF_STATUS_SET = C_PF
I_CALLBACK_USER_COMMAND = C_UCOM
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
IT_EVENTS = G_EV
TABLES
T_OUTTAB = T_FINAL.
ENDFORM. " DISPLAY_DATA
FORM PF_STATUS_SET *
FORM PF_STATUS_SET USING RX_TAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'LTC'.
ENDFORM. "PF_STATUS_SET
FORM USER_COMMAND *
FORM USER_COMMAND USING R_UCOM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOM.
WHEN 'POST'.
PERFORM POST_IT15_LTC_TABLE.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form POST_IT15_LTC_TABLE
FORM POST_IT15_LTC_TABLE .
ENDFORM. " POST_IT15_LTC_TABLE
*& Form clear
FORM CLEAR .
CLEAR T_DATA_LTC.
REFRESH T_DATA_LTC.
CLEAR T_DATA_LTC_NEW.
REFRESH T_DATA_LTC_NEW.
CLEAR T_FINAL.
REFRESH T_FINAL.
CLEAR T_PA0015.
REFRESH T_PA0015.
CLEAR T_SUCCESS.
REFRESH T_SUCCESS.
CLEAR T_ERROR.
REFRESH T_ERROR.
CLEAR G_PLVAR.
CLEAR P_MONTH.
CLEAR COUNT_15.
CLEAR COUNT_15_SUM.
CLEAR COUNT_LTC.
CLEAR COUNT_LTC_SUM.
CLEAR TOTAL_NO.
CLEAR TOTAL_NO_SUM.
CLEAR COUNT_ERROR_IT15.
CLEAR COUNT_ERROR_IT15_SUM.
CLEAR COUNT_ERROR_LTC.
CLEAR COUNT_ERROR_LTC_SUM.
CLEAR COUNT_ENTRY_IT15.
CLEAR COUNT_ENTRY_IT15_SUM.
ENDFORM. " clear -
How to print the Grid title in ALV Report?
Hi All,
I write ALV Report.When i am going to print this report it is not printing the Grid Header(ie.Title ).even in Print Preview Also i m not getting the title.It shows the Gird with Values.How Can i print the title Also...
Regards,RaviHi,
u will declare the data as below like this
DATA: LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
DATA : ST_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
ST_EVENT TYPE SLIS_ALV_EVENT,
IT_EVENT TYPE SLIS_T_EVENT.
DATA : ST_LIST TYPE SLIS_LISTHEADER,
IT_LIST TYPE SLIS_T_LISTHEADER,
IT_LIST1 TYPE SLIS_T_LISTHEADER,
IT_LIST2 TYPE SLIS_T_LISTHEADER.
START-OF-SELECTION.
IF G_FLAG = SPACE.
W_REPID = SY-REPID.
G_TOP_PAGE = 'TOP-PAGE'.
ST_LIST-INFO = ' Title Name '.
APPEND ST_LIST TO IT_LIST.
ST_LIST-INFO = ' second Name'.
APPEND ST_LIST TO IT_LIST.
ELSE.
ENDIF.
FORM TOP-PAGE .
DATA: V_LOGO(15).
V_LOGO = 'LOGO'.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LIST
I_LOGO = V_LOGO.
I_END_OF_LIST_GRID =
ENDFORM. "TOP-PAGE -
How to display field value only once in REUSE_ALV_GRID_DISPLAY
hi experts,
i am using REUSE_ALV_GRID_DISPLAY, for alv outpur display.but i want one of the field in output ,not to display the value which is of same, it have to be displayed only once, I mean i have a number which contains multiple line items corresponding, here i want to display the field value only once when it is repeating , for the same header number, how can i achieve itHi,
check the sample code,
REPORT Z_ALV.
Database table declaration
TABLES:
sflight.
Typepool declaration
TYPE-POOLS:
slis.
Selection screen elements
SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME TITLE text-000.
SELECT-OPTIONS:
s_carrid FOR sflight-carrid.
SELECTION-SCREEN END OF BLOCK blk_1.
Field string to hold sflight data
DATA:
BEGIN OF fs_sflight ,
carrid TYPE sflight-carrid, " Carrier Id
connid TYPE sflight-connid, " Connection No
fldate TYPE sflight-fldate, " Flight date
seatsmax TYPE sflight-seatsmax, " Maximum seats
seatsocc TYPE sflight-seatsocc, " Occupied seats
END OF fs_sflight.
Internal table to hold sflight data
DATA:
t_sflight LIKE
STANDARD TABLE
OF fs_sflight .
Work variables
DATA:
t_fieldcat TYPE slis_t_fieldcat_alv,
fs_fieldcat LIKE
LINE OF t_fieldcat.
*START-OF-SELECTION
START-OF-SELECTION.
PERFORM get_data_sflight. " Getting data for display
PERFORM create_field_cat. " Create field catalog
PERFORM alv_display.
*& Form create_field_cat
Subroutine to create field catalog
There is no interface paramete
FORM create_field_cat .
PERFORM fill_fieldcat USING 'Carrier Id' 'CARRID' '2'.
PERFORM fill_fieldcat USING 'Connection No' 'CONNID' '1'.
PERFORM fill_fieldcat USING 'Flight Date' 'FLDATE' '3'.
PERFORM fill_fieldcat USING 'Maxm.Seats' 'SEATSMAX' '4'.
PERFORM fill_fieldcat USING 'Seats Occ' 'SEATSOCC' '5'.
ENDFORM. "create_field_cat
*& Form fill_fieldcat
Subroutine to fill data to field column
-->p_seltext Column label
-->p_fieldname Fieldname of database table
-->p_col_pos Column position
FORM fill_fieldcat USING
p_seltext LIKE fs_fieldcat-seltext_m
p_fieldname LIKE fs_fieldcat-fieldname
p_col_pos LIKE fs_fieldcat-col_pos.
fs_fieldcat-seltext_m = p_seltext.
fs_fieldcat-fieldname = p_fieldname.
fs_fieldcat-col_pos = p_col_pos.
APPEND fs_fieldcat TO t_fieldcat.
CLEAR fs_fieldcat.
ENDFORM. " fill_fieldcat
*& Form get_data_sflight
Subroutine to fetch data from database table
There is no interface parameter
FORM get_data_sflight .
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO TABLE t_sflight
WHERE carrid IN s_carrid.
ENDFORM. " get_data_sflight
*& Form alv_display
Subroutine for ALV display
There is no interface parameter
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = t_fieldcat
TABLES
t_outtab = t_sflight
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " alv_display
End of code -
I have a finalized project in iMovie '11. Shared it on Youtube, Facebook, and Vimeo. Then, when I shared it to iDVD, it reverted to a previous version of the project, so my titles and pictures were out of sequence. Now, in my list of projects, my project is there, but finalized as the previous version which is all out of sequence. My true final project is now gone! What happend?
I didn't notice this problem until after the DVD was burned in iDVD. Then, when I played the DVD in a public setting, I was a bit embarrassed by what played.Hi
My first thoughts are
• iMovie ill behaving - Trash the iMovie pref file - use to set things right
• in reg. to Photos - Did You change iPhoto Photo Library - Then iMovie get's lost as it peeks into iPhoto on start up to see where photos are stored. Set iPhoto back to first Photo Library (when iMovie is not running) then start iMovie.
Yours Bengt W -
ABAP Dump with using FM 'REUSE_ALV_GRID_DISPLAY'
Hi,
I copied a Standard report program(RCOPCA02) to Z-Program for adding two new fields in the report output. I added those two new fields in the field catalog also. Actually the program is using
FM 'REUSE_ALV_GRID_DISPLAY' , when i execute the program it is dumping.
when i use the same program with FM 'REUSE_ALV_LIST_DISPLAY' with same field catalog the fields are displaying in the layout and report but the values are not populating in the report.
Where is the problem i am not understanding.
Thanks,
fractalI checked in Debug mode, the values are coming in Internal Table correctly...
Here is the Dump.
Runtime Errors MESSAGE_TYPE_X
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Error analysis
Short text of error message:
Technical information about the message:
Message classe...... "0K"
Number.............. 000
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
Variable 3.......... " "
Variable 4.......... " "
"MESSAGE_TYPE_X" C
"SAPLSLVC " or "LSLVCF01 "
"LINE_OUT_NEW_2"
If you cannot solve the problem yourself, please send the
following documents to SAP:
1. A hard copy print describing the problem.
To obtain this, select the "Print" function on the current screen.
2. A suitable hardcopy prinout of the system log.
To obtain this, call the system log with Transaction SM21
and select the "Print" function to print out the relevant
part.
3. If the programs are your own programs or modified SAP programs,
supply the source code.
To do this, you can either use the "PRINT" command in the editor or
print the programs using the report RSINCL00.
4. Details regarding the conditions under which the error occurred
or which actions and input led to the error.
Information on where termination occurred
The termination occurred in the ABAP program "SAPLSLVC " in "LINE_OUT_NEW_2".
The main program was "ZRCOPCA02 ".
The termination occurred in line 924 of the source code of the (Include)
program "LSLVCF01 "
of the source code of program "LSLVCF01 " (when calling the editor 9240).
Source code extract
008940 gs_roid-row_id = rs_row-index * -1.
008950 endif.
008960 gs_roid-sub_row_id = rs_row-rowtype+7(10).
008970 gs_poid-row_id = gs_roid-row_id.
008980 gs_poid-sub_row_id = gs_roid-sub_row_id.
008990 gs_poid-rowtype = rs_row-rowtype.
009000 gs_poid-index = rs_row-index.
009010 insert gs_poid into table rt_poid.
009020 endif.
009030 append gs_roid to rt_roid.
009040
009050 loop at rt_fieldcat assigning <ls_fieldcat> where tech ne 'X' and
009060 no_out ne 'X'.
009070
009080 if gflg_invisible = 'X'.
009090 if <ls_fieldcat>-do_sum is initial.
009100 clear gflg_invisible.
009110 continue.
009120 else.
009130 clear g_col_counter.
009140 clear gflg_invisible.
009150 endif.
009160 endif.
009170
009180 clear gs_lvc_data.
009190 clear g_style.
009200
009210 assign component
009220 <ls_fieldcat>-fieldname of structure rt_data to <g_field>.
009230 if sy-subrc ne 0.
> message x000(0k).
009250 endif.
009260
009270 g_col_counter = g_col_counter + 1.
009280
009290 gs_lvc_data-row_pos = r_row_counter.
009300 gs_lvc_data-col_pos = g_col_counter.
009310 gs_lvc_data-row_id = gs_roid-row_id.
009320 gs_lvc_data-sub_row_id = gs_roid-sub_row_id.
009330
009340 * Endtotal and average
009350 if rs_row-rowtype(1) ca 'T' and <ls_fieldcat>-do_sum = 'C'.
009360 * save the actual grouplevel information
009370 gs_grouplevels = rs_grouplevels.
009380 clear g_lines.
009390
009400 * get number of lines of the collect table
009410 describe table rt_data lines g_lines.
009420 * if there is only one line or the field has no references so
009430 * that only the first line has to be considered
SY field contents..................... SY field contents........
SY-SUBRC 4 SY-INDEX 1
SY-TABIX 95 SY-DBCNT 0
SY-FDPOS 0 SY-LSIND 0
SY-PAGNO 0 SY-LINNO 1
SY-COLNO 1 SY-PFKEY STANDARD_GRID
SY-UCOMM DTC_CONT
SY-TITLE Profit Center: Actual Line Items
SY-MSGTY X SY-MSGID 0K
SY-MSGNO 000 SY-MSGV1
SY-MSGV2 SY-MSGV3
SY-MSGV4
No.... Type........ Name..........................
Program
Include Line
Class
14 FORM LINE_OUT_NEW_2
SAPLSLVC
LSLVCF01 924
13 FORM TOTAL_OUT_NEW
SAPLSLVC
LSLVCF01 1297
12 FORM DATA_TABLE_PREPARE
SAPLSLVC
LSLVCF36 833
11 FORM LVC_TABLE_FOR_DISPLAY_PREPARE
SAPLSLVC
LSLVCF36 259
10 FUNCTION LVC_TABLE_FOR_DISPLAY_PREPARE
SAPLSLVC
LSLVCU35 106
9 METHOD SOFT_REFRESH_TABLE_DISPLAY
CL_GUI_ALV_GRID===============CP
CL_GUI_ALV_GRID===============CM01P 240
CL_GUI_ALV_GRID
8 METHOD REFRESH_TABLE_DISPLAY
CL_GUI_ALV_GRID===============CP
CL_GUI_ALV_GRID===============CM00T 125
CL_GUI_ALV_GRID
7 METHOD MAINTAIN_VARIANT
CL_GUI_ALV_GRID===============CP
CL_GUI_ALV_GRID===============CP
CL_GUI_ALV_GRID===============CM00P 313
CL_GUI_ALV_GRID
6 METHOD EXECUTE_FCODE
CL_GUI_ALV_GRID===============CP
CL_GUI_ALV_GRID===============CM007 582
CL_GUI_ALV_GRID
5 METHOD SET_FUNCTION_CODE
CL_GUI_ALV_GRID===============CP
CL_GUI_ALV_GRID===============CM01E 53
CL_GUI_ALV_GRID
4 FORM PAI
SAPLSLVC_FULLSCREEN
LSLVC_FULLSCREENF01 1776
3 MODULE (PAI) PAI
SAPLSLVC_FULLSCREEN
LSLVC_FULLSCREENI01 4
2 FUNCTION REUSE_ALV_GRID_DISPLAY
SAPLSLVC_FULLSCREEN
LSLVC_FULLSCREENU01 91
1 EVENT START-OF-SELECTION
ZRCOPCA02
ZRCOPCA02 928
Maybe you are looking for
-
Problem Emptying Trash filled with Time Machine Back Up Files
I have needed to create more space on an external hard drive that I use for TIme Machine back up of my hard drive. I took some of the Time Machine back ups [2011 and 2012] and dumped them into my trash. I have gone into my Preferences and removed
-
Suggested data file size for Oracle 11
Hi all, Creating a new system (SolMan 7.1) on AIX 6.1 running Oracle 11. I have 4 logical volumes for data sized at 100gb each. During the installation I'm being asked to input the size for the data files. The default is "2000mb/2gb" is this accept
-
DBMS_METADATA.GET_DDL help needed
Hello, I am using ORACLE 10G, the result of this query SELECT DBMS_METADATA.GET_DDL('TABLE', 'PMSSECURITY2') FROM DUAL Returned the below output CREATE TABLE "ASSETS"."PMSSECURITY2" ( "COMP_CODE" NUMBER(4,0) NOT NULL ENABLE, "BRANCH" NUMBER(4,0) NOT
-
Replacing HD from another Macbook
I have a 2006 Macbook Core Duo and am picking up a Macbook Pro Core 2 Duo with a slower and smaller HD. Can I just swap the HD from the Macbook and startup up the Pro without any problems? Or do I need to reformat etc etc. Thanks
-
"oracle-validated" package not workable
Hi all ; I have installed Oracle Linux 5.5. Why i cant use the "oracle-validated" package to perform pre req step ? # cat /etc/issue Enterprise Linux Enterprise Linux Server release 5.5 (Carthage) # yum install oracle-validated Another app is current