cancel
Showing results for 
Search instead for 
Did you mean: 

Lost data in tabla of WD

Former Member
0 Kudos

Hi all!!... I'm new in this so I'm feeling very lost here, in WebDynpro...

I have a table that should be fill with data from 2 tables, I already selected the data from the tables and put in the one that will be displayed.

What I've done in the method WDDOINIT of my view is the following (I think there is a better way to do this but now, this is the only way that I could do it..)

*********************************************************************

METHOD wddoinit .

DATA:

  • internal tables

t_zappldocs TYPE STANDARD TABLE OF zappldocs,

t_zchecklist TYPE STANDARD TABLE OF zchecklist,

t_zappbpids TYPE STANDARD TABLE OF zappbpids,

node_t_applforms TYPE REF TO if_wd_context_node,

elem_t_applforms TYPE REF TO if_wd_context_element,

stru_t_applforms TYPE if_applforms=>element_t_applforms .

TYPES: BEGIN OF ty_forms,

zidoption TYPE zappldocs-zidoption,

zdescroption TYPE zchecklist-zdescoption,

zpresent TYPE zappldocs-zpresent,

datum TYPE zappldocs-datum,

END OF ty_forms.

TYPES: BEGIN OF ty_zappldocs,

mandt TYPE zappldocs-mandt,

zidapplicant TYPE zappldocs-zidapplicant,

zidprocess TYPE zappldocs-zidprocess,

zidoption TYPE zappldocs-zidoption,

zpresent TYPE zappldocs-zpresent,

datum TYPE zappldocs-datum,

END OF ty_zappldocs.

TYPES: BEGIN OF ty_zchecklist,

mandt TYPE zchecklist-mandt,

zidprocess TYPE zchecklist-zidprocess,

zidoption TYPE zchecklist-zidoption,

zdescoption TYPE zchecklist-zdescoption,

END OF ty_zchecklist.

DATA: t_forms TYPE STANDARD TABLE OF ty_forms,

reg_forms TYPE ty_forms,

reg_zappldocs TYPE ty_zappldocs,

reg_zchecklist type ty_zchecklist.

REFRESH: t_zappldocs,

t_zchecklist,

t_zappbpids,

t_forms.

  • get data from table.

SELECT *

FROM zappldocs

INTO TABLE t_zappldocs

WHERE zidapplicant EQ '0000000006'.

  • get description of process

SELECT *

FROM zchecklist

INTO TABLE t_zchecklist

FOR ALL ENTRIES IN t_zappldocs

WHERE zidprocess EQ t_zappldocs-zidprocess

AND zidoption EQ t_zappldocs-zidoption.

  • get Applicant's details.

SELECT *

FROM zappbpids

INTO TABLE t_zappbpids

WHERE zidapplicant EQ '0000000006'.

  • fill data to be displayed in table

LOOP AT t_zappldocs INTO reg_zappldocs.

READ TABLE t_zchecklist WITH KEY ZIDPROCESS = reg_zappldocs-zidprocess

zidoption = reg_zappldocs-zidoption

INTO reg_zchecklist.

  • read table t_zchecklist with key

reg_forms-zidoption = reg_zappldocs-zidoption.

reg_forms-zdescroption = reg_zchecklist-zdescoption.

reg_forms-zpresent = reg_zappldocs-zpresent.

reg_forms-datum = reg_zappldocs-datum.

APPEND reg_forms TO t_forms.

CLEAR reg_forms.

ENDLOOP.

**********************************************************************************

  • navigate from <CONTEXT> to <T_APPLFORMS> via lead selection

node_t_applforms = wd_context->get_child_node( name = 'T_ZAPPBPIDS' ).

  • BIND

node_t_applforms->bind_table( t_zappbpids ).

DATA:

node_t_forms TYPE REF TO if_wd_context_node,

elem_t_forms TYPE REF TO if_wd_context_element,

stru_t_forms TYPE if_applforms=>element_t_forms .

  • navigate from <CONTEXT> to <T_FORMS> via lead selection

node_t_forms = wd_context->get_child_node( name = 'T_FORMS' ).

node_t_forms->bind_table( t_forms ).

ENDMETHOD.

************************************

in wich zidapplicant will be a parameter that I couldn't create yet and T_forms a node and table that will be display in my dynpro (I already set all the fields text = APPLFORMS.T_FORMS.fieldsname)...

But when I check my Dynpro the only field that I can see is the first one and not the other 3 fields (I already saw the table and has all the data I need.).

Do someone know what could it be?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi alex!

In node_t_forms->bind_table( t_forms )., The table t_forms has 10 rows, and in the dynpro I can see just the first field...

After that instruction SY-SUBRC eq 0... so I thinks that everything is ok...When I click NODE_T_FORMS I can see in the debbug I can see all the information inside the node, and I think I have to see COLLECTION, that contain Standard Table[10x1(8)] that contain the elements....

I think everything is ok so far..

Do I have to de anything else in my code? like read an Attribute or something like that?

The extrange thing is that the first attribute is being display...

I don't have problem for the other node...

I already checked the binding of both and seems to be ok.

Do you have another tips to see what it could be?

Thanks.

Former Member
0 Kudos

hi jorgelina.......

check for the cardinality of the node as 0..n

check whether the internal table and he node are of same structure.

check the values in the internal table before binding.

check whether there are any code in wddomodify that affects this.

--regards,

alex b justin

Former Member
0 Kudos

hI aLEX! Sorry that I didn't give you a response before, the system was down so I could test what you said...

Finally averything is ok, I changed the cardinality but I'm not available to see my data yet. I have nothing in wddomodify (the table is empty here), and the table has the same structure....

What I saw after the binding is the following....

inside NODE_T_FORMS in COLLECTION attribute I have Standard Table[10x1(8)] .... What does it means? that I have 10 rows and just one Column?....

Then I opened the colection attribute and I have 10 rows with this information ->

I reckon that my bind is not working as it is supposed to work...

what can I do?

Former Member
0 Kudos

hi jorgelina.......

10 x 1 means there are 10 values.

in the debugging mode....

double click the node and again double click node_info

in that double click _attributes.

there you can see the values...

try using supply function instead of wddomodify method.

---regards,

alex b justin

Former Member
0 Kudos

What I can see in attribute is:

ATTRIBUTES

after doble click

Field -AT

Data Type Fref

Absolute Type \TYPE=%_T00004S00000185O00000015

View

CF00000000000000

And then in Table Tabs there is no data, so the binding is not working, but, how is posible that the first field is been displayed?

Former Member
0 Kudos

hi jorgelina....

you should not double click attributes....

double click _attributes.

for your convenience.... take all the coding from wddomodify view and put it in wddoinint or the supply function. make sure that thereis no value in wddomodify for it may sometime change the values.

---regards,

alex b justin

Former Member
0 Kudos

Sorry about that, anyway, there is no data in _attributes and all my code is in WDDOINIT...

Former Member
0 Kudos

hi jorgelina.......

these are the steps that has to be followed:

create a context node of some strucute ( eg: mara).

bind it to a table.

in its supply function, uncoment the codings that are present by default.

you willbe having a coding called node->bind_table ( ...... some statements ).

before this statement write all your codings and store it in the internal tables.

now, in bind_table you will have a table which is like new_item = <itab>.

this itab must be your final interanl table.

load all the values into this itab.

so now,

you have written the codings.

passed it to node by statement

node->bind_table( itab ).

this will work.

---regards,

alex b justin

Answers (1)

Answers (1)

Former Member
0 Kudos

hi jorgelina.........

now your t_forms node will be having the values of the table t_forms. and t_zappbpids node will be having the values of the table t_zappbpids .

first have a break point on the bind_table statement for both the nodes and check at that poin whether the tables have any values.

if so... then check the binding of both the nodes to different tables n the screen.

---regards,

alex b justin