Purpose
This page is created to clarify the application logic of the Team Cart searching process.
Overview
This debugging guide can help understanding how search works and it can be useful for identifying the root cause of an undesirable behavior of system.
For general information regarding "Search for Team Carts" topic, refer to the following Wiki page: Searching for Team Shopping Carts.
Debugging Guide
To start debugging, set a breakpoint in the following Methods according to the used search:
- HANA search (BAdI /SAPSRM/BD_POWL_SRCH_DBSYS_OPT has active implementation)
- POWL - Class /SAPSRM/CL_PDO_SO_SEARCH_SC_2 Method BUILD_SEARCH_PARAMETER
- Advanced Search - Class /SAPSRM/CL_PDO_SO_SEARCH_SC Method BUILD_SEARCH_PARAMETER
- Non-HANA search ((BAdI /SAPSRM/BD_POWL_SRCH_DBSYS_OPT hasn't got any active implementations)
- POWL - Class /SAPSRM/CL_PDO_SO_SEARCH_SC_2 Method EXECUTE_SEARCH
- Advanced Search - Class /SAPSRM/CL_PDO_SO_SEARCH_SC Method EXECUTE_SEARCH
The searching logic from Team Cart point of view is the same for both Methods (EXECUTE_SEARCH and BUILD_SEARCH_PARAMETER). On the other hand different logics are called for Shopping Carts Query, than for Team Carts Query or for Advanced Search.
First system checks if the Team Cart related flag was ticked or not.
POWL Shopping Carts Query
In case of POWL with Query Shopping Carts, the following logic is called.
This only populates the variable LV_PURCHTEAM with value "TEAMCART", which means that the search will search for Team Carts only.
Other logic are the same as for normal SC search process.
POWL Team Carts or Advanced Search
In case of POWL with Query Team Carts or Advanced Search, a different logic is used.
This logic also populates the variable LV_PURCHTEAM with value "TEAMCART", so that the system only searches for Team Carts. However, as system has to display not only the login user's SC, but also the Team Carts of other members, system also checks whether a team member was specified or not as a search criterion (This is only possible in Advanced Search).
If no team member was selected LV_TEAMMEMBER will be populated with value "ALL", which means that Team Carts from each member will be shown in the search result.
Afterwards system fetches the partner data of login user and appends it to the partner table, because system also shows the login user's Team Carts.
Then system has to find all members in the team (or check if the selected member exists in the team). For this, it calls Method GET_ITEM_PARTNERS_FOR_TP.
Afterwards system calls the following Methods:
- GET_TEAM_MEMBERS
- GET_TEAM_MEMBERS_REVERSE
In the last method, you can find the SELECT statement, which retrieves the Team Purchasing substitution data from table /SAPSRM/SC_TP. This will get every entry for that
- the login user is set as substitute (SUBSTITUTE)
- the validity date is fulfilled (BEGDA, ENDDA)
- Team Purchasing flag is ticked (TEAM_PUR)
Returning back to Method EXECUTE_SEARCH (non-HANA case) or BUILD_SEARCH_PARAMETER (HANA case), system appends the found members to LT_ITEM_PARTNERS. System will provide the SCs created by the partners in the table.
The rest of the logic is the same as the general SC search.
Related Content
Related Documents
SAP SCN Wiki - Searching for Team Shopping Carts
SAP SCN Wiki - /SAPSRM/BD_POWL_SRCH_DBSYS_OPT