MODIFY Table in OO Context
Hi!
I'm trying to modify an internal table which is a public attribute of a class. I'm always getting a sy-subrc 4.
Here is my code to describe my problem:
MODIFY TABLE go_instance->gt_table FROM <table>.
The datatype of <table> is correct. When I assign with READ TABLE and change the field, it works... but not via MODIFY.
Is the MODIFY in OO-context not allowed?
Thanks in advance!
Daniel
Hi Daniel,
Ok, it has something to do with the key... but its the same now.. ... If someone could explain this it would be great...
quite simple
\[ UNIQUE | NON-UNIQUE ] DEFAULT KEY
This declares the fields of the default key as the key fields. If you have a structured line type, the standard key is build from all columns of the internal table that have a character-type type (c, d, t, n, x, string, xstring). Internal tables with a nested row structure have a standard key built by linearization of the row structure. At elementary row types, the standard key is the row itself. Elementary tables with an internal table as row type have an empty standard key.
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/frameset.htm
one more thing:
The table type is a standard table with the following "db" keys: MANDT;JAHR;VERSION;ORGA;MATNR;KLASSE
Please note that the primary key of the DB-table does not influence the key of your internal table. When you define an internal table, then you can define your own key. You are actually very encouraged to do so, because otherwise the DEFAULT KEY is used. If the table type of the internal table is SORTED, then the data from the DB is automatically sorted to match the internal table sorting.
I strongly recommend to use SORTED/HASHED tables.
(SORTED can have UNIQUE / NON-UNIQUE KEY - sorting according to key is performed. The key is read from left-to-right, thus not all fields of the key must be specified to enforce a binary search)
(HASHED can have UNIQUE KEY only - sorting is irrelevant, all fields of the key must be specified)
Thus, STANDARD tables are to be used only for some special cases (e.g.):
- you can not sort technically (e.g. JANUARY, FEBRUARY, MARCH, APRIL is wanted, instead of the technical sorting APRIL, FEBRUARY, JANUARY, MARCH)
- the sequence is relevant (e.g. stack-implementations (LIFO-principle) or queue implementations (FIFO-principle))
So, if you dont have one of those use-cases, then please always use SORTED/HASHED tables.
Kind regards,
Hristo
Similar Messages
-
Bind Dynamic Table To a Context Node
Hello,
I created an internal dynamic Table. I want to show this table in an ALV-Table. So I want to bind it to a context node.
I create the context node attributes by this:
lr_node_info ?= lo_nd_template_exp->get_node_info( ).
*Type of table type and context type have to be the same
LOOP AT lt_plchar INTO ls_plchar.
clear lv_text.
lv_text = ls_plchar-plchar.
TRANSLATE lv_text TO UPPER CASE.
ls_fieldcatalog-fieldname = lv_text.
ls_fieldcatalog-inttype = 'C'.
ls_fieldcatalog-intlen = '10'.
APPEND ls_fieldcatalog TO lt_fieldcatalog.
ls_attribute-name = lv_text.
ls_attribute-type_name = 'CHAR10'.
lr_node_info->add_attribute( EXPORTING attribute_info = ls_attribute ).
ENDLOOP.
So I create a fieldcatalog and the attributes at once.
Then I generate the table with this:
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcatalog
IMPORTING
ep_table = <fs_data>
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2 .
IF sy-subrc <> 0.
ENDIF.
* So now points to our dynamic internal table.
ASSIGN <fs_data>->* TO <fs_1>.
* Next step is to create a work area for our dynamic internal table.
CREATE DATA new_line LIKE LINE OF <fs_1>.
* A field-symbol to access that work area
ASSIGN new_line->* TO <new_line>.
Data: copy_table type ref to data.
field-symbols: <copy_table> type standard table.
create data copy_table like table of <new_line>.
assign copy_table->* to <copy_table>.
ok, nice. when i now bind the table to <copy_table> to lo_nd_template_exp it all works fine. But i also want to but the data into the table.
This also works. When I debug, I can see the table filled with the values. But then there's always this error:
Invalid operand type for the MOVE-CORRESPONDING statement.
Ok, I have read, that the types may be not fit. But I don't know why and how i can solve it.
Do you have any ideas?Hi,
I've the same problem: I must create all attribute of my node at run-time and then create alv.
I use the method:
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
Pass context node to ALV
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
lo_interfacecontroller->set_data( node_lenght ). " node_lenght is my dynamic node
But I receive this message error:
Invalid operand type for the MOVE-CORRESPONDING statement.
Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
Method: EXECUTE of program CL_SALV_BS_SERVICE_MNGR_TABLE=CP
Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
What can I do??? My node doesn't static attribute....
Thank,
Federica. -
Another user-modified table (VPM1)
Dear Experts,
I faced the above error when trying to add outgoing payment.
Firstly, I saved the outgoing payment as a draft. Then, I open the outgoing payment draft through payment draft report.
Before I add the outgoing payment draft into valid outgoing payment document, I have to confirm and update the check number in payment mean.
Finally I save the outgoing payment. However, system doesn't allow to save this draft into valid document and display error "Another user-modified table (VPM1) (ODBC-2039) [Message 131-183]". Please help!Dear Teng,
It seems to be a database corruption issue.
We would like to suggest you to open a message for SAP Support.
Regards,
Rakesh Pati
SAP Business One Forum Team. -
Error: Another User Modified Table in Service Call in SAP B1 8.8 PL9
Hi Experts,
We are facing an issue in SAP B1 8.8 Patch 9 in Service Call. When taking service calls continuosly, when we try to update every 3rd Service Call the following error is coming
"Another user or another operation modified data; to continue, open the window again 'Service Calls' (OSCL) (ODBC -2039) [Message 131-183]".
Only 1 user is using the service call.. Several times we logged out and logged in, still the same error is coming,
Kindly help to solve this.
Regards
SundaramHi
You may check this thread. It might be a bug.
Re: another user modify table error on Service call
Thanks,
Gordon -
Another user modified table rdr3
Hi
I got error "Another user modified table rdr3" when try to update additional expenses on sales order form.
Case: Update Add. expences through my code based on condition and document updated well with add. expenses
but after that if i update add. expenses through system functionality <b>means By pass my code</b> based on some condition, SBO throws this error.
Help needed!???In what event are you performing your update? I was getting the same message when I did my update in the in "item clicked" (for the update button) and this is evidently before the form does the update. It saw the changes I made to the record and therefore aborted the update.
I moved my update to item-pressed and that solved the problem. But it's been a little more complicated than that for me.
As far as I can tell, SBO updates the object on the form AFTER the BeforeAction event is triggered from item pressed. But the way my debugging suggests it happens is that if there are no errors from that update, while item pressed does get it's AfterAction triggered, the form is no longer in update mode - it's in OK mode. So it seems that the update really needs to happen from OK mode but there's one more complication.
At least for the item master form, button 1 can be in OK mode after doing an Update (which will work), but will also be in OK mode after a find (where the user types, for instance, an item number and presses enter, rather than the find button). So what I am doing is setting a flag on item pressed/update mode/before action that let's me know that update is requested. then in item pressed/find mode/after mode I test for update requested, then update the object and turn off my flag:
Case Is = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
If pVal.ItemUID = "1" Then
Select Case pVal.FormMode
Case Is = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
If pVal.BeforeAction Then
g_UpdateModeStarted = True
End If
Case Is = SAPbouiCOM.BoFormMode.fm_OK_MODE
If g_UpdateModeStarted Then
If pVal.Action_Success Then
UpdateItem()
g_UpdateModeStarted = False
End If
End If
WARNING: I am very new to SBO programming and haven't even taken the class yet. This works for me but I imagine that others in this forum might say I'm going about it all wrong. But since no one else has offered a solution to this yet, I thought I'd let you know how I got around the problem.
Good Luck! -
Another user modify table error on Service call
Dear All,
i am getting error while updating the service call.
As this is SAP2007B PL 16 i have created a service call when i am updating this service call i am getting the error like-another user is modify table-service call .
Kindly help me out.
Regard,
Divya SinghDear Divya,
In most cases, the error messages " Another user modified table XXX (XXXX) (ODBC -2039)." comes because after opening the form at your side, another user opened the same form and applied some changes. You can close the form, open it again, apply your changes and then update it to avoid this error message.
But in some cases, even if you close all the clients and login again, the problem still exists. In that case, this error might be caused by Database Corruption which need DB fix. If this is the case, Kindly log a message to SAP Support.
Regards,
Varun
SAP Business One Forum Team -
Error: Another user -modified table (ODBC -2039)
I receive an error when trying to post data through to the SapbobsCom6.7 business object reading "Another user -modified table (ODBC -2039)"
Could anyone please assist me regarding this!
Thank you!
EtienneHi Etienne et al,
I don't know if this helps you, as your last post in this topic was quite a while ago, but never the less I found one reason for the -2039 error which may be of help to other Business One developers in the future.
I was getting the -2039 error every time I tried to update a record in one of my user defined forms, yet the error wouldn't happen with most of the other records in the table.
Looking at the record I found that there was a column related to a Date field on the which had an incorrectly entered value from a previous data import.
What should have been '2004-06-23 00:00:00.000' in the table was actually '1899-12-30 23:06:04.000' and would appear as 30/12/99 in the form field. Once I corrected the format of the data the addon form was happy to update the record.
I hope this helps anyone else out there.
Nick Jacka -
[OACT], Another user-modified table 'G/L Accounts' (ODBC-2039)
Dear All,
When AP dept user attempting to add outgoing payment, the error message ""[OACT], Another user-modified table 'G/L Accounts' (ODBC-2039)" appears, what could the causes of the problem be ? I have restarted server many times but still unsolved yet.
TIA
Rgds,Steve,
One reason why this happens ("Another User Modifed table") is if the SQL database has been updated while the document is open. When trying to add the document, the information in the document will be inconsistent with the values in the database itself.
It can also be because someone tried to Run one of the Restore Balances Procedure.
Please contact SAP Support by logging a message at http://service.sap.com
Suda -
Another user-modified table... Errors
Dear Experts,
Two of our clients are experiencing same error message but different Table name and scenario.
First: Customer1 change the password of Manager account and it became successful. But when they change the password again, they encounter the u201CAnother user-modified table 'Users'(OUSR)...u201D error message.
Second: Customer2 can't change the Item description in Item Master Data. When they try to update the description, the "Another user-modified table 'Items'(OITM)(ODBC-2039)[Message 131-183]" error message appears.
I've read some of the preferred solutions but the same issue occurs.
Are these considered as bugs?
Please help us.
Thank you so much.
Regards,
Doriza CortezDear Doriza Cortez,
All those errors are caused by table locks. Users have at least to exit from B1 for all their sessions. If the problem still persist, restart server is the last cure. Before that, you can try to kill certain hidden session from SQL Studio.
Thanks,
Gordon -
Another user-modified table '' (POR1) (ODBC -2039) [Message 131-183]
I have updated the purcahse order form.I have added a combo excisable.Also I have defined excisable and non-excisable warehouses.I have added a condition as,
If I select Yes from the combo then the warehouse of the item should be excisable.And,if I select No then the item should be from non-excisable warehouse.
When I change the warehouse as per the above condition it gives error as,
Another user-modified table '' (POR1) (ODBC -2039) [Message 131-183]
I am using SAP Business One 2007 B.
PL:11
The errors occurs when I click on update button.The error does not occur if I don't update purchase order.
Regards,
Dilip KumbharDilip Kumbhar,
You may check these threads first:
Updating a PO
In Purchase Order
Thanks,
Gordon -
Hi All,
Just had an issue reported by a customer. They tried to amend a UDF on an Item Master record and they can change data such as the Item description, remarks etc and update the item successfully... However, when they tried to amend the contents of the UDF's attached to the Item the system issue the message:
Another user-modified table 'Items' (ITEM) (ODBC - 2039) [Message 131-183]
Any thoughts?
Best regards
EarlI figured it out
We had a UDF name U_Discount that was set to only allow Y or N.
In the database I had a space after the Y or N value for some of the records. I discovered it by running
SELECT distinct [U_Discount], COUNT(*) FROM [OITM] group by [U_Discount]
No idea how the space got there, but I ran
update OITM set U_Discount = 'N' where LEFT(U_Discount,1) = 'N'
update OITM set U_Discount = 'Y' where LEFT(U_Discount,1) = 'Y'
and it fixed it -
Another User modified Table (ODBC -2039) - Sales order
Via a button on sales order form I delete some of the order lines with oMatrix.DeleteRow(rowNr).
It works fine but the DocTotal is not updated as it will be if I delete the row manually with the right-click Delete Row command.
When saving the order via Update button it refuses with the error "Another User modified Table (ODBC -2039)".
Do you have any ideas for workarounds for this?
I've tried to set the price to 0 before deleting the row (the DocTotal will be updated) but the error is the same when saving.
I don't manipulate the FormMode in the code.
Regards
LarsHI,
SAP has answered with notes 720076.
They suggest to use
oMatrix.Columns.Item("1").Cells.Item(i).Click()
SBO_Application.ActivateMenuItem("1293")
instead of
oMatrix.DeleteRow(i)
It works for me.
Best regards,
Paolo. -
Hello,
Iu2019m having problems re-assigning some activities. When i make a slight alteration to an existing activity I added my note and reassigned the activity to another user to raise collection but it is coming up with the red message when I click on update which reads as follows:
'Another user-modified table 'Activities' (OCLG) (ODBC-2039) [Message 131-18]'
Could you please assist.
Regards,
JuanGordon,
I have tried disconnecting the AddOns to no avail. There are a few stored procedures but none that I can see attribute to the actitivity screen.
I have tried this on a test company and there is no issue. I have ensured no one else is logged into SAP but the same message appears. Having investigated further it is now only happening for one activity in particular. Other 'Open' activities are fine. Newly created Activities can also be edited.
Any other ideas?
Regards,
Juan -
Another user-modified table 'Items' (ODBC -2039)
I have a problem with the Items object. I have a folder on the Item MasterData form and a extra table that stores the info from that tab.
When I try to update an item i get this error message :
Another user-modified table 'Items' (OITM or OITW) (ODBC -2039)
I can update items normally if my addon is stopped. I have read something about a similar message about PO, but I get the error on all items( even newly added ones) so I don't think it's about them being involved in PO.
Any ideas on this matter ?Hi,
I faced a similar error once, i also modified the Item Master screen and added a tab with an extra table, then i was modifing the FORM MODE explicitly.
If ur are modifing the FORM MODE explicitly we may get this error.
Vasu Natari. -
Another user-modified table ODBC -2039 [Message 131-183]
Hi!
I created a matrix that it is linked to a ChooseFromList, that has multiselection = true.
The thing is that if i'm trying to update the record selecting multiple values, this error is displayed "Another user-modified table ODBC -2039 [Message 131-183]".
If i try doing it with just one record, the UDO works perfectly.
Also, it works fine if i'm creating for the first time the record and adding the multiple selection lines.
Greetings!
Reynaldo!HI,
I think you have some transactions in the background.
Close all stuffs, delete SM_OBS_DLL directory from your TEMP directory, and start the work again.
Regards,
J.
Maybe you are looking for
-
How do you make the albums show up on the song?
Is it supposed to automatically do that? Or do you have to make it show up manually? Cuz on my Nano, I have pictures, but the albums don't show up on the picture.
-
Web Service u0096 IDOC with acknowledgement interface
hi experts, for this scenario do i need to use ccBPM?? <b><i>Web Service IDOC with acknowledgement interface.</i></b> because we need response from idoc and idoc supports asynchronous processing.
-
Is it possible to change an employee that was assigned to an Org Unit through migration? Organizational Management | Org Structures | End Employment Assignment is greyed out.
-
Accessing Hotmail via web browser on 5800
I've got a 5800 and a Hotmail account that I access via the web. Worked fine on my N73. With the 5800 I get the "entering a secure page" warning, but then the phone stops with the warning "Unable to establish a secure connection." It does the same t
-
Embarqs' (now centurylink) mail website has an empty check-box beside each message to make it easier to sort and delete multiple messages at once, instead of moving or deleting them one at a time. Does thunderbird have the same, or a similar option,