SHOW ALV - CL_SALV_TABLE
HI
i want to use class CL_SALV_TABLE to show alv.
the problem that i want that some button in gui-status will be unactive and sometimes will be active( when i decided )
how can i control the buttons and transfer from avtive to unactive? and how i change the button to unactive
thanks
have a nice day
Hi,
Check this here you can get some help.
/people/sap.user72/blog/2005/09/14/a-new-approach-to-alv-programming
Regards
vijay
Similar Messages
-
How to make field is editable in ALV CL_SALV_TABLE only)
Hi,
How to make field is editable in ALV CL_SALV_TABLE only)
Any one has tried to make field si editable by using CL_SALV_TABLE class.
*I know how to do it in REUSEALV function module and CL_GUI_ALV class.*_
Please reply only if you riedin CL_SALV_TABLE class method.
Regards
Rajesh V
Moderator message: not supported, please read class documentation and search for previous discussions.
Edited by: Thomas Zloch on Mar 17, 2011 2:07 PMHi Chad,
Please refer the link,
Edit field in alv
Regards,
Hema.
Reward points if it is useful. -
How to show alv report in tree structure
hi all,
how to show data or create a alv report in tree structure.
thanks in advance.
HarshaHi Harsha,
Its done using FM 'RS_TREE_CONSTRUCT'
and FM for displaying the tree: 'RS_TREE_LIST_DISPLAY'
Thanks
Shrila -
SHOW ALV REPORT IN k$ (DIVID TO 1000)
i have an alv report and with dATA in tousands 100,000, 300,00 , 320,200
i want to see it in K$ LIKE 100, 300 , 320.2
HOW I CAN MAKE IT SIMPLE...I HAVE A LOT OF FIELDS, AND BCS I SEE IT IN REPORT PAINTER I KNEW IT MUST BE IN DECLARING A PARAMETER
Moderator message - Please do not use all caps when posting. It makes it hard to read and is considered yelling. And think about your question before asking. It seems pretty basic.
Edited by: Rob Burbank on Jan 13, 2010 2:11 PM -
How to refresh an ALV (CL_SALV_TABLE) after a parallel process
Hello all,
I have created a list using CL_SALV_TABLE. When you click on a line, a new mode must be opened. There, the user will fill in some data that must be retrieved and shown in the main list when the user closes the new mode. To do so Iu2019ve used u201CCALL FUNCTION func STARTING NEW TASK task CALLING meth ON END OF TASKu201D statement.
Iu2019ve tried to refresh the list within meth (called on end of task) but it doesn't work. I've also tried to get all the data again, but it prompts a short dump, set a new ok code using method cl_gui_cfw=>set_new_ok_code, even a WAIT until process is finished (not valid because I need process 1 active all the timeu2026)
SAP help says u201CThe SET USER-COMMAND u2018OKCDu2019 statement replaces the REFRESH SCREEN commandu201D
CALL FUNCTION 'function'
STARTING NEW TASK w_taskname
PERFORMING end_of_creation ON END OF TASK
EXPORTING
i_zzta = ztztl_zzta
i_manual_order = space
EXCEPTIONS
communication_failure = 1 MESSAGE w_msg
system_failure = 2 MESSAGE w_msg.
[u2026]
FORM end_of_creation USING p_taskname.
RECEIVE RESULTS FROM FUNCTION 'function'
IMPORTING
e_zzta = ztztl_zzta
EXCEPTIONS
communication_failure = 1 MESSAGE w_msg
system_failure = 2 MESSAGE w_msg.
[Modify list]
SET USER-COMMAND 'OKCD'.
[u2026]
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'OKCD'.
Perform get_data.
How can I have the same behaviour when using CL_SALV_TABLE??
Thanks in advance!Hello Matt,<br><br>
does not work means that if I write the following within method ON END OF TASK, the report is not refreshed.
<br><br>
<pre>
o_alv->refresh( ).
</pre><br><br>
I've also tried:
<br><br>
<pre>
o_alv->refresh( ).
o_alv->display( ).
data: o_alv TYPE REF TO cl_salv_table</pre><br><br>
<pre>Short dump: RPERF_ILLEGAL_STATEMENT
Error analysis
There is probably an error in the program
"SAPLSLVC_FULLSCREEN".
The program was probably called in a conversion exit
or in a field exit. These are implemented by
function modules called CONVERSION_EXIT_xxxxx_INPUT/OUTPUT or
USER_EXIT_xxxxx_INPUT.
Conversion exits are triggered during screen field transports or
WRITE statements, field exits during field transports from the
screen to the ABAP/4 program.
In this connection, the following ABAP/4 statements are not allowed:
- CALL SCREEN
- CALL DIALOG
- CALL TRANSACTION
- SUBMIT
- MESSAGE W... and MESSAGE I...
- COMMIT WORK, ROLLBACK WORK
- COMMUNICATION RECEIVE
- STOP
- REJECT
- EXIT FROM STEP-LOOP
Moreover, conversion exits for output conversion
(implemented by function modules called
CONVERSION_EXIT_xxxxx_OUTPUT) do not allow
- MESSAGE E...
to be used.
Trigger Location of Runtime Error
Program SAPLSLVC_FULLSCREEN
Include LSLVC_FULLSCREENU01
Row 187
Module type (FUNCTION)
Module Name REUSE_ALV_GRID_DISPLAY</pre><br><br>
But this short dump is expected since CALL FUNCTION - STARTING NEW TASK help says u201CIn the callback routine, you are not allowed to execute statements that interrupt the program execution or terminate a SAP LUW. Statements for list output are not executed.u201D<br><br>
Thanks Matt, I'll take a look at that forum, but I also tried a self list refresh using a timer and that prompted another short dump: LIST_TOO_MANY_LPROS -> "Error analysis: At present, the maximum permitted number of nested screen levels is restricted to 50." <br><br>
If I find a solution I'll let you know.<br><br>
<br><br>
Thank you!!
Edited by: Matt on Aug 26, 2009 1:16 PM -
Hi abapers,
I am using the minisap 4.6 version, to study. I like to see the data from a table (spfli, saplane or any other, in the "contents" button) but i cant do it.
I tried to create an alv grid with function and with O.O but they didnt display me the data. Then, I tried this code:
http://www.erpgenie.com/abap/controls/alvgrid.htm
and nothing happens again... Can someone tell me what i doing wrong? Or my old minisap is the problem...
Thanks in advance.Hi Rodrigo,
Sometimes, it can also be due to code problems. Two checks you need to do here.... First check is to find out if data is available in the internal table passed to the Method <b>SET_TABLE_FOR_FIRST_DISPLAY</b>...Second check is to verify whether the screen details in screen painter has been activated or not..To check that , double click on the screen number in the statement
CALL SCREEN 100.
You will be directed to the screen painter. Just check if the screen is activated.Sometimes, it can happen like that....If not active, activate it and execute the program again...
Hope this will help you..
Regards,
SP. -
How to show alv list in Dialogbox ??
Hi Experts;
Im writing an OOP program in abap. Code is below ;
TYPE-POOLS: SLIS, CNDP , CNTL.
DATA DIALOGBOX TYPE REF TO CL_GUI_DIALOGBOX_CONTAINER.
DATA: GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
" screen pbo .
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'GUI'.
IF DIALOGBOX IS INITIAL.
CREATE OBJECT DIALOGBOX
EXPORTING
WIDTH = 540
HEIGHT = 100
TOP = 150
LEFT = 150
REPID = REPID
DYNNR = DYNNR.
IF CONTAINER IS INITIAL.
CREATE OBJECT CONTAINER
EXPORTING
DYNNR = DYNNR
PARENT = DIALOGBOX " dont work an error CNTL
CONTAINER_NAME = 'ALV_CONTAINER'.
ENDIF.
IF GRID IS INITIAL.
CREATE OBJECT GRID
EXPORTING
I_PARENT = CONTAINER.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
then Container will become create an error. I m how to PARENT container in dialogbox ?
Thanks for answers
Regards.
İrfanCheck this sample code..
Create a screen 100, and Dont place any control on that.
Create the pf status in PBO enable BACK etc.
REPORT ztest_dialog_alv.
DATA dialogbox TYPE REF TO cl_gui_dialogbox_container.
DATA: grid TYPE REF TO cl_gui_alv_grid.
DATA: container TYPE REF TO cl_gui_container.
DATA: it_flight TYPE sflight_tab1.
SELECT * FROM sflight
INTO TABLE it_flight
UP TO 20 ROWS.
CALL SCREEN 100 .
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
* SET TITLEBAR 'xxx'.
IF dialogbox IS INITIAL.
CREATE OBJECT dialogbox
EXPORTING
width = 540
height = 100
top = 150
left = 150
repid = sy-repid
dynnr = sy-dynnr.
IF grid IS INITIAL.
CREATE OBJECT grid
EXPORTING
i_parent = dialogbox.
ENDIF.
CALL METHOD grid->set_table_for_first_display(
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = it_flight
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
IF sy-subrc ne 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
case sy-ucomm.
when 'BACK' or 'EXIT' or 'CANC'.
leave to screen 0.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
Flow Logic..
process before output.
module status_0100.
process after input.
module user_command_0100.
Check it and update. -
In CL_GUI_SPLITTER_CONTAINER ALV list is not show in called screen
Hello experts,
i come across a problem while using the class:CL_GUI_SPLITTER_CONTAINER ,
my codes is as follows:
data:declarations is as follows:
data:gr_spliter TYPE REF TO cl_gui_splitter_container,
gr_container1 TYPE REF TO cl_gui_container,
gr_container2 TYPE REF TO cl_gui_container,
gr_grid1 TYPE REF TO cl_gui_alv_grid,
gr_grid2 TYPE REF TO cl_gui_alv_grid,
step 0 Fit table contents:gt_out1 and gt_out2
step 1: CREATE OBJECT gr_spliter
EXPORTING
parent = cl_gui_container=>screen0
ows = 1
columns = 2
step 2: CALL METHOD gr_spliter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = gr_container1.
CALL METHOD gr_spliter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = gr_container2.
step 3 :call screen 100 to show ALV.
in the screen's PBO ,i show ALV using CL_GUI_ALV_GRID,the codes is:
CREATE OBJECT gr_grid1
EXPORTING
i_parent = gr_container1
CREATE OBJECT gr_grid2
EXPORTING
i_parent = gr_container2
CALL METHOD gr_grid1->set_table_for_first_display
EXPORTING
i_structure_name = Structure of table Gt_OUT1
CHANGING
it_outtab = gt_out1
CALL METHOD gr_grid2>set_table_for_first_display
EXPORTING
i_structure_name = Structure of table Gt_OUT2
CHANGING
it_outtab = gt_out2
But after activing the program ,there is no ALV show in screen 100,I debug the program and find that
all the above object have been created corredtly.
if i create a custom contol named 'CONTAINER',and at Step 1 change the parent's value to 'CONTAINER',
then i could see the ALV whick i hope in screen 100.
If i create a custom control in screen 100, the size of the alv will be different across different computer,
is it possible to use CL_GUI_CONTAINER=>screen0 as cl_gui_splitter_container's attribute parent value???
and i find that there are 10 attributes named screen0 to screen9 in class CL_GUI_CONTAINER,will you tell me the usage of
these attributes?
now i only konw that ,you could set a containers parent value to be CL_GUI_CONTAINER=>screen0,which you do't have to create
a custom control in your screen ,and the alv will be shown in full screen.and what the other attributes use (screen1,screen2,screen3,screen4 and so on)
now i am confused with the problem,i am sure any words from you will give me help to this question!
Hope to receive your advice!
Best regards!
yours Carl
Edited by: lakeandmoon on Aug 27, 2010 11:24 AMDear Carl,
I mean go to screen painter and place there CUSTOM_AREA (the icon with C letter). In program's PBO create CUSTOM_CONTAINER
module pbo output.
if custom_container is initial.
CREATE OBJECT custom_container
EXPORTING container_name = 'CUSTOM_AREA'.\
endif.
endmodule.
Then you work only with CUSTOM_CONTAINER (i.e. as parent to SPLITTER_CONTAINER). Using subscreens here doens't really add the value, so you don't need any.
But how could i stretch the screen and this area to full screen?is it just gragging the screen to full screen and drag the subscreen or the custom control to full screen in screen painter?
Yes, this is what I mean
Regards
Marcin -
ME57 transaction with possibility to show in ALV layout
Hi experts,
I need change the alv grid in the transaction ME57. To this, I copied the program RM06BZ00 (scree, includes... )
When I try execute the program with ALV layout the message ''Scope of list ALV not defined (please correct)" shows.
To resolve this problem I change the parameter im_service in the ME_REP_GET_TABLE_MANAGER function (Way to function: program ZSAPFM06B / include ZFM06BF04 / Include ZFM06BF04_PRUEFEN_LSTUB)
When I change this parameter on Debug (manual change) the ALV shows correctly, but when I change in program code the message remains.
How the way to copy the Me57 transaction with possibility to show in ALV layout?
Follows the code change:
CALL FUNCTION 'ME_REP_GET_TABLE_MANAGER'
EXPORTING
im_service = 'RM06BZ00'
im_scope = l_scope
IMPORTING
ex_manager = gf_factory.
Thank you!
Edited by: Andréa Molina on Aug 4, 2011 5:12 PM
Edited by: Rob Burbank on Aug 5, 2011 9:22 AMI solved my own problem...
The change in im_service was right.
The problem is that:
The gf_factory back empty in some places and in standrad transaction back with values. The memory clean the gf_factory result.
So... the only way to show ALV is fill the gf_factory in anywhere the gf_factory is check.
The places are:
1. sapfm06b - fm06bf04 - fm06bf04_pruefen_lstub
Call in RM06BZ00 - perform pruefen_lstub(sapfm06b) using p_lstub.
2. sapfm06b - fm06bfsl - fm06bfsl_ban_aufbauen
Call in RM06BZ00 - ban_aufbauen(sapfm06b).
3. sapfm06b - fm06bf01- fm06bf01_submit
Call in RM06BZ00 - perform perform submit(zgb_sapfm06b) using sucomm.
If the gf_factory is filled in this places... The ALV will show! -
hi
i use class CL_SALV_TABLE to show alv, when i transfer it to excel to answer look in this format:
USD
01.01.2001
28.52
USD
01.01.2001
25.34
i want that the fromat look like:
USD 01.01.2001 28.52
USD 01.01.2001 25.34
how can i do it?
thanks
have a nice dayHi,
This is the sample report for downloading the output into EXCEL or WORD. After
executing this report u can find the ICON for downloading the output into EXCEL
or WORD format.
REPORT YMS_ALVEXCELWORDGRAPH message-id z0.
type-pools slis.
tables: t000.
data: itab_output like t000 occurs 0 with header line.
Data: alv_grid_variant type disvariant,
alv_grid_variant_save value 'U',
layout type slis_layout_alv,
fieldcat TYPE SLIS_T_FIELDCAT_ALV.
data: begin of fieldcat_rec.
include type slis_fieldcat_main.
include type slis_fieldcat_alv_spec.
data: end of fieldcat_rec.
*MAIN
start-of-selection.
PERFORM EXTRACT_DATA.
PERFORM OUTPUT-LIST.
*& Form EXTRACT_DATA
FORM EXTRACT_DATA.
refresh itab_output.
select * from t000 into table itab_output.
ENDFORM. " EXTRACT_DATA
*& Form OUTPUT-LIST
FORM OUTPUT-LIST.
*Build field catalog
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'T000'
CHANGING
CT_FIELDCAT = fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = layout
it_fieldcat = fieldcat
I_SAVE = alv_grid_variant_save
IS_VARIANT = alv_grid_variant
TABLES
T_OUTTAB = ITAB_OUTPUT
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. " OUTPUT-LIST
Thanks,
Sankar M -
hi
i use CL_SALV_TABLE the show alv.
when i want to spreadssheet to excel the order of the field is diffrent from the alv and the text(the names of the field) is diffrent too.
maybe you know how to fix it
thanksHi,
When you display data in Excel from ALV, what SAP does is that put all the CHAR fields in the front and the NUMBER fields at the END.
Regards,
Ravi
Note : Please mark the helpful answers -
hi
i use CL_SALV_TABLE to show alv.
how i insert color to some texts in top of page.
thanks
have a nice dayHi,
only the last answer shows into the right direction.
Creating your object, there is parameter I_S_LAYOUT. You must pass a structured field of type LVC_S_LAYO. This must be used to store the name of the table field storing color information:
<pre>
like this...
data:
LS_LAYOUT type VC_S_LAYO.
LS_LAYOUT-CTAB_FNAME = 'COLORS'.
pass this parameter when creating the CL_SALV_TABLE object.
In your internal table, you need a field named COLORS of type LVC_T_SCOL. This should <b>not</b> be part of the field catalog.
The coloring of specific cells is done like
loop at itab.
PERFORM alv_color
USING lv_fnam col_positive 1 0
CHANGING itab-colors.
modify itab.
endloop." at itab.
where lv_fnam is the name of the field where you set the color. If the name is space, ALV will color the whole line, then comes the color (use TYPE-POOLS col), then intensify and inverse (0 or 1) attributes.
You can still make the above loop better using loop .. assigning ...
The form looks like this:
*& Form alv_color
set field color
FORM alv_color USING pv_fieldname TYPE fieldname
pv_color TYPE c
pv_intensify TYPE i
pv_inverse TYPE i
CHANGING pt_colors TYPE LVC_T_SCOL.
DATA:
ls_colors TYPE LINE OF LVC_T_SCOL.
READ TABLE pt_colors TRANSPORTING NO FIELDS WITH KEY
fieldname = pv_fieldname
color-col = pv_color
color-int = pv_intensify
color-inv = pv_inverse
BINARY SEARCH.
CHECK sy-subrc <> 0.
ls_colors-fieldname = pv_fieldname.
ls_colors-color-col = pv_color.
ls_colors-color-int = pv_intensify.
ls_colors-color-inv = pv_inverse.
INSERT ls_colors INTO pt_colors INDEX sy-tabix.
ENDFORM. "alv_color
</pre>
By the way: This is first time I see someone uses CL_SALV_TABLE - Usually CL_GUI_ALV_GRID (similar but I think more powerful) is used. Is ther any advantage?
Hope it really helps.
Regards,
Clemens -
ALV OM - keep filter while deleting lines from ALV
Dear all,
I'm using an ALV (cl_salv_table) to get a proposallist of materials and substances to be linked. When a material is linked to a substance, all lines for this material are deleted from the ALV. So far, so good.
When a user sets a filter on a certain column and links a material, the filter icon on top of the column is shown while the records are not filtered accordingly. When the user selects the column again en pushes the filter button, the value that was set in the first place, is shown.
edit : I've "solved" this problem myself by getting a list of all filters, clearing lr_filters and filling lr_filters up again from this list.I don't think this is a very clean sollution to the problem, but it works.
How can I resolve this problem in a better way? Thanks in advance.
Cheers.
Luk
Edited by: Luk Declerck on Dec 16, 2009 4:28 PMU can do all validations in the event data_changed_finished.
****----EVENT HANDLING.....*****
*------Class definition
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION.
METHODS handle_data_changed_finished FOR EVENT data_changed_finished
OF cl_gui_alv_grid IMPORTING e_modified ET_GOOD_CELLS.
ENDCLASS. "lcl_event_handler DEFINITION
*-----Class implementation
CLASS lcl_event_handler IMPLEMENTATION.
"handle_usercom
**----DATA changed
METHOD handle_data_changed_finished.
PERFORM handle_data_changed_finished USING e_modified
et_good_cells
ENDMETHOD.
ENDCLASS. "lcl_event_handler IMPLEMENTATION
FORM handle_data_changed_finished using i_modified type char01
i_good_cells type LVC_t_MODI.
data: wa_good_cells type lvc_s_modi.
// Perform ur validation here
endform. -
Facing probelm in PF status in ALV Grid display
HI,
i have created a ALV grid intractive report in that i have a check box and Traffice lights , when user select the check box and press save then then traffice light color should changes to green it's doing well..but my problem is..for second time display i am calling same function module to display with chnaged traffice light color.here my probelm is after second time display when i press back it's taking me to first list not to the selection-screen. pls suggest me wot to do now for directly going to selection-screen.
Thanks,
saleem.
points to awarded for all usefull answers.Hi again,
1.
<b> and press save then</b> then traffice light color should changes to green it's doing well..but
U must have written some code
when the BOLD occurs.
2. This must be the call back command
(FORM subrouritine, which the alv call backs,
on a user command)
3. In the same u have to write.
4. For your reference,
just copy paste this code.
a) it will show records from t001 table
b) if u double-click on any row,
it will change the 2nd column to 'CLICKED'
and refresh the data again.
(it won't show alv once more in new screen)
c) then when u do back, it will go back.
d) See BOLD code.
5.
REPORT abc.
TYPE-POOLS : slis.
Data
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : flag tyPE c,
END OF itab.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
Select Data
SELECT * FROM t001 INTO TABLE itab.
*------- Field Catalogue
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Display
alvly-box_fieldname = 'FLAG'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid "<-------Important
i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
is_layout = alvly
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
CALL BACK FORM
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
IMPORTANT.
<b>
data : m type sy-index.
m = whatrow-tabindex.
itab-butxt = 'CLICKED'.
modify itab index m.
whatrow-refresh = 'X'.</b>
ENDFORM. "ITAB_user_command
regards,
amit m. -
Upload an excel file input into an itab,display in ALV using ABAP objects
Requirement:
Create a selection screen which takes an excel file as input with parameters emp id, emp name, salary, mnth, ph no.
Create a database table with the same fields.
The program needs to have two modes. Display mode and update mode.
Display mode only displays the file data in alv grid and update mode updates database table with similar parameters as above and also shows alv grid output.
task is to do using Object oriented approach. This should also have the facility to modify the cell values in ALV grid and once saved then it needs to update the database accordingly.
I have done the same functionality in a report program without using ABAP objects but finding difficulty in using object oriented approach.Please help me as i am new to abap-objects.
Thanks in advance.......Hi,
The selection screen design and all remains the same.
Get all the detials which you need in your final internal table.
This internal table will be used to display in the ALV grid.
The approach remains the same as the normal programing.
Prepare a field catalog table and then use it along with the internal table to display in the grid.
The only change is that instead of FM you will have to make us of classes and their methods.
Firstly you will have to create a screen.
On this screen create a custom control object and give it some name. say for eg. CC_CONTAINER.
This will be a container on which the ALV grid object will be placed.
2 objects are needed to display the grid
CL_GUI_CUSTOM_CONTAINER and CL_GUI_ALV_GRID.
In the PBO of the screen first create an instance of object CL_GUI_CUSTOM_CONTAINER
CREATE OBJECT y_lobj_cont
EXPORTING
container_name = 'CC_CONTAINER'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE y_k_s NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Then create a instance of the GRID
IF y_lobj_grid IS INITIAL.
CREATE OBJECT y_lobj_grid
EXPORTING
i_parent = y_lobj_cont
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5 .
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE y_k_s NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
Then call the method SET_TABLE_FOR_FIRST_DISPLAY to display the grid.
CALL METHOD y_lobj_grid->set_table_for_first_display
EXPORTING
it_toolbar_excluding = y_v_lt_exclude
CHANGING
it_outtab = y_li_tbl
it_fieldcatalog = y_li_fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE y_k_s NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Check the example program BCALV_GRID_EDIT for better understanding.
Regards,
Ankur Parab
Maybe you are looking for
-
How to validate a whole column of DataGrid
I want to validate a whole column of DataGrid using Validator. How to do that?
-
Preview Crash on Large .pdf Files
I am trying to view a 500k pdf in Preview. Every time I try, Preview crashes. It does the same thing whether I try to download and read it in Safari or Firefox from the original website or try to open the downloaded file and read it from the desktop.
-
I am new to Labview and was wondering if it is possib
le to control Labview via an external script? I am trying to automate my testing and want to use a script to send commands that will call my equipment.vi models and have it configure the equipment via GPIB to the test instruments. Thanks in advance -
-
Lets say I have a picture of a person and I want to extract him from the background; I have tried using the various tools (magic wand, magic selector, etc) and I am getting better. But, there is always a lot of fine tuning I have to do to get a sharp
-
Oracle forms builder - windows or unix?
Until recently we've been developing on Forms Builder 6i on our Sun/Solaris box. Now however, we want to move to developing using Forms 10g. We've already recompiled all our forms on the unix box, which has Application Server 10g and an 11g database.