on 01-19-2009 8:45 PM
Hi,
I am practicing this adobe form session [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/a3e2f018-0b01-0010-c7a8-89deb6e63e97] from SDN.Unfortunately this session was not complete so I am trying to complete it.
In brief : this WD component accepts CARRID and displays output in PDF format.
I was able to capture selection and get respective entries for that selection in my internal table but my display is blank.Here is what I coded in Search Button..
method ONACTIONSEARCH .
data: isflight type table of sflight.
DATA lo_nd_adobe_data TYPE REF TO if_wd_context_node.
DATA lo_el_adobe_data TYPE REF TO if_wd_context_element.
DATA lo_nd_data_selections TYPE REF TO if_wd_context_node.
DATA lo_el_data_selections TYPE REF TO if_wd_context_element.
DATA ls_data_selections TYPE wd_this->element_data_selections.
* navigate from <CONTEXT> to <DATA_SELECTIONS> via lead selection
lo_nd_data_selections = wd_context->get_child_node( name = wd_this->wdctx_data_selections ).
* get element via lead selection
lo_el_data_selections = lo_nd_data_selections->get_element( ).
* get all declared attributes
lo_el_data_selections->get_static_attributes(
IMPORTING
static_attributes = ls_data_selections ).
* Retrieve that data from the database. Normally it is suggested to
* encapsulate the data retrieval in a separate class.
* For simplicity, the SELECT statement has been implemented here.
clear isflight. refresh isflight.
select * into corresponding fields of table isflight from sflight
where carrid = ls_data_selections.
* navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
lo_nd_adobe_data = wd_context->get_child_node( name = `ADOBE_DATA` ).
lo_nd_adobe_data->bind_elements( isflight ).
endmethod.
endclass.
Anything wrong with my code..I am getting my data in isflight internal table.
FYI..I am throwing output as text field in adobe form.
rgds
vara
Edited by: Vara K on Jan 19, 2009 9:51 PM
Edited by: Vara K on Jan 19, 2009 10:02 PM
Hi Vara,
See the problem is very clear, before binding the table with your context node you are clearing and refreshing the internal table and work area.... so first bind the table and thn do clear and refresh...
see the small change in your code....
select * into corresponding fields of table isflight from sflight
where carrid = ls_data_selections.
* navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
lo_nd_adobe_data = wd_context->get_child_node( name = `ADOBE_DATA` ).
lo_nd_adobe_data->bind_elements( isflight ).
clear isflight. refresh isflight.
regards
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vara,
Check this [blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7783] [original link is broken] [original link is broken] [original link is broken];, it might help.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pranav,
That is a interactive form tutorial.I just want display my contents .
eg: if I give Invoice number as input in my webdynpro it should output Invoice in pdf form.
Arjun,
I gone through that already but there is no internal table scenario.I am just confused on how do we show internal table contents ?
Rgds
vara
Hi Vara,
Try this code to set data in table
DATA lo_nd_cn_table TYPE REF TO if_wd_context_node.
DATA lt_cn_table TYPE wd_this->elements_cn_table.
* navigate from <CONTEXT> to <CN_TABLE> via lead selection
lo_nd_cn_table = wd_context->get_child_node( name = wd_this->wdctx_cn_table ).
lo_nd_cn_table->bind_table( new_items = lt_cn_table set_initial_elements = abap_true ).
regards
Pranav
Pranav,
What is elements_cn_table?
I have a Context node called ADOBE_DATA and Inside in there are 2 subnodes SLFLIGHT & DATA_SELECTIONS.
So I tried
clear isflight. refresh isflight.
select * into corresponding fields of table isflight from sflight
where carrid = ls_data_selections.
DATA lo_nd_cn_table TYPE REF TO if_wd_context_node.
DATA lt_cn_table TYPE wd_this->elements_sflight.
* navigate from <CONTEXT> to <CN_TABLE> via lead selection
lo_nd_cn_table = wd_context->get_child_node( name = wd_this->wdctx_sflight ).
lo_nd_cn_table->bind_table( new_items = lt_cn_table set_initial_elements = abap_true ).
I got this error..Subnode MAIN.SFLIGHT does not exist
Also,I am not understanding where are we binding our internal table ISFLIGHT ?
Rgds
Vara
Since you have a sub node first you can directly set it this way you have to reach your sub node first...
and you can bind your sflight internal table here
cn_table is the name of my context node........
lo_nd_cn_table->bind_table( new_items = sflight set_initial_elements = abap_true ).
regards
Pranav
Hi Vara,
You can try BIND_TABLE method in the interface IF_WD_CONTEXT_NODE using the reference
lo_nd_adobe_data.
Just check with this and confirm.
Regards,
Shashikanth. D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shasikanth,
I tried this
lo_nd_adobe_data->bind_table( isflight ).
it did not work either.While outputing data I just dragged and dropped 2 fields CARRID & CONNID from data view on to form.
I haven't changed any properties.This is like an input field.
Do you think that is causing the issue?
rgds
vara
Right now i dont have Adobe 7.1 installed so i cant try it at my end, but here is a link from saptechnical in which they are getting data from adobe... now instead of getting data you have to set data.... this link might help you...
open sap technical and go this tutorial... i am not allowed to paste complete link here...
/Tutorials/AdobeForms/UsingABAPDynpro/Page1.htm
regards
Pranav
Hi Vara,
The code seems to be ok.
Did you paste this code in you wddomodifyview of the view where you have the interactive UI element.
data:
lr_interactive_form type ref to cl_wd_interactive_form,
lr_method_handler type ref to if_wd_iactive_form_method_hndl.
check first_time = abap_true.
lr_interactive_form ?= view->get_element('PDF1').
lr_method_handler ?= lr_interactive_form->_method_handler.
lr_method_handler->set_legacy_editing_enabled( abap_true ).
Here PDF1 is the name of the Interactive form UI element name in my scenario.
Hope it helps.
Good day!
Regards,
Shashikanth. d
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have debugged my application.I see entries in my internal table isflight .
I think problem is in binding.
* navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
lo_nd_adobe_data = wd_context->get_child_node( name = `ADOBE_DATA` ).
lo_nd_adobe_data->bind_elements( isflight ).
Shasikanth,
I also tried including code in WDDOMODIFYVIEW but it did not work either.
any idea what i am doing wrong?
rgds
vara
Hi Vara,
Try this:
method ONACTIONSEARCH .
data: isflight type table of sflight.
DATA lo_nd_adobe_data TYPE REF TO if_wd_context_node.
DATA lo_el_adobe_data TYPE REF TO if_wd_context_element.
DATA lo_nd_data_selections TYPE REF TO if_wd_context_node.
DATA lo_el_data_selections TYPE REF TO if_wd_context_element.
DATA ls_data_selections TYPE wd_this->element_data_selections.
* navigate from <CONTEXT> to <DATA_SELECTIONS> via lead selection
lo_nd_data_selections = wd_context->get_child_node( name = wd_this->wdctx_data_selections ).
* get element via lead selection
lo_el_data_selections = lo_nd_data_selections->get_element( ).
* get all declared attributes
lo_el_data_selections->get_static_attributes(
IMPORTING
static_attributes = ls_data_selections ).
* Retrieve that data from the database. Normally it is suggested to
* encapsulate the data retrieval in a separate class.
* For simplicity, the SELECT statement has been implemented here.
* clear isflight. refresh isflight.
select * into corresponding fields of table isflight from sflight
where carrid = ls_data_selections-carrid.
* navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
lo_nd_adobe_data = wd_context->get_child_node( name = `ADOBE_DATA` ).
lo_nd_adobe_data->bind_elements( isflight ).
endmethod.
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.