cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Editable Table in Webdynpro Applications

Former Member
0 Kudos

Hi All,

I am developing an ABAP webdynpro application where an employee can claim their medical claims through this application. In the application I need to add one Table with all the fields editable through which the usercan claim n number of claims at a time.

I have already added 1 table with 10 columns each with Input Field attribute and also the read only flag is not ticked for them. But I am not getting the fields as editable.

Please suggest me how we can get a table with all the rows editable.

Regards,

Pravesh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

For getting the table in editable mode u need to first initialize the table.

Following is the code for initializing the code.

DATA lo_nd_cn_try TYPE REF TO if_wd_context_node.

DATA lo_el_cn_try TYPE REF TO if_wd_context_element.

DATA ls_cn_try TYPE wd_this->element_cn_try.

DATA ls_cn_try1 TYPE wd_this->elements_cn_try.

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

lo_nd_cn_try = wd_context->get_child_node( name = wd_this->wdctx_cn_try ).

do 5 times.

clear ls_cn_try.

append ls_cn_try to ls_cn_try1.

lo_nd_cn_try->bind_table( ls_cn_try1 ).

enddo.

Here cn_try is the node which is binded with the table.

For making more rows Editable run the above DO loop for more times.

e.g. if u want 10 rows editable then run the loop for 10 times.

Regards

Pankaj Aggarwal

Former Member
0 Kudos

Hi Pankaj/Arjun,

I did exactly what you have said. But Still the rows are not editable. Infact all the numeric fields in my table has been intialized (ie default values 0.00).

Please let me know where I might be getting it wrong.

My code is as follows :

DATA lo_nd_claim_det TYPE REF TO if_wd_context_node.

DATA lo_el_claim_det TYPE REF TO if_wd_context_element.

DATA ls_claim_det TYPE wd_this->element_claim_det.

DATA lt_claim_det TYPE wd_this->elements_claim_det.

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

lo_nd_claim_det = wd_context->get_child_node( name =

wd_this->wdctx_claim_det ).

clear ls_claim_det.

DO 10 TIMES.

APPEND ls_claim_det TO lt_claim_det.

ENDDO.

CALL METHOD lo_nd_claim_det->bind_table

EXPORTING

new_items = lt_claim_det.

Regards,

arjun_thakur
Active Contributor
0 Kudos

Hi,

Use this code to remove the initialization of the input field:


DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
  DATA lv_abc TYPE wd_this->element_context-abc.
 
* get element via lead selection
  lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
  IF lo_el_context IS INITIAL.
  ENDIF.
 
** get single attribute
  lo_el_context->set_attribute_null(
    EXPORTING
      name =  `ABC` "ABC is the name of attribute of 'i' type
).

Regarding the table in editable mode, I am not able to understand that why you are not getting the table in editable mode. Just want to make sure that you are using input field in the table? Right?

Regards

Arjun

Answers (3)

Answers (3)

Former Member
0 Kudos

thanks

arjun_thakur
Active Contributor
0 Kudos

Hi,

Try this code:



DATA lo_nd_cn_node2 TYPE REF TO if_wd_context_node.

  DATA lo_el_cn_node2 TYPE REF TO if_wd_context_element.
  DATA: itab2  TYPE wd_this->elements_cn_node2. " cn_node2 is the name of node binded to the table
     
* navigate from <CONTEXT> to <CN_NODE2> via lead selection
  lo_nd_cn_node2 = wd_context->get_child_node( name = wd_this->wdctx_cn_node2 ).

*clear itab.
DO 10 TIMES.

APPEND INITIAL LINE TO itab2.

ENDDO.

lo_nd_cn_node2->bind_table( itab2 ).

Regards

Arjun

Former Member
0 Kudos

Hi,

[]

[]