SAP SRM 7 : How OBN navigation works in NWBC
Few days back I posted a question in abap webdynpro forum contracts POWL – calling contract mass change application to understand how SAP manages to call the specific webdynpro application, when we click on document number or when we click on Display button in the toolbar(Portal or Launchpad customising are not used). Unfortunately I didn’t get any answer. So I had to spend some time debugging this to figure out the logic myself. In this blog I am going to talk about my findings. Before you start reading further, please keep in mind that knowing these things may not help you any usual developments that we do in SRM projects. But I feel there is no harm in getting into finer details of something and enrich your knowledge repository with new stuff. As somebody rightly said “GOD lies in the DETAILS” 🙂
Let’s take SC POWL from purchasing and start analysing the call stack, when we select a SC and click on DISPLAY button. As you all know, control goes to HANDLE_ACTION method of POWL feeder class. Then call stack proceeds something like below
Class / WD component |
Method |
comment |
/SAPSRM/CL_CLL_PWL_A_SC_PROF |
IF_POWL_FEEDER~HANDLE_ACTION |
Feeder class for SC POWL |
/SAPSRM/CL_CLL_POWL_BASE_AGENT |
IF_POWL_FEEDER~HANDLE_ACTION |
Base class for all feeder classes |
CL_POWL_MODEL |
FEEDER_HANDLE_ACTION |
|
CL_POWL_MODEL |
DISPATCH_ACTION |
E_PORTAL_ACTIONS parameter of method HANDLE_ACTION is filled with below data.
Field |
value |
comment |
BO_NAME |
sc |
|
BO_OP_NAME |
displayprof |
|
PARAMETERS |
|
|
SAPSRM_CA_TAB |
D_I_BD |
|
SAPSRM_ITEMID |
0050569955DD1ED4BAB5F7408FBC9F24 |
SC lead item GUID |
sapsrm_boid |
0050569955DD1ED4BAB5E5D3ABF59F24 |
SC header GUID |
After we click F8, we get a blank window and control goes through below mentioned call stack
Class / WD component |
Method |
CL_HTTP_SERVER |
EXECUTE_REQUEST |
CL_NWBC_HTTP |
IF_HTTP_EXTENSION~HANDLE_REQUEST |
CL_NWBC_HTML_BASE |
IF_NWBC_REQUEST_HANDLER~HANDLE_REQUEST |
CL_NWBC_HTML_BASE |
HANDLE_APPLICATION_WINDOW_BODY |
CL_NWBC_RUNTIME35 |
IF_NWBC_RUNTIME~EPCM_DO_OBJECT_BASED_NAVIGATE |
CL_NWBC_RUNTIME35 |
IF_NWBC_RUNTIME~RESOLVE_NAVIGATION |
CL_NWBC_RUNTIME35 |
IF_NWBC_RUNTIME~GET_OBN_TARGETS |
CL_NWBC_RUNTIME35 |
RESOLVE_OBN |
The important method in the above call stack is RESOLVE_NAVIGATION. This method has an export parameter called URL, which determines what content to display in new window. First SAP gets all the OBN targets maintained in all roles of current user. This data is stored in table AGR_HIER_BOR.
This information is maintained in ‘MENU’ tab of role in transaction PFCG. We need to maintain object and method names as shown below.
If we click on the magnifying class, you will see in the parameter assignment section, mapping between webdynpro application parameters and attributes of business object ‘sc’. You can check business object ‘sc’ using transaction SWO1.
After that it checks if the OBN target that we are interested in is part of these OBN targets. If not, system throes an error as shown below.
Once it finds an exact match, it extracts the URL from the data that we maintained in the user role in PFCG. This URL has details like which webdynpro application to call and with which competent configuration. In this case WD application is /SAPSRM/WDA_L_FPM_OIF and component configuration is /SAPSRM/WDAC_I_FPM_OIF_SC_PROF. So now we know exactly what to render on the new window.
URL : /sapsrm/wda_l_fpm_oif?WDCONFIGURATIONID=/SAPSRM/WDAC_I_FPM_OIF_SC_PROF&sapsrm_mode=DISPLAY&sapsrm_botype=BUS2121
So that’s the end of blog. Thank you… Wait… there is still some mystery. How the system knows which SC to display. Here comes Application configuration controller (AppCC) of OIF /SAPSRM/WDC_FPM_OIF_CONF(To know more about AppCC read my blog Dynamically Modifying Purchase order FPM in SRM7 using custom AppCC). Event FPM_START is first event that gets triggered before anything is displayed in the window. First control goes to OVERRIDE_EVENT_OIF method of component controller of AppCC. From there call stack goes as below
Class / WD component |
Method |
/SAPSRM/WDC_FPM_OIF_CONF |
Component controller OVERRIDE_EVENT_OIF |
/SAPSRM/CL_FPM_OVRIDE_OIF |
OVERRIDE_EVENT_START |
/SAPSRM/CL_FPM_OVRIDE_OIF_SC_P |
INIT_OBJECTS |
/SAPSRM/CL_CH_WD_TASKCONTAINER |
/SAPSRM/IF_CLL_TASK_CONTAINER~GET_BOM_SC |
/SAPSRM/CL_CH_WD_MAP_FACTORY |
/SAPSRM/IF_CH_WD_MAP_FACTORY~CREATE_SC_MAPPER |
/SAPSRM/CL_CH_WD_BOM_SC |
CONSTRUCTOR |
In constructor of /SAPSRM/CL_CH_WD_BOM_SC there is code to extract parameter values stored in task container class.
lt_url_params = io_task_container->get_url_parameters( ).
Shopping cart guid is part of lt_url_parameters.
How these parameters are first added to task container class is really difficult to understand. So let’s not worry about it 🙂
I hope you enjoyed reading the blog.
Keep sharing. Thank you 🙂
Dear Sankara,
Thanks for sharing this blog.
Nishant
Thank you
It a good info, Keep posted.
Rgds,
Nayeem.
Thanks Nayeem..
Hi,
Nice conclusion. I also found this logic in another document, such as Rfx.
mark it in my list.
Thanks for sharing this.
BR,
Ivy
Hi Ivy Li,
Nice to hear a comment from an expert like you... 🙂
thanks,
sankar.