Skip to Content

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 Search and 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_QUERY and 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_D01 set 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_CUST and add the field.

14.JPG

15.JPG

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

16.JPG

    Change POWL dinamically

Within the enhancement spot /SAPSRM/BD_CLL_POWL_FEEDER you 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

To report this post you need to login first.

35 Comments

You must be Logged on to comment or reply to a post.

  1. Salavat Petrov

    I have not received a selection criterion in the POWL πŸ™ . After execution of the method / SAPSRM/CL_CLL_POWL_BO_RFQ-SET_MT_SELCRITERIA, MT_SELCRITERIA table doesn’t have custom fields.

    My Feeder Type : SAPSRM_FEEDER_RFQ

    OBJECT_TYPE: BUS2200

    (0) 
    1. Kiran MV

      Hi,

      Try executing the reports POWL_D04 and POWL_D01 for your POWL query, after making changes in the structure.

      Regards,

      Kiran

      (0) 
  2. Hazem Daoud

    Hello,

    Thanks a lot for this great information. But i am not able to display new field on my SC in the SRM 7.0 portal. In fact i want to add MANU_PROD field at item level. I followed what you said but still can’t get the field displayed πŸ™

    Here are the steps:

    1- SAP Supplier Relationship Management -> SRM Server -> Cross-Application Basic Settings -> Extensions and Field Control (Personalization)  -> Configure Field Control -> Configure Control for fields on Item Level.

    2- I select then Metadata for Fields on Item Level and add new entry for the field MANU_PROD.

    3- After saving i open an old SC from portal but the new field is not displayed.

    Any help please?

    (0) 
    1. Ricardo Romero Mata Post author

      Hi Hazem,

      This document is for add custom fields.
      For add standard fields that are not visible sometimes is not sufficient with add the field in the customizing, may be you need a user role or other thing… i don’t know in this case… πŸ™

      Open a new thread in SRM community maybe someone has the solution.

      (0) 
  3. Hazem Daoud

    Is it through web dynpro?If yes, when i try to create new enhancement, a popup is displayed asking for access key. Should i have such key from SAP or am i missing something?

    Thanks.

    (0) 
    1. naveen rajan

      It could be your developer key and not an access key. So verify that.

      Because it will never prompt for an access key when you are enhancing the web dynpro component.

      Regards,

      Naveen

      (0) 
  4. Ruija HUANG

    Hi Ricardo,

    Thanks for this doc at first. we want to add a custom field in PO which should be displayed in multi tabs (ex . field zprint displayed in general data tab and output tab). How can we do that?

    Regards,

    Ruijia

    (0) 
  5. V N SANTOSH KUMAR KUPPILI

    Hi Ricardo,

    This is the procedure I had implemented for enhancing POWL. Everything is working fine, but I see a issue in the update of field for every user. I mean, for every user we need to do some initialization procedure to make the BADi hit for first time. Only after this, I am able to see the custom field in POWL. Is there any procedure to get rid of this?

    Thanks,

    Santosh.

    (0) 
    1. Ricardo Romero Mata Post author

      Hi Santosh,

      The implementation of the badi is optional, you don’t need to do it to show the field in POWL. I don’t know what can be your problem, Did you use the report POWL_D01 to refresh the query?

      If you followed all the steps and doesn’t work may be you ought to create a new thread in the SRM forums. πŸ˜‰  

      (0) 
    1. Ricardo Romero Mata Post author

      Hi Kiran,
      You can create your own data element for the custom field and assign the search help there. Or you can assign the search help to your custom field in the append structure.

      (0) 
    1. Rohit Mahajan

      Hi Pankaj,

      In the feeder class of particular BO we need to do that. For Which BO you are looking for?

      The method GET_SEARCH_CRIT is used for that, Please check the Feeder class for that BO and do that or you tell the BO I will let you know the BO for same.

      Best regards,

      Rohit

      (0) 
      1. Pankaj Pathak

        Hi Rohit,

        I have to do it for Confirmations (BUS2203). Can you plz explain me in detail? This is feeder type I can see for my requirement SAPSRM_FEEDER_CONF_ESS. Do you mean to say that I can’t achieve this through configuration and I have to make changes in ABAP Webdynpro application?

        Thanks and Regards,

        Pankaj

        (0) 
        1. Rohit Mahajan

          Hi Pankaj,

          You can maintain this the configuration for This in POWL node with SPRO for this feeder.

          It will read these entries which are maintained there.

          Run The report POWL_D01 after that and you will see the changes on UI.No need for Webdynpro changes.

          Best regards,

          Rohit

          (0) 
          1. Pankaj Pathak

            Rohit,

            I can also find Status field for my feeder in SPRO but how should I add a new value in Status field. I could not find anywhere those values maintained (Saved, Awaiting Approval, Release Rejected). It just gives properties of the field like dropdown, enabled/disabled etc.

            Thanks and Regards,

            Pankaj

            (0) 
  6. Ashish Bansal

    Quite Nicely explained.

    I am able to achieve

    Label _____ Text Box

    Can you please let us know how to add a label field. For Example:

    Label _____ Text Box _____ Label Description of Text Box Value

    (0) 
    1. Ricardo Romero Mata Post author

      Hi Ashish,

      If you want to add a Description you have to create an enhancement point in the standard webdynpro… Add the attribute in the context using the wizard and then add the label, the field and the description in the layout.

      The customizing is still working for hide or show the field. But you have to bind the visible attribute of the label and the description to the property visible of the text box.

      Regards.

      (0) 
  7. K LOKESH

    Hi,

    I tried this Same issue.

    My Feeder Class:POWL Query_feeder.png

    But After Execution my Feeder class was not displaying in report.

    /wp-content/uploads/2015/03/report_657042.png

    Anybody can u suggest .Field also not displaying in SC.

    Regards

    Lokesh

    (0) 
  8. Sarmath Syed

    Dear ,

                   Thanks for your document, i followed the above procedure and executed POWL_D01 program too but still am not able to see my custom field on scree. please help me to get it displayed.

    Regards,

    Syed

    (0) 
  9. Negrea Madalin

    Hello

    Thanks for the great how to instruction
    Perfect, for me worked perfect to add some standard fields and custom fields to SC and to Search Criteria , but i have a β€œsmall” problem with last part : Add the field in result list

    So i followed all steps to add the fields in the result list, i can see the fields ( i have added for example Vendor to see the supplier in the result list ) , but the field is totally empty, no value inside even do inside the SC vendor exists

    Can anyone support what it’s wrong or what else i must do to get data inside the fields , so fields are now visible but all of them empty

    As you can see i can see them in the settings for the result list, i made them visible
    i can see them but all of them are empty – no values, no error
    All of them are standard except YIRAS number

    and the first part works great – i added them in search criteria, and they work properly
    I can do search / filter based on them EXCELENT

    Β 

    (0) 
    1. Ricardo Romero Mata Post author

      Hi Harendra,

      The steps are the same. You have to add the fields in both structures; cross-document and specific document. The rest os the steps are the same.

      Regards.

      (0) 

Leave a Reply