on 02-26-2016 4:07 PM
Hi all,
I have created a function whereby I can create a side panel (similar to NWBC) in the normal SAP GUI. This was initially initiated via the Generic Object Service (GOS) button but the client doesn't want us to mess with the GOS settings. This function works great via GOS, although its a few extra clicks for the user.
So we thought it would be a simple task to move the side panel call from GOS to Personas... The screen looks like this:
The problem is that the side panel is not created even though we know that the button above calls the RFC because it updates the text in the box indicated.
Any ideas??
I thought it might be an RFC "destination" thing... Because the same code works via the GOS option, and it also works when when I test the function module in SE37..
-----------------------------------------------------------------------
The Personas code is:
//Set RFC parameters
var rfc = session.createRFC("ZPM_SIDE_PANEL_ORDER");
var aufnr = "000008000000";
rfc.setParameter("GV_AUFNR", aufnr);
rfc.requestResults(JSON.stringify(["GV_OUTPUT"]));
rfc.send();
//Return results and display
var output = rfc.getResult("GV_OUTPUT");
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:*/txtPersonas_1455783817053").text = output;
Hi Pete,
SAP Screen Personas 3.0 SP2 runs every function module executed using our scripting engine in a separate background RFC session. We do this for security reasons. As your function module is running as a background job you will not be able to open any sidebar from your own function module.
Nevertheless it should be still possible implementing a sidebar using classical enhancements (without SAP Screen Personas).
Best regards,
Dominik Ofenloch
Personas ABAP Development Lead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the feedback Dominik, that's what we guessed.
We know that we can using classical options. If fact we have this working with it being triggered via GOS functionality. But the client is a little wary of this option - hence the Personas investigation.
Just one point.. If you allowed Personas to call standard function modules (non-RFCs) then wouldn't the security issue disappear?
PeteA
Hi PeteA,
we decided to allow only RFC-enabled function modules as we assume/expect that RFC-enabled function modules have to be secured as they are remote-enabled. Enabling all function modules for scripting would also mean that everyone who is able to execute scripts + do some client debugging/editing can execute any function module he likes.
If you like to enable a non-rfc-enabled function module you can still do this by wrapping it with your own rfc-enabled function module.
Best regards,
Dominik
Hi Dominik,
Yeah - but were back to the same point - the RFC looses the connection to the transaction..
Another issue I see here is that I cannot pickup the data from ABAP memory to use in my FM as once again there is no connection to the back-end transaction. So I cannot calculate/determine information based on the data in the current session (i.e. before I save the document).
Wouldn't the whitelist table control which FMs that can be used?
PeteA
Hi PeteA,
with Personas SP2 unfortunately you don't have any other options. If you need to pass data between different sessions and session memory doesn't work you can still do a workaround using the database table and passing in some GUID/other key to read your session data from database.
I'm very sorry for that I currently cannot offer any other solution. Maybe this will be changed in future.
Best regards,
Dominik
Thanks Dominik,
You information has been very helpful and has saved us a great deal of time.
Unfortunately for us this means that Personas 3.0 has limitations which we need to resolve in other ways.
Having said that, in general this is a great product...
Please pass my issue on to the development team for consideration.
Regards
PeteA
I'm wondering if the problem may be that the FM is called in a separate session, not the one where the transaction is running... since currently this is the case with all RFCs initiated from Personas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi pete,
would you mind posting your FM..never tried it..
Also, just to let you know, personas scripting already has a method to put data from screen to side panel.
session.host.publishData(String sName, String sType, String sValue)
Push the property UNAME of type XYZ with value HELLO
Regards,
Sushant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's the Function Module:
function zpm_side_panel_order.
*"----------------------------------------------------------------------
*"*"Global Interface:
*" IMPORTING
*" VALUE(GV_AUFNR) LIKE AUFK-AUFNR
*" EXPORTING
*" VALUE(GV_OUTPUT) LIKE AUFK-KTEXT
*"----------------------------------------------------------------------
* data lv_init.
data ok_code type sy-ucomm.
data lv_repid type sy-repid.
data lv_dynnr type sy-dynnr.
* break-point.
if sy-tcode = 'SE37'.
lv_repid = 'SAPMSSY0'.
lv_dynnr = '0120'.
else.
lv_repid = 'SAPLCOIH'.
lv_dynnr = '3000'.
endif.
* Create docking container
create object gv_docking
exporting
repid = lv_repid
dynnr = lv_dynnr
side = gv_docking->dock_at_right
extension = 350.
* Create sidebar
create object gv_sidebar
exporting
background_color = cl_dd_area=>col_background_level2.
* Populate sidebar contents
perform fill_sidebar.
* Display sidebar
call method gv_sidebar->display_document
exporting
parent = gv_docking
container = 'HTML'
exceptions
html_display_error = 1.
concatenate lv_repid lv_dynnr into gv_output separated by space.
endfunction.
And here's the Form:
*----------------------------------------------------------------------*
***INCLUDE LZZPMF01.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form FILL_SIDEBAR
*&---------------------------------------------------------------------*
*& Fill the sidebar (see program DD_ADD_LINK)
*&---------------------------------------------------------------------*
form fill_sidebar .
data: lv_text type sdydo_text_element,
lv_equnr type equnr,
lv_tplnr type tplnr,
lv_count type i,
lv_etotal type i,
lv_ftotal type i,
lv_tcount(10) type c,
lv_icon type iconname,
lv_link type ref to cl_dd_link_element.
data lt_tab1 type ref to cl_dd_table_element.
data ls_tab1_c1 type ref to cl_dd_area.
data ls_tab1_c2 type ref to cl_dd_area.
data ls_tab1_c3 type ref to cl_dd_area.
data lt_tab2 type ref to cl_dd_table_element.
data ls_tab2_c1 type ref to cl_dd_area.
data ls_tab2_c2 type ref to cl_dd_area.
*&------------------------------------------------------------&*
call method gv_sidebar->initialize_document
exporting
background_color = cl_dd_area=>col_textarea.
*&------------------------------------------------------------&*
*& Sidebar Text (see program DD_ADD_LINK)
*&------------------------------------------------------------&*
lv_text = 'Side Panel:'(t01).
call method gv_sidebar->add_text_as_heading
exporting
text = lv_text
heading_level = '2'
sap_color = 'LIST_POSITIVE'.
call method gv_sidebar->underline.
endform.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.