cancel
Showing results for 
Search instead for 
Did you mean: 

Copying in SAP

Former Member
0 Kudos

Hello, I apologize if I am in the wrong place but I am brand new  and I'm not sure where I'm supposed to be. But in case I am in the right place here is my problem I am creating a script with VBA that pulls the text from a text box  in sap  that looks like  the one attached. My issue is when I use the code i normally do ActiveCell.Value = session.FindById("wnd[0]/usr/ssubSUBSCREEN_1O_MAIN:SAPLCRM_1O_MANAG_UI:0110/subSUBSCREEN_1O_WORKA:SAPLCRM_1O_WORKA_UI:2100/subSCR_1O_MAINTAIN:SAPLCRM_1O_UI:1100/subSCR_1O_MAINTAIN:SAPLCRM_ACTIVITY_UI:0300/subSCRAREA0:SAPLCRM_ACTIVITY_UI:3010/subVARIABLE_SUBSCREEN:SAPLCRM_ACTIVITY_UI:7300/tabsTABSTRIP_ACTIVITY/tabpT\TACT_HD01/ssubHEADER_DETAIL:SAPLCRM_ACTIVITY_UI:3300/ssubSCRAREA3:SAPLCRM_ACTIVITY_UI:1200/ssubTEXT_SUBSCREEN:SAPLCOM_TEXT_MAINTENANCE:2010/cntlTEXT_CONTROL_2010/shellcont/shell").Text But this way puts all of the text in one cell and makes a long strain that is pretty much unusable for what I am trying to do. My goal is to just to copy and paste the text into excel so it keeps the lines separate. I have come up with 2 ways that I can accomplish this but each comes with its own problems: 1. I can select all of the text in text box but I can't figure out any way to tell my code to copy it.  I have tried using send keys with no success but to be honest I am not sure what I am doing. 2. If I double click the box  it  opens a bigger version of the box which then gives me a drop down option to copy but I can't figure out how to highlight everything as when I record no matter what I do it doesn't show any activity inside of the box. Because of this I don't know how I would go about finding what the session.findByid........ etc etc. is? Any help anyone can give me would help a ton thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

holger_khn
Contributor
0 Kudos

Hello.

As this longtext in SAP is always tricky I prefer to call an functionmodule via Excel VBA(function module RFC_READ_TEXT)-

With the right Input as selection criteria you can easily read required longtext into Excel via RFC. It only will work if you have required Access in your System. I have gave up to check other Options as RFC_READ_TEXT fulfill my requirements for 100%.