on 04-28-2011 3:13 PM
I have a ALV table in a WwbDynpro component.
I have a ON_DATA_CHECK event handler for my INTERFACECONTROLLER.
I`m trying to insert a new row in the table. Even if it gets to the succes message when I check the database table is does have a new row but it`s empty!
Does somebody know why?
Regards,
Ilinca
Could you post the source code you have written in this event handler. It is difficult to comment on what is wrong without actually seeing what is coded there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
method ON_DATA_CHECK .
DATA: node_angajati TYPE REF TO if_wd_context_node,
elem_node_angajati TYPE REF TO if_wd_context_element,
lt_angajati TYPE wd_this->elements_angajati,
cod_angajati TYPE wd_this->element_angajati-cod_angajat,
.......declaration for each attribute in node angajati
data_nasteree TYPE wd_this->element_angajati-data_nastere.
node_angajati = wd_context->get_child_node( name = wd_this->wdctx_angajati ).
node_angajati->get_static_attributes_table( IMPORTING table = lt_angajati ).
DATA: itab TYPE STANDARD TABLE OF zangajati,
itab_angajati LIKE LINE OF itab.
itab_angajati-cod_angajat = cod_angajati.
itab_angajati-nume = numee.
.......
itab_angajati-email = emaill.
itab_angajati-data_nastere = data_nasteree.
INSERT itab_angajati INTO TABLE itab.
INSERT zangajati FROM TABLE itab ACCEPTING DUPLICATE KEYS.
COMMIT WORK.
......
message_text = 'Data was successfully saved.'.
Hi,
Please check the new record has the primary key as same as existing record in the table.
If this is the case then the record will not be inserted to the table and it does not show any error since you have specified ACCEPTING DUPLICATE KEYS.
Check the sy-subrc after the insert statement.
Regards,
Meera
I never had to test in debug mode.
I know that you can switch debugging on with /h....but I don`t really understand where to go from there. Some of the documentation on the internet are confusing for me.
Now I`m getting " Access via 'NULL' object reference not possible." with this call stack:
Method: ON_DATA_CHECK of program /1BCWDY/04RQA8JMA4W8RQKR21UM==CP
Method: ON_DATA_CHECK of program /1BCWDY/04RQA8JMA4W8RQKR21UM==CP
Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/04RQA8JMA4W8RQKR21UM==CP
Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
Method: FIRE_EVENT of program CL_WDR_COMPONENT==============CP
Method: IFWDR_INTERNAL_API~RAISE_EVENT of program SAPLWDR_RG_PROXY_FACTORY
Method: IF_COMPONENTCONTROLLER~FIRE_ON_DATA_CHECK_EVT of program /1BCWDY/05925V4FUOXTQY7GYD5U==CP
Method: IF_SALV_WD_COMPONENT~FIRE_EVENT of program CL_SALV_WD_C_TABLE============CP
Method: IF_SALV_WD_COMP_TABLE_EVENTS~ON_DATA_CHECK of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_IF~DATA_CHECK of program CL_SALV_WD_C_TABLE============CP
Hi,
Are u really a technical consultant? I mean Debugging is a very basic thing a ABAPer should know.
Anyways to switch in debugging mode goto se80-> give your web dynpro compnent/intf.
Goto the view ,then to methods where you have coded put the cursor on the line which you want to debug goto Utilities ->External Breakpoint->set/delete external breakpoint. In web Dynpro abap /H debugging wont work. Or else paste the entire code wich you are getting error.
Regards,
Santosh
Of course I`m not an sap consultant. I`m a newbie trying to learn abap.
I already tried what you said with the breakpoint....The problem is what should I do in ABAP Debugger to figure out what went wrong in my code? There are many tabs in Abap Debugger that I don`t understand. Which is the right one in my case?
Hi,
Use modify Statement, and Enque and deque table. check below sample code.
LlOOP AT IT_VTTK INTO WA_VTTK.
WA_VTTK-UATEN = WA_VTTK-UATEN.
WA_VTTK-TDLNR = WA_VTTK-TDLNR.
MODIFY IT_VTTK from WA_VTTK.
ENDLOOP.
lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'VTTK'
VARKEY = ship_no
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
MODIFY VTTK from table IT_VTTK.
if sy-subrc is initial.
COMMIT WORK .
else.
ROLLBACK work.
endif.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'VTTK' .
Cheers,
Kris.
HI,
Take help from your senior consultant as this is not a training place to give you all details.Or else there are many sites where you can find how to debug a code. Debug the code with the help of your senior and find wat value you get in Internal table ITAB.
And i asked you to send the whole code so that it can be more clear where you went wrong.The above code which you have send is incomplete. If that is the only code in method ON_DATA_CHECK then the output you are getting is correct.
Regards,
Santosh
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.