Skip to Content
avatar image
Former Member

SAP Screen Personas - script for Purchase Order Document Overview

Hello experts,

In SAP Screen Personas 3.0 SP3, I want to perform a script who opens the Document Overview tab, select a purchase order from the respective selection variant and copy it with the adopt button, closing then the Document overview. It would be like an copy purchase order functionality.

From recording those manual actons I get this:

// Document overview ON
session.findById("wnd[0]/tbar[1]/btn[8]").press();
// Open Selection variant button
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell/dropmenuSELECT").executeWebRequest("post", "action", "12", null, null);
// Choose purchase orders query
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell/dropmenuSELECT/shell/item0050569C61461ED6A5F1F494C20B3CA4NEWPO_QUERY").select();
// Set purchase order number
session.findById("wnd[0]/usr/ctxtSP$00014-LOW").text = "4500081473";
// Submit
session.findById("wnd[0]/tbar[1]/btn[8]").press();
// Select the first line in the tree
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").executeWebRequest("post", "action", "41", "type=item&node_key=%20%20%20%20%20%20%20%20%20%201⁢em=%26Hierarchy", null);
// Press the Copy button
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell/btnCOPY").press();
// Document overview OFF
session.findById("wnd[0]/tbar[1]/btn[9]").press();

Syntax is ok, but when I try to run it, I get this error:

ZMM_ME21N_COPY_TEST>SAPLMEGUI>0014>wnd[0]/scrptPersonas_0
Error, 2016-10-21, 16:44:37.270270
Error during script execution:
session.findById(...).select is not a functionTypeError: session.findById(...).select is not a function
at eval ([AppID:ME21N]>[Flavor:ZMM_ME21N_COPY_TEST]>[Script:wnd[0]/scrptPersonas_0-onLoad]:9:132)
at Object.self.executeScriptInternal (http://my.server/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/ScriptingEngine.js?20161017234402:57:8937)
at Object.sap.personas.scripting.executeScriptInternal (http://my.server/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/ScriptingEngine.js?20161017234402:57:11437)
at eval (http://my.server/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/Runtime.js:1:617)

The script seem to stop right after opening the Document Overview.

Any idea about how I can do this properly?

Thanks in advance for any help you can provide me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 30, 2018 at 07:29 PM

    Hi Marco,

    Have you tried to identify whether there is a FM that can bring the information faster for you?
    Have you also updated the SP level? Nowadays we have SP6, with new features.

    Kind regards,
    Cris

    Add comment
    10|10000 characters needed characters exceeded