on 01-16-2008 10:02 AM
hi all,
i have 3 individual nodes of type structure.
now when i click a particilar button, the attributes of these nodes are taken and supplied to the bapi which den displays the result on the table.
Once when i read all the 3 individual nodes and then call the method as shown below but nothing gets displayd on the table....tried all possible solutions but no luck :[
data itab type standard table of BAPI_BCA_STR_CN_ACCT_EXT.
*
data wa type BAPI_BCA_STR_CN_ACCT_EXT.
*
*
*reading bank-country
DATA lo_nd_account_details TYPE REF TO if_wd_context_node.
DATA lo_el_account_details TYPE REF TO if_wd_context_element.
DATA ls_account_details TYPE wd_this->element_account_details.
DATA lv_bank_country LIKE ls_account_details-bank_country.
navigate from <CONTEXT> to <ACCOUNT_DETAILS> via lead selection
lo_nd_account_details = wd_context->get_child_node( name = wd_this->wdctx_account_details ).
get element via lead selection
lo_el_account_details = lo_nd_account_details->get_element( ).
get single attribute
lo_el_account_details->get_attribute(
EXPORTING
name = `BANK_COUNTRY`
IMPORTING
value = lv_bank_country ).
*reading bank-key
DATA lo_nd_account_details1 TYPE REF TO if_wd_context_node.
DATA lo_el_account_details1 TYPE REF TO if_wd_context_element.
DATA ls_account_details1 TYPE wd_this->element_account_details1.
DATA lv_bank_code LIKE ls_account_details1-bank_code.
navigate from <CONTEXT> to <ACCOUNT_DETAILS1> via lead selection
lo_nd_account_details1 = wd_context->get_child_node( name = wd_this->wdctx_account_details1 ).
get element via lead selection
lo_el_account_details1 = lo_nd_account_details1->get_element( ).
get single attribute
lo_el_account_details1->get_attribute(
EXPORTING
name = `BANK_CODE`
IMPORTING
value = lv_bank_code ).
*reading account-number
DATA lo_nd_account_details2 TYPE REF TO if_wd_context_node.
DATA lo_el_account_details2 TYPE REF TO if_wd_context_element.
DATA ls_account_details2 TYPE wd_this->element_account_details2.
DATA lv_account_number LIKE ls_account_details2-account_number.
navigate from <CONTEXT> to <ACCOUNT_DETAILS2> via lead selection
lo_nd_account_details2 = wd_context->get_child_node( name = wd_this->wdctx_account_details2 ).
get element via lead selection
lo_el_account_details2 = lo_nd_account_details2->get_element( ).
get single attribute
lo_el_account_details2->get_attribute(
EXPORTING
name = `ACCOUNT_NUMBER`
IMPORTING
value = lv_account_number ).
WA-BANK_COUNTRY = lv_bank_country.
WA-BANK_CODE = lv_bank_code.
WA-account_number = lv_account_number.
Append WA to ITAB.
IF SY-SUBRC <> 0.
COMMIT WORK.
ENDIF.
CALL FUNCTION 'BAPI_BCA_PAYMITEM_GET_LIST'
EXPORTING
ACCOUNTIDENT = wa.
*
hi urbashi.....
first place a breakpoint in the code and check whether the bapi returns any value.....
then try executing the bapi from se37 providing the sameset of values and check for the results.
---regards,
alex b justin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Three possible cases may arise in your case:
1) Check if the bapi is returnoing any data
2) If you want to display the data in normal table , check if you have binded the data to the node and binded the node to the table.
3) If you are using ALV map the node containing data to the node called DATA in the interface controller
Regards,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Urbashi Dewan
Check ur bapi 'BAPI_BCA_PAYMITEM_GET_LIST' in se 37 with ur values, if its returning some values there.. if its returning some values, then go debug the wda . try putting break point before the bapi call and check the parameters u are passing.
Regards
Sarath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sharath,
The values i passed to the global variables is stored in the internal table..
and the Bapi is processing it too(i.e it gets passed to the bapi) and it is returning me a table but nothing is displayed in it..and m not using a service call but hard-coding it..Plaese help me solve dis...
Thanks
Hi Urbashi.
Your Web dynpro table must have been bound to a context node.
That node must be having the same structure as your return table from the bapi. Right?
Then after you BAPI call, just bind back the returned internal table (say tab_n0) to the context node (say node_n0) as follows:
DATA:
node_n0 TYPE REF TO if_wd_context_node,
tab_n0 TYPE wd_this->elements_n0.
node_n0 = wd_context->get_child_node( name = wd_this->wdctx_n0 ).
node_n0->bind_table( tab_n0 ).
Hope it helps.
Hi..
RETURN_TABLE is the node which I created which is of the same type as tht of bapi and RETURN is the actual table retrieved from bapi.So I wrote the following code
DATA:
RETURN_TABLE TYPE REF TO if_wd_context_node,
RETURN TYPE wd_this->elements_n0.
RETURN_TABLE = wd_context->get_child_node( name = wd_this->wdctx_n0 ).
RETURN_TABLE->bind_table( RETURN ).
But I get the error:
Type "ELEMENTS_N0" is unknown.
Please help.
HI MADHU,
after setting the cardinality, the error is gone..but still notin gets displayd,
Well letme again tell u d scenerio.
I have 3 global variables created inside a context node...
bank_country type banks,
bank_code type bapibca_dte_bankkey,
acc_no type bapibca_dte_acext,
Now m reading these nodes in that event(search) and then appending it to the workarea.
I now call the bapi which displays the payment items BAPI_BCA_PAYMITEM_GET_LIST.
this bapi has an export parameter accountident of type BAPI_BCA_STR_CN_ACCT_EXT(which is a structure)
and to this parameter i am passing the wa or itab(usually ITAB shows error)
now i create a context node of type BAPI_BCA_PAYMITEM_DETAIL_MED (node name: DISPLAY_PAYMITEMS)
and bind this to the Result(ie a Table)
and then i write this code
DATA:
DISPLAY_PAYMITEMS TYPE REF TO if_wd_context_node,
ITAB1 TYPE wd_this->elements_DISPLAY_PAYMITEMS.
DISPLAY_PAYMITEMS = wd_context->get_child_node( name = wd_this->wdctx_DISPLAY_PAYMITEMS ).
DISPLAY_PAYMITEMS->bind_table( ITAB1 ).
AND FINALLY m passing this ITAB1 to the tables parameter of the bapi BAPI_BCA_PAYMITEM_GET_LIST.
PAYMENTITEMDETAIL = ITAB1. there the parameter PAYMENTITEMDETAIL is a structure of type BAPI_BCA_PAYMITEM_DETAIL_ME.
m i approaching the problem correctly...
Plz help me out cause m new to this whole concept,
Thanks n regards,
Urvashi
Well Urbashi, i suggest you first read the tutorials before heading on to these developments.
Anyway, for your problem, binding of the table should be done AFTER you get the results from the BAPI. What this binding does is that contents of the internal table are passed to the node.
So if you are binding an empty table, context node has an empty table.
Hope it helps...
On any container (like Group or Transparent Container) there is an Invisible attribute.
You can bind that attribute to a context attribute of type WDY_BOOLEAN.
Initially let the value of the context attribute be blank.
So your group will not be visible.
Then when your button is clicked, just change the value of that attribute to ABAP_TRUE. So your group should become visible.
Hope it helps...
Hi Urbashi.
The procedure should be like this:
Create an attribute (say ATT_VISIBLE) in your context which is of type WDY_BOOLEAN.
Bind the "VISIBILE property of your GROUP (in the layout) to this attribute.
So when the view is first displayed, ATT_VISIBLE is blank, which means the entire group will not be visible.
Now when the user clicks on the button, you will be having an action to it and a method associated to that action. Inside that action, read the context attribute ATT_VISIBLE and set it to ABAP_TRUE.
Hope it helps...
HI ONCE I READ THE CONTEXT ATTRIBUTE OF TYPE WDY_BOOLEAN INSIDE THE EVENT(BUTTON-CLICK)
i get this code...so where do i set it to abap_true?
DATA lo_nd_group_vis TYPE REF TO if_wd_context_node.
DATA lo_el_group_vis TYPE REF TO if_wd_context_element.
DATA ls_group_vis TYPE wd_this->element_group_vis.
DATA lv_visible2 LIKE ls_group_vis-visible2.
navigate from <CONTEXT> to <GROUP_VIS> via lead selection
lo_nd_group_vis = wd_context->get_child_node( name = wd_this->wdctx_group_vis ).
get element via lead selection
lo_el_group_vis = lo_nd_group_vis->get_element( ).
get single attribute
lo_el_group_vis->get_attribute(
EXPORTING
name = `VISIBLE2`
IMPORTING
value = lv_visible2 ).
On the click of your button, you need to know whether to make it visible or invisible.
Let's say it's a toggle kind of thing - that is, if it is visible, it will become invisible and if it is invisible, it shall become visible on the click of the button.
To achieve this:
DATA lo_nd_group_vis TYPE REF TO if_wd_context_node.
DATA lo_el_group_vis TYPE REF TO if_wd_context_element.
DATA ls_group_vis TYPE wd_this->element_group_vis.
DATA lv_visible2 LIKE ls_group_vis-visible2.
navigate from <CONTEXT> to <GROUP_VIS> via lead selection
lo_nd_group_vis = wd_context->get_child_node( name = wd_this->wdctx_group_vis ).
get element via lead selection
lo_el_group_vis = lo_nd_group_vis->get_element( ).
get single attribute
lo_el_group_vis->get_attribute(
EXPORTING
name = `VISIBLE2`
IMPORTING
value = lv_visible2 ).
if lv_visible2 = abap_false.
lv_visible2 = abap_true.
else.
lv_visible2 = abap_false.
endif.
lo_el_group_vis->set_attribute(
EXPORTING
name = `VISIBLE2`
value = lv_visible2 ).
Hope it helps...
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.