How to create a basic WebDynpro alv

Double-click on WD application.

 1

Enter component name on the following screen.

 2

Double-click on ‘COMPONENT CONTROLLER’ and click on ‘PROPERTIES’ tab

Click ‘Create Controller Usage’ button.

Select two components on the following screen.

 3

Create node at Component Controller Contex.

Double-Click on Interface Controller Usage.

 4

Click on ‘Controller Usage’ button on the following screen.

Drag and drop your node from Component Controller to Interface Controller.

 5

Create a ViewContainerUIElement on layout.

 6

Go to your defined Window and Create an ‘Embed View’ to your view.

 7

 8

Open your view’s WDOINIT method and write the following codes.

  datalo_node type ref to if_wd_context_node.

  datait_aoz type standard table of if_v_main=>element_aoz_table,

        is_aoz like line of it_aoz.

  select from zanil

  into corresponding fields of table it_aoz.

  lo_node wd_context->get_child_nodename ‘AOZ_TABLE’).

  lo_node->bind_tableit_aoz ).

 10

Program to get report of transport requests

Selection-Screen

1

 

Result:

2

Codes:

 

report  zanil.

tablestmsbufreqtstrfcofile070.

type-poolsctslgslisicon.

data:

gt_fcat type slis_t_fieldcat_alv  ,

gs_fcat type slis_fieldcat_alv    .

databegin of tt_request occurs 0,

trkorr  like e070trkorr          ,

as4date like e070as4date         ,

as4user like e070as4user         ,

end of tt_request.

databegin of tt_text occurs 0   ,

trkorr  like e07ttrkorr          ,

as4text like e07tas4text         ,

end of tt_text.


Click here to download full code


How build fieldcatalog dynamically

Building fieldcat dynamically.

Class-Method:

 1

Parameters:

 2

 

Codes:

 

data lt_fieldcat type slis_t_fieldcat_alv.

data ls_fieldcat type slis_fieldcat_alv.

data ls_layout   type      slis_layout_alv.

data lo_aele  type ref to cl_abap_elemdescr.

data lo_asdes type ref to cl_abap_structdescr.

data ls_dfies type        dfies.

field-symbols <fs_comp>  

          like line of lo_asdes->components.

field-symbols <fs_field> type any.

* Creating Structure Obj.

lo_asdes ?= cl_abap_structdescr=>describe_by_data(

   p_data is_structure ).


How to define a button on Selection-Screen toolbar

Selection-Screen:

 

se1

 

Result:

 res

 

Codes:

 

report  zanil.

* Job: Define button on selection screen.

tablessscrfields.

data lv_result type i.

data lv_val    type string.

* Parameters

parametersp_val1 type i obligatory.

parametersp_val2 type i obligatory.

selection-screen function key 1.

initialization.

  move ‘Sum Values’ to sscrfieldsfunctxt_01.

at selectionscreen.

  if sscrfieldsucomm eq ‘FC01’.

     lv_result p_val1 + p_val2.

     lv_val    lv_result.

     message lv_val type ‘S’.

     return.

  endif.