Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Store Ordering is one among the work set provided by The Business Package, In Store Merchandise and Inventory Management. With this work set, the store manager can create store order follow-on documents, retrieve and view the generated documents. Based on the Customizing settings, the follow-on documents can be purchase orders, purchase requisitions, or deliveries.

For creating Purchase Orders of different type we need certain fields as mandatory fields. Vendor Number and Supplying Site are two much mandatory fields for purchase order creation based on the type of purchase order created.  We need Vendor number as mandatory field for some type of purchase orders and Supplying Site for some type of purchase orders. For example, Standard Purchase Orders (Type – NB) we need Vendor Number and for Stock Transport Order (Type UB) we need Supplying Site instead of Vendor No. 

In standard Webdynpro application for creating purchase orders, instead of using two separate input fields for these Vendor Number and Supplying Site a single field is used. As a single input field is used for capturing both the Vendor Number and Supplying Site, we need to attach the search help to the field which need to list for Vendor Number and for Supplying Site. 

A standard Webdynpro component WDC_WSVD_VNDR_PLANT_SRCH is available for providing the Vendor/ Site Search Help to a field. This document will explain the steps to reuse this search help to a custom field in a custom Webdynpro application so to list Vendor number and Site. 

Step 1: Specify the component to be reused WDC_WSVD_VNDR_PLANT_SRCH under the Used Components of the custom Webdynpro application.

              

Among the filter criteria for this search for Vendor/ Site, Material Number is also there. And a material search help is attached among this material no field. For using this material no search help field in the filter criteria of this Vendor/Site search help, we need to reuse one more standard Webdynpro component WDC_WSAM_SHMAE_SEARCH_MAT. This also needs to get included among the reused component.

                  

Step 2: Declare the Used controllers under the used controllers tab of the component controller.

                      

Step 3: Create the context nodes 

From the left hand side of the component Controllers context node, the contexts of the used controllers are visible as follows:

                        

                           

Create context node in the component controller, to hold the Vendor/ Site value. This is the value to which we are going to attach the search help.

 

The type of this field needs to be WSPO_WD_VNDR-VNDR_ID. 

Step 4: Search Help – Freely programmed 

For attaching the above mentioned search help for the used controller, we need to change the Input Help Mode as Freely Programmed. In the option Input Help Component Usage assign VNDR_PLANT.

                             

On selecting ENTER; we can see the next option after the Input Help Mode will be Input Help Component Usage.  The following values will get listed in the search help for his Input Help Mode will be Input Help Component Usage field. 

                                

                           

Step 5: Create an External Mapping to the N_SHVDST_CRIT and N_SHVDST_CRIT_VIS node of the VNDR_SITE Component. 

For creating an external mapping to these nodes, create a copy of similar nodes using drag and drop method and select the nodes as Interface nodes.

                             

Step 6: Create an internal mapping of the component controller context to the view controller context using drag and drop method.

                                

Step 7: Create a view element of type InputField and create a binding to the context attribute VEN_SITE.

                                  

Step 8: Create an event on open of the Vendor Site Search Help and assign the default article.

                                     

Write the below code to default the Article Id and for the fields to get visible in the search help filter criteria.

DATA: lo_interfacecontroller      TYPE REF TO iwci_wdc_wsvd_vndr_plant_srch,
            lo_nd_n_shvdst_crit      
TYPE REF TO if_wd_context_node,
            lo_el_n_shvdst_crit       
TYPE REF TO if_wd_context_element,
            lo_nd_n_shvdst_crit_vis
TYPE REF TO if_wd_context_node,
            lo_el_n_shvdst_crit_vis 
TYPE REF TO if_wd_context_element.

DATA: ls_n_shvdst_crit             TYPE wd_this->element_n_shvdst_crit,
           ls_n_shvdst_crit_vis      
TYPE wd_this->element_n_shvdst_crit_vis.

*-- Componenet usage
  lo_interfacecontroller
wd_this->wd_cpifc_vndr_site( ).

*-- Call interface method to adjust parameter
  lo_interfacecontroller
->set_vh_request_focus( iv_request_focus = abap_true ).

*-- Set default Article ID as ARTN
  lo_nd_n_shvdst_crit
= wd_context->get_child_node( name = wd_this->wdctx_n_shvdst_crit ).
 
IF lo_nd_n_shvdst_crit IS NOT INITIAL.
    lo_el_n_shvdst_crit
= lo_nd_n_shvdst_crit->get_element( ).
   
IF lo_el_n_shvdst_crit IS INITIAL.
      lo_el_n_shvdst_crit
->get_static_attributes( IMPORTING static_attributes = ls_n_shvdst_crit ).
      ls_n_shvdst_crit
-matid = cl_wsrs_tools_logistics=>gc_matid_material."ARTN
      lo_el_n_shvdst_crit
->set_static_attributes( EXPORTING static_attributes = ls_n_shvdst_crit ).
   
ENDIF.
 
ENDIF.

*-- Set Visiblity for the filter criteria fields
  lo_nd_n_shvdst_crit_vis
= wd_context->get_child_node( name = wd_this->wdctx_n_shvdst_crit_vis ).
 
IF lo_nd_n_shvdst_crit_vis IS NOT INITIAL.
    lo_el_n_shvdst_crit_vis
= lo_nd_n_shvdst_crit_vis->get_element( ).
   
IF lo_el_n_shvdst_crit_vis IS NOT INITIAL.
      lo_el_n_shvdst_crit_vis
->get_static_attributes( IMPORTING static_attributes = ls_n_shvdst_crit_vis )
     
ls_n_shvdst_crit_vis-vndr_id       = cl_wd_abstract_input_field=>e_visible-none.
      ls_n_shvdst_crit_vis
-vndr_type     = cl_wd_abstract_input_field=>e_visible-visible.
      ls_n_shvdst_crit_vis
-plantcat      = cl_wd_abstract_input_field=>e_visible-none.
      ls_n_shvdst_crit_vis
-name_1        = cl_wd_abstract_input_field=>e_visible-visible.
      ls_n_shvdst_crit_vis
-city          = cl_wd_abstract_input_field=>e_visible-visible.
      ls_n_shvdst_crit_vis
-post_code1    = cl_wd_abstract_input_field=>e_visible-visible.
      ls_n_shvdst_crit_vis
-mat_key       = cl_wd_abstract_input_field=>e_visible-visible.
      ls_n_shvdst_crit_vis
-local_vendors = cl_wd_abstract_input_field=>e_visible-none.
      lo_el_n_shvdst_crit_vis
->set_static_attributes( EXPORTING static_attributes = ls_n_shvdst_crit_vis ).
   
ENDIF.
 
ENDIF.

Output:-