cancel
Showing results for 
Search instead for 
Did you mean: 

no data is displayd on the table

Former Member
0 Kudos

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.

*

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks a lot

Former Member
0 Kudos

HI

Madhu2004
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

hi urbashi.......

make sure that your table is bound to the internal table that is returned by the bapi.... and check for your logic too.

---regards,

alex b justin

Former Member
0 Kudos

HI ALEX,

reallly sorry 4 bothering you....but dis is completely new to me...

The question is how do i bind the table to the internal table returnd by the BAPI??

Regards,

Urvashi

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

HI SHISHIR,

thanks a lot for the help but its showing a run-time error of " Number of Elements of the Collection of Node COMPONENTCONTROLLER.1.DISPLAY_PAYMITEMS Violates the Cardinality."

Please help.

thanks and regards

Urvashi

Madhu2004
Active Contributor
0 Kudos

Hi,

Just change the cardinality of the node to 0..n.

Thankyou,

Madhu

Former Member
0 Kudos

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

Former Member
0 Kudos

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...

Former Member
0 Kudos

hi urbashi.......

what you have done is partly right....

you are using

DISPLAY_PAYMITEMS->bind_table( ITAB1 )

fine..

but there is no need for passing it again to the bapi.....

moreover before binding to display_payitems, check the values of itab1.

---regards,

alex b justin

Former Member
0 Kudos

HEY HI,

thanks u sooooo much...d data is getting displayd in the table..........

Thanks a ton,

Regards,

Urvashi

Former Member
0 Kudos

Hi Shishir,

thanks a ton, ur method solvd ma prob....well just wantd to ask u hw do we make a group which contains labels and input fields, visible or invisible..

when the application runs ,it should b invis but when i click a button,it should be shown

Thanks n regards

Urvashi

Former Member
0 Kudos

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...

Former Member
0 Kudos

hey i greated a context node of that type wdy_boolean and i binded the group to that context node,but where do i need to set dat property abap_true,

regards,

urvashi

Former Member
0 Kudos

hi urbashi........

just read the attribute which is bound to the visibility property of the group.

attr1 = abap_false or true.

then bind it back again.

you can write it in the on action event.

---regards,

alex b justin

Former Member
0 Kudos

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...

Former Member
0 Kudos

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 ).

Former Member
0 Kudos

DEAR ALL,

Thanks a lot...its working....really appreciate ur gesture...

Thanks

Former Member
0 Kudos

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...