Free Essay

Math

In:

Submitted By amit121
Words 4008
Pages 17
http://wiki.sdn.sap.com/wiki/display/ABAP/ best link for abaper

Working with Multiple dynamic internal tables
By Bhumika Mahawar, YASH Technologies
The main objective of this article is not to show how to display two ALV’s on a single page rather it mainly focuses on the use of dynamic tables in ALV.
My requirement was to create two dynamic table and display data into them.
The first dynamic table was created in the same way as already known using the method “create_dynamic_table” but the problem was the second dynamic table creation.
To do this, you don’t need to use the same method again rather the RTTC concept helps us in the same. The below code illustrates the same and displays the data in an ALV as shown in the diagram below.

REPORT ztest. **** Data declarations DATA: dtab TYPE REF TO data, newstr2 TYPE REF TO cl_abap_typedescr, tab_type1 TYPE REF TO cl_abap_tabledescr, lref_ditab TYPE REF TO data, lref_new_line TYPE REF TO data. **** Field-Symbols declarations FIELD-SYMBOLS: <fs_dyn_tab1> TYPE ANY TABLE, <fs_dyn_tab2> TYPE ANY TABLE, <fs_dyn_wa> TYPE ANY. **** Field Catalog declarations DATA: ls_fcat TYPE lvc_s_fcat, lt_fcat TYPE lvc_t_fcat. **** Data declarations for ALV Display * **** Object variable for ALV grid DATA: obj_my_alv_grid TYPE REF TO cl_gui_alv_grid. **** Object variable for ALV Container DATA: obj_r_container TYPE REF TO cl_gui_custom_container. *---------------------------------------------------------------------* * START O F S E L E C T I O N * *---------------------------------------------------------------------* START-OF-SELECTION. * Create Field Catalog PERFORM create_field_catalog. * Create Dynamic Table PERFORM create_dynamic_table. * Fill the dynamic tables with data PERFORM fill_dynamic_table. * Call the screen no.100 PERFORM call_screen. *&---------------------------------------------------------------------* *& Form CREATE_FIELD_CATALOG *&---------------------------------------------------------------------* FORM create_field_catalog . * Append fields to field catalog table ls_fcat-fieldname = 'VBELN'. ls_fcat-ref_field = 'VBELN'. ls_fcat-ref_table = 'VBAK'. APPEND ls_fcat TO lt_fcat. CLEAR ls_fcat. ls_fcat-fieldname = 'AUART'. ls_fcat-ref_field = 'AUART'. ls_fcat-ref_table = 'VBAK'. APPEND ls_fcat TO lt_fcat. CLEAR ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-ref_field = 'ERNAM'. ls_fcat-ref_table = 'VBAK'. APPEND ls_fcat TO lt_fcat. CLEAR ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-ref_field = 'ERDAT'. ls_fcat-ref_table = 'VBAK'. APPEND ls_fcat TO lt_fcat. CLEAR ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-ref_field = 'ERZET'. ls_fcat-ref_table = 'VBAK'. APPEND ls_fcat TO lt_fcat. CLEAR ls_fcat. ENDFORM. " CREATE_FIELD_CATALOG *&---------------------------------------------------------------------* *& Form CREATE_DYNAMIC_TABLE *&---------------------------------------------------------------------* FORM create_dynamic_table . ** Create dynamic table CALL METHOD cl_alv_table_create=>create_dynamic_table EXPORTING it_fieldcatalog = lt_fcat IMPORTING ep_table = lref_ditab EXCEPTIONS generate_subpool_dir_full = 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. ** Assign the dynamic table reference to a field-symbol ASSIGN lref_ditab->* TO <fs_dyn_tab1>. **Create another dynamic table with the same structure newstr2 ?= cl_abap_structdescr=>describe_by_data_ref( lref_ditab ). tab_type1 ?= newstr2. CREATE DATA dtab TYPE HANDLE tab_type1. ASSIGN dtab->* TO <fs_dyn_tab2>. ** Create a structure similar to the dynamic table created CREATE DATA lref_new_line LIKE LINE OF <fs_dyn_tab1>. ASSIGN lref_new_line->* TO <fs_dyn_wa>. ENDFORM. " CREATE_DYNAMIC_TABLE *&---------------------------------------------------------------------* *& Form FILL_DYNAMIC_TABLE *&---------------------------------------------------------------------* FORM fill_dynamic_table. ** Fill the dynamic table <fs_dyn_tab1> SELECT vbeln auart ernam erdat erzet FROM vbak INTO TABLE <fs_dyn_tab1> WHERE auart = 'ROR' AND erdat LT sy-datum. ** Fill the dynamic table <fs_dyn_tab2> SELECT vbeln auart ernam erdat erzet FROM vbak INTO TABLE <fs_dyn_tab2> WHERE auart = 'ZSOR' AND erdat LT sy-datum. ENDFORM. " FILL_DYNAMIC_TABLE *&---------------------------------------------------------------------* *& Form CALL_SCREEN *&---------------------------------------------------------------------* FORM call_screen . CALL SCREEN 100. ENDFORM. " CALL_SCREEN *&---------------------------------------------------------------------* *& Module STATUS_0100 OUTPUT *&---------------------------------------------------------------------* * PBO Module- Display both the tables in alv *---------------------------------------------------------------------* MODULE status_0100 OUTPUT. SET PF-STATUS 'MENUBAR'. SET TITLEBAR 'ALV REPORT'. *&---------------------------------------------------------------------* * ALV Display-1st table *----------------------------------------------------------------------* * Object for container CREATE OBJECT obj_r_container EXPORTING container_name = 'CUSTOM1' EXCEPTIONS cntl_error = 1 cntl_system_error = 2 create_error = 3 lifetime_error = 4 lifetime_dynpro_dynpro_link = 5 OTHERS = 6. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. * Object for Alv grid CREATE OBJECT obj_my_alv_grid EXPORTING i_parent = obj_r_container EXCEPTIONS error_cntl_create = 1 error_cntl_init = 2 error_cntl_link = 3 error_dp_create = 4 OTHERS = 5. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. * Calling method for displaying the data CALL METHOD obj_my_alv_grid->set_table_for_first_display CHANGING it_outtab = <fs_dyn_tab1> it_fieldcatalog = lt_fcat 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. *&---------------------------------------------------------------------* * ALV Display-2nd table *----------------------------------------------------------------------* * Object for conatainer CREATE OBJECT obj_r_container EXPORTING container_name = 'CUSTOM2' EXCEPTIONS cntl_error = 1 cntl_system_error = 2 create_error = 3 lifetime_error = 4 lifetime_dynpro_dynpro_link = 5 OTHERS = 6. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. * Object for Alv grid CREATE OBJECT obj_my_alv_grid EXPORTING i_parent = obj_r_container EXCEPTIONS error_cntl_create = 1 error_cntl_init = 2 error_cntl_link = 3 error_dp_create = 4 OTHERS = 5. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. * Calling method for displaying the data CALL METHOD obj_my_alv_grid->set_table_for_first_display CHANGING it_outtab = <fs_dyn_tab2> it_fieldcatalog = lt_fcat 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. " STATUS_0100 OUTPUT *&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* * PAI Module *----------------------------------------------------------------------* MODULE user_command_0100 INPUT. CASE sy-ucomm. WHEN 'BACK' OR 'EXIT'. LEAVE TO SCREEN 0. WHEN 'CANCEL'. LEAVE PROGRAM. ENDCASE. " CASE SY-UCOMM ENDMODULE. " USER_COMMAND_0100 INPUT

Demo Program on ALV Tree Control
By Anand Kumar
REPORT zdemo_alv_tree.
* Demo program prepared for SAPTechnical.COM
CLASS cl_gui_column_tree DEFINITION LOAD.
CLASS cl_gui_cfw DEFINITION LOAD.
DATA tree1 TYPE REF TO cl_gui_alv_tree_simple.
INCLUDE <icon>.
INCLUDE bcalv_simple_event_receiver.
DATA: gt_sflight TYPE sflight OCCURS 0, " Output-Table gt_fieldcatalog TYPE lvc_t_fcat, " Field Catalog gt_sort TYPE lvc_t_sort, " Sorting Table ok_code LIKE sy-ucomm. " OK-Code
END-OF-SELECTION.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
* This subroutine is used to build the field catalog for the ALV list
*----------------------------------------------------------------------*
FORM build_fieldcatalog.
* get fieldcatalog CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' EXPORTING i_structure_name = 'SFLIGHT' CHANGING ct_fieldcat = gt_fieldcatalog.
* change fieldcatalog DATA: ls_fieldcatalog TYPE lvc_s_fcat. LOOP AT gt_fieldcatalog INTO ls_fieldcatalog. CASE ls_fieldcatalog-fieldname. WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'. ls_fieldcatalog-no_out = 'X'. ls_fieldcatalog-key = ''. WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'. ls_fieldcatalog-do_sum = 'X'. ENDCASE. MODIFY gt_fieldcatalog FROM ls_fieldcatalog. ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
*& Form BUILD_OUTTAB
*&---------------------------------------------------------------------*
* Retrieving the data from the table and filling it in the output table
* of the ALV list
*----------------------------------------------------------------------*
FORM build_outtab. SELECT * FROM sflight INTO TABLE gt_sflight.
ENDFORM. " BUILD_OUTTAB
*&---------------------------------------------------------------------*
*& Form BUILD_SORT_TABLE
*&---------------------------------------------------------------------*
* This subroutine is used to build the sort table or the sort criteria
*----------------------------------------------------------------------*
FORM build_sort_table. DATA ls_sort_wa TYPE lvc_s_sort.
* create sort-table ls_sort_wa-spos = 1. ls_sort_wa-fieldname = 'CARRID'. ls_sort_wa-up = 'X'. ls_sort_wa-subtot = 'X'. APPEND ls_sort_wa TO gt_sort. ls_sort_wa-spos = 2. ls_sort_wa-fieldname = 'CONNID'. ls_sort_wa-up = 'X'. ls_sort_wa-subtot = 'X'. APPEND ls_sort_wa TO gt_sort. ls_sort_wa-spos = 3. ls_sort_wa-fieldname = 'FLDATE'. ls_sort_wa-up = 'X'. APPEND ls_sort_wa TO gt_sort.
ENDFORM. " BUILD_SORT_TABLE
*&---------------------------------------------------------------------*
*& Module PBO OUTPUT
*&---------------------------------------------------------------------*
* This subroutine is used to build the ALV Tree
*----------------------------------------------------------------------*
MODULE pbo OUTPUT. IF tree1 IS INITIAL. PERFORM init_tree. ENDIF. SET PF-STATUS 'ZSTATUS'.
ENDMODULE. " PBO OUTPUT
*&---------------------------------------------------------------------*
*& Module PAI INPUT
*&---------------------------------------------------------------------*
* This subroutine is used to handle the navigation on the screen
*----------------------------------------------------------------------*
MODULE pai INPUT. CASE ok_code. WHEN 'EXIT' OR 'BACK' OR 'CANC'. PERFORM exit_program. WHEN OTHERS. CALL METHOD cl_gui_cfw=>dispatch. ENDCASE. CLEAR ok_code.
ENDMODULE. " PAI INPUT
*&---------------------------------------------------------------------*
*& Form exit_program
*&---------------------------------------------------------------------*
* free object and leave program
*----------------------------------------------------------------------*
FORM exit_program. CALL METHOD tree1->free. LEAVE PROGRAM.
ENDFORM. " exit_program
*&---------------------------------------------------------------------*
*& Form register_events
*&---------------------------------------------------------------------*
* Handling the events in the ALV Tree control in backend
*----------------------------------------------------------------------*
FORM register_events.
* define the events which will be passed to the backend DATA: lt_events TYPE cntl_simple_events, l_event TYPE cntl_simple_event.
* define the events which will be passed to the backend l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req. APPEND l_event TO lt_events. l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req. APPEND l_event TO lt_events. l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req. APPEND l_event TO lt_events. l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children. APPEND l_event TO lt_events. l_event-eventid = cl_gui_column_tree=>eventid_header_click. APPEND l_event TO lt_events. l_event-eventid = cl_gui_column_tree=>eventid_item_keypress. APPEND l_event TO lt_events. CALL METHOD tree1->set_registered_events EXPORTING events = lt_events EXCEPTIONS cntl_error = 1 cntl_system_error = 2 illegal_event_combination = 3.
* set Handler DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver. CREATE OBJECT l_event_receiver. SET HANDLER l_event_receiver->on_add_hierarchy_node FOR tree1.
ENDFORM. " register_events
*&---------------------------------------------------------------------*
*& Form build_header
*&---------------------------------------------------------------------*
* build table for header
*----------------------------------------------------------------------*
FORM build_comment USING pt_list_commentary TYPE slis_t_listheader p_logo TYPE sdydo_value. DATA: ls_line TYPE slis_listheader.
*
* LIST HEADING LINE: TYPE H CLEAR ls_line. ls_line-typ = 'H'.
* LS_LINE-KEY: NOT USED FOR THIS TYPE ls_line-info = 'ALV TREE DEMO for SAPTechnical.COM'. APPEND ls_line TO pt_list_commentary. p_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "build_comment
*&---------------------------------------------------------------------*
*& Form init_tree
*&---------------------------------------------------------------------*
* Building the ALV-Tree for the first time display
*----------------------------------------------------------------------*
FORM init_tree. PERFORM build_fieldcatalog. PERFORM build_outtab. PERFORM build_sort_table.
* create container for alv-tree DATA: l_tree_container_name(30) TYPE c, l_custom_container TYPE REF TO cl_gui_custom_container. l_tree_container_name = 'TREE1'. CREATE OBJECT l_custom_container EXPORTING container_name = l_tree_container_name EXCEPTIONS cntl_error = 1 cntl_system_error = 2 create_error = 3 lifetime_error = 4 lifetime_dynpro_dynpro_link = 5.
* create tree control CREATE OBJECT tree1 EXPORTING i_parent = l_custom_container i_node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple i_item_selection = 'X' i_no_html_header = '' i_no_toolbar = '' EXCEPTIONS cntl_error = 1 cntl_system_error = 2 create_error = 3 lifetime_error = 4 illegal_node_selection_mode = 5 failed = 6 illegal_column_name = 7.
* create info-table for html-header DATA: lt_list_commentary TYPE slis_t_listheader, l_logo TYPE sdydo_value. PERFORM build_comment USING lt_list_commentary l_logo.
* repid for saving variants DATA: ls_variant TYPE disvariant. ls_variant-report = sy-repid.
* register events PERFORM register_events.
* create hierarchy CALL METHOD tree1->set_table_for_first_display EXPORTING it_list_commentary = lt_list_commentary i_logo = l_logo i_background_id = 'ALV_BACKGROUND' i_save = 'A' is_variant = ls_variant CHANGING it_sort = gt_sort it_outtab = gt_sflight it_fieldcatalog = gt_fieldcatalog.
* expand first level CALL METHOD tree1->expand_tree EXPORTING i_level = 1.
* optimize column-width CALL METHOD tree1->column_optimize EXPORTING i_start_column = tree1->c_hierarchy_column_name i_end_column = tree1->c_hierarchy_column_name.
ENDFORM. " init_tree Output:

Displaying Logo in ALV Grid
By Madhavi
Logo should be uploaded into application server using transaction 'OAER'. 1. Go to Transaction OAER, 2. Give Class Name as PICTURES 3. Class type as OT 4. Object Key as the name of the Object u want to specify 5. Upon execution you would be prompted to give the file path details. Just upload which ever logo u want to display 6. Now you can use the same name in your ALV FM
In your ALV program, you need to have event for TOP_OF_PAGE, and also this works only in case of Grid not in ALV LIST.

Look at the sample code to display LOGO.

**********************

call function 'REUSE_ALV_GRID_DISPLAY' exporting i_callback_program = i_repid it_fieldcat = header is_layout = gt_layout i_callback_top_of_page = 'TOP-OF-PAGE1' i_grid_title = xyz it_sort = gt_sort[] i_default = 'X' i_save = 'U' is_variant = gt_variant it_events = gt_events tables t_outtab = t_output.

*****************

*-------------------------------------------------------------------*

* Form TOP-OF-PAGE1

*-------------------------------------------------------------------*

form top-of-page1.

data: header type slis_t_listheader, wa type slis_listheader.

* TITLE AREA

wa-typ = 'S'. wa-info = text-h04. append wa to header.

wa-typ = 'S'. write sy-datum to wa-info mm/dd/yyyy.

concatenate text-h03 wa-info into wa-info separated by space. append wa to header.

wa-typ = 'S'. concatenate text-h02 sy-uname into wa-info separated by space. append wa to header.

wa-typ = 'S'. concatenate text-h01 sy-repid into wa-info separated by space. append wa to header.

********" LOGO

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = header

i_logo = 'ENJOYSAP_LOGO'.

*********" LOGO

endform.

Here in TOP-OF-PAGE form it will show you the Prog name,Date, User Name

Demo program to color particular row or column or cell of an ALV list using 'REUSE_ALV_LIST_DISPLAY'
By Haritha
REPORT ZALV_LIST1.

TABLES:
SPFLI.

TYPE-POOLS:
SLIS.

PARAMETERS:
P_COL TYPE I ,
P_ROW TYPE I,
P_COLOR(4) TYPE C .

DATA:
T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FS_FIELDCAT LIKE LINE OF T_FIELDCAT,
FS_LAYOUT TYPE SLIS_LAYOUT_ALV ,
W_COLOR(4) ,
W_ROW TYPE I,
W_FIELDNAME(20),
W_PROG TYPE SY-REPID.

DATA:
BEGIN OF T_SPFLI OCCURS 0,
COLOR(4),
CHECKBOX ,
CELL TYPE SLIS_T_SPECIALCOL_ALV,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
CITYFROM TYPE SPFLI-CITYFROM,
CITYTO TYPE SPFLI-CITYTO,
DISTANCE TYPE SPFLI-DISTANCE,
END OF T_SPFLI.

DATA:
FS_CELL LIKE LINE OF T_SPFLI-CELL.

SELECT *
FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE T_SPFLI.

W_COLOR = P_COLOR.

T_SPFLI-COLOR = P_COLOR.
IF P_COL IS INITIAL AND P_ROW GT 0.
MODIFY T_SPFLI INDEX P_ROW TRANSPORTING COLOR.
ENDIF.

FS_FIELDCAT-FIELDNAME = 'CARRID'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 1.
FS_FIELDCAT-KEY = 'X'.
FS_FIELDCAT-HOTSPOT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.

CLEAR FS_FIELDCAT .
FS_FIELDCAT-FIELDNAME = 'CONNID'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 2.
FS_FIELDCAT-KEY = 'X'.
FS_FIELDCAT-HOTSPOT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.

CLEAR FS_FIELDCAT .
FS_FIELDCAT-FIELDNAME = 'DISTANCE'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.

FS_FIELDCAT-COL_POS = 3.
FS_FIELDCAT-KEY = ' '.
FS_FIELDCAT-EDIT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.

CLEAR FS_FIELDCAT.
FS_FIELDCAT-FIELDNAME = 'CITYFROM'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 4.
FS_FIELDCAT-KEY = ' '.
APPEND FS_FIELDCAT TO T_FIELDCAT.

LOOP AT T_FIELDCAT INTO FS_FIELDCAT.
IF FS_FIELDCAT-COL_POS EQ P_COL.
FS_FIELDCAT-EMPHASIZE = P_COLOR.
W_FIELDNAME = FS_FIELDCAT-FIELDNAME.
IF P_ROW IS INITIAL AND P_COL GT 0.
MODIFY T_FIELDCAT FROM FS_FIELDCAT TRANSPORTING EMPHASIZE.
ENDIF.
ENDIF.
ENDLOOP.

FS_CELL-FIELDNAME = W_FIELDNAME .
FS_CELL-COLOR-COL = 6.
FS_CELL-NOKEYCOL = 'X'.
APPEND FS_CELL TO T_SPFLI-CELL.

IF P_ROW IS NOT INITIAL AND P_COL IS NOT INITIAL.
MODIFY T_SPFLI INDEX P_ROW TRANSPORTING CELL.
ENDIF.

FS_LAYOUT-INFO_FIELDNAME = 'COLOR'.
FS_LAYOUT-BOX_FIELDNAME = 'CHECKBOX'.
FS_LAYOUT-COLTAB_FIELDNAME = 'CELL'.
FS_LAYOUT-F2CODE = '&ETA'.

W_PROG = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_PROG
IS_LAYOUT = FS_LAYOUT
IT_FIELDCAT = T_FIELDCAT
TABLES
T_OUTTAB = T_SPFLI
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.
NOTE Column and Row are colored with a coded color ‘Cxyz’. Where C: Color (coding must begin with C) X: Color Number Y: Bold Z: Inverse. The Selection Screen will be as follows. In the Selection screen if we enter only the Column Number and color the whole column will be colored as follows. In the Selection screen if we enter only the row Number and color, the whole column will be colored as follows. In the Selection screen if we enter both the Row number and the Column Number then that particular cell will be colored as follows (this color is not picked from selection screen, it is already written in the program itself)

Sample ALV Grid program using the function module REUSE_ALV_GRID_DISPLAY
By Vikram Chellappa, Mouri Tech Solutions
*&---------------------------------------------------------------------*
*& Report ZALV_REPORT_SFLIGHT
*&
*&---------------------------------------------------------------------*
* Published at SAPTechnical.COM
*&---------------------------------------------------------------------*
REPORT ZALV_REPORT_SFLIGHT.
TABLES : SFLIGHT.
TYPE-POOLS : SLIS.
**INTERNAL TABLE DECLARTION
DATA : WA_SFLIGHT TYPE SFLIGHT, IT_SFLIGHT TYPE TABLE OF SFLIGHT.
**DATA DECLARTION
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE, GD_LAYOUT TYPE SLIS_LAYOUT_ALV, GD_REPID LIKE SY-REPID, G_SAVE TYPE C VALUE 'X', G_VARIANT TYPE DISVARIANT, GX_VARIANT TYPE DISVARIANT, G_EXIT TYPE C, ISPFLI TYPE TABLE OF SPFLI.
* To understand the importance of the following parameter, click here.
**SELECTION SCREEN DETAILS
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002 .
PARAMETERS: VARIANT LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF BLOCK B1.
**GETTING DEFAULT VARIANT
INITIALIZATION.
GX_VARIANT-REPORT = SY-REPID. CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET' EXPORTING I_SAVE = G_SAVE CHANGING CS_VARIANT = GX_VARIANT EXCEPTIONS NOT_FOUND = 2. IF SY-SUBRC = 0. VARIANT = GX_VARIANT-VARIANT. ENDIF.
**PERFORM DECLARATIONS
START-OF-SELECTION.
PERFORM DATA_RETRIVEL. PERFORM BUILD_FIELDCATALOG. PERFORM DISPLAY_ALV_REPORT.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM BUILD_FIELDCATALOG . FIELDCATALOG-FIELDNAME = 'CARRID'. FIELDCATALOG-SELTEXT_M = 'Airline Code'. FIELDCATALOG-COL_POS = 0. APPEND FIELDCATALOG TO FIELDCATALOG. CLEAR FIELDCATALOG. FIELDCATALOG-FIELDNAME = 'CONNID'. FIELDCATALOG-SELTEXT_M = 'Flight Connection Number'. FIELDCATALOG-COL_POS = 1. APPEND FIELDCATALOG TO FIELDCATALOG. CLEAR FIELDCATALOG. FIELDCATALOG-FIELDNAME = 'FLDATE'. FIELDCATALOG-SELTEXT_M = 'Flight date'. FIELDCATALOG-COL_POS = 2. APPEND FIELDCATALOG TO FIELDCATALOG. CLEAR FIELDCATALOG. FIELDCATALOG-FIELDNAME = 'PRICE'. FIELDCATALOG-SELTEXT_M = 'Airfare'. FIELDCATALOG-COL_POS = 3. FIELDCATALOG-OUTPUTLEN = 20. APPEND FIELDCATALOG TO FIELDCATALOG. CLEAR FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATALOG

*&---------------------------------------------------------------------*
*& Form DISPLAY_ALV_REPORT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DISPLAY_ALV_REPORT . GD_REPID = SY-REPID. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING I_CALLBACK_PROGRAM = GD_REPID I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE' "see FORM I_CALLBACK_USER_COMMAND = 'USER_COMMAND' IT_FIELDCAT = FIELDCATALOG[] I_SAVE = 'X' IS_VARIANT = G_VARIANT TABLES T_OUTTAB = IT_SFLIGHT 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_REPORT
" DISPLAY_ALV_REPORT
*&---------------------------------------------------------------------*
*& Form DATA_RETRIVEL
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DATA_RETRIVEL . SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT.
ENDFORM. " DATA_RETRIVEL
*-------------------------------------------------------------------*
* Form TOP-OF-PAGE *
*-------------------------------------------------------------------*
* ALV Report Header *
*-------------------------------------------------------------------*
FORM TOP-OF-PAGE.
*ALV Header declarations DATA: T_HEADER TYPE SLIS_T_LISTHEADER, WA_HEADER TYPE SLIS_LISTHEADER, T_LINE LIKE WA_HEADER-INFO, LD_LINES TYPE I, LD_LINESC(10) TYPE C.
* Title WA_HEADER-TYP = 'H'. WA_HEADER-INFO = 'SFLIGHT Table Report'. APPEND WA_HEADER TO T_HEADER. CLEAR WA_HEADER.
* Date WA_HEADER-TYP = 'S'. WA_HEADER-KEY = 'Date: '. CONCATENATE SY-DATUM+6(2) '.' SY-DATUM+4(2) '.' SY-DATUM(4) INTO WA_HEADER-INFO. "todays date APPEND WA_HEADER TO T_HEADER. CLEAR: WA_HEADER. CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING IT_LIST_COMMENTARY = T_HEADER.
ENDFORM. "top-of-page

ALV Styles in Field catalogue using OOPS
By Swarna S, Tata Consultancy Services *&---------------------------------------------------------------------* *& Report ZALV_STYLES * *& Published at SAPTechnical.COM * *&---------------------------------------------------------------------* *& AS : ALV Styles in a fieldcatalogue. * *& The ALV is developed using OOPS and various styles are given for * *& each column in the fieldcatalogue * *&---------------------------------------------------------------------* REPORT zalv_styles. *Include for ALV styles INCLUDE <cl_alv_control>. *Type ppols for alv TYPE-POOLS : slis. *structure for t582a tbale TYPES : BEGIN OF ty_table, infty TYPE infty, pnnnn TYPE pnnnn_d, zrmkz TYPE dzrmkz, zeitb TYPE dzeitb, dname TYPE dianm, edynr TYPE edynp, ldynr TYPE ldynp, stypt TYPE stypt, sytxt TYPE sytxt, davo TYPE davo, davoe TYPE davoe, END OF ty_table. *Structure for infotype text TYPES : BEGIN OF ty_itext, infty TYPE infty, itext TYPE intxt, sprsl TYPE sprsl, END OF ty_itext. *Structure for output display TYPES : BEGIN OF ty_output, infty TYPE infty, itext TYPE intxt, pnnnn TYPE pnnnn_d, zrmkz TYPE dzrmkz, zeitb TYPE dzeitb, dname TYPE dianm, edynr TYPE edynp, ldynr TYPE ldynp, stypt TYPE stypt, sytxt TYPE sytxt, davo TYPE davo, davoe TYPE davoe, text(6) TYPE c, sradio(6) TYPE c, scheck(6) TYPE c, END OF ty_output. *internal table and work area declarations DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0, it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0, it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0, wa_table TYPE ty_table, wa_output TYPE ty_output, wa_ittext TYPE ty_itext. *Data declarations for ALV DATA: c_ccont TYPE REF TO cl_gui_custom_container, "Custom container c_alvgd TYPE REF TO cl_gui_alv_grid, "ALV grid object it_fcat TYPE lvc_t_fcat, "Field catalogue it_layout TYPE lvc_s_layo. "Layout *Field symbols declarations for style FIELD-SYMBOLS : <wa_fcat> TYPE lvc_s_fcat. *initialization event INITIALIZATION. *start of selection event START-OF-SELECTION. *select the infotypes maintained SELECT infty pnnnn zrmkz zeitb dname edynr ldynr stypt sytxt davo davoe FROM t582a UP TO 25 ROWS INTO CORRESPONDING FIELDS OF TABLE it_table. * *Select the infotype texts IF it_table[] IS NOT INITIAL. SELECT itext infty sprsl FROM t582s INTO CORRESPONDING FIELDS OF TABLE it_ittext FOR ALL ENTRIES IN it_table WHERE infty = it_table-infty AND sprsl = 'E'. ENDIF. *Apppending the data to the internal table of ALV output LOOP AT it_table INTO wa_table. wa_output-infty = wa_table-infty. wa_output-pnnnn = wa_table-pnnnn. wa_output-zrmkz = wa_table-zrmkz. wa_output-zeitb = wa_table-zeitb. wa_output-dname = wa_table-dname. wa_output-edynr = wa_table-edynr. wa_output-ldynr = wa_table-ldynr. wa_output-stypt = wa_table-stypt. wa_output-sytxt = wa_table-sytxt. wa_output-davo = wa_table-davo. wa_output-davoe = wa_table-davoe. * For texts READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty. wa_output-itext = wa_ittext-itext. wa_output-text = wa_ittext-sprsl. APPEND wa_output TO it_output. CLEAR wa_output. ENDLOOP. * Calling the ALV screen with custom container CALL SCREEN 0600. *On this statement double click it takes you to the screen painter SE51. *Enter the attributes *Create a Custom container and name it CC_CONT and OK code as OK_CODE. *Save check and Activate the screen painter. *Now a normal screen with number 600 is created which holds the ALV grid. * PBO of the actual screen , * Here we can give a title and customized menus *&---------------------------------------------------------------------* *& Module STATUS_0600 OUTPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE status_0600 OUTPUT. * SET PF-STATUS 'xxxxxxxx'. * SET TITLEBAR 'xxx'. ENDMODULE. " STATUS_0600 OUTPUT * calling the PBO module ALV_GRID. *&---------------------------------------------------------------------* *& Module ALV_GRID OUTPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE alv_grid OUTPUT. CREATE OBJECT c_ccont EXPORTING container_name = 'CC_CONT'. CREATE OBJECT c_alvgd EXPORTING i_parent = c_ccont. * SET field for ALV PERFORM alv_build_fieldcat. * Setting the styles for the ALV grid control * using field-symbols LOOP AT it_fcat ASSIGNING <wa_fcat>. *For Each and every line of the fieldcat CASE sy-tabix. *Color Styles *Background/Font/Group/positive/negative WHEN '1'. <wa_fcat>-style = alv_style_color_inv_positive. WHEN '2'. <wa_fcat>-style = alv_style_color_int_negative. WHEN '3'. <wa_fcat>-style = alv_style_color_inv_negative. WHEN '4'. <wa_fcat>-style = alv_style_color_int_positive. WHEN '5'. <wa_fcat>-style = alv_style_color_background. <wa_fcat>-style = alv_style_color_inv_background. WHEN '6'. <wa_fcat>-style = alv_style_color_group. <wa_fcat>-style = alv_style_color_int_background. *Style for F4 WHEN '7'. <wa_fcat>-style = alv_style_f4. *Style for Alignment(others are also possible) WHEN '8'. <wa_fcat>-style = alv_style_align_left_bottom. *Style for Font Underlined/Bold and Italic are possible WHEN '9'. <wa_fcat>-style = alv_style_font_underlined. *Style for button type WHEN '10'. <wa_fcat>-style = alv_style_button. *Style for Font Symbol WHEN '11'. <wa_fcat>-style = alv_style_font_symbol. *Style for Radiobutton WHEN '12'. <wa_fcat>-style = alv_style_radio_checked. *Style for checkbox WHEN '13'. <wa_fcat>-style = alv_style_checkbox_checked. *Style for column style characteristics(highlighting the col) WHEN '14'. <wa_fcat>-style = alv_col_style_characteristic. *Styles for Enabling the column WHEN '15'. <wa_fcat>-style = alv_style_enabled. ENDCASE. ENDLOOP. * Set ALV attributes FOR LAYOUT PERFORM alv_report_layout. CHECK NOT c_alvgd IS INITIAL. * Call ALV GRID CALL METHOD c_alvgd->set_table_for_first_display EXPORTING is_layout = it_layout CHANGING it_outtab = it_output it_fieldcatalog = it_fcat 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. " ALV_GRID OUTPUT *&---------------------------------------------------------------------* *& Form alv_build_fieldcat *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * <--P_IT_FCAT text *----------------------------------------------------------------------* *subroutine to build fieldcat FORM alv_build_fieldcat. DATA lv_fldcat TYPE lvc_s_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '1'. lv_fldcat-fieldname = 'INFTY'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 8. lv_fldcat-scrtext_m = 'Infotype'. lv_fldcat-icon = 'X'. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '2'. lv_fldcat-fieldname = 'PNNNN'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 15. lv_fldcat-scrtext_m = 'Structure'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '3'. lv_fldcat-fieldname = 'ITEXT'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 60. lv_fldcat-scrtext_m = 'Description'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '4'. lv_fldcat-fieldname = 'TEXT'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 5. lv_fldcat-scrtext_m = 'General'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '5'. lv_fldcat-fieldname = 'ZRMKZ'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 1. lv_fldcat-scrtext_m = 'PERIOD'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '6'. lv_fldcat-fieldname = 'ZEITB'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 60. lv_fldcat-scrtext_m = 'Time constraint'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '7'. lv_fldcat-fieldname = 'DNAME'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 15. lv_fldcat-scrtext_m = 'Dialogmodule'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '8'. lv_fldcat-fieldname = 'EDYNR'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'Single screenno'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '9'. lv_fldcat-fieldname = 'LDYNR'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'List screenno'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '10'. lv_fldcat-fieldname = 'STYPT'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'SubtypeTable'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '11'. lv_fldcat-fieldname = 'SYTXT'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'Font Symbol'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '12'. lv_fldcat-fieldname = 'SRADIO'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'RADIO'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '13'. lv_fldcat-fieldname = 'SCHECK'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'CHECK'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '14'. lv_fldcat-fieldname = 'DAVO'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'Start Date'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. lv_fldcat-row_pos = '1'. lv_fldcat-col_pos = '15'. lv_fldcat-fieldname = 'DAVOE'. lv_fldcat-tabname = 'IT_OUTPUT'. lv_fldcat-outputlen = 10. lv_fldcat-scrtext_m = 'End date'. lv_fldcat-icon = ''. APPEND lv_fldcat TO it_fcat. CLEAR lv_fldcat. ENDFORM. " alv_build_fieldcat *&---------------------------------------------------------------------* *& Form alv_report_layout *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * <--P_IT_LAYOUT text *----------------------------------------------------------------------* *Subroutine for setting alv layout FORM alv_report_layout. it_layout-cwidth_opt = 'X'. it_layout-zebra = 'X'. it_layout-col_opt = 'X'. ENDFORM. " alv_report_layout * PAI module of the screen created. In case we use an interactive ALV or *for additional functionalities we can create OK codes *and based on the user command we can do the coding. *&---------------------------------------------------------------------* *& Module USER_COMMAND_0600 INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE user_command_0600 INPUT. ENDMODULE. " USER_COMMAND_0600 INPUT
Output
Part 1 (Continued output)
Part 2

Similar Documents

Free Essay

Math

...and solve problems in everyday life”. In my everyday life I have to keep the balance in my check book, pay bills, take care of kids, run my house, cook, clean etc. With cooking I am using math, measuring how much food to make for four people (I still haven’t mastered that one). With bills I am using math, how much each company gets, to how much money I have to spare (which these days is not much). In my everyday life I do use some form of a math. It might not be how I was taught, but I have learned to adapt to my surroundings and do math how I know it be used, the basic ways, none of that fancy stuff. For my weakest ability I would say I fall into “Confidence with Mathematics”. Math has never been one of my favorite subjects to learn. It is like my brain knows I have to learn it, but it puts up a wall and doesn’t allow the information to stay in there. The handout “The Case for Quantitative Literacy” states I should be at ease with applying quantitative methods, and comfortable with quantitative ideas. To be honest this class scares the crap out of me, and I am worried I won’t do well in this class. The handout also says confidence is the opposite of “Math Anxiety”, well I can assure you I have plenty of anxiety right now with this class. I have never been a confident person with math, I guess I doubt my abilities, because once I get over my fears and anxiety I do fine. I just have to mentally get myself there and usually it’s towards the end of the class. There are several...

Words: 418 - Pages: 2

Premium Essay

Math

...solutions. If you have a graphing calculator, this method is the quickest. If you don't have a calculator, it can be difficult to graph the equation. Completing the square: This is probably the most difficult method. I find it hardest to remember how to apply this method. Since the quadratic formula was derived from this method, I don't think there is a good reason to use completing the square when you have the formula Factoring: this is probably the easiest method for solving an equation with integer solutions. If you can see how to split up the original equation into its factor pair, this is the quickest and allows you to solve the problem in one step. Week 9 capstone part 1 Has the content in this course allowed you to think of math as a useful tool? If so, how? What concepts...

Words: 662 - Pages: 3

Premium Essay

Math

...This article is about the study of topics, such as quantity and structure. For other uses, see Mathematics (disambiguation). "Math" redirects here. For other uses, see Math (disambiguation). Euclid (holding calipers), Greek mathematician, 3rd century BC, as imagined by Raphael in this detail from The School of Athens.[1] Mathematics is the study of topics such as quantity (numbers),[2] structure,[3] space,[2] and change.[4][5][6] There is a range of views among mathematicians and philosophers as to the exact scope and definition of mathematics.[7][8] Mathematicians seek out patterns[9][10] and use them to formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proof. When mathematical structures are good models of real phenomena, then mathematical reasoning can provide insight or predictions about nature. Through the use of abstraction and logic, mathematics developed from counting, calculation, measurement, and the systematic study of the shapes and motions of physical objects. Practical mathematics has been a human activity for as far back as written records exist. The research required to solve mathematical problems can take years or even centuries of sustained inquiry. Rigorous arguments first appeared in Greek mathematics, most notably in Euclid's Elements. Since the pioneering work of Giuseppe Peano (1858–1932), David Hilbert (1862–1943), and others on axiomatic systems in the late 19th century, it has become customary...

Words: 634 - Pages: 3

Premium Essay

Math

...Diana Garza 1-16-12 Reflection The ideas Stein presents on problem saving and just math in general are that everyone has a different way of saving their own math problems. For explains when you’re doing a math problem you submit all kinds of different numbers into a data or formula till something works or maybe it’s impossible to come up with a solution. For math in general he talks about how math is so big and its due in large measure to the wide variety of situations how it can sit for a long time without being unexamined. Waiting for someone comes along to find a totally unexpected use for it. Just like has work he couldn’t figure it out and someone else found a use for it and now everyone uses it for their banking account. For myself this made me think about how math isn’t always going to have a solution. To any math problem I come across have to come with a clear mind and ready to understand it carefully. If I don’t understand or having hard time taking a small break will help a lot. The guidelines for problem solving will help me a lot to take it step by step instead of trying to do it all at once. Just like the introduction said the impossible takes forever. The things that surprised me are that I didn’t realize how much math can be used in music and how someone who was trying to find something else came to the discovery that he find toe. What may people were trying to find before...

Words: 270 - Pages: 2

Free Essay

Math

...Sample Exam 2 - MATH 321 Problem 1. Change the order of integration and evaluate. (a) (b) 2 0 1 0 1 (x y/2 + y)2 dxdy. + y 3 x) dxdy. 1 0 0 x 0 y 1 (x2 y 1/2 Problem 2. (a) Sketch the region for the integral f (x, y, z) dzdydx. (b) Write the integral with the integration order dxdydz. THE FUNCTION f IS NOT GIVEN, SO THAT NO EVALUATION IS REQUIRED. Problem 3. Evaluate e−x −y dxdy, where B consists of points B (x, y) satisfying x2 + y 2 ≤ 1 and y ≤ 0. − Problem 4. (a) Compute the integral of f along the path → if c − f (x, y, z) = x + y + yz and →(t) = (sin t, cos t, t), 0 ≤ t ≤ 2π. c → − → − → − (b) Find the work done by the force F (x, y) = (x2 − y 2 ) i + 2xy j in moving a particle counterclockwise around the square with corners (0, 0), (a, 0), (a, a), (0, a), a > 0. Problem 5. (a) Compute the integral of z 2 over the surface of the unit sphere. → → − − → − → − − F · d S , where F (x, y, z) = (x, y, −y) and S is → (b) Calculate S the cylindrical surface defined by x2 + y 2 = 1, 0 ≤ z ≤ 1, with normal pointing out of the cylinder. → − Problem 6. Let S be an oriented surface and C a closed curve → − bounding S . Verify the equality → − → − → → − − ( × F ) · dS = F ·ds − → → − if F is a gradient field. S C 2 2 1...

Words: 254 - Pages: 2

Premium Essay

Math

...say whether I was able to learn how to be a better teacher and what the teacher did that I could possibly use in the future. While analyzing and going through the process of this assignment it is helping realize how to become a better teacher as well. I would also like to get more comfortable and experience on using this template of the paper. Memories Of A Teacher My teacher, Mr. G, used many different instructional techniques and approaches to his lessons. Mr. G had taught me math for three years in a row, so I think that I have a good grasp on his approaches to the lessons that he would teach. He would assign many homework assignments, as well as in-class assignments, which helped me and other students understand and get practice with the lesson that we were learning. I think that with math having a lot of homework is a good thing. In my mind, the only way to learn how to do math is plenty of practice. The more you practice, the easier it will be. Mr. G would also have the students do some math problems on the chalk board or smart board to show the class and go over the corrections with the whole class so that everyone would understand the problem. Playing “racing” games also helped and added fun to the class. With the “racing” games, the students would get into groups and have to take...

Words: 1027 - Pages: 5

Free Essay

Math

...STAT2011 Statistical Models sydney.edu.au/science/maths/stat2011 Semester 1, 2014 Computer Exercise Weeks 1 Due by the end of your week 2 session Last compiled: March 11, 2014 Username: mac 1. Below appears the code to generate a single sample of size 4000 from the population {1, 2, 3, 4, 5, 6}. form it into a 1000-by-4 matrix and then find the minimum of each row: > rolls1 table(rolls1) rolls1 1 2 3 4 5 6 703 625 679 662 672 659 2. Next we form this 4000-long vector into a 1000-by-4 matrix: > four.rolls=matrix(rolls1,ncol=4,nrow=1000) 3. Next we find the minimum of each row: > min.roll=apply(four.rolls,1,min) 4. Finally we count how many times the minimum of the 4 rolls was a 1: > sum(min.roll==1) [1] 549 5. (a) First simulate 48,000 rolls: > rolls2=sample(x=c(1,2,3,4,5,6),size=48000,replace=TRUE) > table(rolls2) rolls2 1 2 3 4 5 6 8166 8027 8068 7868 7912 7959 (b) Next we form this into a 2-column matrix (thus with 24,000 rows): > two.rolls=matrix(rolls2,nrow=24000,ncol=2) (c) Here we compute the sum of each (2-roll) row: > sum.rolls=apply(two.rolls,1,sum) > table(sum.rolls) sum.rolls 2 3 4 5 6 7 8 9 10 11 742 1339 2006 2570 3409 4013 3423 2651 1913 1291 1 12 643 Note table() gives us the frequency table for the 24,000 row sums. (d) Next we form the vector of sums into a 24-row matrix (thus with 1,000 columns): > twodozen=matrix(sum.rolls,nrow=24,ncol=1000,byrow=TRUE) (e) To find the 1,000 column minima use > min.pair=apply(twodozen,2,min) (f) Finally compute the...

Words: 597 - Pages: 3

Premium Essay

Math

...Jasmine Petersen Dr. Abdeljabbar MAT 1111 April 23, 2014 Algebra is one of the most important subjects someone can learn. It is a subject that transfers into daily life. A lot of people do not realize that they are using algebra. Algebra can be anything from calculating the amount of money you’ve spent on your grocery shopping, designing structural plans for a building, and keeping track of the calories you have in your diet. Our professor told us that in every subject, we use math. My major is chemistry and mathematics is used widely in chemistry as well as all other sciences. Mathematical calculations are absolutely necessary to explore important concepts in chemistry. You’ll need to convert things from one unit to another. For example, you need to convert 12 inches to feet. Also, we use simple arithmetic to balance equations. A lot of things I’ve had learned from this course and one of them was that we use Math for everyday life. I’ve also learned many ways how to solve equations such as linear, quadratic, exponential, and logarithmic equations. All the material that we did learn was all easy to learn and understand. I believe that the instructor did a good job explaining on how to solve problems. If my friend was asking me how to determine the differences between the equation of the ellipse and the equation of the hyperbola, I would first give he or she the definition of the two words ellipse and hyperbola. An ellipse is a set of all points in a plane such that the sum...

Words: 623 - Pages: 3

Free Essay

Math

...A | Course Title & Number | Calculus II: MTH104 | B | Pre/Co-requisite(s) | Pre-requisite: MTH103 (Calculus I) | C | Number of credits | 3 | D | Faculty Name | Dr. Ghada Alobaidi | E | Term/ Year | Fall 2014 | F | Sections | Course | Days | Time | Location | MTH104.02 MTH104.04MTH104.06 | UTR UTRMW | 9:00-9:50 10:00-10:50 8:00-9:15 | PHY 113NAB 007NAB010 | | | | | | G | Instructor Information | Instructor | Office | Telephone | Email | Ghada Alobaidi | NAB 249 | 06 515 2754 | galobaidi@aus.edu | Office Hours: UT: 11:00 – 12:30 , R: 11:00 – 12:00 or by appointment. | H | Course Description from Catalog | Covers techniques of integration, improper integrals, sequences, infinite series, power series, parameterized curves, polar coordinates, integration in polar coordinates and complex numbers. | I | Course Learning Outcomes | Upon completion of the course, students will be able to: * Read, analyze, and apply to problems, written material related to the study of calculus. * Use the appropriate technique(s) – including integration by parts, trigonometric substitutions, partial fractions, etc. to integrate algebraic, logarithmic, exponential, trigonometric, and composite functions. * Evaluate improper integrals and test them for convergence. * Compute arc length and surface area of revolution of graphs and parametric curves. * Graph polar curves and find enclosed area and arc length. * Apply theorems about limits of...

Words: 1366 - Pages: 6

Premium Essay

Math

...Math is used everyday – adding the cost of the groceries before checkout, totaling up the monthly bills, estimating the distance and time a car ride is to a place a person has not been. The problems worked this week have showed how math works in the real world. This paper will show how two math problems from chapter five real world applications numbers 35 and 37 worked out. Number 35 A person hired a firm to build a CB radio tower. The firm charges $100 for labor for the first 10 feet. After that, the cost of labor for each succeeding 10 feet is $25 more than the preceding 10 feet. That is, the nest 10 feet will cost $125; the next 10 feet will cost $150, etc. How much will it cost to build a 90-foot tower? Solving this problem involves the arithmetic sequence. The arithmetic sequence is a sequence of numbers in which each succeeding term differs from the preceding term by the same amount (Bluman, 2011). n = number of terms altogether n = 9 d = the common differences d = 25 ª1 = first term ª1 = 100 ªn = last term ª2 = ª9 The formula used to solve this problem came from the book page 222. ªn = ª1 + (n -1)d ª9 = 100 + (9-1)25 ª9 = 100 + (8)25 ...

Words: 540 - Pages: 3

Premium Essay

Math

...you come to geometry, your opinion may vary. This class introduces a lot of new topics, which can be challenging, and take lots of practice outside of school if you do not pay attention or do your math homework. I strongly advise you to do your math homework everyday, not for just a grade, but it also helps you when it comes time for quizzes and tests. She rarely checks homework, but when she does, she will not tell you. It is also a great review for tests and quizzes. Ms.Hull’s tests and quizzes are not the easiest things you will take. The quizzes take new concepts and apply to the quiz. Also, her tests are usually always hard. It is a good idea to practice new concepts and review old ones from previous units, so you can get a good grade on the tests. I also advise you to be organized throughout the year. Organization is the key to success especially in math class. Tool kits are an extremely helpful resource to use. There are going to be a lot of conjectures and theorems that will be new, and it would be hard to just memorize them. My overall geometry year was not exactly the way I hoped it would turn out. It was extremely had, and it moves at a very quick pace, so keeping up was hard for me personally. If I could have done something differently, it would have been practicing math more often. Each concept was hard, and I did not have anytime to review it, because I have a lot of honors classes which require a lot of work too. The key to being successful in this course...

Words: 361 - Pages: 2

Free Essay

Math

...|7|SURVEY OF MATHEMATICS FALL 2015 | |8| | |8| | |8| | |8| | | |  | | |Instructor  | | |Gary F. Melendy | | | | | |Title  | | |Instructor ...

Words: 1789 - Pages: 8

Free Essay

Math

...Math 1P05 Assignment #1 Due: September 26 Questions 3, 4, 6, 7, 11 and 12 require some Maple work. 1. Solve the following inequalities: a) b) c) 2. Appendix D #72 3. Consider the functions and . a) Use a Maple graph to estimate the largest value of at which the graphs intersect. Hand in a graph that clearly shows this intersection. b) Use Maple to help you find all solutions of the equation. 4. Consider the function. a) Find the domain of. b) Find and its domain. What is the range of? c) To check your result in b), plot and the line on the same set of axes. (Hint: To get a nice graph, choose a plotting range for bothand.) Be sure to label each curve. 5. Section 1.6 #62 6. Section 2.1 #4. In d), use Maple to plot the curve and the tangent line. Draw the secant lines by hand on your Maple graph. 7. Section 2.2 #24. Use Maple to plot the function. 8. Section 2.2 #36 9. Section 2.3 #14 10. Section 2.3 #26 11. Section 2.3 #34 12. Section 2.3 #36 Recommended Problems Appendix A all odd-numbered exercises 1-37, 47-55 Appendix B all odd-numbered exercises 21-35 Appendix D all odd-numbered exercises 23-33, 65-71 Section 1.5 #19, 21 Section 1.6 all odd-numbered exercises 15-25, 35-41, 51, 53 Section 2.1 #3, 5, 7 Section 2.2 all odd-numbered exercises 5-9, 15-25, 29-37 Section 2.3 all odd-numbered exercises...

Words: 271 - Pages: 2

Premium Essay

Math

...find the national average cost of food for an individual, as well as for a family of 4 for a given month. http://www.cnpp.usda.gov/sites/default/files/usda_food_plans_cost_of_food/CostofFoodJan2012.pdf 5. Find a website for your local city government. http://www.usa.gov/Agencies/Local.shtml 6. Find the website for your favorite sports team (state what that team is as well by the link). http://blackhawks.nhl.com/ (Chicago Blackhawks) 7. Many of us do not realize how often we use math in our daily lives. Many of us believe that math is learned in classes, and often forgotten, as we do not practice it in the real world. Truth is, we actually use math every day, all of the time. Math is used everywhere, in each of our lives. Math does not always need to be thought of as rocket science. Math is such a large part of our lives, we do not even notice we are computing problems in our lives! For example, if one were interested in baking, one must understand that math is involved. One may ask, “How is math involved with cooking?” Fractions are needed to bake an item. A real world problem for baking could be as such: Heena is baking a cake that requires two and one-half cups of flour. Heena poured four and one-sixth cups of flour into a bowl. How much flour should Heena take out of the bowl? In this scenario of a real world problem, we have fractions, and subtraction of fractions, since Heena has added four and one-sixth cups of flour, rather than the needed...

Words: 665 - Pages: 3

Free Essay

Math

...Math was always the class that could never quite keep my attention in school. I was a daydreamer and a poor student and applying myself to it was pretty much out of the question. When I would pay some attention I would still forget the steps it had taken me to find the solution. So, when the next time came around I was lost. This probably came about because as a kid I wasn’t real fond of structure. I was more into abstract thought and didn’t think that life required much more than that at the time. I was not interested in things I had to write down and figure out step by step on a piece of paper. I figured I could be Tom Sawyer until about the age of seventy two. My thoughts didn’t need a rhyme or reason and didn’t need laws to keep them within any certain limits. The furthest I ever made it in school was Algebra II and I barely passed that. The reason wasn’t that I couldn’t understand math. It was more that I didn’t apply myself to the concepts of it, or the practice and study it took to get there. I was always more interested in other concepts. Concepts that were gathered by free thinkers, philosophers, idealists. Now I knew that a lot of those figures I read about tried their hand in the sciences, physics, and mathematics in their day, but I was more interested in their philosophical views on everyday life. It was not until I started reading on the subject of quantum physics and standard physics that I became interested in math. The fact that the laws of standard physics...

Words: 473 - Pages: 2