I am working on a project to pull some data for a process and need to pull the text from an SAP task that is designated as long text. I need to click a button which opens a document that contains the long text as a paragraph. This data is contained in a Microsoft word-looking document which appears as a popup from the SAP interface.
The script recorder cannot be used in this situation since it is somewhat outside of SAP and therefore I cannot click on a field to record the data present.
When I try to record opening the document (pressing the long test button in SAP) it records a long string of gibberish and does not allow me to simply change from a .setfocus as would be seen when clicking on a field, to a .text in order to extract the statements to excel.
I am working on a project to pull some data for a process and need to pull the text from an SAP task that is designated as long text. I need to click a button which opens a document that contains the long text as a paragraph. This data is contained in a Microsoft word-looking document which appears as a popup from the SAP interface.
The script recorder cannot be used in this situation since it is somewhat outside of SAP and therefore I cannot click on a field to record the data present.
When I try to record opening the document (pressing the long test button in SAP) it records a long string of gibberish and does not allow me to simply change from a .setfocus as would be seen when clicking on a field, to a .text in order to extract the statements to excel.
Here is a piece of the recorded script when pressing the "long text view" button. It is too large to paste the whole thing but it basically repeats. The code ends in a .press about 30,000 characters after this snippet.
Does anyone know the code associated with pulling long text data of this sort?
session.findById("wnd[0]").maximize
session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB10/ssubSUB_GROUP_10:SAPLIQS0:7210/tabsTAB_GROUP_20/tabp20\TAB03/ssubSUB_GROUP_20:SAPLIQS0:7125/tblSAPLIQS0MASSNAH_VIEWER2/btnQMICON-LTMASS[5,0]").setFocus
session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB10/ssubSUB_GROUP_10:SAPLIQS0:7210/tabsTAB_GROUP_20/tabp20\TAB03/ssubSUB_GROUP_20:SAPLIQS0:7125/tblSAPLIQS0MASSNAH_VIEWER2/btnQMICON-LTMASS[5,0]").press
session.findById("wnd[0]/usr/cntlSCMSW_CONTAINER_2102/shellcont/shell").setDocument 1,"e1xydGYxXGFkZWZsYW5nMTAyNVxhbnNpXGFuc2ljcGcxMjUyXHVjMVxhZGVmZjBcZGVmZjBcc3RzaGZkYmNoMFxzdHNoZmxvY2gzN1xzdHNoZmhpY2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MpO317XGZkYm1ham9yXGYzMTUyNVxmYmlkaSBcZnJvbWFuXGZjaGFyc2V0MTg2XGZwcnEyIFRpbWVzIE5ldyBSb21hbiBCYWx0aWM7fQ0Ke1xmZGJtYWpvclxmMzE1MjZcZmJpZGkgXGZyb21hblxmY2hhcnNldDE2M1xmcHJxMiBUaW1lcyBOZXcgUm9tYW4gKFZpZXRuYW1lc2UpO317XGZoaW1ham9yXGYzMTUyOFxmYmlkaSBcZnN3aXNzXGZjaGFyc2V0MjM4XGZwcnEyIENhbGlicmkgTGlnaHQgQ0U7fXtcZmhpbWFqb3JcZjMxNTI5XGZiaWRpIFxmc3dpc3NcZmNoYXJzZXQyMDRcZnBycTIgQ2FsaWJyaSBMaWdodCBDeXI7fQ0Ke1xmaGltYWpvclxmMzE1MzFcZmJpZGkgXGZzd2lzc1xmY2hhcnNldDE2MVxmcHJxMiBDYWxpYnJpIExpZ2h0IEdyZWVrO317XGZoaW1ham9yXGYzMTUzMlxmYmlkaSBcZnN3aXNzXGZjaGFyc2V0MTYyXGZwcnEyIENhbGlicmkgTGlnaHQgVHVyO317XGZoaW1ham9yXGYzMTUzNVxmYmlkaSBcZnN3aXNzXGZjaGFyc2V0MTg2XGZwcnEyIENhbGli
I found a way to get what I need. Once you open the long text, you will be brought to a Microsoft word like document. At the top of your SAP bar, you will see a goto option. Click that and then click configure editor. Uncheck Graphical PC Editor. You will find that the interface will change and now each line is treated as a field. Script recorder works well with this format so you can record clicking the long text button to open the text, as well as each line in the long text document. I just created a loop to add each line together until the paragraph was complete.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With