Bind_table
I know that there is a way to bind an internal table to a context node using the
method bind_table.
But I need to do the opposite. I need to populate an internal table with the elements
of a node. Is there an existing method I can use?
Hi,
To get the values binded to the table you can use method
get_static_attributes_table.
1.click on patter or CTRL+F6.
2.select call method.
enter class/interface as IF_WD_CONTEXT_NODE.
method :get_static_attributes_table.
CALL METHOD lo_nd_prf_exp_cer_detail->get_static_attributes_table
* EXPORTING
* from = 1
* to = 2147483647
IMPORTING
table = lt_prf_exp_cer_detail
Priya
Similar Messages
-
Dynamic column Name# Contains Invalid Characters. Bind_table() fails
Hi WD experts,
I have tried to use the bind_table() on a dynamically generated table. Now it happens that this dynamic table contains columns like NAME# . This gave rise to a dump :
The Name NAME# Contains Invalid Characters. Valid Characters are A-Z, 0-9, _, and /.
Other tables which do not have such columns are correctly bound.
In my method , I first loop over the field catalog to retrieve some field names from a dynamicallt generated report...
LOOP AT lt_fieldcat_out INTO lwa_fieldcat.
comp-name = lwa_fieldcat-fieldname.
comp-type ?= cl_abap_typedescr=>DESCRIBE_BY_DATA( lwa_fieldcat-FIELDNAME ).
APPEND comp TO comp_tab.
ENDLOOP.
structure which represents the dynamic table
struct_type = cl_abap_structdescr=>get(
p_components = comp_tab
p_strict = abap_FALSE ).
node_info = wd_context->get_node_info( ).
node_info = node_info->add_new_child_node(
name = 'DYN_TAB_NODE'
IS_MANDATORY = ABAP_TRUE
IS_MANDATORY_SELECTION = ABAP_FALSE
IS_MULTIPLE = ABAP_TRUE
IS_MULTIPLE_SELECTION = ABAP_FALSE
IS_SINGLETON = ABAP_FALSE
IS_INITIALIZE_LEAD_SELECTION = ABAP_FALSE
static_element_rtti = struct_type
is_static = abap_false
struct_type = node_info->GET_STATIC_ATTRIBUTES_TYPE( ).
Afterwards, I bind a dynamic table to the new node...
Do you have an idea how to circumvent this ?
Thank you,
cheers,Zied.cols have to be changed
-
Links not getting displayed in the contextual panel
Hi,
I have created a contextual panel inside a transparent container. And created a method in the same view supply_values of type supply function to supply the values to the panel.Inside the method I have coded like:
DATA TAB TYPE WD_THIS->ELEMENTS_N_VIEW_SWITCH.
DATA LINE TYPE WD_THIS->ELEMENT_N_VIEW_SWITCH.
LINE-TEXT = 'User Manual'. "#EC NOTEXT
LINE-ENABLED = ABAP_TRUE.
APPEND LINE TO TAB.
LINE-TEXT = 'Logout'. "#EC NOTEXT
LINE-ENABLED = ABAP_TRUE.
APPEND LINE TO TAB.
NODE->BIND_TABLE( TAB ).
Also in the context of the view I have created a node and supplied the method 'supply_values' in the supply function.Under the node I have 2 attributes named text and enabled. Text is of string type and enabled is of boolean type. In the properties of the contextual panel I have bound the visible property with the enabled attribute.
Now when I am running this application , links are not getting displayed in the contextual panel. Though when I debug TAB contains the values. Please suggest if I have missed out something or I need to look into the properties of the contextual panel. Any pointers will be really helpful.
Regards,
AshutoshHi,
Can you elaborate ' ItemEnable property of ViewSwitch'.
I have already bound the enable property of the panel with a context attribute of type wdy_boolean but it is still not working.
Regards,
Ashutosh -
Interactive forms- i see only one record -how can i see more?
Hi experts,
i have a table and the result is only one record instead of more records.
how can i see more records?
my code is:
types: begin of structure_0021,
favor type pa0021-favor,
yy_id type pa0021-yy_id,
fgbdt type pa0021-fgbdt,
end of structure_0021.
data: it_0021 type table of struct_0021,
wa_0021 like line of it_0021.
select favor yy_id fgbdt from pa0021 into corresponding fields of table it_0021
where pernr = lv_pernr and
subty = '2'.
data: lo_nd_adobe2 type ref to if_wd_context_node,
lo_nd_ls00212 type ref to if_wd_context_node,
lo_el_ls00212 type ref to if_wd_context_element,
ls_ls00212 type wd_this->element_ls0021.
lo_nd_adobe2 = wd_context->get_child_node( name = wd_this->wdctx_adobe).
lo_el_ls00212 = lo_nd_adobe2->get_element().
lo_nd_ls00212 = lo_nd_adobe->get_child_node(name = wd_this->wdctx_ls0021).
lo_el_ls00212 = lo_nd_ls00212->get_element().
loop at it_0021 into wa_0021.
lo_el_ls00212->get_static_attributes(importing static_attributes = ls_ls00212).
endloop.
lo_nd_ls00212->bind_table(new_items = it_0021).
if anyone can help me - i will really appreciate it.
i tried other thing and didnt succeed.
thanks,
Michal.Obvious question, but have you got 'Find My iPhone' set on both devices? Settings>iCloud>Find My iPhone.
-
How to create a node with attributes at runtime in webdynpro for ABAP?
Hi Experts,
How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
Please help!
Thanks
GopalHi
I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
Note
The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
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_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
Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
My code is like the following:
TYPES: BEGIN OF t_type,
CARRID TYPE sflight-carrid,
CONNID TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
dyn_node type ref to if_wd_context_node,
rootnode_info type ref to if_wd_context_node_info,
i_node_att type wdr_context_attr_info_map,
wa_node_att type line of wdr_context_attr_info_map.
wa_node_att-name = 'CARRID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
insert wa_node_att into table i_node_att.
wa_node_att-name = 'CONNID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
insert wa_node_att into table i_node_att.
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
rootnode_info = wd_context->get_node_info( ).
rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
attributes = i_node_att
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
dyn_node->bind_table( i_struc ).
l_ref_interfacecontroller->set_data( dyn_node ).
I am trying to create a new node. That is
CONTEXT
- DYNFLIGHT
CARRID
CONNID
As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
Also I cannot define the structure in the ABAP dictionary because it changes based on condition
Message was edited by: gopalkrishna baliga -
Error while binding data into Node which is Created Dynamically.
Hi All
We have a scenario , which is to create the Context and its attribute dynamically at runtime. When I create the context with structure. Using the method <b>create_nodeinfo_from_struct()</b>.here the attributes under the created node is automatically taken from the provided structure SPFLI.
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = DYN
structure_name = SPFLI
is_multiple = abap_true ).
Using the above method it is working fine and I could bind the value into the node.
But our scenario is to create context and its attributes without giving any predefined structure. We need to add attributes manually giving one by one.
For that I have used the method rootnode_info->add_new_child_node &
dyn_node->add_attribute( exporting attribute_info = ls_attribute ).
But am getting short dumb showing <b>Line types of an internal table and a work area not compatible.</b>
Please give me a solution..
I used the following code .
data:
rootnode_info type ref to if_wd_context_node_info,
dyn_node type ref to if_wd_context_node,
data :ls_attribute type wdr_context_attribute_info.
rootnode_info = wd_context->get_node_info( ).
call method rootnode_info->add_new_child_node
exporting
SUPPLY_METHOD =
SUPPLY_OBJECT =
DISPOSE_METHODS =
DISPOSE_OBJECT =
STATIC_ELEMENT_TYPE =
name = 'DYN'
is_mandatory = abap_false
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_false
is_singleton = abap_true
is_initialize_lead_selection = abap_true
STATIC_ELEMENT_RTTI =
is_static = abap_false
ATTRIBUTES =
receiving
child_node_info = node_nsp
ls_attribute-name = 'CARRID'.
ls_attribute-type_name = 'S_CARR_ID'.
ls_attribute-value_help_mode = '0'.
node_nsp->add_attribute( exporting attribute_info = ls_attribute ).
ls_attribute-name = 'CONNID'.
ls_attribute-type_name = 'S_CONN_ID'.
ls_attribute-value_help_mode = '0'.
node_nsp->add_attribute( exporting attribute_info = ls_attribute ).
DATA : BEGIN OF str,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
END OF str.
DATA : it_str LIKE TABLE OF str.
select carrid connid from spfli into corresponding fields of table it_str
dyn_node = wd_context->get_child_node( name = 'DYN' ).
dyn_node->bind_table( it_str ).
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv_usage( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv_usage( ).
l_ref_interfacecontroller->set_data(
r_node_data = dyn_node " Ref to if_Wd_Context_Node
Thanks in advance..
Nojish
Message was edited by:
nojish pHi Nojish.
I gues the error happens when you try to read the static attributes of an element of
you dynamic node. This does not work using your defined type str, cause with
get_static_attribute you only receive the static and not the dynamic attributes.
Static attributes are attributes that are defined at design time. Thats why the
structure does not match.
But you can use the following code to get your dynamic attributes, for example
getting the lead selection element and the attribute carrid:
dyn_node = wd_context->get_child_node( name = 'DYN' ).
lr_elelement = dyn_node->get_element( ).
lr_el->get_attribute(
EXPORTING
name = 'CARRID'
IMPORTING
value = lv_carrid
Hope this helps.
PS: Or do you get the reerror in above code? Your code works here. If so pls provide short dump.
Cheers,
Sascha
Message was edited by:
Sascha Dingeldey -
Unable to retreive values from selection screen built using WDR_SELEC_OPTIO
Hi All,
I have created a selection screen as below
lr_field = wd_this->m_handler->create_range_table( 'YFMTFLOW' ).
* ASSIGN lr_field->* TO <fs_range>.
* ls_date-sign = 'I'.
* ls_date-option = 'EQ'.
* ls_date-low = 'US'.
* APPEND ls_date TO <fs_range>.
* Add the select-option to the group
wd_this->m_handler->add_selection_field(
i_id = 'FLOW'
i_within_block = 'PROC'
i_no_intervals = abap_true
it_result = lr_field ).
If i enter some value and click a button to retireve the values as below
DATA
lt_sel_item TYPE if_wd_select_options=>tt_selection_screen_item.
types: ty_flow type range of yfmtflow.
FIELD-SYMBOLS:
<fs_sel_item> LIKE LINE OF lt_sel_item,
<fs_process> TYPE yfmtprocess,
<fs_flow> TYPE ty_flow.
* Get the selection-screen items
l_handler->get_selection_screen_items(
IMPORTING et_selection_screen_items = lt_sel_item ).
* Retrieve the values from the select-options items
LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
CASE <fs_sel_item>-m_id.
WHEN `PROCESS`.
ASSIGN <fs_sel_item>-m_value->* TO <fs_process>.
WHEN 'FLOW'.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_flow>.
ENDCASE.
ENDLOOP.
<fs_flow> is empty
but after I enter value and then press enter and then click the button to retrieve the values I am able to get low value <fs_flow> not the sign and option
Is it the standard functionality ,if yes how can we overcome
Thanks
Bala DuvvuriAm giving clear coding of select options.
nOTE: S_CARR_ID IS THE DATA ELEMENT OF CARR ID FIELD,
FOR THAT I AM APPLYING SELECT OPTIONS IN BELOW CODING.
WRITE THE BELOW CODE IN WDDOINT( ) METHOD OF
REQUIRED VIEW
Data: lt_range_table type ref to data,
read_only type abap_bool.
WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS-
>WD_CPIFC_SELECT_OPTIONS( ).
WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS-
>INIT_SELECT_SCREEN( ).
WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(
I_DISPLAY_BTN_CANCEL = ABAP_FALSE
I_DISPLAY_BTN_CHECK = ABAP_FALSE
I_DISPLAY_BTN_RESET = ABAP_FALSE
I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).
LT_RANGE_TABLE = WD_THIS->M_HANDLER-
>CREATE_RANGE_TABLE( I_TYPENAME = 'S_CARR_ID' ).
WD_THIS->M_HANDLER->ADD_SELECTION_FIELD(
I_ID = 'S_CARR_ID'
IT_RESULT = LT_RANGE_TABLE
I_READ_ONLY = READ_ONLY ).
BELOW CODE IN REQUIRED ACTION( SAY IN SOME BUTTON
ACTION WHICH WILL RETRIEVE THE DATA FROM DATABASE TABLE
USING SELECTI OPTIONS VALUES)
fIRST THE GET REFERENCE TO NODE( CTRL F7--->READ
CONTEXTB---FLIGHT NODE )
***THEN BELOW CODE
DATA: RT_CARRID TYPE REF TO DATA.
DATA:IS_FLIGHT TYPE TABLE OF SFLIGHT.
FIELD_SYMBOLS: <FS_CARRID> TYPE TABLE.
RT_CARRID = WD_THIS-> M_HANDLER-
>GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
ASSIGN RT_CARRID-> TO <FS_CARRID>.*
SELECT * INTO CORRRESPONDING FIELDS OF TABLE IS_FLIGHT
FROM SFLIGHT WHERE CARRID IN <FS_CARRID>
NODE_FLIGHT->BIND_TABLE( IS_FLIGHT ). -
Unable to display table data in Review View
Hi Experts,
I have one main view and one review View .In my main view i have one table (Normal Table) and several other input feilds and text views....
If i click on review button in my main view, am able to see all the data in review view except table data.
How can i get the table data which i have entered in main view.. the same should display in review view.
I binded the same node in both main and review. and node is defined under component controller.
Any ideas?
Regards
Farooq.Hi,
I think you already binded in review view also with same node. right? So data will move automatically and display in
review view also. In WDDOINIT of review veiw read data from that node and use bind_Table.
Cheers,
Kris. -
Setting the value of a single attribute for multiple line items
Hi all,
I am working on a Web Dynpro application, I have created this applicaion for an accounting document so it has header data and multiple line item data. As per the requirement I have to put the following logic:
1. When a user enters a value in the field KBLNR on the line item, all the other fields like cost centerm fund, functional area should populate from a database table based on the value of the KBLNR. to get this I have put the following code:
TYPES: BEGIN OF t_kblp,
fipos TYPE kblp-fipos,
kostl TYPE kostl,
END OF t_kblp.
DATA lv_kblnr TYPE wd_this->element_t_bseg-kblnr.
DATA: lt_kblp TYPE STANDARD TABLE OF t_kblp,
wa_kblp LIKE LINE OF lt_kblp,
lt_bseg TYPE STANDARD TABLE OF bseg,
wa_bseg TYPE bseg.
DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
DATA: ls_t_bseg TYPE wd_this->element_t_bseg,
lo_api_controller TYPE REF TO if_wd_controller,
lo_message_manager TYPE REF TO if_wd_message_manager,
lo_nd_tbseg TYPE REF TO if_wd_context_node,
lo_el_tbseg TYPE REF TO if_wd_context_element,
lt_el_tbseg TYPE wdr_context_element_set,
lv_bseg TYPE bseg.
lo_nd_t_bseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager.
lo_nd_tbseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
lt_el_tbseg = lo_nd_tbseg->get_elements( ).
LOOP AT lt_el_tbseg INTO lo_el_tbseg.
lo_el_tbseg->get_static_attributes(
IMPORTING static_attributes = lv_bseg ).
IF lv_bseg-kblnr NE ' '.
SELECT belnr
fipos
kostl
PSPNR
geber
saknr
fkber
grant_nbr
gsber
FROM kblp
inTO corresponding fields of wa_kblp
WHERE belnr = lv_bseg-kblnr and
saknr = lv_bseg-saknr.
ENDSELECT.
lo_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
* get element via lead selection
lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
lo_el_tbseg->set_static_attributes(
EXPORTING static_attributes = wa_kblp ).
CLEAR: lv_bseg, wa_kblp.
ENDLOOP.
everything is working fine but now the problem is couple of fields that I have in wa_kblp are with different names in bseg table and hence they are not updating... I tried putting the following logic within the loop :
lo_el_t_bseg->set_attribute(
name = `PROJK`
value = wa_kblp-pspnr ).
but it's only setting the value of the first line item and not working for the multiple line items, can you please tell me how can do this?
Thanks,
Rajat Garg
Edited by: rajatg on Jun 24, 2011 5:09 PMHi Chris,
I tried your code and it worked fine but after I put this code I am getting another issue. within the loop I had a code to make the fields non modifiable on the screen and was working fine but now what's happening is it's making the all the lines uneditable except the one with data on it (which is completely opposite), this is what I have coded:
LOOP AT lt_el_tbseg INTO lo_el_tbseg.
lo_el_tbseg->get_static_attributes(
IMPORTING static_attributes = lv_bseg ).
IF lv_bseg-kblnr NE ' '.
SELECT belnr
fipos
kostl
PSPNR
geber
saknr
fkber
grant_nbr
gsber
FROM kblp
inTO corresponding fields of wa_kblp
WHERE belnr = lv_bseg-kblnr and
saknr = lv_bseg-saknr.
ENDSELECT.
move: wa_kblp-belnr to wa_bseg-kblnr,
wa_kblp-fipos to wa_bseg-fipos,
wa_kblp-kostl to wa_bseg-kostl,
wa_kblp-pspnr to wa_bseg-projk,
wa_kblp-geber to wa_bseg-geber,
wa_kblp-saknr to wa_bseg-saknr,
wa_kblp-fkber to wa_bseg-fkber,
wa_kblp-grant_nbr to wa_bseg-grant_nbr,
wa_kblp-gsber to wa_bseg-gsber,
lv_bseg-dmbtr to wa_bseg-dmbtr.
append wa_bseg to lt_bseg.
lo_nd_edit_property = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG.EDIT_PROPERTY` ).
get element via lead selection
lo_el_edit_property = lo_nd_edit_property->get_element( ).
lo_el_edit_property->set_attribute(
name = `EDIT_FIELD`
value = 'ABAP_TRUE' ).
lo_el_edit_property->set_attribute(
name = `EDIT_WBS`
value = 'ABAP_TRUE' ).
endif.
endloop.
o_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
get element via lead selection
lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
CALL METHOD lo_nd_t_bseg->bind_table
EXPORTING
new_items = lt_bseg.
Can you please see what I am doing it wrong here.... -
Not compatible with the formal parameter "NEW_ITEMS"
Dear,
I'm creating a very simple WD4A to just display the contents of the table.
So in the COMPONENTCONTROLLERS I created the node ZPI_USERS, according to the type of the internal table ZPI_USERS we have on the PI system.
Still in the COMPONENTCONTROLLER under methods I'm trying to implement this code in the 'wddoinit' event:
METHOD wddoinit.
DATA: lt_users TYPE zpi_users,
node_users TYPE wd_this->element_users,
lo_nd_users TYPE REF TO if_wd_context_node,
lo_el_users TYPE REF TO if_wd_context_element.
* navigate from <CONTEXT> to <USERS> via lead selection
lo_nd_users = wd_context->get_child_node( name = wd_this->wdctx_users ).
SELECT * FROM zpi_users
INTO lt_users.
lo_nd_users->bind_table( new_items = lt_users ).
ENDMETHOD.
On trying to activate I get the following error :
Web Dynpro Comp. / Intf. ZPI_DISPLAY_MONIUSERS,Web Dynpro Component Controller COMPONENTCONTROLLER
Method WDDOINIT
"LT_USERS" is not type-compatible with formal parameter "NEW_ITEMS".
I know I'm overseeing something very simple, though I get the feeling I'm running in circles. Again: the only thing I want to do is show an internal SAP table through a Web Dynpro.
Kind regards,Hi,
You have declared
DATA: lt_users TYPE zpi_users,
This means that you are declaring a work area and not an internal table, whereas while binding we need to pass an internal table.
Declare your table as follow,
DATA: lt_users TYPE TABLE OF zpi_users.
" modify your select
SELECT *
FROM zpi_users
INTO TABLE lt_users.
Hope this helps!
Regards,
Radhika. -
Display data from diferent tables
My requirement is to display data from diferent tables supose tables likeVBAK and VBAP.it will allow for all entries concept oops abap?.
how to write code for display data from diferent tables .
method WDDOINIT.
data:
node_sflight type ref to if_wd_context_node,
Itab_sflight type standard table of SFLIGHT.
select * from SFLIGHT into table Itab_sflight.
node_sflight = wd_context->get_child_node( name = 'SFLIGHT_NODE' ).
node_sflight->bind_table( itab_sflight ).
endmethod.
Thanks,
RamaHI,
IS IT CORRECT WAY OF DONIG CODING?
IF I AM WORNG PLEASE SUGEST ME.
method WDDOINIT.
data:
node_sflight type ref to if_wd_context_node,
final type standard table of vbap.
types: begin of t_vbak,
vbeln type vbak-vbeln,
end of t_vbak.
endmethod.
data wa_vbak type t_vbak.
data i_vbak type standard table of t_vbak.
types: begin of t_vbap,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
end of t_vbap.
data wa_vbap type t_vbap.
data i_vbap type standard table of t_vbap.
select vbeln from vbak into table I_vbak.
select vbeln posnr matnr from vbap into table I_vbap
for all entries in I_vbak
where vbeln = i_vbak-vbeln.
loop at I_vbak.
read table i_vbap with key vbeln = I_vbak-vbeln.
final-vbeln = I_vbap-vbeln.
final-posnr = I_vbap-posnr .
final-matnr = I_vbap-matnr .
append final.
clear final.
endloop.
node_sflight = wd_context->get_child_node( name = 'NODE_VBAP' ).
node_sflight->bind_table( final ).
endmethod.
Thanks,
rama -
Hebrew fonts from drop-down box not displaying in text box.
I am using InDesign CS 5.5 on a Mac 10.8.4.
When in ID, the fonts I am seeing on the Font dropdown menu when I try to use in a text box are not displaying correctly. They only display as boxes. The fonts are in the Hebrew language. They are properly installed in the FontBook.
Please help!! Thank you.Reema,
I followed most of your steps. I have a question reg. step 3 ie populating data in node 1.
Here is my code:
method WDDOINIT .
types: begin of zs,
zktokd type kna1-ktokd,
end of zs.
data: handle1 type ref to if_wd_context_node,
begin of zstruct,
zktokd type kna1-ktokd,
end of zstruct,
zitab type table of zs.
handle1 = wd_context->get_child_node( name = 'NODE1' ).
*select ktokd into corresponding fields of zstruct from kna1.
*append zstruct to zitab.
*endselect.
zstruct-zktokd = 'Sold-to party'.
append zstruct to zitab.
zstruct-zktokd = 'Goods recipient'.
append zstruct to zitab.
zstruct-zktokd = 'Payer'.
append zstruct to zitab.
zstruct-zktokd = 'Bill-to party'.
append zstruct to zitab.
zstruct-zktokd = 'Prospective Customer'.
append zstruct to zitab.
zstruct-zktokd = 'Competitor'.
append zstruct to zitab.
zstruct-zktokd = 'Sales partners'.
append zstruct to zitab.
zstruct-zktokd = 'Hierarchy Node'.
append zstruct to zitab.
zstruct-zktokd = 'Named List of Accounts'.
append zstruct to zitab.
zstruct-zktokd = 'Distribution center'.
append zstruct to zitab.
zstruct-zktokd = 'Payer'.
append zstruct to zitab.
handle1->bind_table( new_items = zitab ).
endmethod.
Please let me know if this is the best way to populate the node and then bind the table values from the node to the drop down box.
Thanks and Regards. -
More fun with enumerated dropdowns - Binding to table
Hi All,
I'm having some trouble with enumerated dropdowns.
My context is as follows:
node DATA 1...1
---> node FLIGHTS 0...N
-->CARRID etc from SFLIGHTS
--->DDL (element type string)
I have successfully tried to add a simple dropdown with the following code on the component controller:
method wddoinit .
data lo_nd_data type ref to if_wd_context_node.
data lo_el_data type ref to if_wd_context_element.
data ls_data type wd_this->element_data.
data lv_ddl like ls_data-ddl.
data node_info type ref to if_wd_context_node_info.
data vals type table of wdr_context_attr_value.
data: s_element type wdr_context_attr_value.
data: str type string.
* navigate from <CONTEXT> to <DATA> via lead selection
lo_nd_data = wd_context->get_child_node( name = wd_this->wdctx_data ).
* get element via lead selection
lo_el_data = lo_nd_data->get_element( ).
lo_el_data->get_static_attributes(
importing
static_attributes = ls_data ).
* get node info
call method lo_nd_data->get_node_info
receiving
node_info = node_info.
do 25 times.
str = sy-index.
condense str no-gaps.
s_element-text = str.
s_element-value = str.
append s_element to vals.
enddo.
* Set Value_sets to node_info
call method node_info->set_attribute_value_set
exporting
name = 'DDL'
value_set = vals
endmethod.
This works fine, however now I am trying the same thing with a field from the SFLIGHTS table.
I want to display a table of the retrieved SFLIGHTS but a field as a dropdown with valid entries from the database. I have added the following code to the view.
method WDDOINIT .
data lo_nd_data type ref to if_wd_context_node.
data lo_nd_flights type ref to if_wd_context_node.
data lo_el_flights type ref to if_wd_context_element.
data ls_flights type wd_this->element_flights.
data gt_flights type table of sflights.
select * from sflights into table gt_flights.
* navigate from <CONTEXT> to <DATA> via lead selection
lo_nd_data = wd_context->get_child_node( name = wd_this->wdctx_data ).
* navigate from <DATA> to <FLIGHTS> via lead selection
lo_nd_flights = lo_nd_data->get_child_node( name = wd_this->wdctx_flights ).
lo_nd_flights->bind_table( gt_flights ).
types: begin of ty_carrname,
carrname type s_carrname,
end of ty_carrname.
data: gt_carrname type table of ty_carrname.
select distinct carrname
from sflights
into table gt_carrname.
data lv_carrname like ls_flights-carrname.
data node_info type ref to if_wd_context_node_info.
data vals type table of wdr_context_attr_value.
data: s_element type wdr_context_attr_value.
data: str type string.
lo_nd_flights->get_static_attributes(
importing
static_attributes = ls_flights ).
call method lo_nd_flights->get_node_info
receiving
node_info = node_info.
field-symbols: <carrname> like line of gt_carrname.
loop at gt_carrname assigning <carrname>.
str = <carrname>-carrname.
s_element-text = str.
s_element-value = str.
append s_element to vals.
endloop.
call method node_info->set_attribute_value_set
exporting
name = 'CARRNAME'
value_set = vals.
endmethod.
I can display all the entries with a repeating subform but when I bind the CARRNAME to an enumerated dropdown I get an ADS rendering error:
WebDynpro Exception: The ADS call has failed. You can find information about the cause in the error.pdf on the application server
I have looked in the Error PDF but it is blank.
Does anyone have any suggestions on what is goign wrong or how to diagnose the problem.
I am assuming you can have a data element that has a 0..N cardinality (i.e a table element) and is also of type enumerated dropdown.
I'm guessing this is something to do with cardinality but I have no way to find out.
Thanks,
GregorI have looked in the defaultTrace file and found the following errors:
1. A pdf document with 0 pages.
Return Status: Render Failure
Output Trace returned: <?xml version="1.0" encoding="UTF-8"?>
<log>
<m mid="29184" tid="10064.4896" sev="f" d="2008-11-12T15:20:01.722Z">Malformed SOM expression: $record.sap-vhlist.FLIGHTS\\.DATA[*]\\.CARRNAME.item[*]</m></log>
Has anybody else used the enumerated dropdown element bound to dynamic data?
I am using the latest releases and the "Specify Item Values" on the Object->Binding tab is filled in with what looks correct ($record.sap-vhlist.FLIGHTS\.Data etc) but greyed out.
Thanks -
Hi!
When I enter fix values into a domain, it is appearing automatically through the data element in an element of a view (like a dropdown by key). That's nice, it is working perfectly.
However if I don't use fix values in the domain, but I use a value table, the table entries are not appearing automatically. Do I have to code it in the wddoinit, or is there an easier way for showing in the view's dropdown element, the values from the domain's value table?
Thank you
TamáHi,
Just fetch data from your value table and bind it to the node. You can use dropdownbyindex.
Create a node; cardinality 0:n -> create an attribute ( keep the attribute name same as the field name of your value table; this will help reduce the coding )
Now use the follwing code;
Data: l_node type ref to if_wd_context_node.
Data: lt_values type wd_this->elements_nodename.
" fetch data from value table.
Select text " fieldname
from .............. into lt_values.
l_node = wd_context->get_child_node( 'NODENAME' ).
l_node->bind_table( lt_values ).
Regards,
Radhika. -
Fm to convert XSTRING TO STRING in SRM 7.0
HI All ,
i have created a web dynpro application for Uploading excel . Now i am not getting any workaround to convert X STRING to STRING . In SAP there is a FM HR_KR_XSTRING_TO_STRING but its not there in SRM so when i tried to copy the same in SRM and try to convert its getting converted in Junk characters . Please help me out in this .
Regards
ShankarHI Nilema ,
I have tried ur code also but still the same result .
METHOD onactionon_upload .
TYPES :
BEGIN OF str_itab,
name(10) TYPE c,
age(10) TYPE c,
END OF str_itab.
DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
i_data TYPE STANDARD TABLE OF string,
lo_nd_sflight TYPE REF TO if_wd_context_node,
lo_el_sflight TYPE REF TO if_wd_context_element,
l_string TYPE string,
fs_table TYPE str_itab,
l_xstring TYPE xstring,
fields TYPE string_table,
lv_field TYPE string,
lv_codepage TYPE CPCODEPAGE.
DATA : t_table TYPE if_main=>element_datatab,
data_table TYPE if_main=>element_datatab.
get single attribute
break akedia.
wd_context->get_attribute(
EXPORTING
name = `DATASOURCE`
IMPORTING
value = l_xstring ).
CALL FUNCTION 'SCP_CODEPAGE_BY_EXTERNAL_NAME'
EXPORTING
external_name = 'ISO-8859-1'
KIND = 'H'
IMPORTING
SAP_CODEPAGE = lv_codepage
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
lv_codepage = '1100'.
ENDIF.
CALL FUNCTION 'LXE_COMMON_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IN_CODEPAGE = lv_codepage
EX_CODEPAGE = '0000'
UNMASK_CRLF = ''
IMPORTING
EX_STRING = l_string
EXCEPTIONS
ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
Bind With table Element.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field INDEX 1.
fs_table-name = lv_field.
READ TABLE fields INTO lv_field INDEX 2.
fs_table-age = lv_field.
APPEND fs_table TO t_table1.
ENDLOOP.
lo_nd_sflight = wd_context->get_child_node( 'DATATAB' ).
lo_nd_sflight->bind_table( t_table1 ).
ENDMETHOD.
Maybe you are looking for
-
Hi All, I have created a room using the "Room Creation" Wizard. on the first screen i had Name : Description: Owner: Categories: Template: Template Description: and on the next screen i had Room Type: Room members: i filled all the above fields and c
-
G5 upgraded to Leopard - failed - installed Tiger on EHD - what next?
When my G5 iMac failed, the repairers put in a new power supply and a new HD. But they had no Tiger instal disks and I didn't think to supply mine. So they gave me Leopard instead (but no disks). Since then I have seen faults develop, mostly at login
-
How to Debug ATG Apllication in eclipse juno
Hi , Am new to ATG, I have existing project which i imported using import option. can any one please let me know 1.Settings for debug in eclipse. 2.how to debug ATG application in eclipse with weblogic. Am using weblogic 10.3.6 server and IDE is ecli
-
Files not being shared across IoS devices
Why are my files on my iPad not shared with my iPhone?
-
How to configure sendmail to act as a mail gateway and relay mails???
I installed the Solaris (Intel) v.8 (10/01) in my external network. Now, I want to configure it as a mail server and as a mail gateway between my internal mail host and itself. I think I have read all documentation which comes in Answerbook2 about ma