on 12-26-2014 2:49 PM
Hi Team,
Happy Christmas to All.
I want to automatically download the attachment from SAP which are uploaded through T-code FB03.
I have recorded below script for downloading the attachments but save as doalog box is not getting recorded.
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]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/nfb03"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/txtRF05L-GJAHR").setFocus
session.findById("wnd[0]/usr/txtRF05L-GJAHR").caretPosition = 4
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_VIEW_ATTA"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").currentCellColumn = "BITM_DESCR"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectedRows = "0"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").contextMenu
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectContextMenuItem "%ATTA_EXPORT"
session.findById("wnd[1]/tbar[0]/btn[0]").press
Could somone help me to get the script for downloading attachments from SAP T-code Fb03.
Thanks for your support.
Hi
I have the same problem, i can't open the window explorer for atachment from fb03 with VBA, I have been reading ABAP resource but is not working yet.
Someone can reply with code? Or is not possible, thanks
Bst Regardings
Lucas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Team,
I forgot to attach the image
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]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/nfb03"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/txtRF05L-BELNR").text = "100001235"
session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").text = "3300"
session.findById("wnd[0]/usr/txtRF05L-GJAHR").text = "2015"
session.findById("wnd[0]/usr/txtRF05L-GJAHR").setFocus
session.findById("wnd[0]/usr/txtRF05L-GJAHR").caretPosition = 4
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_VIEW_ATTA"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").currentCellColumn = "BITM_DESCR"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectedRows = "0"
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").contextMenu
session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectContextMenuItem "%ATTA_EXPORT"
After this script line, i get the popup box which i have attached in JPG format for your reference.
Could any of you help me to get the complete script which will enable me to download 1 by 1 attachments on the basis of the information pulled from the excel through below script line
session.findById("wnd[0]/usr/txtRF05L-BELNR").text = "100001235"
session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").text = "3300"
session.findById("wnd[0]/usr/txtRF05L-GJAHR").text = "2015"
Thanks for your support and will be waiting for better solution on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dan: we've worked with attachment downloads sometime ago, but with a very different approach. The solution was an ABAP report. Here are some details, if you think it's usefull I'll give you more details.
The idea was to download the attachments of the purchase requests. Table SRGBTBREL has a record of each attachment in SAP (as far as I know for any module). Searching there we got an ID for the attachment, which is used with function module SO_DOCUMENT_READ_API1 to download the attachment to a file on our network.
Cheers,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.