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

Inconsistent Business Partner handling

$
0
0

If a business partner is no more valid then there is no way to search for the documents which are assigned to this business partner or change the ownership of the document.

 

Feature:

 

This feature enables you to edit or display any document in Supplier Relationship Management (SAP SRM) that is assigned to a business partner who is terminated or whose role has become inconsistent in the SAP SRM org structure. This feature is available from SAP SRM 703 Support Package 06.

 

Allows New business partner to be assigned to a SRM document in case the existing partner is terminated or becomes inconsistent in SRM HR Organization. Thus, allows to create Follow-on documents to be created for documents containing old business partner.

 

This feature also helps us to track transfer of SRM documents from old Business Partner to new Business Partner.

 

 

Information:

 

To use the feature, you have to first activate the Business Function SRM_CONT_IMPR_3 and then activate the Customizing switch Inconsistent Busines Partner handling(SRM_703_TERMIN_EMP) under SRM Server-> Continuous Improvement->  Activate/Deactivate Inconsistent Business Partner Handling.



To view the functionality, visit theYou Tube link: https://www.youtube.com/watch?v=_8GiO2SOEDQ



For complete details about SAP SRM 7.03 refer: SAP SRM 7.03





Assign Supplier button obsolete

$
0
0

To Assign Supplier for a Shopping Cart item, we have to enter the supplier number in the supplier field and click on Assign Supplier Button in Source of Supply tab in Item details.


Feature:

 

This feature enables a shopping cart user to assign the supplier on enter of the value in the Supplier field for any shopping cart item on the Source of Supply tab page. It reduces the additional effort of clicking the Assign Supplier button after entering the value in the Supplier field and thus improves usability. All the validations that used to happen on click of the button applies here too.

 

Information:


To use the feature, you have to first activate the Business Function SRM_CONT_IMPR_2 and then activate the Customizing switch Assign Supplier Button(SRM_702_ASSIGN_SUPPLIER_OBS) under SRM Server-> Continuous Improvement ->  Activate/Deactivate Assign Supplier Button.

 

Note:

 

2045636: Interface Changes - Assign Supplier Button Obsolete

 

 

To view the functionality, visit the You Tube link: https://www.youtube.com/watch?v=xbB1nQV9dQs

 

For complete details about SAP SRM 7.03 refer: SAP SRM 7.03




Formatted Text modules in Business Documents

$
0
0

It is not possible to format long texts. Plain texts can be added as long texts(notes) in SRM documents.

 

Feature:

 

This feature enables the user to format the texts entered in long text boxes. With text formatting options users can emphasize key points and hence improves the readability of the entered text by providing multiple formatting options such as bold, italics, bullets etc.

 

This feature is available in Rfx, Rfx Response, Purchase Order, Central Contract and Shopping Cart Business Object.

 

Ended Rfx.PNG

 

Information:

 

To use the feature, you have to first activate the Business Function SRM_CONT_IMPR_1 and then activate the Customizing switch Text format for long text boxes (SRM_701_TEXT_FORMAT) under SRM Server-> Cross Application Basic Setting->  Activate/Deactivate Text Format for Long Text Boxes.

 

Notes:

 

2045021: Interface Change: Preparation Changes for Text Formatting

2038548: Interface Change: Text Formatting

2039409: Implementation Note for Text Formatting



To view the functionality, visit the You Tube link: https://www.youtube.com/watch?v=GtZOoVAg9EA


For complete details about SAP SRM 7.03 refer: SAP SRM 7.03




New Features of the ABAP Language in NW 7.40

$
0
0

This is a list of new language features in a NW 7.40 system, compared with a 6.20 system.

NEW Operator for Objects

In 7.40, creating an object required a lengthy statement. This has become shorter:

old:
DATA lo_object TYPE REF TO <an interface>.
CREATE OBJECT lo_object TYPE <a class> EXPORTING iv_parameter = 'a value'.
new:
DATA lo_object TYPE REF TO <an interface>.
lo_object = NEW <a class>( iv_parameter = 'a value' ).

It is even possible to create an anonymous object without declaring a variable for it:

NEW object-><a method>( ). 

There is a shortcut which combines declaration and assignment:

DATA(lo_object> = NEW <a class>( iv_parameter = 'a value' ).

In this case, the object type of variable "lo_object" is derived from the NEW operator. The object type is the class "<a class>".

There is another shortcut where the constructor is derived from the declared type. The hashmark denotes the class type infered from the data deeclaration:

DATA lo_object TYPE REF TO <a class>.
lo_object = NEW #( ).

Here, the constructor called is the constructor from the static type "<a class>".

 

NEW Operator for Primitive Data

The NEW operator can be applied to data of primitive types as well. The following looks like auto-boxing in Java. Caution: The access is via reference:

old:
DATA lr_integer TYPE REF TO i.
CREATE DATA lr_integer.
lr_integer->* = 123.
WRITE: /, 'integer value:', lr_integer->*.
new:
DATA(lr_integer) = NEW i( 123 ).
WRITE: /, 'integer value:', lr_integer->*.

The code creates a new integer number intialized with value 123.

There are shortcuts for data creation as well. The hashmark # denotes the data type infered from the variable declaration.:

DATA lr_integer TYPE REF TO i.
lr_integer = NEW #( 123 ).
DATA(lr_string) = NEW string( 'Hello' ).
WRITE: /, 'string value: ', lr_string->*, ', integer value: ', lr_integer->*.

NEW Operator for Structures and Tables

One can create a new structure and initialize some fields of the structure.  The fields are set by fieldname. The access is via reference:

TYPES BEGIN OF t_struct,
               col1 TYPE i,
               col2 TYPE string,
END OF t_struct.
DATA lr_structure TYPE REF TO t_struct.
lr_structure = NEW t_struct( col1 = 123 col2 = 'Hello' ).

There are shortcuts for creation as well.

DATA lr_structure TYPE REF TO t_struct.
lr_structure = NEW #(col1 = 123 col2 = 'Hallo ).

The NEW operator for tables is analogous. The access is via reference.

TYPES t_table TYPE TABLE of t_struct.
DATA lr_table TYPE REF TO t_table.
lr_table = NEW t_struct(  ( col1 = 123 col2 = 'Hello' )
                          ( col1 = 456 col2 = 'Goodbye' )).

The example creates a table with two rows.

Inline Declarations of Variables

It is possible to declare variables inline within an ABAP statement. The type is inferred from the statement.

DATA(lv_integer) = new i( 123 ).
LOOP AT lt_table INTO DATA(ls_line).
...
ENDLOOP.
LOOP AT lt_table ASSIGNING FIELD-SYMBOL(<ls_line>).
...
ENDLOOP.

The two variables lv_integer and ls_line and the field symbol <ls_line> are declared inline.

Caution: ABAP does not know a local scope. I.e. the variable ls_line is NOT ONLY known within the loop. It is known within the whole method.

Creation of Anonymous Complex Data Objects with VALUE

This concept is similar to object literals in JavaScript. A new anonymous data literal is created with keyword VALUE.

TYPES BEGIN OF t_struct,
                col1 TYPE i,
                col2 TYPE string, END OF t_struct.
DATA ls_structure TYPE t_struct.
ls_structure = VALUE t_struct( col1 = 123 col2 = 'Hello' ).

Here, an anonymous data object initialized with values for col1 and col2 is created and assigned to variable "ls_structure".

Unlike the use of NEW operator with complex data, we do not use a reference to the data, we use the data literal directly.

There are shortcuts for creation. The hashmark # can be used in lieu of an explicit data type if the type can be derived from the assignment.

TYPE t_table TYPE TABLE of t_struct.
DATA lt_table TYPE t_table.
lt_table = VALUE #( ( col1 = 123 col2 = 'Hello' )
                    ( col1 = 456 col2 = 'Goodbye' )).

Especially, an anonymous data object can used if a method has a mandatory importing parameter. The data type is derived from the method signature:

DATA lo_object TYPE REF TO <a class>.
lo_object->set_structure( VALUE #( ) ).

In this example, the object's method "set structure" requires an importing parameter of some complex data type. The operator "VALUE #( )" derives the needed data type from the method signature and creates a matching anyonymous object.

Host Variables in OPENSQL Statements

Previously, the ABAP language  and the OPENSQL language were closely intertwined. Especially, an ABAP variable declared in an ABAP statement could be directly used in an OPENSQL statement.

In NW 7.40, the languages try to distinguish between variables in ABAP and in OPENSQL.

old:
DATA ls_sflight TYPE sflight.
SELECT SINGLE * FROM sflight INTO ls_sflight.
new:
DATA ls_sflight TYPE sflight.
SELECT SINGLE * FROM sflight INTO @ls_sflight.

With the new syntax it is more obvious that a variable declared in ABAP  is used within an OPENSQL statement.

Regular Expressions With FIND and REPLACE

It is possible to use regular expressions with FIND and REPLACE:

FIND <regex> IN <a string>.
REPLACE <regex> IN <a string> WITH <new>.

String Operations

No need to use the obnoxious CONCATENATE! One can use '&&' instead:

DATA lv_string TYPE string.
lv_string = 'abc' && 'def' && 'ghi'.

There are new string functions like substring, insert, match, replace, to_upper, to_lower:

DATA lv_substring TYPE string.
lv_substring = substring( val = 'abcdefghi' off = 2 len = 3 ).

String Templates

A string template can be used to create a string from one or more expressions.

Example:

DATA lv_text TYPE string.
lv_text = |{ lo_object1->to_string( ) } { lo_object2->to_string( ) }|.

The string template is embedded in '|'.

Each expression is embedded in curly braces.

Boolean Functions

The function BOOLC can be used to evaluate a Boolean expression. It returns the usual characters 'X' or ' '.

DATA lv_flag TYPE c.
lv_flag = boolc( sy-batch IS NOT INITIAL ).

SAP SRM 7.0 Enhancement Package 3

$
0
0

SAP Supplier Relationship Management (SAP SRM) provides you with innovative methods to coordinate your business processes with your key suppliers and make them more effective. SAP SRM enables you to optimize your procurement strategy, to work more effectively with your supplier pool, and thus to gain long-term benefits from all your supplier relationships.


In this document you can find more information related to SAP SRM 703.


Details about SAP SRM 703


Support Package(SP) 01:

SP01 is available since August, 2013

Porting of SAP SRM to HANA database is done in this SP. For details related to SAP SRM 7.03 SP01 refer: SAP SRM 7.0 Enhancement Package 3 SP01


Support Package(SP) 02:

SP02 is Available since November, 2013

New features are introduced in this SP. The features are introduced as part of Customer Connection initiative. After having released the first set of Fiori Apps for the Shopping Cart, now with SRM 7.03 Support Package 2 the Fiori App for SRM Purchase Order Approval is delivered. For details related to SAP SRM 7.03 SP02 refer: SAP SRM 7.0 Enhancement Package 3 SP02


Support Package(SP) 03:

SP03 is Available since January, 2014

Performance optimizing of POWL by making use of HANA capabilities is done in this SP. For details related to SAP SRM 7.03 SP03 refer: SAP SRM 7.0 Enhancement Package 3 SP03


Support Package(SP) 04:

SP04 is available since April, 2014

Performance improvement is the key deliverable of SP04. For details related to SAP SRM 7.03 SP04 refer: SAP SRM 7.0 Enhancement Package 3 SP04


Support Package(SP) 06:

SP06 is Available since October, 2014

New features are introduced in this SP. The features are introduced as part of Customer Connection initiative. SRM Fiori Carry out Sourcing App is delivered in this SP. For details related to SAP SRM 7.03 SP06 refer: SAP SRM 7.0 Enhancement Package 3 SP06


Useful Links:


Link to RKT Material

 

SAP Enhancement Package 3 for SRM 7.0 Overview

 

SAP Enhancement Package 3 for SRM 7.0 SP Overview

Step by Step Addition of Toolbar Button in Bidder Response at Runtime

$
0
0

It's sometime useful to create toolbar button at runtime to meet the dynamic requirements. For example, we may want to give print of comparative statement to bidder after successful evaluation of bids submitted.

 

a1.PNG

To create the "Comparative Statement" button at runtime as shown above.

 

Step - 1 :  Create Enhancement Implementation for the View "CNR_VIEW" of the  WDA Component "FPM_OIF_COMPONENT".

Step - 2 :  Create Post-Exit for the method "WDDOMODIFYVIEW" of "CNR_VIEW".

Step - 3 :  Write the following Codes in the Post Exit of WDDOMODIFYVIEW.

 

DATA l_cmp_api TYPE REF TO if_wd_component.

DATA l_key        TYPE wdy_config_key.

 

* Get the Configuration ID

   l_cmp_api = wd_comp_controller->wd_get_api( ).

   CALL METHOD l_cmp_api->GET_CONFIGURATION_KEY

     RECEIVING

       CONFIG_KEY = l_key.


* Add Button Only in Bidder Screen

   IF l_key-CONFIG_ID = '/SAPSRM/WDCC_FPM_OIF_QTE_BIDDER'.

     DATA lo_fpm TYPE REF TO if_fpm.

     DATA lo_oif TYPE REF TO if_fpm_cnr_oif.

 

*   Get reference to FPM service object

     lo_fpm = cl_fpm_factory=>get_instance( ).

 

*   Get reference to Toolbar service object

     lo_oif  ?= lo_fpm->get_service( cl_fpm_service_manager=>gc_key_cnr_oif ).

 

CALL METHOD lo_oif->DEFINE_BUTTON        

      EXPORTING

        IV_VARIANT_ID       = 'VARIANT_QTE_BIDD'        " Bidder Varient

        IV_FUNCTION         = 'OTHER_FUNCTIONS'

        IV_ELEMENT_ID     = 'EXTENSIBILITY1'               " 'BIDDER_CS'

        IV_VISIBILITY         = '02'                                    " Yes

        IV_SEQUENCE_ID = '40'

        IV_ENABLED         = 'X'                                      " Yes

        IV_EXPLANATION  = 'Comparative Statement - Bidder Version'

        IV_TOOLTIP           = 'Comparative Statement - Bidder Version'

        IV_TEXT                = 'Comparative Statement'

        IV_ON_ACTION     = 'ZBIDDER_CS'.                   " Action

 

* Render buttons

     WD_THIS->MO_CNR->RENDER_BUTTONS( ).

* Render button choices

     WD_THIS->MO_CNR->RENDER_BUTTON_CHOICES( ).

* Render separators

     WD_THIS->MO_CNR->RENDER_SEPARATORS( ).

* Render duplicate_toolbar

     WD_THIS->MO_CNR->RENDER_DUPLICATE_TOOLBAR( ).

* Render YOU CAN ALSO

     WD_THIS->MO_CNR->RENDER_YOU_CAN_ALSO( ).

* Render RELATED_LINKS

     WD_THIS->MO_CNR->RENDER_RELATED_LINKS( ).

 

     CALL METHOD WD_ASSIST->PREPARE_TOOLBAR

       EXPORTING

         IV_FIRST_TIME = FIRST_TIME

         IO_VIEW       = VIEW

         IO_CONTEXT    = WD_COMP_CONTROLLER->MO_TOOLBAR_NODE.

 

 

 

Step - 4  : Create Post-Exit for the method "ONACTIONBUTTON_PRESSED" of "CNR_VIEW".

Step - 5  :  Write the  Codes in the Post Exit of method "ONACTIONBUTTON_PRESSED" to give print of comparative statement to bidder when button is pressed.

How to control 'Edit' button for business partner

$
0
0
Some users expected to control edit button for supplier maintenance with object B_BUPA_RLT in role authorization.
However In standard SRM design, there is no option for a "readonly" access to the supplier maintainance transaction.Business partner role authorization plays no role in SRM application.
Here, I will introduce the following coding where edit button is control in each place.
1) How to control Edit button while selecting one BP in POWL screen:
edit-1.png
Method ENABLE_BUTTONS (Class /SAPSRM/CL_CLL_POWL_BO_BUPA)
...

* Enable all buttons before check whether they should be disabled
 
CALL METHOD me->enable_all_buttons
   
CHANGING
      ct_action_defs
= ct_action_defs.
...
You may remove 'X' of 'enabled' for edit button in table ct_action_defs.
2) How to control Edit button while displaying the supplier:
edit-2.png
Method UPDATE_ACTIONS (Class /SAPSRM/CL_CH_WD_MAP_IDENT)
...
CALL METHOD io_meta_consumer->get_action_metadata
       
EXPORTING
          iv_set_type
= lv_settype " header set type
          iv_set_key 
= lv_header_guid " header guid
          iv_action  
= ls_idr_action-action " action name
        RECEIVING
          rv_enabled 
= lv_enabled.
...
You may remove 'X' of 'lv_enabled' for Edit button. Then No edit button will be displayed.
3) How to control 'Add lines' and 'Delete' buttons in edit mode of Supplier:
edit-3.png

Method /SAPSRM/IF_PDO_META_CONSUMER~GET_ACTION_METADATA (Class /SAPSRM/CL_PDO_META_MO_SUPP)

...

WHEN /sapsrm/if_pdo_bp_c=>gc_pd_set_suppurdat.
      rv_enabled
= mo_meta_supp_char->get_action_metadata(
                                          iv_set_type
= iv_set_type
                                          iv_set_key 
= iv_set_key
                                          iv_action 
= iv_action      ).

...

Here when /sapsrm/if_pdo_bp_c equals to 'BPD' and iv_action equals to 'delete_item', it will call the following method to enable button 'Delete':

Method /SAPSRM/IF_PDO_META_CONSUMER~GET_ACTION_METADATA (Class /SAPSRM/CL_PDO_META_DO_SUPP_CH)

 

if lv_mode eq /sapsrm/if_pdo_constants_gen_c=>gc_mode_display.
    rv_enabled
= abap_false.
 
elseif lv_mode eq /sapsrm/if_pdo_constants_gen_c=>gc_mode_edit or
         lv_mode
eq 'CREATE'.
   
case iv_action.
     
when /sapsrm/if_pdo_action_c=>gc_action_delete.
        rv_enabled
= abap_true.
     
when others.
        rv_enabled
= abap_true.
   
endcase.


While in 'edit' or 'create' mode, button will always be enabled.
This document will be of help to realize user's own requirement.

Customer exit to consider already ASN-ed quantity in SAR

$
0
0

When creating an ASN document for a Schedule Agreement Release (SAR) in SUS the system will propose the full quantity for all items, even when for some of the items ASN has been created for the full quantity. To consider the already ASN-ed quantity you can implement user-exit MEETA001 in ECC with this sample coding:

 

data: ls_ekeh like i_ekeh,

      lv_menge like i_ekeh-menge.

 

 

loop at i_ekeh into ls_ekeh.

 

  check not ls_ekeh-updkz is initial.

   lv_menge = ls_ekeh-menge - ls_ekeh-dabmg.

   if lv_menge eq 0.

      clear ls_ekeh-updkz.

   else.

  ls_ekeh-menge = lv_menge.

   endif.

   modify i_ekeh from ls_ekeh.

 

endloop.

 

You can adjust the coding to your requirements when needed. As an alternative you can implement the BADI BBP_SUS_FILTER_SCHAR on SUS side to achieve the same effect.


Search for SC using ECC PO number

$
0
0

In Employee POWL for Shopping cart it is not possible to search for Shopping Carts using the Purchase Order number.


Feature:


Employee shall be able to search for Shopping Carts using the Purchase Order number in the Shopping Cart POWL.


Ended Rfx.PNG


Note:


2040513 : Search for SC with PO number in Employee POWL


For complete details about SAP SRM 7.03 refer: SAP SRM 7.03




SAP SRM 7.0 Enhancement Package 3 SP06

$
0
0

As part of SAP SRM 7.03 SP02 based on customer connection requirements, the following features are delivered:

 

Additional status for RFx at end of bidding period:

     A new status, 'Ended', is introduced for RFx at the end of bidding period.


Formatted Text modules in Business Documents:

     User can format texts entered in the long text boxes with text formatting.


Search for SC using ECC PO number:

     Employees can search for SC using ECC back-end PO number.


Inconsistent Business Partner handling:

     Enables you to edit or display any document in SAP SRM that is assigned to a business partner who is terminated or whose role has become inconsistent in SAP SRM Org structure.


Check for open Purchase Order before Contract completion:

     Error or warning message will be displayed while trying to close a Contract with open PO.


Assign Supplier / Currency in Shopping Cart:

     This provides an easier way of assigning supplier or currency for items in SC.


Assign Supplier button obsolete:

    Simplifies the process of assigning suppliers for items in SC by reducing the number of user clicks.


SRM Fiori Carry Out Sourcing App:

     This app with intuitive UX helps user to easily identify right suppliers and source of supply.



You can find detailed description about these features by following the links mentioned below:


Additional status for RFx at end of bidding period


Formatted Text modules in Business Documents


Search for SC using ECC PO number


Inconsistent Business Partner handling


Check for open Purchase Order before Contract completion

 

Assign Supplier / Currency in Shopping Cart

 

Assign Supplier button obsolete


For complete details about SAP SRM 7.03 refer: SAP SRM 7.03


    


    

SRM: Step by Step guide to handle the erroneous Total Value in Purchase Order.

$
0
0

In SRM systems, direct Currency conversion (e.g. from USD to ARS) is used for Exchange Rate. There may be a few cases where  Customers are using Alternative Exchange rate type(e.g. EURX) for conversion from ‘from currency’(e.g. USD) to ‘To Currency' (e.g. ARS).

Configuration for Alternate Exchange Rate type (e.g. EURX):

Figure1: Table TCURF showing the conversion factors and field  'ABWCT' for Alternative exchange rate type.

Currency.PNG

 

 

Figure2: Alternative Exchange rate type(e.g. EURX) is maintained for conversion from

'from currency'(e.g. USD) to 'to currency' (e.g. ARS).

. Capture.PNG


Steps tohandle erroneous Total Value in Purchase Order:

In SAP SRM Procurement Scenario, purchaser/employee creates a shopping cart with free text item in ‘local currency’ (since User/purchasing organization has ‘local currency’ as default currency). A preferred supplier is added to the shopping cart which has ‘foreign currency’ as default currency. A Purchase Order is created out of this shopping cart with currency ‘foreign currency’.

During currency conversion, a rounding error occurs for certain prices(not all) resulting in erroneous Total Value(multiplied by conversion factor twice instead of once).

        • Rounding issue occurs for some prices(not for all).
        • Internal SAP standard uses direct conversion. When using Indirect conversion there is a huge impact in business due to error in Purchase order total value can be an unexplored area for most of the users.
        • Huge Effort in Understanding the root cause for the error as when SRM application calls IPC multiple times, there may be a very slight rounding difference in values for some Price Values, resulting in huge erroneous Total Value in Purchase Order.
                    

SRM architecture calls IPC Multiple time as per the design. For the first call to IPC from SRM, currency conversion is done as maintained in

customization by the customer i.e. from ‘local currency’ to EUR and then from  EUR to ‘foreign Currency’, that creates a particular rounded value in IPC.  For the second call to IPC, ‘local currency’ to ‘foreign Currency’ conversion is direct which
creates a different rounded value. Due to rounding off value difference, Function Module for conversion to foreign currency  is called again causing a huge Total Value by multiplying the value again with conversion factor.

When using indirect currency conversion for certain Prices, Rounding Errors can impact the procurement process ,

by calculating:

Total Value(foreign currency) calculated wrongly in Purchase Order = Price(local currency) x Conversion Factor  x Conversion Factor


Kindly note that the behavior mentioned above occurs only for European Monetary Union (EMU) Exchange Rate Type.


Solution:

This Rounding Off issue is resolved via note 2061300. Customer can download the latest IPC patch from the service marketplace
using the instructions in note 880749 and apply it.


Release Information:

SAP SRM 7.0 Enhancement pack 3.

Shopping Cart attachments to SharePoint

$
0
0

Requirement

Shopping cart attachments should be saved in the SharePoint instead of SAP Database/Tables. And also all the operations should be happen normally as usual(Delete, Renaming File name, Adding New attachments,etc).

 

Development Approach

Here we wanted to store the physical documents in SharePoint and URL of those documents in SAP. So we are using standard framework to perform all the attachment related operations but we are just making that with URL.

 

1.png

 

By default all the documents will be stored in SAP Database tables. We have an option to store the attachments as URL based or Normal (Content Based). Content Based will store the attachment physical information in to the SAP tables whereas URL based will store URLs.

Now we changed Content Repository BBPFILESYSTEM as URL based, so SAP system can store URL based attachments. After that we enhanced standard Function Modules that creates, updates, deletes Shopping cart attachments.

 

We haven't created any custom content server instead we used the standard content repository and framework. We created FM to store the documents in SharePoint using the HTTP classes and store that SharePoint URL in SAP standard framework tables.

 

Steps

  1. Changing the Content Repository BBPFILESYSTEM to store URL based attachments
  2. Enhancing the standard create, update, delete API function modules to bypass the documents to SharePoint.
  3. Custom Function/Class to store an attachment to SharePoint using the HTTP standard classes.

 

2.png

 

Development Steps


Changing Content Repository BBPFILESYSTEM

 

Goto SPRO-> SAP Web Application Server-> Application Server-> Basis Services -> Knowledge Provider-> Content Management Service-> Define Content Repositories

Click on BBPFILESYSTEM

3.png

 

You will see Rep. Sub-Type as Normal

4.png

Change Rep. Sub-Type to URL based

5.png

 

Enhancing Standard APIs

We have to find APIs which are creating, updating, Delete attachments, etc. The Package BBP_ATTACH has all the attachments related objects and function group BBP_ATTACH has API function modules that actually trigger while creating, updating, and deleting.6.png

Based on your requirement you can enhance those FMs. Here we created an implicit enhancement at starting to these FMs

 

Create FM - BBP_ATTACH_METH_KW_CREATE_DOC

This function module creates an attachment for SRM documents. we have to enhance this and make the attachments to store in SharePoint.

ENHANCEMENT ZZ_AP_ATTACHMENTS_SHAREPOINT.    "active version
*****************************************************************************
* Purpose  : Route the Attachment Storing to SharePoint and Store URL only in SAP.
* Date     : 8/27/2014
* User     : SMARAPUREDDI
* Transport: SRDK900966       SMARAPUREDDI AP Enhancement - Storing Enhancements in SharePoint
******************************************************************************
* Declarations
DATA:
ls_skwfid_en           
TYPE skwf_objid,
ls_loio_en             
TYPE skwf_io,
ls_phio_en             
TYPE skwf_io,
lt_phio_prop_en        
TYPE TABLE OF sdokpropty,
lt_loio_prop_en        
TYPE TABLE OF sdokpropty,
ls_prop_en             
TYPE sdokpropty,
ls_error_en            
TYPE skwf_error,
ls_file_access_info_en 
TYPE sdokfilaci,
lt_file_access_info_en 
TYPE TABLE OF sdokfilaci.

* The INSERT & REPLACE blocks are the updated logic for Standard

*{   INSERT
*
DATA:
lv_url             
TYPE so_url,
ls_file_access_url 
TYPE sdokcompru,
lt_file_access_url 
TYPE TABLE OF sdokcompru,
lv_send            
TYPE c.
*}   INSERT

* exporting = importing plus KW-fields
es_attach
= is_attach.

ls_skwfid_en
= is_attach-guid.

* perpare properties of the attachments
ls_prop_en
-name = bbpoa_pn_desc.
ls_prop_en
-value = is_attach-description.
APPEND ls_prop_en TO lt_loio_prop_en.
ls_prop_en
-name = bbpoa_pn_relurl.
ls_prop_en
-value = is_attach-phio_fname.
APPEND ls_prop_en TO lt_loio_prop_en.

lt_phio_prop_en[]
= lt_loio_prop_en[].
ls_prop_en
-name = bbpoa_pn_langu.
ls_prop_en
-value = sy-langu.
APPEND ls_prop_en TO lt_phio_prop_en.
ls_prop_en
-name = bbpoa_pn_mime.
ls_prop_en
-value = is_attach-phio_mime.
APPEND ls_prop_en TO lt_phio_prop_en.
ls_prop_en
-name = bbpoa_pn_ver_no.
ls_prop_en
-value = is_attach-phio_version_no.
APPEND ls_prop_en TO lt_phio_prop_en.

* create logical and physical objects
CALL FUNCTION 'SKWF_LOIO_WITH_PHIO_CREATE'
EXPORTING
loio_class     
= bbpoa_loioclass
phio_class     
= bbpoa_phioclass
loio_unique_id 
= ls_skwfid_en
phio_unique_id 
= ls_skwfid_en
IMPORTING
loio           
= ls_loio_en
phio           
= ls_phio_en
error          
= ls_error_en
TABLES
loio_properties
= lt_loio_prop_en
phio_properties
= lt_phio_prop_en.

IF NOT ls_error_en IS INITIAL.
PERFORM kw_error_messages TABLES et_messages
USING ls_error_en.
EXIT.
ENDIF.

* Store the physical attachment in SharePoint of corrsponding folder(Dev,QA,PRD)
*{   INSERT
*
DATA: lv_error      type sy-subrc,
lv_error_text
type string.

CALL FUNCTION 'Z_SEND_ATTACHMENT'
EXPORTING
IS_ATTACH
= is_attach
IV_LOIO  
= ls_loio_en-objid
IMPORTING
EV_URL   
= lv_url
EV_ERROR 
= lv_error
EV_ERROR_TEXT
= lv_error_text
EXCEPTIONS
NO_OBJEC_TYPE
= 1
NO_SHAREPOINT_DIRECTORY
= 2
OTHERS = 3.

IF LV_ERROR > 2.
ls_error_en
-type = 'E'.
ls_error_en
-id = 'BBP_ATT'.
ls_error_en
-no = '004'.
ls_error_en
-v1 = 'ERROR: Unable to upload document to sharepoint.'.
ls_error_en
-v2 = ' '.
ls_error_en
-v3 = lv_error_text.
PERFORM kw_error_messages TABLES et_messages
USING ls_error_en.
EXIT.
ENDIF.

" Send to sharepoint.
if lv_error = 0.
lv_send
= 'X'.
" Clear the object type info.
clear es_attach-PHIO_CHECKOUT_USER.
endif.
*}   INSERT
* Store URL instaed of physica attachment in SAP
*{   REPLACE
*\  ls_file_access_info-file_name  = is_attach-phio_fname.
*\  ls_file_access_info-property   = bbpoa_bbp_appl.
*\  ls_file_access_info-mimetype   = is_attach-phio_mime.
*\  ls_file_access_info-binary_flg = c_on.
*\  ls_file_access_info-file_size  = is_attach-phio_fsize.
ls_file_access_url
-file_name  = is_attach-phio_fname.
ls_file_access_url
-property   = bbpoa_bbp_appl.
ls_file_access_url
-mimetype   = is_attach-phio_mime.
ls_file_access_url
-file_size  = is_attach-phio_fsize.

if lv_send is initial.
ls_file_access_info_en
-binary_flg = c_on.
else.
ls_file_access_url
-file_type  = 'B'.
ls_file_access_url
-uri        = lv_url.
endif.
*}   REPLACE

*{   REPLACE
*\  APPEND ls_file_access_info TO lt_file_access_info.
if lv_send is initial.
APPEND ls_file_access_info_en TO lt_file_access_info_en.
else.
APPEND ls_file_access_url TO lt_file_access_url.
endif.
*}   REPLACE

if lv_send is initial.
* store attachmentcontent with content
CALL FUNCTION 'SKWF_PHIO_STORE_CONTENT'
EXPORTING
phio               
= ls_phio_en
x_raw_mode         
= c_on
IMPORTING
error              
= ls_error_en
TABLES
file_access_info   
= lt_file_access_info_en
file_content_binary
= is_attach-phio_content.
else.
* store attachmentcontent with URL
CALL FUNCTION 'SKWF_PHIO_STORE_CONTENT'
EXPORTING
phio               
= ls_phio_en
x_raw_mode         
= c_on
IMPORTING
error              
= ls_error_en
TABLES
*{   REPLACE
*\      file_access_info    = lt_file_access_info
file_access_url   
= lt_file_access_url
*}   REPLACE
file_content_binary
= is_attach-phio_content.
endif.

IF NOT ls_error_en IS INITIAL.
PERFORM kw_error_messages TABLES et_messages
USING ls_error_en.
EXIT.
ENDIF.

es_attach
-loio_class    = ls_loio_en-class.
es_attach
-loio_objid    = ls_loio_en-objid.
*{   INSERT
*
if lv_send is initial.
es_attach
-loio_class    = ls_loio_en-class.
es_attach
-loio_objid    = ls_loio_en-objid.
else.
es_attach
-url = lv_url.
es_attach
-type = c_att_type_url.
endif.
*}   INSERT

* Return
return.

ENDENHANCEMENT.

Change FM - BBP_ATTACH_METH_KW_UPDATE_DOC

In the same way you have to make the logic to update the document and store that in SharePoint.

 

Version FM - BBP_ATTACH_LOIO_GET_VERSIONS

 

Code for these FMs are attached.. Basically we are routing the documents to SharePoint and Storing the URL in SAP.

 

Include LBBP_ATTACHF03

You have to restrict an error message logging here

 

*{   REPLACE        SRDK900254                                        1
*\  IF NOT ls_error IS INITIAL.
IF NOT ls_error IS INITIAL AND
NOT ( ls_error-id = 'SKWF_SDOKERRS' AND ls_error-no = 33 ).
*}   REPLACE
PERFORM kw_error_messages TABLES pt_messages
USING ls_error.
EXIT.
ENDIF.

 

Custom FM for storing attachments in SharePoint

We enhanced standard framework to store attachments URL and store physical attachments in SharePoint using custom FM 'Z_SEND_ATTACHMENT'.

 

FUNCTION z_send_attachment.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(IS_ATTACH) TYPE  BBP_PDS_ATT_T
*"     REFERENCE(IV_LOIO) TYPE  SDOK_DOCID OPTIONAL
*"  EXPORTING
*"     REFERENCE(EV_URL) TYPE  SO_URL
*"     REFERENCE(EV_ERROR) TYPE  SY-SUBRC
*"     REFERENCE(EV_ERROR_TEXT) TYPE  STRING
*"  EXCEPTIONS
*"      NO_OBJECT_TYPE
*"      NO_SHAREPOINT_DIRECTORY
*"----------------------------------------------------------------------
DATA:  ls_obj_attachment TYPE zobj_attachments,
lv_object_type
TYPE crmt_subobject_category_db,
data TYPE xstring,
length
TYPE i,
server_name
TYPE string,
server_port
TYPE string,
auth_server_name
TYPE string,
auth_server_port
TYPE string,
lv_filename
TYPE string,
lv_attachment_time
(15) TYPE n,
lv_attachment_version
TYPE bds_dverno,
lv_loio
TYPE sdok_docid,
lv_file_ext
TYPE string,
lv_url
TYPE string,
lv_tmp
TYPE service_rl,
ret
TYPE string.
DATA:  client TYPE REF TO if_http_client.

" Get the object attachment configuration.
SELECT SINGLE *
FROM   zobj_attachments
INTO   ls_obj_attachment.
*  WHERE  name = lv_object_type.

" Not found?
IF ls_obj_attachment IS INITIAL OR ls_obj_attachment-send_external <> 'X'.
RAISE no_sharepoint_directory.
*     message 'ERROR: Unable to upload document to sharepoint due to configuration error.' type 'E'.
ENDIF.

* Convert to string.
length
= is_attach-phio_fsize.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length
= length
IMPORTING
buffer       = data
TABLES
binary_tab  
= is_attach-phio_content
EXCEPTIONS
OTHERS       = 1.

" Error?
IF sy-subrc <> 0.
ev_error
= sy-subrc.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ev_error_text.
RETURN.
ENDIF.

" Set the external server information.
server_name
= ls_obj_attachment-server_name.
server_port
= ls_obj_attachment-server_port.
auth_server_name
= ls_obj_attachment-auth_server_name.
auth_server_port
= ls_obj_attachment-auth_server_port.
CALL METHOD cl_http_client=>create
EXPORTING
proxy_host   
= auth_server_name
proxy_service
= auth_server_port
host         
= server_name
service      
= server_port
scheme       
= 1
IMPORTING
client        = client
EXCEPTIONS
OTHERS        = 1.

" Error?
IF sy-subrc <> 0.
ev_error
= sy-subrc.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ev_error_text.

RETURN.
ENDIF.

" Get the file extension, if any.
CALL FUNCTION 'BBP_OUTPUT_X_PATH_FILE_EXT'
EXPORTING
i_pathfile 
= is_attach-phio_fname
IMPORTING
e_file_pure
= lv_filename
e_extens   
= lv_file_ext
EXCEPTIONS
OTHERS      = 1.

CONDENSE lv_filename NO-GAPS.
CONDENSE lv_file_ext NO-GAPS.

REPLACE ALL OCCURRENCES OF '#' IN lv_filename WITH '_'.
REPLACE ALL OCCURRENCES OF '?' IN lv_filename WITH '_'.
REPLACE ALL OCCURRENCES OF '&' IN lv_filename WITH '_'.
REPLACE ALL OCCURRENCES OF '%' IN lv_filename WITH '_'.
REPLACE ALL OCCURRENCES OF '/' IN lv_filename WITH '_'.
REPLACE ALL OCCURRENCES OF '#' IN lv_file_ext WITH '_'.
REPLACE ALL OCCURRENCES OF '?' IN lv_file_ext WITH '_'.
REPLACE ALL OCCURRENCES OF '&' IN lv_file_ext WITH '_'.
REPLACE ALL OCCURRENCES OF '%' IN lv_file_ext WITH '_'.
REPLACE ALL OCCURRENCES OF '/' IN lv_file_ext WITH '_'.

" Set the version number.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input  = is_attach-phio_version_no
IMPORTING
output = lv_attachment_version.

" Set the URL.
lv_attachment_time
= is_attach-creationtime.
IF NOT is_attach-loio_objid IS INITIAL.
lv_loio
= is_attach-loio_objid.
ELSE.
lv_loio
= iv_loio.
ENDIF.

IF lv_file_ext IS INITIAL.
"      concatenate ls_obj_attachment-folder_name '/' lv_filename '_' sy-uname '_' lv_attachment_time into lv_url.
CONCATENATE ls_obj_attachment-folder_name '/' lv_filename '_' sy-uname '_V' lv_attachment_version '_' lv_loio INTO lv_url.
ELSE.
"      concatenate ls_obj_attachment-folder_name '/' lv_filename '_' sy-uname '_' lv_attachment_time '.' lv_file_ext into lv_url.
CONCATENATE ls_obj_attachment-folder_name '/' lv_filename '_' sy-uname '_V' lv_attachment_version '_' lv_loio '.' lv_file_ext INTO lv_url.
ENDIF.

CALL METHOD cl_http_utility=>set_request_uri
EXPORTING
request
= client->request
uri    
= lv_url
EXCEPTIONS
OTHERS  = 1.

" Error?
IF sy-subrc <> 0.
ev_error
= sy-subrc.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ev_error_text.

RETURN.
ENDIF.

CALL METHOD client->request->set_method
EXPORTING
method = 'PUT'.

CALL METHOD client->request->set_data
EXPORTING
data = data.

CALL METHOD client->send
EXCEPTIONS
OTHERS = 1.

" Error?
IF sy-subrc <> 0.
ev_error
= sy-subrc.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ev_error_text.

RETURN.
ENDIF.

CALL METHOD client->receive
EXCEPTIONS
OTHERS = 1.

" Error?
IF sy-subrc <> 0.
ev_error
= sy-subrc.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ev_error_text.

RETURN.
ENDIF.

ret
= client->response->get_cdata( ).

" Error?
IF ret IS NOT INITIAL.
MESSAGE 'ERROR: Unable to upload document to sharepoint.' TYPE 'E'.
ENDIF.

CALL METHOD client->close.

CONCATENATE 'http://'
ls_obj_attachment
-server_name
lv_url
INTO ev_url.

RETURN.
ENDFUNCTION.

 

Custom table zobj_attachments

This custom table will have the SharePoint URL folder path info based on the document type

7.png

PO Form Display in SRM for Classical Scenario

$
0
0

Summary

PO form that is displaying at ECC ME23n transaction level with print preview option should be displayed in SRM system portal level.


Analysis

As it is classical scenario PO details and standard PO form will not be there in SRM. So we have to get the details from backend ECC system.

PO2.png

 

Displaying PO Form

One way is like fetching all the data that is needed for PO form display and create a custom Adobe form same like ECC PO from in SRM system. Other way is calling the same ECC PO Form from SRM and display.

 

First way is more complex and need more development objects creation. So second one is good but we should be able to call the PO from and display the same form in SRM.

 

We can call the PO from in ECC using the generated Function Module for adobe form and that FM will give us PDF raw data. Then you have to get that PDF raw data in SRM and display PDF form.

 

We are creating Webdynpro Application to display PO form, so using the PDF raw data we can directly display the Adobe form in Webdynpro.

 

PO Search Screen

We wanted a PO form search screen like the below

PO1.png

 

So user should be able to search PO’s with all these criteria’s.  But we don’t have PO’s available in SRM for all Carts. Because PO will be created in the backend, for some carts PO will be the first follow on document and for some documents PR will be the first follow on document. It depends on Country, so PO will be available in SRM table BBP_PDBEI if PO is the first follow on document. Otherwise PR only will be available.

 

We have an API to search Shopping Carts with different criteria.

 

Class: /SAPSRM/CL_PDO_AOMS_SC-> /SAPSRM/IF_PDO_AOMS_SC~SEARCH with this method you can search shopping carts with different criteria’s. With this class you can only search with single range of values. I mean if you wanted to search based on the PO numbers but you can only search 1 PO at one time or you can specify range. But you cannot search based on the different range of PO and different PO numbers at one time.

 

FM: BBP_BW_SC_SELECT_1 using this FM we can search with same search criteria that class provided with multiple range of values. You can pass every value as range table and based on that you can search. You can even specify OPTIONS (EQ, NE, etc..) and SIGN(Include, Exclude).

 

Once we get the Shopping cart details you have to get the PO of those carts. So using the BBP_GET_DOC_HISTORY we can get the PO details.

 

If you don’t want use these APIs then you have to find the database tables to query. But this will be more complex and have to write lot of queries and conditions. Coz you have different search criteria’s and you should be able to write logic to achieve all those.

 

Search based Shopping cart, Date range, Created by

CRMD_ORDERADM_H - You can read Shopping cart with those criteria directly from this table.

 

Then read the PO using tables using FM BBP_GET_DOC_HISTORY

 

Or you can read the PO using the below relationship tables
SRRELROLES
BBP_PDBINREL

Requester Based search

First you have to read the Shopping carts created by this requester, so using the below tables you can read.

CRMD_ORDERADM_H
CRMD_ORDERADM_I
CRMD_LINK
CRMD_PARTNER
BUT000

 

Then read the PO using tables using FM BBP_GET_DOC_HISTORY

 

Or you can read the PO using the below relationship tables
SRRELROLES
BBP_PDBINREL

 

PO number based Search

SRRELROLES
BBP_PDBINREL
CRMD_ORDERADM_H

 

Development Steps

ECC level Development

Create an RFC function module that calls PO form and send PDF data of form based on the PO number.

PO3.png

Attached file has the logic

 

SRM Level Development

Webdynpro ABAP Application

Create a webdynpro component and all the sub object as like below screen shot.

PO4.png

Component usage

PO5.png


Create context as like below

PO6.png

Create a selection screen in WDDOINIT method

PO7.png

Attached file has the logic.

 

Search Button action

PO8.png

Link to Action Download PO

PO9.png

Download Selected PO Button action

same logic like above method

PO10.png

Webynpro Application

PO11.png

Search PO based on the entered Criteria

Central class for different generic and database relate operations methods. Selected methods are related to PO Search. The main method GET_PO_FORM_SEARCH_RESULT that is calling from the Webdynpro Search action and the other methods inside the main method.

PO12.png

Method Signature

PO13.png

Logic attached

 

Methods which are calling inside the main method to search. logic of these methods are attached

GET_PO_FOR_CARTS - this will search PO for the Carts

PO14.png

SEARCH_CARTS_REQUESTED_BY - This method will search carts based on the Requested by user

PO15.png

SEARCH_CARTS_PR_BASED - This method search carts PR based

PO16.png

 

SEPERATE_PO_PR - Separate PO based and PR based PO's

PO17.png

SEARCH_CARTS_PO_BASED - Search carts which are PO based

PO18.png

 

Testing

Integrated webdynpro application with IView.

PO19.png

Carts created by me and click on Purchase order number or select and click on button

PO20.png

PO form will be downloaded

PO21.png

Reason for Rejecting Shopping Cart with Popup

$
0
0

Summary

If the approver is trying to reject the shopping cart then approver should enter a rejection reason. If approver not entered any rejection reason and clicked on REJECT button then a popup should be displayed to enter the rejection reason. If the user entered reason and press on ADD then rejection process should continue otherwise rejection process should be stopped and raise an error message. So the approver can only reject with rejection reason.


Rejection Reason_new.PNG


Analysis

Normally if we need to make Rejection reason as mandatory then you can check it in the BBP_DOC_CHECK_BADI by reading the long texts based on the GUID using the BBP_PD_SC_GETDETAIL. But here the requirement is to show a popup to enter rejection reason. We cannot raise popup from the BADI.  So somewhere in the Webdynpro component level we have to call a popup.

 

But whenever approver clicks on the Reject button it’s running the actual rejection process logic and then related webdynpro components (Shopping Cart Header, Item, and Approval Note components) are triggering. So we cannot really create an enhancement to these Webdynpro components to raise popup, because the actually process is already happening.

 

We should be able to control the execution of Rejection process to execute after the popup shows. So we should execute a custom action instead of standard REJECT FPM action and based on the Rejection reason entered or not we should trigger an actual standard REJECT FPM action.

Design

  1. Capture the Approver action on the screen (is it REJECT or any other action).
  2. If REJECT then display the popup to enter rejection reason. If the user entered reason and click on ok then close the popup and reject the cart with entered reason. If not then don’t close a popup and raise an error message. If the user click on CANCEL button on popup screen then close the popup and show an error message in main screen and don’t reject.
  3. If the action is not REJECT then don’t do anything just normal process should continue.

Development Steps
Enabling Approve & Reject buttons at Approval Screen

Generally approval screen will be like below. We don’t find approve & Reject buttons in the screen and instead submit button will be there. In this case you can approve some items and reject some items. So Item level approvals are there.

 

But here, our case is total document approve and we don’t have item level approvals.  So we have to hide submit button and 2 columns (Approve/Reject).  And enable Approve & Reject buttons on the approval screen. Approve button approves total document and Reject button Rejects total document.

 

2.png

We cannot directly enable the Approve & Reject buttons through FPM configuration editor.  Because those buttons visibility is controlling somewhere in the run time. Even those you enabled the Approve & Reject buttons those won’t be displayed there. So we have to enable those dynamically.

 

We should also make sure the Approve & Reject buttons only visible for approval screen and not in the creation and edit of Shopping cart screen. To achieve this we can create an enhancement to Webdynpro component /SAPSRM/WDC_UI_SC_OIF_CA and create a Pre-Exit for WDDOMODIFYVIEW method of view V_SC_OIF_CA.

3.png

Place this V_SC_OIF_CA->WDDOMODIFYVIEW section of code in attached document.

 

Capture Approval Action (is it REJECT or any other action)

We have an option to Approve/Reject the Shopping cart from 2 different screens. I mean, Approver can Approve/Reject directly from the UWL or go to the details (By clicking on the Shopping Cart or Details button) and Approve/Reject from there.

 

So we have to capture the action from both screens and also we have to know from which screen it’s triggered.

 

We cannot capture both actions at one place, because UWL action won’t trigger the Webdynpro components and details screen can be captured at Webdynpro. So we have to find a place to capture those.

 

We are going to capture these actions using the Export/Import Memory statements

 

Details Screen Action

You can capture details screen actions at /SAPSRM/CL_CH_WD_MAP_IDENT_SC->/SAPSRM/IF_CLL_IDENT_MAPPER~HANDLE_EVENT this method.

4.png

Attached document has code.

 

UWL Screen Action

You can capture UWL screen actions at FM /SAPSRM/FU_WF_RFC_DECISION.

5.png

Attached document has code.

 

Validation and Display popup for Rejection Reason

Details Screen Rejection

Here we are calling standard approval note popup view as our Rejection reason popup. We are not creating any new view and the component for Approval note /SAPSRM/WDC_DO_APPR_NOTE.

 

As shown in the below screen, the approver should enter Rejection reason in the Approval Note. Any notes will be entered here by Approvers and Requesters. If there are no notes then you can directly enter in the below shown input box.

6.png

If there are some notes already there then you will see Add Comment link option to add new note. If you click on that then a popup will be displayed to enter the notes. Those notes will be prefixed to the previous notes with User & timestamp.

7.png

The Approval Note popup will be shown like this.

8.png

Here now if we need to achieve our functionality.

  • First we have to find type of action (REJECT or any other action)
  • If the action is not REJECT then normal process should happened like Approve, Check, etc.
  • If the action is REJECT then we have to fine whether approver entered an rejection note or not
  • If approver entered a rejection note then rejection process should happened and the document should be rejected.
  • If approver not entered a rejection note then we have to show popup to enter rejection reason. The process should go further if the user only enters a rejection note otherwise it should be stopped and raise an error message.

Here we are calling the same standard approval popup as rejection note popup when REJECT action triggered and no approval note.

 

So we have to check the above conditions and call popup in the Post-Exist of WDDOMODIFYVIEW in the V_DODC_MAIN_VIEW of

/SAPSRM/WDC_DO_APPR_NOTE.

9.png

Place this attached V_DODC_MAIN_VIEW->WDDOMODIFYVIEW section of code.


This is view which is calling as popup for approval note and rejection reason.

10.png

Here we have to enhance the follow methods

11.png

  1. WDDOMODIFYVIEW – here we have to enable approval note input field to editable and other related operations. Here we are also calling the save action of popup view directly, because the rejection reason is already there so we should not display the popup. The same thing we can control in the popup calling view V_DODC_MAIN_VIEW but we have some problem raising FPM standard event from there. So we are calling the popup and automatically adding that without user action.

12.png

2) ONACTIONON_SAVE – Here we have to add the entered rejection text to document. First check action type if the action type is rejection then check the rejection reason entered or not. If not entered then don’t close the popup and show error messages. If entered then capture the entered rejection reason and raise a standard FPM REJECT event.

 

Remember we have changed the standard REJECT event with ZREJECT event and based on the condition we are raising standard Rejection event.

13.png

 

14.png

Attached document has this section of code V_DODC_ADD_COMMENT->ONACTIONON_SAVE


3) ONACTIONON_CANCEL – Here we have to close the popup and stop the process by raising an error in the main screen.

15.png

Attached document has the code V_DODC_ADD_COMMENT->ONACTIONON_CANCEL


4) BBP_DOC_CHANGE_BADI – Here we are going to update the approval note to document.

    Attached document has the logic


UWL Level Rejection

For UWL action we don’t have an option to raise a popup directly. We may have to include that in workflow step to show popup.

But here I am just raising an exception in the BBP_DOC_CHECK_BADI with some text saying

 

Please click on details and enter Reason for Rejection in Approval Note Fiel

DATA: lv_id3            TYPE          c LENGTH 15 VALUE 'UWL_ACTION',
lv_uwl_action   
TYPE          /sapsrm/cll_decision,

* Import UWL Screen Action(Approve/Reject)
IMPORT p2 = lv_uwl_action FROM MEMORY ID lv_id3.

 

** If Document is Shopping Cart
IF flt_val = 'BUS2121'.
* And Action is UWL then Rasie the Exception with below text and stop the Rejection
IF lv_uwl_action = 'REJECTED'.
MESSAGE '  -  Please click on details and enter Reason for Rejection in Approval Note Field' TYPE 'E'.
ENDIF.
ENDIF.
** End of - SMARAPUREDDI - July/29/2014 Reason for SC Rejection UWL Validations


Additional status for RFx at end of bidding period

$
0
0

When an RFx is in published status, there is no way of knowing if the bidding period is still ongoing or the bidding has ended without checking the submission deadline of the document. In the purchaser’s view, the RFx is still in status published status, even when the submission deadline is over.

 

Feature:

 

As part of this feature, a new status, 'Ended' is introduced for RFx and this status is set for the document when the submission deadline is over. This feature brings in more transparency in the bidding process. The new status indicates that the bidding period of an RFx has ended. It will help you to track the bidding process in an efficient manner.

 

This feature is also supported for  BId-Decoupled scenario. In this case the switch has to be activated in both SRM and SUS systems.

 

When we display an RFx for which the bidding period is over, the status will be displayed as 'Ended' as follows:

 

Ended Rfx.PNG

 

Also, there will be an option in POWL(Personal Object Work list) to search for all Ended RFx.

 

Ended Rfx.PNG

 

Information:


To use the feature, you have to first activate the Business Function SRM_CONT_IMPR_2 and then activate the Customizing switch Additional Status for RFx(SRM_702_RFQ_END) under SRM Server-> RFx->  Activate/Deactivate Additional status after Publishing RFx.

 

Also, the report, /SAPSRM/RFX_ENDED_STAT_UPDATE, has to be run or scheduled in background for changing the status of all RFx for which submission deadline is over.


Notes:


2045450: Interface Changes: Preparation Changes for Ended RFx

2038376: Interface Changes: Ended RFx

2038377: Implementation note for Ended RFx

 

 

For complete details about SAP SRM 7.03 refer: SAP SRM 7.03





Inconsistent Business Partner handling

$
0
0

If a business partner is no more valid then there is no way to search for the documents which are assigned to this business partner or change the ownership of the document.

 

Feature:

 

This feature enables you to edit or display any document in Supplier Relationship Management (SAP SRM) that is assigned to a business partner who is terminated or whose role has become inconsistent in the SAP SRM org structure. This feature is available from SAP SRM 703 Support Package 06.

 

Allows New business partner to be assigned to a SRM document in case the existing partner is terminated or becomes inconsistent in SRM HR Organization. Thus, allows to create Follow-on documents to be created for documents containing old business partner.

 

This feature also helps us to track transfer of SRM documents from old Business Partner to new Business Partner.

 

 

Information:

 

To use the feature, you have to first activate the Business Function SRM_CONT_IMPR_3 and then activate the Customizing switch Inconsistent Busines Partner handling(SRM_703_TERMIN_EMP) under SRM Server-> Continuous Improvement->  Activate/Deactivate Inconsistent Business Partner Handling.



For complete details about SAP SRM 7.03 refer: SAP SRM 7.03




Check for open Purchase Order before Contract completion

$
0
0

It is possible to close a Contract ( Transaction Completed ) even if the document has Open PO associated with it.

 

Feature:

 

This feature prevents the completion of Contract if there is any Open Purchase Order against it. Configurable message will be displayed upon trying to close the Contract which has open Purchase Order. Thus, this feature ensures better compliance of the business process.

 

Information:

 

To use the feature, you have to first activate the Business Function SRM_CONT_IMPR_1 and then activate the Customizing switch Check for open PO before Contract Completion (SRM_701_CONT_CLOSE) under SRM Server-> Cross Application Basic Setting->  Service Procurement-> Activate/Deactivate Check for Open Purchase Orders before Contract Complet.


Notes:

 

2042218: Interface Changes: Check for Open Purchase Order before Contract Completion

2040522: Implementation note: Check for Open Purchase Order before Contract Completion

 

For complete details about SAP SRM 7.03 refer: SAP SRM 7.03






Assign Supplier / Currency in Shopping Cart

$
0
0

In order to assign supplier for items in Shopping Cart, we will have to navigate to items details screen and maintain the supplier for each item. Similarly currency has to be maintained one by one for each item.

 

Feature:

 

With this feature, the operational purchaser can select multiple items in Shopping Cart and assign a mutual supplier and currency or both for all the items selected at once. It reduces the duplicate effort of assigning a supplier or currency for each item individually.

 

In the below screenshot you can see that the currency for all items is EURO and no supplier is assigned.

 

Capture.PNG

 

Now, purchaser is trying to assign first 3 items with currency, USD and supplier, 1444Capture.PNG

 

We can see that the supplier and currency is rightly assigned.

 

Capture.PNG

Information:


To use the feature, you have to first activate the Business Function SRM_CONT_IMPR_2 and then activate the Customizing switch Assign supplier and currency in shopping cart (SRM_702_ASSIGN_SUPP_CURR) under SRM Server-> Continuous Improvement->  Activate/Deactivate ***. Suppl. or Curr. to selected items in Shopping Cart.

 

Notes:

 

2046757: Interface Note: Assign Supplier and Currency in Shopping Cart

2046755: Implementation Note: Assign Supplier and Currency in Shopping Cart

 

For complete details about SAP SRM 7.03 refer: SAP SRM 7.03

Step by Step Addition of Toolbar Button in Bidder Response at Runtime

$
0
0

It's sometime useful to create toolbar button at runtime to meet the dynamic requirements. For example, we may want to give print of comparative statement to bidder after successful evaluation of bids submitted.

 

a1.PNG

To create the "Comparative Statement" button at runtime as shown above.

 

Step - 1 :  Create Enhancement Implementation for the View "CNR_VIEW" of the  WDA Component "FPM_OIF_COMPONENT".

Step - 2 :  Create Post-Exit for the method "WDDOMODIFYVIEW" of "CNR_VIEW".

Step - 3 :  Write the following Codes in the Post Exit of WDDOMODIFYVIEW.

 

DATA l_cmp_api TYPE REF TO if_wd_component.

DATA l_key        TYPE wdy_config_key.

 

* Get the Configuration ID

   l_cmp_api = wd_comp_controller->wd_get_api( ).

   CALL METHOD l_cmp_api->GET_CONFIGURATION_KEY

     RECEIVING

       CONFIG_KEY = l_key.


* Add Button Only in Bidder Screen

   IF l_key-CONFIG_ID = '/SAPSRM/WDCC_FPM_OIF_QTE_BIDDER'.

     DATA lo_fpm TYPE REF TO if_fpm.

     DATA lo_oif TYPE REF TO if_fpm_cnr_oif.

 

*   Get reference to FPM service object

     lo_fpm = cl_fpm_factory=>get_instance( ).

 

*   Get reference to Toolbar service object

     lo_oif  ?= lo_fpm->get_service( cl_fpm_service_manager=>gc_key_cnr_oif ).

 

CALL METHOD lo_oif->DEFINE_BUTTON        

      EXPORTING

        IV_VARIANT_ID       = 'VARIANT_QTE_BIDD'        " Bidder Varient

        IV_FUNCTION         = 'OTHER_FUNCTIONS'

        IV_ELEMENT_ID     = 'EXTENSIBILITY1'               " 'BIDDER_CS'

        IV_VISIBILITY         = '02'                                    " Yes

        IV_SEQUENCE_ID = '40'

        IV_ENABLED         = 'X'                                      " Yes

        IV_EXPLANATION  = 'Comparative Statement - Bidder Version'

        IV_TOOLTIP           = 'Comparative Statement - Bidder Version'

        IV_TEXT                = 'Comparative Statement'

        IV_ON_ACTION     = 'ZBIDDER_CS'.                   " Action

 

* Render buttons

     WD_THIS->MO_CNR->RENDER_BUTTONS( ).

* Render button choices

     WD_THIS->MO_CNR->RENDER_BUTTON_CHOICES( ).

* Render separators

     WD_THIS->MO_CNR->RENDER_SEPARATORS( ).

* Render duplicate_toolbar

     WD_THIS->MO_CNR->RENDER_DUPLICATE_TOOLBAR( ).

* Render YOU CAN ALSO

     WD_THIS->MO_CNR->RENDER_YOU_CAN_ALSO( ).

* Render RELATED_LINKS

     WD_THIS->MO_CNR->RENDER_RELATED_LINKS( ).

 

     CALL METHOD WD_ASSIST->PREPARE_TOOLBAR

       EXPORTING

         IV_FIRST_TIME = FIRST_TIME

         IO_VIEW       = VIEW

         IO_CONTEXT    = WD_COMP_CONTROLLER->MO_TOOLBAR_NODE.

 

 

 

Step - 4  : Create Post-Exit for the method "ONACTIONBUTTON_PRESSED" of "CNR_VIEW".

Step - 5  :  Write the  Codes in the Post Exit of method "ONACTIONBUTTON_PRESSED" to give print of comparative statement to bidder when button is pressed.

How to control 'Edit' button for business partner

$
0
0
Some users expected to control edit button for supplier maintenance with object B_BUPA_RLT in role authorization.
However In standard SRM design, there is no option for a "readonly" access to the supplier maintainance transaction.Business partner role authorization plays no role in SRM application.
Here, I will introduce the following coding where edit button is control in each place.
1) How to control Edit button while selecting one BP in POWL screen:
edit-1.png
Method ENABLE_BUTTONS (Class /SAPSRM/CL_CLL_POWL_BO_BUPA)
...

* Enable all buttons before check whether they should be disabled
 
CALL METHOD me->enable_all_buttons
   
CHANGING
      ct_action_defs
= ct_action_defs.
...
You may remove 'X' of 'enabled' for edit button in table ct_action_defs.
2) How to control Edit button while displaying the supplier:
edit-2.png
Method UPDATE_ACTIONS (Class /SAPSRM/CL_CH_WD_MAP_IDENT)
...
CALL METHOD io_meta_consumer->get_action_metadata
       
EXPORTING
          iv_set_type
= lv_settype " header set type
          iv_set_key 
= lv_header_guid " header guid
          iv_action  
= ls_idr_action-action " action name
        RECEIVING
          rv_enabled 
= lv_enabled.
...
You may remove 'X' of 'lv_enabled' for Edit button. Then No edit button will be displayed.
3) How to control 'Add lines' and 'Delete' buttons in edit mode of Supplier:
edit-3.png

Method /SAPSRM/IF_PDO_META_CONSUMER~GET_ACTION_METADATA (Class /SAPSRM/CL_PDO_META_MO_SUPP)

...

WHEN /sapsrm/if_pdo_bp_c=>gc_pd_set_suppurdat.
      rv_enabled
= mo_meta_supp_char->get_action_metadata(
                                          iv_set_type
= iv_set_type
                                          iv_set_key 
= iv_set_key
                                          iv_action 
= iv_action      ).

...

Here when /sapsrm/if_pdo_bp_c equals to 'BPD' and iv_action equals to 'delete_item', it will call the following method to enable button 'Delete':

Method /SAPSRM/IF_PDO_META_CONSUMER~GET_ACTION_METADATA (Class /SAPSRM/CL_PDO_META_DO_SUPP_CH)

 

if lv_mode eq /sapsrm/if_pdo_constants_gen_c=>gc_mode_display.
    rv_enabled
= abap_false.
 
elseif lv_mode eq /sapsrm/if_pdo_constants_gen_c=>gc_mode_edit or
         lv_mode
eq 'CREATE'.
   
case iv_action.
     
when /sapsrm/if_pdo_action_c=>gc_action_delete.
        rv_enabled
= abap_true.
     
when others.
        rv_enabled
= abap_true.
   
endcase.


While in 'edit' or 'create' mode, button will always be enabled.
This document will be of help to realize user's own requirement.
Viewing all 198 articles
Browse latest View live


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