on 06-06-2010 8:54 PM
Hi Guys,
i have a FunctionModule collecting necessary Data of ALL BusinessPartners (means: bapibus1006_central, central_organ, address, etc).
It stores the data for each BP in a Structure, lets call it "BP_data", containing all these abovementioned structures. The FM collects all BPs in a tabletype "BP_data_tab" and returns it.
Resulting a structure like:
- BP_data_tab
- BP_data //first BP
- centraldata
- some attributes
- some attributes
- ...
- organisation
- ...
- address
- ...
- BP_data //second BP
- BP_data //third BP
- ... //many BPs
So far so good.
Now i like to display the attributes in a webdynpro table. One line of the table corresponds to one line in "BP_data_tab", and therefore is a "BP_data" struct.
BUT: After creating the service-call in my componentcontroller, the created context node does contain the elements of "BP_data" as single attributes. As comparation to the example above:
- BP_data_tab
- BP_data //first BP
- centraldata //as atomar type, not node :/
- organisation
- address
- BP_data //second BP
- BP_data //third BP
- ... //many BPs
For example an attribute centraldata of type bapibus1006_central as attribute and not as node as is want it to.
Therefore i cant access the atom attributes of those contained structures. But that's exactly what i need.
Can you please tell me what i messed up?
Thanks!
Philipp
Edited by: Philipp.Heinemann on Jun 6, 2010 9:56 PM
>After creating the service-call in my componentcontroller
What is wrong is that you used the service call wizard. This is a very basic wizard and really only good for simple services when you are first learning Web Dynpro ABAP. You shouldn't come to rely upon it as part of your development tools. It can't for instance handle nested structures as in your example.
You will need to delete the attributes that it created for the substructures and recreate them as nested nodes in the context. You can then either replace the code the wizard generated or try and adjust it. You will need to popuplate the sub-nodes of the context.
You can loop through the parent elements and create child node elements that are dependent upon the parent elements like such:
****Loop Through all the Items
DATA element_set TYPE wdr_context_element_set.
DATA ls_product TYPE sdemo_pd_with_price.
DATA lt_product_name TYPE sdemo_pd_na_tt.
FIELD-SYMBOLS <wa_set> LIKE LINE OF element_set.
FIELD-SYMBOLS <wa_item> TYPE sdemo_so_item_all.
DATA l_tabix TYPE sytabix.
element_set = lo_nd_sales_items->get_elements( ). "Parent Node - Already Popuplated
LOOP AT element_set ASSIGNING <wa_set>. "Loop through each element of parent node
l_tabix = sy-tabix.
READ TABLE <wa_so>-t_item ASSIGNING <wa_item> INDEX l_tabix. "Read corresponding data form itab
*****Load WDCTX_SCHEDULE_LINES
DATA lo_nd_schedule_lines TYPE REF TO if_wd_context_node.
DATA lt_schedule_lines TYPE wd_this->elements_schedule_lines.
lo_nd_schedule_lines = <wa_set>->get_child_node( name = if_componentcontroller=>wdctx_schedule_lines ).
lt_schedule_lines = <wa_item>-t_sl.
lo_nd_schedule_lines->bind_table( new_items = lt_schedule_lines set_initial_elements = abap_true ).
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the tip...
i created a nested structure in my context of a view as well as a GUI-Table in the Layout.
Afterwards i tried to map the table to elements of the context.
If i chose the parent BP_data (see example above) in the wizard (used to map a table to a structure) it doesnt show the nested nodes and their elements.
Hi,
post this question in webdynpro abap forum to get good response. In your question, as per my understanding all the table lines will be different from each other as u have different business partner information. in case of web dynpro the table line type must be same for every row. showing this data in one table seems tricky or not possible.
If you want to create the node hiereachy as you mentioned, create them manually in component controller and do the mapping with importing exporting parameters of your BAPi call.
Regards
Vishal Kapoor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.