Query in alv using oops
Hello ......
i have developed z table, initially there are no entries in it.
i create a z program and create a alv display using method SET_TABLE_FOR_FIRST_DISPLAY
then i have used method set_ready_for_input .
i will now execute the z program..
i will have a std toolbar on screen, there will be three icons insert, delete and append (std tool bar)
as i have told earlier that there are no entries, so when i will press insert button it will be show empty one row in that table, it will be in edit mode due to method set_ready_for_input ..
now my query is suppose there are 3 col and i vl enter value in 3 columns shown in table after pressign insert button, how to get those values in internal table so that later on i can update a z table .
Edited by: medha24 on Apr 15, 2011 11:59 AM
thanks friends, let me more clear with u all,
when i will execute the program, i can only see headings of alv display rather table........
to create entries , i m pressing insert button, which comes as in-built as alv std toolbar.....
now when i press insert, it will show me one empty row, i vl enter some values in it.....
how i will get those entries in my internal table......
which method,, wht event........?
Similar Messages
-
Detect rows selection in ALV using oops
Hi ALL,
I HAVE An ALV OUTPUT OF RECORDS USING OOPS.
NOW I CAN SELECT ONE OR MULTIPLE ROWS OF THE OUTPUT AND I HAVE ADDED A DELETE ICON TO MY TOOL BAR.
I HAVE BACK AND EXIT BUTTON AND I HAVE CODE FOR THE SAME IN PAI.
FOR DELETE ICON SY-UCOMM IS DELE AND CONTROL COMES TO PAI
MY QUESTION IS HOW DO YOU KNOW WHICH ROW OR ROWS ARE SELETEd , IN NORMAL ABAP , a field BOX type c has a value X , but what about in ALV using OOPS.
I have no idea whether my approach is correct or wrong or do i need to something else.
ThanksHi Darren,
This is what i have . Iam new oops so i want to just make sure
method handle_user_command.
§ 3.In event handler method for event USER_COMMAND: Query your
function codes defined in step 2 and react accordingly.
data: lt_rows type lvc_t_row.
case e_ucomm.
when 'DELETE'.
call method g_grid->get_selected_rows
importing et_index_rows = lt_rows.
DATA : WA_LT_ROWS LIKE LINE OF LT_ROWS.
LOOP AT LT_ROWS INTO WA_LT_ROWS.
DELETE I_ZFINAL INDEX WA_LT_ROWS-INDEX.
ENDLOOP.
ENDCASE.
call method g_grid->set_table_for_first_display
exporting
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
is_layout = g_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
it_toolbar_excluding = pt_exclude
IT_HYPERLINK =
IT_ALV_GRAPHICS =
changing
it_outtab = i_zFINAL
it_fieldcatalog = fieldcat
IT_SORT =
IT_FILTER =
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
LET ME KNOW THANKS -
How to get Subtotal text in ALV using OOPS
hi,
Can any one pls help me out getting <b>subtotals text</b> in ALV using OOPS concepts....Pls provide me if any of u have sample code for that......
my code:
data:gr_grid_d0100 type ref to cl_gui_alv_grid.
data : gr_events_d0100 type ref to lcl_events_d0100.
classes**********
class lcl_events_d0100 definition.
public section.
methods:
subtotal_text for event subtotal_text
of cl_gui_alv_grid
importing es_subtottxt_info
ep_subtot_line
e_event_data.
endclass.
class lcl_events_d0100 implementation.
method subtotal_text.
perform d0100_event_subtotal_text using es_subtottxt_info
ep_subtot_line
e_event_data.
endmethod. "subtotal_text
endclass.
data : gr_event_handler type ref to lcl_events_d0100.
SET HANDLER gr_event_handler->subtotal_text FOR wcl_alv_grid_request
FORM d0100_event_subtotal_text USING
es_subtottxt_info TYPE LVC_S_STXT
ep_subtot_line TYPE REF TO data
e_event_data TYPE REF TO cl_alv_event_data.
DATA: l_text TYPE string.
l_text = es_subtottxt_info.
FIELD-SYMBOLS: <fs> TYPE ANY.
ASSIGN e_event_data->m_data->* TO <fs>.
<fs> = text-007.hi vijay
check this code
if you want to use field symbols.
data: total type ref to data,
subtotal1 type ref to data.
field-symbols <total> like gt_sflight.
field-symbols <subtotal1> like gt_sflight.
call method grid1->get_subtotals
importing
ep_collect00 = total
ep_collect01 = subtotal1.
assign total->* to <total>.
assign subtotal1->* to <subtotal1>.
or u can use
U have to do the subtotal column wise.In the field catalog specify the following in addition to the corresponding field name(i.e. Column)
DATA ls_fcat TYPE lvc_s_fcat.
ls_fcat-do_sum = 'X'.
Hope this helps u out.
Thanks & Regards,
naveen -
Hello ,
Can anyone let me know how to trigger the END-of-page event in ALV using OOPs.
Thanks in advance.
Regards
JaiHello Pratuysh,
Thanks for the answer
I know that report,but that doesn't help me.
Any other way
Thanks
Jai -
I need to display Table header in ALV using Oops.
I need to data from 8 fields which I get in the run time of the program.
I am new to Oops ALV, I have done a similar thing in normal ALV but not in oops.
Detailed info required, Custom container settings as well.
Thanks in Advancesee this weblog TOP_OF_PAGE in ALV Using CL_GUI_ALV_GRID
-
hi
i would like to have coding for total and subtotal in alv using oops concept and (not using function module).
also i would like to have coding for cell color and heading and footer.
thanx in adv
rockyHi Rocky,
please check this link
http://www.****************/Tutorials/ALV/Total/text.htm
While modifying field catalog , try the following.
Field-symbols: <lfs_fieldcat> TYPE lvc_s_fcat.
LOOP AT i_fieldcat ASSIGNING <lfs_fieldcat>.
CASE <lfs_fieldcat>-fieldname.
WHEN 'LOSGR'.
<lfs_fieldcat>-coltext = text-007.
<lfs_fieldcat>-do_sum = c_x.
ENDCASE.
ENDLOOP.
Or if you want to use field symbols.
data: total type ref to data,
subtotal1 type ref to data.
field-symbols <total> like gt_sflight.
field-symbols <subtotal1> like gt_sflight.
call method grid1->get_subtotals
importing
ep_collect00 = total
ep_collect01 = subtotal1.
assign total->* to <total>.
assign subtotal1->* to <subtotal1>.
Best regards,
raam -
Regarding ALV using OOPS Concept
Hi Experts,
Can abody explain to me how can i disable some settings in the tool bar of ALV Grid using oops concept??Hi Alex,
You can perform this step, before you call set_table_for_first_display and pass that to this call.
**Exculude all unnecessary standard function in ALV
PERFORM exclude_tb_functions CHANGING lt_exclude.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
is_variant = l_variant
i_save = 'A'
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = gt_fieldcat
it_sort = gt_sort[]
it_outtab = it_final[].
You can exclude all unwanted function in the subroutine.
FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
DATA ls_exclude TYPE ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
APPEND ls_exclude TO pt_exclude.
ENDFORM. " exclude_tb_functions
This will give you complete the solution for your query.
Thanks
Lakshmi -
Hi,
I want create an ALV report in which when i will double click on record will drill down the report.
I know interactive ALV report using function module. but now i want to create it using OOPs concept. Please guidme
thanks and regrds
abhishekmethods: double_click for event double_click of cl_gui_alv_grid
importing e_row e_column es_row_no
method double_click.
message s400(00) with 'documents' e_row. "#EC *
data : wa_display like line of lt_display.
if e_column = 'BELNR'.
read table lt_display index e_row into wa_display.
if sy-subrc = 0.
set parameter id 'BLN' field wa_display-belnr.
set parameter id 'BUK' field wa_display-bukrs.
set parameter id 'GJR' field wa_display-gjahr.
call transaction 'FB03' and skip first screen.
endif.
endif.
endmethod.
see this may help u.
Regards -
Hi Friends,
I have created a Hierarchial ALV report using OOP concept (Class Builder). The output is OK but it is displaying the unwanted columns in the header part.
The code written is as follows.
=====================================================
data: gt_zsd_abcd type zsd_abcd occurs 0, "Output-Table
data l_hierarchy_header type treev_hhdr.
perform build_hierarchy_header changing l_hierarchy_header.
call method g_alv_tree->set_table_for_first_display
exporting
i_structure_name = 'zsd_abcd'
is_hierarchy_header = l_hierarchy_header
changing
it_outtab = gt_zsd_abcd. "table must be empty !
perform create_hierarchy.
call method g_alv_tree->frontend_update.
=====================================================
I would like know as to how to display only the required columns in the header part.
Pls guide me.
TIA.
Regards,
Mark KHi Mark,
i got it, in your case you will get all the fields present in the structure you mentioned in the method.
so if you want only Purchase Order then you need to Build the fieldcat only for that field and then pass that fieldcat to the method. and don't pass the structure in this case.
call method alv_tree_control->set_table_for_first_display
exporting
is_variant = l_variant
i_save = 'A'
i_default = 'X'
is_hierarchy_header = l_hierarchy_header
it_special_groups = l_special_groups
it_toolbar_excluding = l_toolbar_excluding
changing
<b>it_fieldcatalog = l_field_catalog</b>
it_outtab = l_output_tbl.
Regards
vijay -
How can we set GUI STATUS in a alv program using oops...Is there any method we need to use for this ????
Hi,
Just call screen from your program as below .
call screen 9001.
In the PBO of the screen,write the following code
MODULE status_9001 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'ZTITLE'.
ENDMODULE. " STATUS_9001 OUTPUT -
Position of cursor in ALV using oops
Hi all,
i am using OOPS ALV (CL_GUI_ALV_GRID) to display data.
i have some editable fields in ALV.
While i enter value in some field and press 'ENTER' my cursor goes to the FIRST field of the alv.
i want it to keep cursor in same field.
please tell me how to do
thanksHi,
I guess you are using the method REFRESH_TABLE_DISPLAY of the alv grid. If so, pass the parameters IS_STABLE. It is a structure of type LVC_S_STBL. Pass 'X' to LS_STABLE-ROW &
LS_STABLE-COL = 'X'.
Example :
data LS_STABLE type LVC_S_STBL.
LS_STABLE-ROW = 'X'.
LS_STABLE-COL = 'X'.
call method G_GRID->REFRESH_TABLE_DISPLAY
exporting
IS_STABLE = LS_STABLE
exceptions
FINISHED = 1
others = 2.
Use the above code and it will solve the problem.
regards,
Advait -
Hi All,
How do we create a hotspot using OOPs concept in ALV? Also tell me how to call a transaction code after doing a Hotspot click on a field.try factory methods like this:
form display .
Sort output table
sort it_out by vbeln_vl vbeln_vf fkart.
try.
Using Factory classes for output display
call method cl_salv_table=>factory
importing
r_salv_table = o_table
changing
t_table = it_out.
o_functions = o_table->get_functions( ).
o_functions->set_all( abap_true ).
To sort the table by Delivery, billing document.
o_sorts = o_table->get_sorts( ).
o_sorts->add_sort( columnname = 'VBELN_VL' subtotal = abap_true ).
o_sorts = o_table->get_sorts( ).
o_sorts->add_sort( columnname = 'VBELN_VF' subtotal = abap_true ).
To goto transaction*
o_cevents = o_table->get_event( ).
create object o_levents.
set handler o_levents->on_double_click for o_cevents.
Catch exceptions
catch cx_salv_msg into o_salv_msg.
message e184 with o_salv_msg->msgv1
o_salv_msg->msgv2
o_salv_msg->msgv3
o_salv_msg->msgv4.
catch cx_salv_not_found into o_salv_not_found.
message e184 with o_salv_not_found->object
o_salv_not_found->textid
o_salv_not_found->key
o_salv_not_found->method.
catch cx_salv_data_error into o_salv_data_error .
message e184 with o_salv_data_error->object
o_salv_data_error->textid
o_salv_data_error->key
o_salv_data_error->method.
catch cx_salv_existing into o_salv_existing .
message e184 with o_salv_existing->object
o_salv_existing->textid
o_salv_existing->key
o_salv_existing->method.
endtry.
Display
o_table->display( ).
endform. " display
*& Form disp_line_item
To display the delivery data using transaction VL03n*
on double click on any row.*
form disp_line_item using fp_row type salv_de_row
fp_column type salv_de_column.
Read the output table*
read table it_out into wa_out index fp_row.
if sy-subrc eq 0 .
set parameter id 'VL' field wa_out-vbeln_vl.
call transaction 'VL03N' and skip first screen. " Call transaction vl03n
endif.
endform. " disp_line_item
Edited by: kartik tarla on Dec 15, 2008 7:35 PM -
I NEVER USED OOPS CONCEPT.BUT I GOT A TASK ON ALV REPORT USING class CL_GUI_ALV_GRID, call method SET_TABLE_FOR_FIRST_DISPLAY for ALV . I HAD PASSED THE VALUES FROM INTERNAL TABLE AND GOT OUTPUT IN ALV.
The problem is When i save an layout(default setting button ).
iam unable to get the output for all fields.
if u want i will send screenshots to ur mail
THANKS IN ADVANCE.ok fine,
In the output (alv grid) there is an icon for layout settings.
if i want to save layout (as DEFAULT SETTING) i am missing some fields in output
EX:
mat no | batch | proces order | time | date |
when i save layout (as DEFAULT SETTING) i am missing some fields in output
mat no | batch |
the rest of the field were not displayed.
if u are not clear just ask me. i will send some more examples. -
Obtaining subtotals based on 2 fields.(ALV using oops concept)
Need help on how to apply sort on 2 fields and obtain subtotals.For example if I have some records for similar tax code and some more records for a similar tax jurisdiction (under which all tax codes come).I need to calculate subtotals for same tax code as well as same tax jurisdiction code.Currently I am able to generate subtotals by sorting on 1 field only ,using OOPs concept.How do I apply for both the fields? This is what is being done currently with regard to sorting and subtotaling :
METHOD set_sorts.
lr_sorts = gr_alv_data->get_sorts( ).
TRY.
lr_sorts->add_sort( 'TXJCD' ). ---sorting based on tax jurisdiction
CATCH: cx_salv_not_found,
cx_salv_existing,
cx_salv_data_error.
ENDTRY.
TRY.
lr_sorts->add_sort( columnname = 'MSKWZ'
subtotal = if_salv_c_bool_sap=>true ).
CATCH cx_salv_data_error cx_salv_not_found
cx_salv_existing.
ENDTRY.
ENDMETHOD. "set_sorts
Thanks & Regards,
SavithaHi Savitha,
Use the other paramenters like POSITION, SEQUENCE, SUBTOTAL for both fields like as follows. Then it will work fine.
TRY.
lr_sorts->add_sort( columnname = 'TXJCD'
sequence = 1
Position = 1
subtotal = if_salv_c_bool_sap=>true ).
CATCH cx_salv_data_error cx_salv_not_found
cx_salv_existing.
ENDTRY.
TRY.
lr_sorts->add_sort( columnname = 'MSKWZ'
sequence = 2
Position = 1
subtotal = if_salv_c_bool_sap=>true ).
CATCH cx_salv_data_error cx_salv_not_found
cx_salv_existing.
ENDTRY. -
Hi to all,
I am new to ABAP and i would like to know ,how ALV is implemented in OOP.
Could any one pls pass relevant material and examples on it
Thanks in Advance.Hi,
Check these links.
Check this for basic concepts of OOPS
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
Tabstrip
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/022ba607-0301-0010-e382-fdedca553f5f
Editable ALV
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ec31e990-0201-0010-f4b6-c02d876ce033
Tree
http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
General Tutorial for OOPS
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
standard pgms
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
Maybe you are looking for
-
How to prevent users from saving and emailing intranet documents externally
Someone in our company needs to upload a pdf to our sharepoint intranet site for internal-only use. How can I prevent users from downloading it and emailing it externally? I mean, a user could screenshot it I guess, but I need to give management a du
-
Anyone know the name of the small coax used for antennas on most WRT series routers?
I am looking for more information on the coax cable used on most WRT series routers. It has a clear jacket, approximately 1/8" thick. Only way to see is by opening your router, or looking inside the rubber part of antenna. I would appreciate any ex
-
Hi all, wondering if anyone can shed a little light on this. I received 3 sms to my land line today from 51472 saying "your iCloud Keychain verification code is" each message had a different code and all the messages occurred in about 15 mins. I am v
-
Error while starting ManagedServer from admin console.
HI, can any one please help me on the below error. i got the below error when i tried to start managedserver from admin console. and below are the steps i have done before start the manages server. 1. started admin server. 2. started nodemanager from
-
Chrashing after trying to open clip
Everything worked well in the first place, but after using more clips the FC begings to be unstable and chrashed. I´m using the very latest Mac Book Pro with 4GB RAM and a 256GBSSD + an extern 0,5GB Lacie Fire-wire 800. The same happend on my Mac Pro