Skip to Content
Author's profile photo Krishna Reddy B

How To Create Client Table( CTable ) With Pages Part -2.

Go to -> How To Create Client Table( CTable ) With Pages Part -1.

Go to created CTable Column->right click->Insert Cell Editor->create Element VBELN of type Text View.

/wp-content/uploads/2013/05/img18_217208.png

/wp-content/uploads/2013/05/img19_217210.png

Repeate this step for all columns by creating elements for POSNR,MATNR,ARKTX and ZMENG.

/wp-content/uploads/2013/05/img20_217214.png

Select CTable->Go to properties window->bind data source property with CTable node.

/wp-content/uploads/2013/05/img21_217215.png

/wp-content/uploads/2013/05/img22_217216.png

Select VBELN Text View under CTable Column->Go to properties->Bind Text Property with CTable node attribute VBELN.

/wp-content/uploads/2013/05/img23_217223.png

Repeat this by binding all Text Property of all attributes to respective context Ctable node attributes.

/wp-content/uploads/2013/05/img24_217224.png

Go to CTable->Properties->Navigation Property->Select Pager.

/wp-content/uploads/2013/05/img25_217225.png

After Selecting Pager CTable looks like below screen Shot.

/wp-content/uploads/2013/05/img26_217229.png

Go to Actions Tab->Display action->Write Sample Code Like Below.

/wp-content/uploads/2013/05/img27_217230.png

Header 1

method ONACTIONDISPLAY .

  DATA lo_nd_input TYPE REF TO if_wd_context_node.
 
DATA lo_el_input TYPE REF TO if_wd_context_element.
 
DATA lv_vbeln    TYPE wd_this->Element_input-vbeln.

  DATA lo_nd_ctable TYPE REF TO if_wd_context_node.
 
DATA lo_el_ctable TYPE REF TO if_wd_context_element.
 
DATA ls_ctable    TYPE wd_this->Element_ctable.
 
DATA lt_ctable    TYPE wd_this->Elements_ctable.
* navigate from <CONTEXT> to <INPUT> via lead selection
  lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
* get element via lead selection
  lo_el_input = lo_nd_input->get_element( ).

  IF lo_el_input IS NOT INITIAL.* get single attribute
    lo_el_input->get_attribute(
     
EXPORTING
        name = 
`VBELN`
     
IMPORTING
       
value = lv_vbeln ).
 
ENDIF.

  IF lv_vbeln IS NOT INITIAL.
* navigate from <CONTEXT> to <CTABLE> via lead selection
    lo_nd_ctable = wd_context->get_child_node( name = wd_this->wdctx_ctable ).

    SELECT vbeln
           posnr
           matnr
           arktx
           zmeng
FROM VBAP
                
INTO CORRESPONDING FIELDS OF TABLE lt_ctable
                
WHERE vbeln = lv_vbeln.

    lo_nd_ctable->bind_table( lt_ctable ).

  ENDIF.
endmethod.

Goto Componet->Create->Webdynpro Application.

/wp-content/uploads/2013/05/img28_217231.png

Activate all.

/wp-content/uploads/2013/05/img29_217232.png

In put :

Enter Sales Document Click on Display for Output.

/wp-content/uploads/2013/05/img30_217233.png

Out put : CTable with Pages looks like this. You can navigate to Pages by clicking on Page number or Forward Button.

/wp-content/uploads/2013/05/img31_217234.png

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      nice document...