Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

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.

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

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

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

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

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

After Selecting Pager CTable looks like below screen Shot.

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

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.

Activate all.

In put :

Enter Sales Document Click on Display for Output.

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

1 Comment
Labels in this area