Object Oriented ALV
Hi All,
I want to know the advantages of using OOPS ALV over the normal ALV function modules and how should we decide whether we need to use Object oriented ALV or normal ALV.
Regards,
S.Subasree
HI
please check out the following links
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIDOCK/BCCIDOCK.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIGOF/BCCIGOF.pdf
hope this helps
regards
Aakash Banga
Similar Messages
-
How to display horizontal line in top-of-page by using object oriented ALV?
How to display horizontal line in top-of-page by using object oriented ALV.
I am created top-of-page in object oriented alv.
But not be successes in showing horizontal line in it.
Can any one pls give solution for this..
Thanks and regards..Hi
Try like this
data: gt_list_top_of_page type slis_t_listheader. " Top of page text.
Initialization.
perform comment_build using gt_list_top_of_page[].
form top_of_page.
* Note to self: the gif must be loaded into transaction OAOR with
* classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions.
* I Loaded NOVALOGO2 into system.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
* I_LOGO = 'NOVALOGO2'
* i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = gt_list_top_of_page.
endform. " TOP_OF_PAGE
form comment_build using e04_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
clear ls_line.
ls_line-typ = 'A'.
ls_line-info = 'Special'(001).
fgrant = xgrant.
concatenate ls_line-info fgrant
'Stock Option Report to the board'(002)
into ls_line-info separated by space.
condense ls_line-info.
append ls_line to e04_lt_top_of_page.
endform. " COMMENT_BUILD
Use following syntex for footer print in alv:
* For End of Page
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
* For End of Report
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
check this link
http://abapprogramming.blogspot.com/
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d
Changing width of a custom container dynamically
Display Page numbers in ALV
Insert picture in selection screen.
Logo in OO ALV Grid
Reward all helpfull answers
Regards
Pavan -
HOw to make an Object oriented alv respond to double click
Hi all,
HOw to make an Object oriented alv respond to double click.SAmple code will be helpful.
Thanks in advance,
Alex.Hi,
1. Create a Control (for Custom and Split Containers only)
2. Instantiate a Container Object (in case of Custom and Split Containers, specify the control which is created by us in Screen painter) CREATE OBJECT
3. Instantiate an Object of the kind of report that has to be displayed (List, Grid or Tree). CREATE OBJECT . Here we need to specify the Parent Container as the so that it sits in that container.
4. Call appropriate methods to display the report on the screen. CALL METHOD ->
DATA : g_dock TYPE REF TO cl_gui_docking_container,
g_split TYPE REF TO cl_gui_easy_splitter_container,
g_cont1 TYPE REF TO cl_gui_container,
g_cont2 TYPE REF TO cl_gui_container,
g_grid1 TYPE REF TO cl_gui_alv_grid,
g_grid2 TYPE REF TO cl_gui_alv_grid.
i_mara is an internal table of structure MARA
SELECT * FROM mara INTO TABLE i_mara.
i_kna1 is an internal table of structure KNA1
SELECT * FROM kna1 INTO TABLE i_kna1.
To create an Object of type Docking Container
CREATE OBJECT g_dock
EXPORTING
side = cl_gui_docking_container=>dock_at_top
extension = 200 .
To Create an Object of Type Split Container. Here we can see that the Docking *Container Created above has been used as a parent .
CREATE OBJECT g_split
EXPORTING
parent = g_dock
orientation = 1 .
Easy Split container splits one Control into 2 manageable controls, each of them is used * to handle one GUI Container each
g_cont1 = g_split->top_left_container.
g_cont2 = g_split->bottom_right_container.
To Create an Object of type Grid . Here we can see that the Left Split Container * Created above has been used as a parent .
CREATE OBJECT g_grid1
EXPORTING
i_parent = g_cont1 .
To Create an Object of type Grid . Here we can see that the Right Split Container * Created above has been used as a parent .
CREATE OBJECT g_grid2
EXPORTING
i_parent = g_cont2 .
The method of Grid Control Object is used to display the Data.
CALL METHOD g_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'MARA'
CHANGING
it_outtab = i_mara[] .
The method of Grid Control Object is used to display the Data.
CALL METHOD g_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNA1'
CHANGING
it_outtab = i_kna1[] .
Regards
Hari -
How to capture index/row no of row in table using object oriented alv.
i have a table with many fields. i have an alv grid table displayed using object oriented alv. when i double click on a record, i call another screen. there i want to display the record number. eg, if i doubleclick on the third row, i will go to next screen and display 3 there.
please let me know how it is done as it is urgent.
thanks in advance.Hi,
Use the following code to get rowno.
CLASS lcl_grid_events DEFINITION DEFERRED.
DATA:
grid1_events TYPE REF TO lcl_grid_events.
CLASS lcl_grid_events DEFINITION.
PUBLIC SECTION.
METHODS:
dbclk
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row
e_column
es_row_no.
ENDCLASS. "lcl_grid_events DEFINITION
CLASS lcl_grid_events IMPLEMENTATION.
METHOD dbclk.
*access e_row variable, which contains the record no.
ENDMETHOD. "dbclk
ENDCLASS. "lcl_grid
write the following code after method call of set_table_for_first_display
CREATE OBJECT grid1_events.
SET HANDLER grid1_events->dbclk
FOR grid1.
reward point if useful. -
Interactive object oriented alv
hi friends,
i want interactive object oriented alv report. i want some example program for that.try like this
*& Report ZALV_OOP
REPORT zalv_oop.
CLASS lcl_event_handler DEFINITION
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION .
METHODS:
*--Double-click control
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column es_row_no.
PRIVATE SECTION.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION .
*--Handle Double Click
METHOD handle_double_click .
PERFORM handle_double_click USING e_row e_column es_row_no .
ENDMETHOD . "handle_double_click
ENDCLASS . "lcl_event_handler IMPLEMENTATION
TABLES : mseg.
DATA : BEGIN OF itab OCCURS 0,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
menge LIKE mseg-menge,
END OF itab.
DATA : gr_alvgrid TYPE REF TO cl_gui_alv_grid,
gr_ccontainer TYPE REF TO cl_gui_custom_container,
gt_fcat TYPE lvc_t_fcat,
gs_layo TYPE lvc_s_layo.
DATA gr_event_handler TYPE REF TO lcl_event_handler .
DATA : ok_code LIKE sy-ucomm.
DATA : t_mat LIKE mara-matnr.
DATA: variant TYPE disvariant.
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_mblnr FOR mseg-mblnr.
SELECTION-SCREEN : END OF BLOCK blk1.
START-OF-SELECTION.
SET SCREEN 100.
CREATE OBJECT gr_event_handler .
PERFORM get_data.
PERFORM dis_data.
*& Form get_data
text
FORM get_data.
SELECT mblnr matnr menge FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab
WHERE mblnr IN s_mblnr.
variant-report = sy-repid.
variant-username = sy-uname.
ENDFORM. "get_data
*& Form dis_data
text
FORM dis_data.
IF gr_alvgrid IS INITIAL.
CREATE OBJECT gr_ccontainer
EXPORTING
container_name = 'CC_ALV'
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.
CREATE OBJECT gr_alvgrid
EXPORTING
i_parent = gr_ccontainer
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.
PERFORM create_fcat CHANGING gt_fcat.
PERFORM create_layout CHANGING gs_layo.
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
is_variant = variant
i_save = 'A'
is_layout = gs_layo
CHANGING
it_outtab = itab[]
it_fieldcatalog = gt_fcat
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SET HANDLER gr_event_handler->handle_double_click FOR gr_alvgrid .
ENDIF.
ENDFORM. "dis_data
*& Form create_fcat
text
<--P_GT_FCAT text
FORM create_fcat CHANGING pt_fcat TYPE lvc_t_fcat.
DATA : ls_fcat TYPE lvc_s_fcat.
ls_fcat-fieldname = 'MBLNR'.
ls_fcat-coltext = 'Material Doc.'.
APPEND ls_fcat TO pt_fcat.
ls_fcat-fieldname = 'MATNR'.
ls_fcat-coltext = 'Material'.
APPEND ls_fcat TO pt_fcat.
ls_fcat-fieldname = 'MENGE'.
ls_fcat-coltext = 'Quantity'.
APPEND ls_fcat TO pt_fcat.
ENDFORM. " create_fcat
*& Form create_layout
text
<--P_GS_LAYO text
FORM create_layout CHANGING ps_layo TYPE lvc_s_layo.
ps_layo-zebra = 'X'.
ENDFORM. " create_layout
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZALV_OOP'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
ok_code = sy-ucomm.
CASE ok_code.
WHEN 'BACK' OR 'UP' OR 'CANC'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form handle_double_click
text
-->I_ROW text
-->I_COLUMN text
-->IS_ROW_NO text
FORM handle_double_click USING i_row TYPE lvc_s_row
i_column TYPE lvc_s_col
is_row_no TYPE lvc_s_roid.
READ TABLE itab INDEX is_row_no-row_id .
IF sy-subrc = 0 .
IF i_column = 'MATNR'.
t_mat = itab-matnr.
SET PARAMETER ID 'MAT' FIELD t_mat.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
SET PARAMETER ID 'MAT' FIELD space.
ELSEIF i_column = 'MBLNR'.
CALL TRANSACTION 'MIGO'.
ENDIF .
ENDIF.
ENDFORM . "handle_double_click
here in screen 100 i have taken one custom control with name cc_alv -
Field symbols in Object Oriented ALV
Hi Friends....Can somebody explain me what is the significance of field symbols in OO ALV. Why it is assigned to Field catalog. Also explain me the basic steps to do Object Oriented ALV. Thanks in advance...
Hi Satyesh,
Field symbols are symbolic names to which a memory area can be assigned during program runtime. A field symbol can be used instead of data objects at operand positions of statements.
Please go through this following code. This uses field symbols for OO ALV.
LCL_TABLE_DISPLAY DEFINITION
CLASS lcl_table_display DEFINITION.
PUBLIC SECTION.
TYPE-POOLS: abap, slis.
CLASS-METHODS: display_list IMPORTING in_data TYPE STANDARD TABLE,
display_grid IMPORTING in_data TYPE STANDARD TABLE.
METHODS: constructor IMPORTING in_data TYPE STANDARD TABLE
EXCEPTIONS casting_error
empty_fieldcat.
METHODS: output_list,
output_grid.
METHODS: set_table_name IMPORTING in_tabname TYPE any,
set_alv_title IMPORTING in_title TYPE any,
set_alv_settings IMPORTING in_settings TYPE any,
set_alv_layout IMPORTING in_layout TYPE any,
set_alv_event IMPORTING in_name TYPE any
in_form TYPE any.
PRIVATE SECTION.
CLASS-DATA: g_table_object TYPE REF TO lcl_table_display.
TYPES: BEGIN OF ty_defin,
fieldname TYPE fieldname,
ref_tabname TYPE tabname,
ref_fieldname TYPE fieldname,
END OF ty_defin.
DATA: g_repid TYPE repid,
g_struc TYPE tabname,
g_table TYPE tabname.
DATA: gt_data TYPE REF TO data.
DATA: g_title TYPE lvc_title,
gt_fcat TYPE slis_t_fieldcat_alv,
gs_sett TYPE lvc_s_glay,
gs_layo TYPE slis_layout_alv,
gt_evnt TYPE slis_t_event.
DATA: gt_defin TYPE TABLE OF ty_defin,
g_level TYPE tabname.
METHODS: output_table IMPORTING data TYPE REF TO data
mode TYPE c,
fill_fieldcat IMPORTING repid TYPE repid
struc TYPE tabname
CHANGING fcat TYPE slis_t_fieldcat_alv
EXCEPTIONS no_definition,
get_definition IMPORTING repid TYPE repid
struc TYPE tabname
CHANGING abap TYPE rsfb_source,
recursive_definition IMPORTING repid TYPE repid
CHANGING abap TYPE rsfb_source,
map_structure IMPORTING source TYPE any
CHANGING destin TYPE any.
ENDCLASS.
LCL_TABLE_DISPLAY IMPLEMENTATION
CLASS lcl_table_display IMPLEMENTATION.
Display table in ALV list
METHOD display_list.
IF NOT g_table_object IS INITIAL.
FREE: g_table_object.
ENDIF.
CREATE OBJECT g_table_object EXPORTING in_data = in_data.
CALL METHOD g_table_object->output_list.
ENDMETHOD.
Display table in ALV grid
METHOD display_grid.
IF NOT g_table_object IS INITIAL.
FREE: g_table_object.
ENDIF.
CREATE OBJECT g_table_object EXPORTING in_data = in_data.
CALL METHOD g_table_object->output_grid.
ENDMETHOD.
Create table display
METHOD constructor.
DATA: ls_data TYPE REF TO data.
DATA: ob_desc TYPE REF TO cl_abap_structdescr.
DATA: l_absol TYPE char200,
l_repid TYPE repid,
l_struc TYPE tabname.
FIELD-SYMBOLS: <table> TYPE STANDARD TABLE,
<struc> TYPE ANY.
Get data and store it into attribute
CREATE DATA me->gt_data LIKE in_data.
ASSIGN me->gt_data->* TO <table>.
<table> = in_data.
Get global data definition
CREATE DATA ls_data LIKE LINE OF <table>.
ASSIGN ls_data->* TO <struc>.
CATCH SYSTEM-EXCEPTIONS assign_casting_illegal_cast = 1.
ob_desc ?= cl_abap_typedescr=>describe_by_data( <struc> ).
ENDCATCH.
IF sy-subrc = 1.
RAISE casting_error.
ENDIF.
Get program name and main type used to define table
l_absol = ob_desc->absolute_name.
SPLIT l_absol AT '\TYPE=' INTO l_repid l_struc.
SHIFT l_repid UP TO '='.
SHIFT l_repid.
CHECK l_struc NP '%_*'.
IF me->g_repid NE l_repid
OR me->g_struc NE l_struc.
Set attributes
me->g_repid = l_repid.
me->g_struc = l_struc.
me->g_table = l_struc.
REPLACE 'TY' WITH 'WT' INTO me->g_table.
Field catalog
CALL METHOD fill_fieldcat EXPORTING repid = l_repid
struc = l_struc
CHANGING fcat = me->gt_fcat.
IF me->gt_fcat IS INITIAL.
RAISE empty_fieldcat.
ENDIF.
ENDIF.
ENDMETHOD.
Output list
METHOD output_list.
CALL METHOD output_table EXPORTING data = me->gt_data
mode = 'L'.
ENDMETHOD.
Output grid
METHOD output_grid.
CALL METHOD output_table EXPORTING data = me->gt_data
mode = 'G'.
ENDMETHOD.
Output table
METHOD output_table.
DATA: ls_vari TYPE disvariant.
FIELD-SYMBOLS: <table> TYPE STANDARD TABLE.
ASSIGN me->gt_data->* TO <table>.
Get default user variant
ls_vari-report = me->g_repid.
ls_vari-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'U'
CHANGING
cs_variant = ls_vari
EXCEPTIONS
OTHERS = 0.
Display table contents
IF mode = 'G'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = me->g_repid
i_grid_title = me->g_title
i_grid_settings = me->gs_sett
is_layout = me->gs_layo
it_fieldcat = me->gt_fcat
i_save = 'U'
is_variant = ls_vari
it_events = me->gt_evnt
TABLES
t_outtab = <table>
EXCEPTIONS
OTHERS = 0.
ELSE.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = me->g_repid
is_layout = me->gs_layo
it_fieldcat = me->gt_fcat
i_save = 'U'
is_variant = ls_vari
it_events = me->gt_evnt
TABLES
t_outtab = <table>
EXCEPTIONS
OTHERS = 0.
ENDIF.
ENDMETHOD.
Fill field catalog
METHOD fill_fieldcat.
DATA: lt_abap TYPE TABLE OF rssource.
DATA: ls_defin TYPE ty_defin.
DATA: lt_dfies TYPE TABLE OF dfies,
ls_dfies TYPE dfies,
ls_dd04v TYPE dd04v,
ls_dd01v TYPE dd01v,
l_flong TYPE dfies-lfieldname,
l_dname TYPE dfies-domname.
DATA: ls_fcat TYPE slis_fieldcat_alv,
ls_fcat2 TYPE slis_fieldcat_alv.
DATA: l_index TYPE i,
l_nbfld TYPE i.
FREE: me->gt_defin.
Process data definition
CALL METHOD get_definition EXPORTING repid = repid
struc = struc
CHANGING abap = lt_abap.
Process sub levels if required
CALL METHOD recursive_definition EXPORTING repid = repid
CHANGING abap = lt_abap.
IF me->gt_defin IS INITIAL.
RAISE no_definition.
ENDIF.
LOOP AT me->gt_defin INTO ls_defin.
CLEAR: ls_fcat.
MOVE-CORRESPONDING ls_defin TO ls_fcat.
Retrieve info about this field
FREE: ls_dfies, ls_dd04v, ls_dd01v, l_dname.
l_flong = ls_fcat-ref_fieldname.
SET LOCALE LANGUAGE 'E'.
TRANSLATE: ls_fcat-ref_tabname TO UPPER CASE,
ls_fcat-ref_fieldname TO UPPER CASE,
l_flong TO UPPER CASE.
IF NOT ls_fcat-ref_tabname IS INITIAL.
Try to get info about field in table
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = ls_fcat-ref_tabname
fieldname = ls_fcat-ref_fieldname
lfieldname = l_flong
IMPORTING
dfies_wa = ls_dfies
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_dfies TO ls_fcat.
ls_fcat-fieldname = ls_defin-fieldname.
MOVE: ls_dfies-keyflag TO ls_fcat-key,
ls_dfies-scrtext_m TO ls_fcat-seltext_l,
ls_dfies-domname TO l_dname.
ENDIF.
ELSE.
Try to get info about structure
ls_defin-ref_tabname = ls_defin-ref_fieldname.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = ls_defin-ref_tabname
TABLES
dfies_tab = lt_dfies
EXCEPTIONS
OTHERS = 0.
IF NOT lt_dfies IS INITIAL.
Process fields of this structure
LOOP AT lt_dfies INTO ls_dfies.
CLEAR: ls_fcat.
MOVE-CORRESPONDING ls_dfies TO ls_fcat.
CONCATENATE ls_defin-fieldname ls_fcat-fieldname
INTO ls_fcat-fieldname
SEPARATED BY '-'.
MOVE ls_dfies-keyflag TO ls_fcat-key.
MOVE ls_dfies-scrtext_m TO ls_fcat-seltext_l.
ls_fcat-tabname = me->g_table.
CLEAR: ls_fcat-col_pos,
ls_fcat-offset.
IF ls_fcat-ref_tabname IS INITIAL.
ls_fcat-ddictxt = 'L'.
ENDIF.
Display Yes/No fields as checkboxes
IF ls_dfies-domname = 'XFELD'.
ls_fcat-checkbox = 'X'.
ENDIF.
Add field to field catalog
APPEND ls_fcat TO fcat.
ENDLOOP.
ELSE.
Try to get info about data element
CALL FUNCTION 'DDIF_DTEL_GET'
EXPORTING
name = ls_fcat-ref_fieldname
langu = sy-langu
IMPORTING
dd04v_wa = ls_dd04v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_dd04v TO ls_fcat.
MOVE: ls_dd04v-scrtext_m TO ls_fcat-seltext_l,
ls_dd04v-domname TO l_dname.
ELSE.
Finally try to get info about domain
CALL FUNCTION 'DDIF_DOMA_GET'
EXPORTING
name = ls_fcat-ref_fieldname
langu = sy-langu
IMPORTING
dd01v_wa = ls_dd01v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_dd01v TO ls_fcat.
MOVE: ls_dd01v-ddtext TO ls_fcat-seltext_l,
ls_dd01v-domname TO l_dname.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
Table name must be internal table containing data
ls_fcat-tabname = g_table.
No offset
CLEAR: ls_fcat-offset.
Default text is stored in long text
IF ls_fcat-ref_tabname IS INITIAL.
ls_fcat-ddictxt = 'L'.
ENDIF.
Display Yes/No fields as checkboxes
IF l_dname = 'XFELD'.
ls_fcat-checkbox = 'X'.
ENDIF.
Add field to field catalog
APPEND ls_fcat TO fcat.
ENDLOOP.
Link between fields
DESCRIBE TABLE fcat LINES l_nbfld.
LOOP AT fcat INTO ls_fcat.
IF sy-tabix NE l_nbfld.
l_index = sy-tabix + 1.
READ TABLE fcat INTO ls_fcat2 INDEX l_index.
IF sy-subrc = 0.
IF ls_fcat-datatype = 'CURR'.
Currency unit
IF ls_fcat2-datatype = 'CUKY'.
ls_fcat-cfieldname = ls_fcat2-fieldname.
ls_fcat-ctabname = ls_fcat2-tabname.
MODIFY fcat FROM ls_fcat.
ELSE.
LOOP AT fcat INTO ls_fcat2
FROM l_index
WHERE datatype = 'CUKY'.
First currency unit after field
ls_fcat-cfieldname = ls_fcat2-fieldname.
ls_fcat-ctabname = ls_fcat2-tabname.
MODIFY fcat FROM ls_fcat.
EXIT.
ENDLOOP.
IF sy-subrc NE 0.
No currency unit after field, try before
READ TABLE fcat INTO ls_fcat2
WITH KEY datatype = 'CUKY'.
IF sy-subrc = 0.
ls_fcat-cfieldname = ls_fcat2-fieldname.
ls_fcat-ctabname = ls_fcat2-tabname.
MODIFY fcat FROM ls_fcat.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
IF ls_fcat-datatype = 'QUAN'.
Quantity unit
IF ls_fcat2-datatype = 'UNIT'.
ls_fcat-cfieldname = ls_fcat2-fieldname.
ls_fcat-ctabname = ls_fcat2-tabname.
MODIFY fcat FROM ls_fcat.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
Get definition of type from code source
METHOD get_definition.
DATA: l_strng TYPE rssource,
ls_abap TYPE rssource,
l_fdpos TYPE i,
l_first TYPE i,
l_lastr TYPE i.
DATA: lt_incl TYPE TABLE OF repid,
ls_incl TYPE repid.
Get program code
READ REPORT repid INTO abap.
CHECK sy-subrc EQ 0.
Get first line of definition
CONCATENATE 'BEGIN OF' struc INTO l_strng
SEPARATED BY space.
LOOP AT abap INTO ls_abap.
IF ls_abap CS l_strng.
l_fdpos = strlen( l_strng ) + sy-fdpos.
IF ls_abap+l_fdpos(1) CA ', "'.
l_first = sy-tabix.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
IF l_first IS INITIAL.
Table is defined in an include
CALL FUNCTION 'RS_GET_ALL_INCLUDES'
EXPORTING
program = repid
TABLES
includetab = lt_incl
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
LOOP AT lt_incl INTO ls_incl.
Try to find definition in this include
READ REPORT ls_incl INTO abap.
LOOP AT abap INTO ls_abap.
IF ls_abap CS l_strng.
l_fdpos = strlen( l_strng ) + sy-fdpos.
IF ls_abap+l_fdpos(1) CA ',. "'.
l_first = sy-tabix.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
IF NOT l_first IS INITIAL.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
Get last line of definition
CONCATENATE 'END OF' struc INTO l_strng
SEPARATED BY space.
LOOP AT abap INTO ls_abap.
IF ls_abap CS l_strng.
l_fdpos = strlen( l_strng ) + sy-fdpos.
IF ls_abap+l_fdpos(1) CA ',. "'.
l_lastr = sy-tabix - l_first.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
Keep only relevant code lines
IF l_first LE 0
OR l_lastr LE 0.
REFRESH abap.
ELSE.
DELETE abap TO l_first.
DELETE abap FROM l_lastr.
ENDIF.
ENDMETHOD.
Get definition of type recursively
METHOD recursive_definition.
DATA: lt_token TYPE TABLE OF stokex,
ls_token TYPE stokex,
lt_state TYPE TABLE OF sstmnt,
ls_state TYPE sstmnt.
DATA: ls_defin TYPE ty_defin,
l_reffld TYPE fieldname.
DATA: lt_recu TYPE TABLE OF rssource.
Retrieve tokens
SCAN ABAP-SOURCE abap
TOKENS INTO lt_token
STATEMENTS INTO lt_state.
LOOP AT lt_state INTO ls_state.
CLEAR: ls_defin.
Field name
READ TABLE lt_token INTO ls_token
INDEX ls_state-from.
ls_defin-fieldname = ls_token-str.
Reference type
READ TABLE lt_token INTO ls_token
INDEX ls_state-to.
l_reffld = ls_token-str.
Check if this type is defined in program
FREE: lt_recu.
CALL METHOD get_definition EXPORTING repid = repid
struc = l_reffld
CHANGING abap = lt_recu.
IF lt_recu IS INITIAL.
IF NOT g_level IS INITIAL.
CONCATENATE g_level ls_defin-fieldname INTO ls_defin-fieldname
SEPARATED BY '-'.
CONDENSE ls_defin-fieldname.
ENDIF.
IF l_reffld CS '-'.
SPLIT l_reffld AT '-'
INTO ls_defin-ref_tabname
ls_defin-ref_fieldname.
IF ls_defin-ref_tabname = 'SY'.
ls_defin-ref_tabname = 'SYST'.
ENDIF.
ELSE.
ls_defin-ref_fieldname = ls_token-str.
ENDIF.
APPEND ls_defin TO me->gt_defin.
ELSE.
Process sub levels
IF me->g_level IS INITIAL.
me->g_level = ls_defin-fieldname.
ELSE.
CONCATENATE me->g_level ls_defin-fieldname INTO me->g_level
SEPARATED BY '-'.
ENDIF.
CALL METHOD recursive_definition EXPORTING repid = repid
CHANGING abap = lt_recu.
IF me->g_level CS '-'.
SHIFT me->g_level RIGHT UP TO '-'.
SHIFT me->g_level RIGHT.
SHIFT me->g_level LEFT DELETING LEADING space.
ELSE.
CLEAR: me->g_level.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
Set table name
METHOD set_table_name.
me->g_table = in_tabname.
ENDMETHOD.
Set title
METHOD set_alv_title.
me->g_title = in_title.
ENDMETHOD.
Set settings
METHOD set_alv_settings.
CALL METHOD map_structure EXPORTING source = in_settings
CHANGING destin = me->gs_sett.
ENDMETHOD.
Set layout
METHOD set_alv_layout.
CALL METHOD map_structure EXPORTING source = in_layout
CHANGING destin = me->gs_layo.
ENDMETHOD.
Add event
METHOD set_alv_event.
DATA: ls_evnt TYPE slis_alv_event.
ls_evnt-name = in_name.
ls_evnt-form = in_form.
COLLECT ls_evnt INTO gt_evnt.
ENDMETHOD.
Map fields from incoming structure into attribute
METHOD map_structure.
DATA: ob_desc TYPE REF TO cl_abap_structdescr,
ls_compo TYPE abap_compdescr.
FIELD-SYMBOLS: <field> TYPE ANY,
<struc> TYPE ANY.
ob_desc ?= cl_abap_typedescr=>describe_by_data( destin ).
LOOP AT ob_desc->components INTO ls_compo.
ASSIGN COMPONENT ls_compo-name OF STRUCTURE source TO <field>.
IF <field> IS ASSIGNED.
ASSIGN COMPONENT ls_compo-name OF STRUCTURE destin TO <struc>.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.
MOVE <field> TO <struc>.
ENDCATCH.
UNASSIGN <field>.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
PLZ REWARD POINTS -
Why do we use cl_gui_cfw= flush method in Object Oriented ALV programming
Dear Friends,
Please solve my query regarding control framework. Why do we use cl_gui_cfw=>flush method in Object Oriented ALV programming. I studied and found that this method transfers automation queue to Front end. But I could not find any further update on this.
Thanks & Regards
Amit SharmaGenerally this is to restrict the traffic b/w frontend and backend. This means that every operation in Control Framework should be first buffered in the backend and synchronized with the frontend at certain points (one of this point is calling synchronization method cl_gui_cfw=>flush ). This explicit order of synchronization is due to RFC call needed for every communication b/w front/back end. So to avoid to many RFC calls we do it only at certain time.
Please refer [Automation Queue|http://help.sap.com/saphelp_wp/helpdata/en/9b/d080ba9fc111d2bd68080009b4534c/frameset.htm]. I think it explains the concept quite well.
Regards
Marcin -
Save layout Button in Object Oriented ALV
Hi gurus,
I am working on Object Oriented ALV. I am facing one problem when the outpput get shown on the screen the save layout and select layout buttons are not appearing on the application toolbar of alv.
TRY .
cl_salv_table=>factory( IMPORTING r_salv_table = g_alv_out
CHANGING t_table = i_alv ).
Set status GUI
g_alv_out->set_screen_status(
pfstatus = 'STANDARD'
report = sy-repid
set_functions = g_alv_out->C_FUNCTIONS_ALL ).
g_columns = g_alv_out->get_columns( ).
Set new description texts for columns
PERFORM f_set_column_name USING:
'LTEXT' text-001 text-001 text-001 space,
'NAME1' text-002 text-002 text-002 space,
'TXZ01' text-003 text-007 text-007 space,
'KWERT' text-004 text-004 text-004 space,
'WEMNG' text-005 text-010 text-011 space,
'BALNC' text-012 text-013 text-014 space,
'AFNAM' text-006 text-008 text-009 space.
PERFORM f_set_column_name USING 'WEMNG'
space space space 'WAERS'.
PERFORM f_set_column_name USING 'KWERT'
space space space 'WAERS'.
Set column as hotspot
g_column ?= g_columns->get_column( 'EBELN' ).
g_column->set_cell_type( g_column->hotspot ).
g_events = g_alv_out->get_event( ).
CREATE OBJECT gr_events .
SET HANDLER gr_events->on_double_click FOR g_events.
Display report
g_alv_out->display( ).
CATCH cx_salv_msg.
ENDTRY.
where in the Status STANDARD I have entered all the buttons includeing these two buttons
Can you please Help me in solving this issue.
thanks,
Vinod.
Edited by: vinod parhad on Jul 2, 2010 1:35 PMdata: gr_layout type ref to cl_salv_layout,
gr_alv type ref to cl_salv_table,
gs_key type salv_s_layout_key,
* in your SALV routine.... after FACTORY call
gs_key-report = sy-repid.
* User can save layout.
gr_layout = gr_alv->get_layout( ). "layouts
gr_layout->set_key( gs_key ). "Pass Program Name
gr_layout->set_save_restriction( cl_salv_layout=>restrict_none ). "User can save
See also Rich Heilman's excellent tutorials on SALV by searching for SALV Tutorial,
See also programs named: SALV* for demonstrations of SALV outputs and how to code.
Edited by: BreakPoint on Jul 2, 2010 1:46 PM add references for tutorials -
Error for object oriented alv running in background.
Hi all,
I have an ALV report done using object oriented functionality.
When I am trying to run that report in background , it is giving me error.
I want to know why it is happening and how it can be corrected.
Regards,
Vaibhav.Create a docky container :
c_docking_cont TYPE REF TO cl_gui_docking_container.
*For background execution
IF sy-batch EQ c_x.
CREATE OBJECT c_alv
EXPORTING
i_parent = c_docking_cont.
ENDIF.
ALV for display field details
CALL METHOD c_alv->set_table_for_first_display
EXPORTING
is_layout = t_lay
CHANGING
it_outtab = t_table[]
it_fieldcatalog = t_field_cat.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Edited by: Madhavi t on Nov 2, 2009 1:34 PM -
Object Oriented ALV - Editable
hi, Could anyone advice me please....as I'm trying to modify and save the values after displaying in ALV...but value which i'm modifying is not reflecting in ALV, it is displaying the old value....this problem is occuring only when I change the value for the first time...and prob is not occuring from second time....please correct me...
*& Form display_alv
FORM display_alv .
IF w_grid IS INITIAL.
CREATE OBJECT W_DOCK_CONTAINER
RATIO = '95'
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.
CREATE OBJECT W_GRID
I_PARENT = W_DOCK_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.
PERFORM prepare_field_catalog CHANGING w_lvc_t_fcat.
PERFORM prepare_layout CHANGING w_lvc_layo.
W_DISVARIANT-REPORT = SY-REPID.
CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_VARIANT = W_DISVARIANT
I_SAVE = 'A'
IS_LAYOUT = W_LVC_LAYO
CHANGING
IT_OUTTAB = I_YIBRK_EARNINGS[]
IT_FIELDCATALOG = W_LVC_T_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.
ELSE.
*-- refresh table
CALL METHOD W_GRID->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 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.
ENDIF.
ENDFORM. " display_alv
*& Module USER_COMMAND_9500 INPUT
MODULE USER_COMMAND_9500 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'. " BACK BUTTON
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXIT' OR 'CANCEL'. " EXIT AND CANCEL BUTTON
LEAVE PROGRAM.
WHEN 'SUBMIT'. "SUBMIT
PERFORM submit_data.
WHEN 'SAVE'. "SAVE
PERFORM save_data.
ENDCASE.
ENDMODULE. " USER_COMMAND_9500 INPUT
*& Form save_data
FORM save_data.
*-- if data changes
CALL METHOD W_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = cl_gui_alv_grid=>mc_evt_enter " modified
EXCEPTIONS
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. " save_dataHi
Send me the code within perform submit_data
You have call the grid method check_changed_data on save .Which will raise the data_changed event of cl_alv_gui_grid.
METHOD HANDLE_DATA_CHANGED.
DATA : ROW_ID TYPE I,
FIELDNAME TYPE LVC_FNAME,
DATE1 TYPE I,
DATE2 TYPE I,
DATE3 TYPE I.
DATA : LV_VALUE TYPE I,
LV_VAL(10) TYPE N,
LV_VAL1 TYPE N.
DATA : COUNTER TYPE I VALUE 1,
COUNT TYPE I,
LS_DEL_ROW TYPE LVC_S_MOCE.
data : lv_eff_dt type /CPC/TCTMBRHST-CONTMBREFFDATE.
GV_FLAG = 'X'.
CLEAR ERROR_DATA.
SORT GT_PRICE_DATA BY COUNTER.
DATA : FS LIKE TABLE OF GT_PRICE_DATA.
FIELD-SYMBOLS :
<FS1> TYPE ANY,
<FS3> TYPE ANY,
<FS2> LIKE GS_PRICE_DATA.
CREATE DATA NEW_LINE LIKE LINE OF GT_PRICE_DATA.
ASSIGN NEW_LINE->* TO <GS_PRICE_DATA>.
CLEAR VAR.
*****Check for Inserted and Modified Rows
LOOP AT ER_DATA_CHANGED->MT_MOD_CELLS INTO LS_MOD_CELLS.
ASSIGN COMPONENT LS_MOD_CELLS-FIELDNAME OF STRUCTURE
<GS_PRICE_DATA>
TO <FS1>.
See the above method
Please reward if useful. -
Working with Object Oriented ALV
Hi All..
could anyone please send me the sample code for working with OO ALV.
Like.. I have two tables VBAK and VBAP... what I'll do if working with FM approach, is that, I'll join both the tables on certain condition, put the joined data in a Final Internal Table, and then display it in ALV grid using REUSE_ALV_GRID_DISPLAY.
Now I want to do the same thing using OO ALV.
Quick Help will be appreciated very much..
Thanks..TABLES: zsflight.
G L O B A L I N T E R N A L T A B L E S
DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
G L O B A L D A T A
DATA:
g_wa_sflight LIKE sflight.
Declare reference variables to the ALV grid and the container
DATA:
go_grid TYPE REF TO cl_gui_alv_grid,
go_custom_container TYPE REF TO cl_gui_custom_container.
S T A R T - O F - S E L E C T I O N.
START-OF-SELECTION.
CALL SCREEN 100.
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
text
module STATUS_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
Create objects
IF go_custom_container IS INITIAL.
create object go_custom_container
exporting
PARENT =
container_name = 'ALV_CONTAINER' UR CUSTOM CONTROL NAME
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
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.
create object go_grid
exporting
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = go_custom_container
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_USE_VARIANT_CLASS = SPACE
I_NAME =
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.
PERFORM load_data_into_grid.
ENDIF.
endmodule. " STATUS_0100 OUTPUT
*& Form load_data_into_grid
text
--> p1 text
<-- p2 text
form load_data_into_grid.
SELECT *
FROM sflight
INTO TABLE gi_sflight.
Load data into the grid and display them
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'SFLIGHT'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = gi_sflight
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
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.
endform. " load_data_into_grid
Name of the structure would be a structure of your alv display and gi_sflight would be the internal containing the data.
Thanks,
Jayant -
Generic object-orientated ALV with
Hello everyone!
I've got to solve a little problem and hope, to finde some help here.
My goal is a global ALV-class, that can be used by programms to easily create ALV's.
I want to use a generate_output method within this class, that takes any internal table as a parameter and generates an ALV out of it. So when you got an internal table, you just have to create an instance of the global alv class and run the output method with your table as parameter to get a basic alv (later I'm planning to use sub-classes of this basic, global alv class, for more specified and program-related alv's.).
But for now, that's all I need to do.
So it should look and work like this:
DATA: lo_alv TYPE REF TO zcl_alv_report. "our global class instance
DATA: it_tab TYPE TABLE OF zzm_ehsanl. "a random internal table
SELECT * FROM zzm_ehsanl INTO TABLE it_tab. "fill it with some data
CREATE OBJECT lo_alv. "let's create an instance of the global alv class
lo_alv->generate_output( it_tab ). "This line is supposed to be all we need for the alv
Now, let's take a look at the generate_output method within the global class.
methods GENERATE_OUTPUT importing alv_table type any table.
So we can use any internal table as a parameter.
Let's get to the implementation part:
METHOD generate_output.
DATA: lx_msg TYPE REF TO cx_salv_msg.
FIELD-SYMBOLS: <fs_itab> TYPE ANY TABLE.
ASSIGN alv_table TO <fs_itab>. "assign the parameter to the field-symbol
TRY.
cl_salv_table=>factory("<=== that's the point where the dump occurs
IMPORTING r_salv_table = o_alv
CHANGING t_table = <fs_itab> ).
CATCH cx_salv_msg INTO lx_msg.
ENDTRY.
The further code shouldn't be relevant for my problem..
Edited and split up into 2 posts..Well, sadly this dumps with "CX_SY_DYN_CALL_ILLEGAL_TYPE" at the specified point. It also says, that field <fs_itab> is protected against changes.
Well, right now I'm very stuck with this problem and don't know what to do.
Maybe there is another way to solve the issue?
Or a better alternative to the cl_salv_table=>factory method?
A strange thing is, that everything worked well, when I was been using a local class instead of the global one. But there was a little difference in the local implementation. You will notice, that the field symbol is declared within the generate_output method in this implementation. Because classes can't have any field symbols in their main declaration spaces. But when I used it with a local class, I put the declaration of the field-symbol to the point, where all normal global program data is defined. So in the local implementation, the field symbol was not declared within any class-code, but globally within the report. Maybe this is a start for a possible solution to this problem.
Any help is very appreciated!
Thanks & regards in forward. -
Urgent: Object oriented ALV Refresh
Hello:
Pl let me know or share a code--- to update multiple lines selected from OO ALV GRID list in the SAP transparent table
Also
I am trying to update the data into transparent table.
Using OO ALV .
The lines are getting refreshed ...
PERFORM refresh_grid. "Refresh the grid with the new data
FORM refresh_grid.
CALL METHOD grid1->refresh_table_display.
DESCRIBE TABLE GT_OUTTAB LINES LIN1.
CALL METHOD cl_gui_cfw=>flush.
ENDFORM. " REFRESH_GRID
but based on that refresh need to edit the refreshed line..but this is not working..
it should be iterative process..
Thanks,
SanikaHello Sanika
Assuming that you have an editable ALV list (displayed on screen '0100') you should have to following coding in your report:
<b>1. At beginning of USER_COMMAND module (PAI)</b>
go_grid->check_changed_data( ). " retrieve changes from ALV grid into ABAP itab
" Of course you have to do all necessary validations prior to saving the data into any DB table
<b>2. At the beginning of STATUS_0100 module (PBO):</b>
CALL METHOD go_grid->refresh_table_display( ).
" In order to keep the current position fill the IS_STABLE parameter.
Regards
Uwe -
Object oriented ALV with zebra layout
Hello all,
couldn't find anything regarding the above mentioned topic via search function so here my question:
How can I get a zebra layout while using the method cl_salv_table=>factory and further steps. Can someone post some example coding?
Thanks!!
Jan SchneeSure, try this.
report zalvom_demo1.
data: ispfli type table of spfli.
data: gr_table type ref to cl_salv_table.
data: gr_functions type ref to cl_salv_functions.
data: gr_display type ref to cl_salv_display_settings.
start-of-selection.
select * into table ispfli from spfli.
cl_salv_table=>factory( importing r_salv_table = gr_table
changing t_table = ispfli ).
gr_functions = gr_table->get_functions( ).
gr_functions->set_all( abap_true ).
gr_display = gr_table->get_display_settings( ).
gr_display->set_striped_pattern( cl_salv_display_settings=>true ).
gr_table->display( ).
Regards,
Rich Heilman -
Can anyone give me document to devlop alv report in object oriented
hi
hi i want document how to devlope alv report in object oriented.
i need document .
thanks .HI,
Check these programs and links.
OOPS ALV standard pgms
BCALV_EDIT_01
BCALV_EDIT_02
BCALV_EDIT_03
BCALV_EDIT_04
BCALV_EDIT_05
BCALV_EDIT_06
BCALV_EDIT_07
BCALV_EDIT_08
ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
some helful links.
Go through the below links,
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
Regards
Sudheer
Maybe you are looking for
-
Time machine keeps OSX from updating to Mavericks - how do I fix?
Keep trying to update my old computer to Mavericks. It's currently at 10.6.8 and totally updated. Everytime I go to install Mavericks, when it gets to the window where you choose where to save it, I try to pick my Hard Drive but I get an error messag
-
An Easy One... Maybe
For some reason the Command Key+Tab keyboard shortcut to show open applications doesn't work anymore. Now when I attempt it, I only get the finder window icon. How do I restore the function? Restoring the defaults in the keyboard shortcuts didn't wor
-
HT204406 iTunes Match worked with 11.0.1, but not with 11.0.2
Just as the title states, Match is not working with 11.0.2. It was however working with the 11.0.1 version of iTunes. It ried turning Match off and on as the help suggested, but now Match won't turn back on at all.
-
Hi, I've run into an interesting ORA-22813 error. I ran the following SQL aginst an xmltype table. SQL> select 2 extractValue(value(a), '/GTP/TransmissionSource@ID') TransmissionSourceID, 3 extractValue(value(a), '/GTP/TransmissionSource@Name') Trans
-
Send to encore... multiple timelines from PPro CS4
Hi Firstly, apologies if I've missed an answer to this somewhere else. Here's my problem... I have a HDV 50i PAL project that I want to burn to blu-ray. The project is currently split into three separate timelines in Premiere. At the moment, I'm sele