on 11-04-2008 1:13 PM
Hi.
I want Insert the data from Web Dyn Pro Applications to SAP Data Base Tables.
How it is possible.
Suppose i have Three Fields in the Layout.
I have Insert Button.
When i press INSERT Button then what i entered data in those 3 fields. That data is stored in the Data Base Tables and i want display the message like 'Record is Inserted'.
How it is possible. Explain about this with an Screen Shorts. If possible.
Thank You.
Hi Kirshna,
You just need to read the context carrying user-entered values.
And modify the database table with the context.
See the code below
DATA node TYPE REF TO if_wd_context_node.
DATA context_element TYPE REF TO if_wd_context_element.
* navigate from <CONTEXT> to <NODE> via lead selection
node = wd_context->get_child_node( name = wd_this->nodename ).
* get element via lead selection
context element = node->get_element( ).
* @TODO handle not set lead selection
IF context element IS NOT INITIAL.
DATA i_table TYPE STANDARD TABLE OF <database _table>.
node->get_static_attributes_table(
IMPORTING
table = i_table ).
MODIFY <database_table> FROM TABLE i_table.
After this u can show the success message using the Code Wizard.
Please revert back with issues
Regards,
Sumit Oberoi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
DATA : INPUT1 TYPE STRING,
INPUT2 TYPE STRING,
INPUT3 TYPE STRING.
DATA ITAB_DETAIL TYPE STANDARD TABLE OF ZTABLENAME
DATA WA_ITAB TYPE ZTABLENAME
DATA : DETAIL TYPE REF TO IF_WD_CONTEXT_NODE.
DETAIL = WD_CONTEXT->GET_CHILD_NODE( 'NODENAME' ).
DETAIL->GET_ATTRIBUTE( EXPORTING NAME = 'INPUTFIELDATTRIBUTENAME1'
IMPORTING VALUE = INPUT1 ).
DETAIL->GET_ATTRIBUTE( EXPORTING NAME = 'INPUTFIELDATTRIBUTENAME2'
IMPORTING VALUE = INPUT2 ).
DETAIL->GET_ATTRIBUTE( EXPORTING NAME = 'INPUTFIELDATTRIBUTENAME3'
IMPORTING VALUE = INPUT3 ).
WA_ITAB-FIELD1 = INPUT1.
WA_ITAB-FIELD2 = INPUT2.
WA_ITAB-FIELD3 = INPUT3.
APPEND WA_ITAB TO ITAB_DETAILl.
if wa_itab is not initial.
insert into ZTABLE values wa_itab.
if sy-subrc = 0.
msg = 'Record Updated'.
l_current_controller ?= wd_this->wd_get_api( ).
call method l_current_controller->get_message_manager
receiving
message_manager = l_message_manager.
call method l_message_manager->report_success
exporting
message_text = msg
PARAMS =
MSG_USER_DATA =
.
exit.
endif.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.