Quantcast
Channel: SCN : Document List - Supplier Relationship Management (SAP SRM)
Viewing all articles
Browse latest Browse all 198

Add custom field to SC and POWL

$
0
0

In this document you learn how to add custom fields in the shopping cart. Then we will see how to add these fields in POWL.

This can also be applied to other business objects.

Adding the custom field in SC

Go to the following path in SPRO:

SAP Supplier Relationship Management -> SRM Server -> Cross-Application Basic Settings -> Extensions and Field Control (Personalization)

1.JPG

Define customer fields at Header Level.

Within Configure Customer Fields -> Define Customer Fields on Header Level we need to add the field in two places:

2.JPG

Append the field first in Append for Customer Cross-Document Database Fields on Header. Create a new Append Structure if you have not any:

3.JPG

Add the field you want (should start with ZZ) in my case I have created a data element that is a CHAR 4 with a domain with some values.

4.JPG

Don’t active the structure yet, we need to add the field in another structure and it takes a lot of time in the activation so we are going to active both structures at the same time.

Append the field also in Append for Customer Fields on Shopping Cart Header you need to create also another Append Structure if you have not any.

5.JPG

Now, active both structures don’t worry it takes a lot of time.

6.JPG

Configure field control.

For display the field we need to add it in Configure Field Control -> Configure Control for Fields on Header Level -> Metadata for Fields on Document Headers

7.JPG

Add a new entry for BUS2121 and mark it as Enabled and Visible:

8.JPG

At this point you can define a dynamic class and method for control de visualization of the field. For this example is not necessary but if you want only need to create a class with Super Class /SAPSRM/CL_PDO_DYN_META_FIELD and a method with the following parameters:

9.JPG

With the parameter CS_METADATA you can modify the visualization of the field dynamically.

Now the field is displayed:

10.JPG

Now the objective is add this field as selection criteria in POWL:

11.JPG

Adding the custom field in POWL

 

 

 

Add the field in DB Criteria

First we need to add this field in the structure /SAPSRM/S_SEARCHFIELDS. Create an Append Structure and add the field:

1.JPG

Now we need to add this field also in the view /SAPSRM/V_SRC_CR. So go to SM30 and add the field:

sm301.JPG

 

sm302.JPG

 

We need to know which the feeder is used for SC for continue.


 

EDIT: I think this document is more accurate to find the correct POWL we need to use.
How to identify  SRM POWL details and control the actions 


Go to the following path in SPRO:

SAP Supplier Relationship Management à SRM Server à Cross-Application Basic Settings à POWL and Advanced Search.

4.JPG

Enter in Define Default POWL Application for Advanced Searchand look up the Query Id for the object type BUS2121. We can see that is SAPSRM_AL_PURCHASING_02_01.

5.JPG

Now go to the transaction POWL_QUERYand find this Query Id.

6.JPG

Do double-click there and you can see what the feeder is.

7.JPG

Ok, return to SPRO and go to Adjust POWL Layout, Search Criteria, and Pushbuttons (transaction /SAPSRM/POWL_CUST).

8.JPG

Find the feeder type and select DB Criteria and add a new line with the field. At this point you can assign the search help used for this field in POWL.

9.JPG

Now, if you go to POWL you don’t see the field yet. Why?. You need to ‘refresh’ the Query. For do that go to se38 to the program POWL_D01set your user and mark Display. Then choose the correct feeder and use the Delete query button.

10.JPG

11.JPG

Now the field is displayed.

12.JPG

Note:If some errors are displayed when you use the custom field check this note:

Note 1555113 - Dump occurs when searching for customer fields

 

 

Note: There is a problem if you have a custom field at header and item level with the same name. You should define fields with different names at header and item level. If the field exists at header level, this will always have priority, if it does not exist there; the search continues to item level.

 

Add the field in result list

If you also want to display the field in the result list is necessary to add it in the structure /SAPSRM/S_POWL_RESULT_SC_ITM. There is an include reserved for this purpose INCL_EEW_PD_SEARCH_HDR_CSF_SC“Cust.Enhancements in Shoppg Cart Header: Search Results”. Create an Append structure in this structure and add the field.

Return to SPRO Adjust POWL Layout, Search Criteria, and Pushbuttons  or transaction /SAPSRM/POWL_CUSTand add the field.

14.JPG

15.JPG

Refresh the query with the program POWL_D01and now the field is also displayed in the result list.

16.JPG

 

    Change POWL dinamically

Within the enhancement spot /SAPSRM/BD_CLL_POWL_FEEDERyou have four Badi Definitions for change the behavior of POWL.

1.JPG

Let see a tiny example of use of one of these BADI definitions, goto SE18 and choose Display.

2.JPG

Expand the node /SAPSRM/BD_POWL_CHNG_SELCRIT and choose Create BADI implementation.

3.JPG

First, create the Enhancement implementation. Choose “New” and create a new one.

4.JPG

Then choose it and push Ok:

5.JPG

Now, create the BADI Implementation:

6.JPG

Now, if you want you can define a filter for specify with wich feeder the badi will be triggerd, is good to do it but in this case is not necessary we’re going to control it by code. So, go to the implementing class:

7.JPG

In the signature of the method you have the parameters you need to know the feeder and application ID.

8.JPG

Let’s see a sample code for hide the field or change the search help is used:

  DATA: ls_selcriteria LIKE LINE OF ct_selcriteria.  IF iv_flt_powl_type   EQ 'SAPSRM_FEEDER_SC_PROF'.    READ TABLE ct_selcriteria INTO ls_selcriteria WITH KEY selname = 'ZZ_CUSTOM_FLD'.    IF sy-langu EQ 'ES'. "Put here the condition you want...      ls_selcriteria-hidden = 'X'.    ELSE.      ls_selcriteria-ddic_shlp = 'ZZ_OTHER_DDIC_SHELP'.      ls_selcriteria-mandatory = 'X'.    ENDIF.    MODIFY ct_selcriteria FROM ls_selcriteria INDEX sy-tabix.  ENDIF.

Related Content

http://wiki.sdn.sap.com/wiki/display/WDABAP/Documentation+Information+about+POWL

http://wiki.sdn.sap.com/wiki/display/WDABAP/POWL

http://wiki.sdn.sap.com/wiki/display/WDABAP/FAQ+ABOUT+POWL


Viewing all articles
Browse latest Browse all 198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>