Quantcast
Channel: SCN : Discussion List - Scripting Languages
Viewing all articles
Browse latest Browse all 325

Copy SAP FIELDS TO EXCEL

$
0
0

Hi,

 

I have a situation in my work, i would like to copy a SAP field value to Exel. Kindly help me out.

 

i would like to copy the Capitalisation date of a particular asset to the Excel. Tried to save the Field in a variable and want to have the same in Excel.

 

Below is the script i have it.. KINDLY HELP ME OUT ( I AM VERY NEW TO SAPGUI SCRIPT I DONT HAVE THE ACCESS TO REPORTS AND SE16N)

 

If Not IsObject(application) Then

   Set SapGuiAuto  = GetObject("SAPGUI")

   Set application = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(connection) Then

   Set connection = application.Children(0)

End If

If Not IsObject(session) Then

   Set session    = connection.Children(0)

End If

If IsObject(WScript) Then

   WScript.ConnectObject session,     "on"

   WScript.ConnectObject application, "on"

End If

 

session.findById("wnd[0]/usr/ctxtANLA-ANLN1").text = strAsset

session.findById("wnd[0]/usr/ctxtANLA-ANLN2").text = "0"

session.findById("wnd[0]/usr/ctxtANLA-BUKRS").text = strCc

session.findById("wnd[0]/usr/ctxtANLA-BUKRS").setFocus

session.findById("wnd[0]/usr/ctxtANLA-BUKRS").caretPosition = 4

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/usr/subTABSTRIP:SAPLATAB:0100/tabsTABSTRIP100/tabpTAB01/ssubSUBSC:SAPLATAB:0200/subAREA3:SAPLAIST:1142/ctxtANLA-AKTIV").setFocus

Cell = session.findById("wnd[0]/usr/subTABSTRIP:SAPLATAB:0100/tabsTABSTRIP100/tabpTAB01/ssubSUBSC:SAPLATAB:0200/subAREA3:SAPLAIST:1142/ctxtANLA-AKTIV").setFocus

session.findById("wnd[0]/tbar[0]/btn[11]").press


Viewing all articles
Browse latest Browse all 325

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>