Table updation using alv
Dear Expert,
While updating the jest table against the Order number, the data in the table is not getting affected. When i refresh the list t again shows the order number. Can anyone please provide me sample ALV program where it displays the list of Orders.
when one selects the order the order should get approved.
if i get sample program then i would be helpful.
Regards,
Shakti.
hi Sapbond007,
You have to create an ALV event handler class to write back the data that has been changed in your ALV.
Please refer to example programs BCALV_EDIT_* (I think BCALV_EDIT_04 should be the correct one)...
or you should refer This code
Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>.
REFRESH <dyn_tab_temp>.
Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table.
Regards
Saurabh Goel
Similar Messages
-
LIKP table updation using the IDOC_INPUT_DESADV1
Hi,
Please help me when and where the LIKP table is updating using the FM IDOC_INPUT_DESADV1. I debugged the program several times even though i couldnt able to find the updation part.
Further to the above wherer exactly the idoc number is generrating in this FM.
This is very urgent.Kindly give the replies at the earliest.Ubay
Refer to this code in IDOC function module DOC_INPUT_DESADV1. Delivery order must be getting created thorugh this function module.
CALL FUNCTION 'GN_DELIVERY_CREATE'
EXPORTING
VBSK_I = S_VBSK
NO_COMMIT = TRUE
IF_SYNCHRON = ' ' "INS_HP_338221
IF_NO_DEQUE = 'X' "n_632020
IMPORTING
VBSK_E = S_VBSK
TABLES
XKOMDLGN = T_DLGN
XVBFS = T_VBFS
XVBLS = T_VBLS
XVERKO = T_VSEK
XVERPO = T_VSEP
IT_GN_HUSERNR = T_HUSN
IT_GN_SERNR = T_SERN
EXCEPTIONS
ERROR_MESSAGE = 1
OTHERS = 2.
Thanks
Amol G. Lohade -
Implement a table menu using ALV
Hi,
I was wondering if its possible to implement a standard sap table menu bar into WDA using ALV?
is there a doc that explains that?
I'm looking for something similar to this
[screenshot|http://www.mypicx.com/02202009/menubar/]
Thanks in advance.what sort of program do use data structure? let's say
i want to use binary search on data , how can i?As nasch said: pretty much any program uses data structures.
Okay, let's say you want to try binary search. You could do that on an array, on a singly linked list, on a doubly linked list, probably on others that I can't think of right now.
If you just want practice using the data structures you've learned, then why not write a binary search over several different ones? That will give you a feel for how they differ in usage and performance.
Or, you can just pick any kind of program that interests you. Unless it's trivially small and simple, there will probably be a use for one or more of the data strux you've learned.
A chat program needs data structures to hold curently connected users, ongoing conversations, maybe a queue for messages waiting to be sent.
A card game needs to be able to search to see if a given card is in a given hand. Needs to hold all the cards in a deck that has to be shuffled. Dealing is like popping off a stack.
A database of students and their courses might want to keep something in an ordered tree--by last name for instance.
What applications interest you? -
Table Update using Nolog/Hint
Hi all
Although we can insert records using /nolog so that they are not added into archive logs.
We required using this for table update for some large routene updates which in any way does not effect the integrity of the database.
This table updation facility using /nolog was not available in earlier versions.
Alternate solution for temporarily turning the database into Noarchivelog ->Fire update statement ->Turn database into archivelog mode is not acceptable as the database is production database where certain users are always on with their routene small entry/updation jobs.
I want to know whether this has been enhanced in Oracle 10g or is there any work around by way of giving some hints at the update statement. As large table updation generating too much archive logs are not really desired in certain cases.
Suresh BansalMr. Sayed
Thanks for reply. Insert idea is given just for the available workaround when required and to link this to the subject of discussion. Idea is when Oracle has provided some workaround for Inserting records without loging , why they have not provide so for update.
Pl. advise some workaround for the large update problem.
In Oracle 10g, the default is 'database force logging'. Hence, even nologging transaction, oracle will force to create logging.I would request you to elaborate this. We installed Oracle 10g at one site and the database runs in Noarchive log which is default installation in Windows 2003 server. I could not understand what you mean by default 'database force logging'
Suresh Bansal -
Hi All,
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
I am working on Loading a file using SQL Loader.
I have loaded all the records (20Million) in to a table which has 30 columns.
Issue : Now i got a new layout for same Data file, Which already has 5 new columns at the end which we didn't loaded.
I have created the CTL file with New columns but can i update only those 5 new columns into the table. Is that Possible?
Or should i truncate and do it from the scratch....Please suggest me...
ThanksSQL*Loader does not update; It only inserts. You could load the data into a staging table, then use SQL to update, but that would be slower than just starting over. So, you should just reload the whole file, including the new columns, using the REPLACE in the SQL*Loader control file, instead of APPEND. That will overwrite any existing data.
-
Table updation using reports.
Hello friends,
I have written a code to convert internal table into XML and i have provided an option to Download it.
1. Once they download , the invoice no and date should store in a newly created table.
2. If they try to download it again it should show an error like "This has been Downloaded".
How to update by using reports.
Please someone help me on this.
Regards,
Vijay VikramHi Naidu,
Hope you have created a database table ('Z') to maintain the downloaded invoice number and date.
If then you can update the invoice number and date to that table when download was successful, if sy-subrc equals 0. If again user prompts to download the invoice number should be same. So you can write a select query to find whether the same invoice exists or not. if it finds the you can show the error message.
select inv_no from zdown where inv_no = lv_inv_no.
if sy-subrc <> 0.
call function 'GUI_DOWNLOAD'
if sy-subrc <>0.
message e...
else.
update table zdown ...
else.
message e...
endif. -
Table updation using function exit in CC01
In CC01 transaction , Using screen exit i have provided a field for input in the screen . the fields added are in the table AENR .
But when I Save the transaction, the customised fields are cleared.
How do I get these fields to be updated in the table ?
How to use the function exit(provided with the screen exit) in order to update the fields in the table .
Thanks,
AmitInfact you have to create it:
- Trx SE11 show table AENR
- Go to the end of the structure of AENR you should see the structure CI_AENR, do a doubleclick and create it;
- After creating it, insert your new fields
In enhancement:
- Create the screen 100 using structure AENR
- You have to implement 2 user-exit:
1) To import the data from std to screen-exit
EXIT_SAPMC29C_001
Here insert the code:
MOVE USERDATA TO AENR
2) To export the data from screen-exit to std program:
EXIT_SAPMC29C_002
Here insert the code:
MOVE AENR TO USERDATA.
Max -
Hi ,
IDOC_CREATE_ON_DATABASE which DB table is going to update by using this FM for ARTMAS.
Thanks,
jo
Moderator message: please do some research before asking.
Edited by: Thomas Zloch on Mar 15, 2011 11:55 AMHi ,
We do not want to use the direct update, insert statements to update the table. So we are looking for an alternative FM or BAPI to update the same. The records we are trying to update are for outbound delivery details.
Regards,
Raksha -
Required to create a script for base table update using XMLSTORE package.
Hi can anybody provide me some help full suggestion on how to update base table using XMLSTORE package.
I created a simple script for Employee table and can able to do the basic operation like Insert and update on the table.
Query is as follow's
DECLARE
insCtx DBMS_XMLSTORE.ctxType;
rows NUMBER;
xmlDoc CLOB :=
'<ROWSET>
<ROW num="1">
<EMPLOYEE_ID>922</EMPLOYEE_ID>
<SALARY>1801</SALARY>
<HIRE_DATE>17-DEC-2007</HIRE_DATE>
<JOB_ID>ST_CLERK</JOB_ID>
<EMAIL>RAUSSJACK</EMAIL>
<LAST_NAME>JACK</LAST_NAME>
<DEPARTMENT_ID>20</DEPARTMENT_ID>
</ROW>
<ROW>
<EMPLOYEE_ID>923</EMPLOYEE_ID>
<SALARY>2001</SALARY>
<HIRE_DATE>31-DEC-2005</HIRE_DATE>
<JOB_ID>ST_CLERK</JOB_ID>
<EMAIL>PATHAK</EMAIL>
<LAST_NAME>PRATIK</LAST_NAME>
<DEPARTMENT_ID>20</DEPARTMENT_ID>
</ROW>
</ROWSET>';
BEGIN
insCtx := DBMS_XMLSTORE.newContext('EMPLOYEES'); -- Get saved context
DBMS_XMLSTORE.clearUpdateColumnList(insCtx); -- Clear the update settings
-- Set the columns to be updated as a list of values
DBMS_XMLSTORE.setUpdateColumn(insCtx, 'EMPLOYEE_ID');
DBMS_XMLSTORE.setUpdateColumn(insCtx, 'SALARY');
DBMS_XMLSTORE.setUpdateColumn(insCtx, 'HIRE_DATE');
DBMS_XMLSTORE.setUpdateColumn(insCtx, 'JOB_ID');
DBMS_XMLSTORE.setUpdateColumn(insCtx, 'EMAIL');
DBMS_XMLSTORE.setUpdateColumn(insCtx, 'LAST_NAME');
DBMS_XMLSTORE.setUpdateColumn(insCtx, 'DEPARTMENT_ID');
-- Insert the doc.
rows := DBMS_XMLSTORE.insertXML(insCtx, xmlDoc);
--COMMIT;
DBMS_OUTPUT.put_line(rows || ' rows inserted.');
-- Close the context
DBMS_XMLSTORE.closeContext(insCtx);
END;
SELECT employee_id, LAST_name FROM employees WHERE employee_id = 114;
DECLARE
updCtx DBMS_XMLSTORE.ctxType;
rows NUMBER;
xmlDoc CLOB :=
'<ROWSET>
<ROW>
<EMPLOYEE_ID>114</EMPLOYEE_ID>
<LAST_NAME>PRABHU</LAST_NAME>
</ROW>
</ROWSET>';
BEGIN
updCtx := DBMS_XMLSTORE.newContext('EMPLOYEES'); -- get the context
DBMS_XMLSTORE.clearUpdateColumnList(updCtx); -- clear update settings
-- Specify that column employee_id is a "key" to identify the row to update.
DBMS_XMLSTORE.setKeyColumn(updCtx, 'EMPLOYEE_ID');
rows := DBMS_XMLSTORE.updateXML(updCtx, xmlDoc); -- update the table
DBMS_XMLSTORE.closeContext(updCtx); -- close the context
commit;
END;
Nowi want little modification on this above query like as i am passing static XML tags and i want it to pick the dynamic XML from web and use the XMLSTORE for the update.
and also for complex XML having 2-3 levels how this query needs to be changed.As i am new to this Oracle utillity any help from xepert will be a great help for me.
ThanksNowi want little modification on this above query like as i am passing static XML tags and i want it to pick the dynamic XML from webFrom a Web Service?
You'll need UTL_HTTP or HttpUriType interface to send the request and receive the XML response.
Search in the forum, there are already a lot of useful examples available.
and also for complex XML having 2-3 levels how this query needs to be changed.DBMS_XMLStore is OK for readily processing a canonical XML format (/ROWSET/ROW/COLUMN structure or alike).
However, if you have to deal with a more complex structure, you either have to :
- use a target object table that matches the XML structure
- preprocess the input document using XSLT to transform it to canonical format
That's why DBMS_XMLStore is not appropriate for multilevel documents, especially if they contain nested repeating groups.
In this case, XMLTable is a more flexible way of parsing the XML and process it relationally at the same time.
Depending on the size of the document, performance may be improved with schema-based object-relational storage.
For more help, please post a new thread in the {forum:id=34} forum, with the following information :
- database version (select * from v$version)
- a sample XML document (the complex one)
- DDL of your target table
- mapping between XML elements and columns (ie which tag goes to which column?)
- an XML schema (if you have one) -
Using ALV table inside the WD CHIP
Hi,
I am trying to display the internal table values using alv component in WD CHIP. But, not able to add the component usage as SALV_WD_TABLE.
Can anyone please confirm how can we use the ALV component inside the WD chip.
My requirement is that based upon the selection parameter provided by the user in the CHIP, i need to display the resource id in a table in the same CHIP.
Thanks,
JayaprakashHi Kabil,
You mean in WD CHIP. It seems that it is behaving differently when working with CHIP.
It is not allowing me to add other components like SALV_WD_TABLE.
Thanks,Prabu -
BCALV_EDIT_03 - Need the table update function
I am fairly new to OO programming and have worked through the various sample programs. I am currently using BCALV_EDIT_03 and _04 to write a table maintenance program.
I kind of have figured out how the delete and insert function works but unfortunately in sample program _03 the final table update function is missing.
What I am after is that I get all the changed records from the grid and update the external table just with those records.
Could somebody post some sample update code that I could check out?
Thanks in advance.
GerdTable update as in, database table update or ALV table update ?
ALV Table update will be done automatically, in case you have used the method : set_table_for_first_display
As you also quote that you are checking out BCALV_<b>EDIT</b>_03, I will just clarify this point, all changes made to the table are triggered by the EVENT DATA_CHANGED and this event has the necessary fields, from which you can come to know which rows and what values have changed. You need to use this DATA_CHANGED event and update your internal table. This is then shown in SET_TABLE_FOR_FIRST_DISPLAY in PBO.
In case you are talking about database update and if it is a custom table, then you have to use the direct update.
In case it is a SAP table, you might let us know which table it is, and probably some of the experts here can let you know the Function Module, BAPI or any method of a class to use.
In case you need a good tutorial help, you can find it in Serdar Simsekler's
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf
Let me know if I am way tangent here or I could be of help to you.
Regards,
Subramanian V. -
hi abaper's
i have to make ALV report in which i have to display custom table data using ALV and all operation what we can do on DDIC ztable(like delete save change etc) these operation we can do only on UI screen. so please help me how to do this
points will be rewaded
thnks n regard
pardeep kumarHi by adding extra button on alv output tool bar like SAVE , DELETE , MODIFY
like this
In order to add user command functioality to the ALV grid you need to perform the following steps:
1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'USER_COMMAND' FORM
2. Create 'USER_COMMAND' FORM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
I_callback_user_command = 'USER_COMMAND' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
we can define our own screen by doing like thsi
In order modify PF_STATUS of ALV grid report you need to perform the following steps:
1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:
i_callback_pf_status_set = 'SET_PF_STATUS' statement.
2. Create 'SET_PF_STATUS' FORM
3. Create pf_status (i.e. 'ZNEWSTATUS').
- It is recommend that you copy standard status'STANDARD' from function group SALV
and modify it accordingly. ALV standard function codes always start with '&'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_pf_status_set = 'SET_PF_STATUS' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
FORM SET_PF_STATUS *
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZNEWSTATUS'.
"Copy of 'STANDARD' pf_status from fgroup SALV
ENDFORM.
double clik on the bold one and design what ever screen u want -
How to display selected table fields in ALV report.
Hi,
I am displaying data from table EKPO using ALV through this query.
select * from ekpo into table itab_ekpo up to 25 rows.
bt if i need to display selected fields like
select ebeln matnr netpr from ekpo into table itab_ekpo up to 25 rows.
IT gives error GETWA_NOT_ASSIGNED.
FIELD SYMBOL HAS NOT YET BEEN ASSIGNED
CAN ANYONE PLZ HELP ME.Hi ,
I am pasting the code in which i am getting the error.Plz help.
REPORT ZHALV.
tables:ekpo.
data itab_ekpo type ekpo occurs 100 with header line.
types: begin of itab_new,
f_ebeln type ekpo-ebeln,
f_matnr type ekpo-matnr,
f_netpr type ekpo-netpr,
end of itab_new.
data itab1 TYPE STANDARD TABLE OF itab_new initial size 0.
type-pools: slis.
DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,
lf_fieldcat TYPE slis_fieldcat_alv.
DATA: ws_repid TYPE sy-repid VALUE 'ZHALV'.
DATA: l_layout TYPE slis_layout_alv.
selection-screen Begin of block block1 with frame title text-111.
select-options : S_EBELN for EKPO-EBELN.
selection-screen end of block block1.
INITIALIZATION.
start-of-selection.
select ebeln matnr netpr from ekpo into table itab1 up to 10 rows WHERE EBELN IN S_EBELN.
*select * from ekpo into table itab_ekpo up to 25 rows.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM GET_DETAILS.
end-of-selection.
*& Form build_fieldcatalog
text
FORM build_fieldcatalog .
PURCHASING DOCUMENT NUMBER
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'EBELN'.
lf_fieldcat-ref_tabname = 'EKKO'.
lf_fieldcat-ref_fieldname = 'EBELN'.
MATERIAL NUMBER
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'MATNR'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'MATNR'.
APPEND lf_fieldcat TO lt_fieldcat.
NET PRICE IN PURCHASING DOCUMENT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'NETPR'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'NETPR'.
lf_fieldcat-cfieldname = 'WAERS'.
lf_fieldcat-do_sum = 'X'.
APPEND lf_fieldcat TO lt_fieldcat.
ENDFORM. " build_fieldcatalog
*& Form GET_DETAILS
text
FORM GET_DETAILS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ws_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'EKPO'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = lt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*append itab_ekpo to i_tab.
ENDFORM. "GET_DETAILS -
Hi,
I am trying to use class CL_ALV_CHANGED_DATA_PROTOCOL to update a database table from an ALV grid.
I have used program BCALV_EDIT_04 as an example.
I am able to successfully processed inserted or deleted lines using the attributes
MT_DELETED_ROWS
MT_INSERTED_ROWS
but I also want to process modified lines.
I was just wondering whether anyone out there has some example code for this.
I can see that there are the following attributes available
MT_MOD_CELLS
MP_MOD_ROWS.
I would ideally like to use MP_MOD_ROWS rather than MT_MOD_CELLS but it is not clear to me what type MP_MOD_ROWS is.
If anyone has any example code for this sort of thing, please let me know.
Thanks,
Rubyhi Ruby,
Yes we can use that *data reference variable *.
It is a variable( something comparable to a pointer ) that points to a int table( table with changed contents )
which ll be created at run-time based on the data type ot the internal table that we pass to the parameter it_outtab of method set_table_for_first_display ...
assign er_data_changed->mp_mod_rows->* to a field-symbol and use it...
Check the below code for example -> method refresh_changed_data
screen flow logic.
PROCESS BEFORE OUTPUT.
MODULE pbo.
PROCESS AFTER INPUT.
MODULE pai.
main program.
* CLASS lcl_event_responder DEFINITION *
CLASS lcl_event_responder DEFINITION.
PUBLIC SECTION.
DATA : ls_changed_cell TYPE lvc_s_modi,
lv_language TYPE spras..
METHODS refresh_changed_data FOR EVENT data_changed
OF cl_gui_alv_grid
IMPORTING er_data_changed
e_ucomm.
ENDCLASS. "event_responder DEFINITION
TYPES tt_makt TYPE STANDARD TABLE OF makt.
DATA: go_handler TYPE REF TO lcl_event_responder,
go_grid TYPE REF TO cl_gui_alv_grid,
gt_fieldcat TYPE lvc_t_fcat,
gv_language TYPE spras VALUE 'E',
gt_outtab TYPE tt_makt,
gs_tableline TYPE LINE OF tt_makt.
FIELD-SYMBOLS : <changed_rows> TYPE tt_makt.
CALL SCREEN 100.
* MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'BASIC'.
PERFORM create_and_init_alv CHANGING gt_outtab[]
gt_fieldcat.
ENDMODULE. "pbo OUTPUT
* MODULE PAI INPUT *
MODULE pai INPUT.
LEAVE PROGRAM.
ENDMODULE. "pai INPUT
FORM create_and_init_alv CHANGING pt_outtab LIKE gt_outtab[]
pt_fieldcat TYPE lvc_t_fcat.
CHECK go_grid IS NOT BOUND.
CREATE OBJECT go_grid
EXPORTING
i_parent = cl_gui_container=>default_screen.
PERFORM build_display_table.
PERFORM build_fieldcat CHANGING pt_fieldcat.
go_grid->set_table_for_first_display( CHANGING it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab ).
go_grid->set_ready_for_input( 1 ).
* raises the 'data_changed' event when we select another cell/any action after changing the data
go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_enter ).
CREATE OBJECT go_handler.
SET HANDLER go_handler->refresh_changed_data FOR go_grid.
ENDFORM. "CREATE_AND_INIT_ALV
FORM build_display_table.
FREE gt_outtab.
SELECT * FROM makt UP TO 20 ROWS INTO TABLE gt_outtab WHERE spras EQ gv_language.
ENDFORM. "build_display_table
FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'MAKT'
CHANGING
ct_fieldcat = pt_fieldcat.
LOOP AT pt_fieldcat INTO ls_fcat.
ls_fcat-edit = abap_true.
MODIFY pt_fieldcat FROM ls_fcat.
ENDLOOP.
ENDFORM. "build_fieldcat
* CLASS event_responder IMPLEMENTATION *
CLASS lcl_event_responder IMPLEMENTATION.
METHOD refresh_changed_data.
ASSIGN er_data_changed->mp_mod_rows->* TO <changed_rows>.
LOOP AT <changed_rows> INTO gs_tableline.
BREAK-POINT.
ENDLOOP.
ENDMETHOD. "click
ENDCLASS. "event_responder IMPLEMENTATION
Cheers,
Jose. -
Table Maintenance Generator via program using ALV OO concept
Hi All,
I have a requriement to update the table using OO ALV i.e table maintenance generator program.
My Z table have three fields say.. NEW status, old status and flag.
I have to dispaly the records of the Z table in Matrix format.
for example the records of the Z table is
New status
Old status
Flag
N1
O11
F11
N1
O12
F12
N1
O13
F13
N2
O21
F21
N2
O22
F22
N2
O23
F23
N3
O31
F31
N3
O32
F32
N3
O33
F33
My program have to display the records of the table in matrix format i.e
| ..... | O11 | O12 | O13 | O21 | O22 | O23 | O31 | O32 | O33 | ..
| N1 | F11 | F12 | F13 | ..... | ..... | .... | ..... | ....... | .... | .. ____________________________________________________________________________________
| N2 | ..... | ...... | ....... | F21 | F22 | F23 | ... | ..... | ...... | .
| N3 | ...... | ..... | ....... . | ....... | ....... | .... | F31 | F32 | F33 |
The ALV display is dynamic i.e it depends upon the no. of records in the table...
My headings( Row heading and Column heading ) will be the value from table... and the user should be able to change the Flag ... For example when the user change the Flag 'F21' to say 'X',
| ..... | O11 | O12 | O13 | O21 | O22 | O23 | O31 | O32 | O33 | ..
| N1 | F11 | F12 | F13 | ..... | ..... | .... | ..... | ....... | .... | .. ____________________________________________________________________________________
| N2 | ..... | ...... | ....... | X | F22 | F23 | ... | ..... | ...... | .
| N3 | ...... | ..... | ....... . | ....... | ....... | .... | F31 | F32 | F33 | .
In the Z table the record is
N2 O21 F21
should be changed to
N2 O21 X
I tried using ALV oo concept....but I can able to display the output as like it is in table ....Not like the one above format....
Can you please help me to resolve it?
Thanx in advance
Sangeetha
Edited by: sangeetha s k on Dec 16, 2008 7:42 AM
Edited by: sangeetha s k on Dec 16, 2008 7:50 AM
Edited by: sangeetha s k on Dec 16, 2008 8:04 AMHi,
Go through Following Menu Path
Tcode SE11-> Table Name-> Change.
Utilities-> Table Maintance Generator->Create Maintance.
On Same Screen go to Menu Environment->Modification->Events
Create New Event e.g. 05 , Enter Form Routine Name.
Go to Editor.
and Put Your Logic
e.g.
FORM FILL_DEFAULT.
* Actual Logic for how to get materials list.
ENDFORM.
Maybe you are looking for
-
Single sign-on using Kerberos and Ldap
I am currently setting up single sign-on using Kerberos for authentication and Ldap for authorization and information store. The setup includes several Solaris 8 & 9 workstations, a couple of SGI's, as well as a M$ terminal server farm, several WinXP
-
F-32 customer clearing prroblem
Hi.. Kindly tell me while I am going to clear throguh F-32(customer clearing), Partial payment tab then Assigned value and Non Assigned value become 0 after seleting individual all records under Net Amount. And shows error message :"Enter line item
-
Playlists don't appear in iTunes Playlist selection window when synching
I just updated to iTunes 9.0 (big mistake) and discovered that many of my playlists do not appear in the playlist selection window when I synch my iPod nano 2.0. Even playlists that I created after upgrading to 9.0 don't appear. I have more playlists
-
Issues Installing/Uninstalling QuickTime
I've tried everything I could think of to uninstall QuickTime (because I need to install the new version). I tried going QuickTime > Uninstall Quicktime. Didn't work. I tried going to Add/Remove Programs. I downloaded a force uninstaller from the int
-
KDE4 / hal no longer automounting usb thumb drives
I have hal and dbus running as services and they were until recently automounting usb storage devices in KDE4. After installing VirtualBox/WinXP it's not working anymore. I did set up a usb device entry in fstab to be used by VirtualBox, but even whe