This website is not affiliated with, sponsored by, or approved by SAP AG.

Attaching external documents to posting

SAP-OTHER (SAP Components and all other issues that do not fall under above categories)

Moderators: thx4allthefish, Snowy

Attaching external documents to posting

Postby GregWantuch » Wed Dec 30, 2009 6:51 am

HI,

Do you know the solution how to attach external documents like outlook messages, excel files to each sap posting (e.g journal entry) Normal way is to use transaction FB03, but using this I'm able to attach only one document at time. Is there any transaction which would attach the same document to 150 or more postings?

I don't have administrator access, I can only do it using transactions.

I've tried to make it faster by creating a VBA macro in Outlook 2003 which saves message in .msg format on hard drive, then opens sap, sendkeys to open fb03 but there is no button to "create attachment"

Any help would be appreciated
Many Thanks
Greg

GregWantuch
 
Posts: 2
Joined: Wed Dec 30, 2009 6:36 am

Re: Attaching external documents to posting

Postby AtholH » Wed Dec 30, 2009 2:29 pm

Nothing standard. You could try use SAP DMS to object link to a transaction but it doesn't come with an object standard to FB03 so you would have to create it with ABAP.
Specialist SAP DMS Consultant/Specialist SAP ArchiveLink Consultant
http://www.linkedin.com/in/atholhill
AtholH
 
Posts: 85
Joined: Wed Nov 29, 2006 4:43 pm
Location: Melbourne, Australia

Re: Attaching external documents to posting

Postby GregWantuch » Tue May 31, 2011 8:05 am

Hi All,

I have returned to above subject few days ago. Please see my solution for attaching emails directly from Outlook to SAP
If anyone is interested please see the VBA code I used in Outlook 2007 (vba saves email as msg on Z:\Test, copy the file path to clipboard then open SAP, FB03 input data from textboxes. Enters the document, opens create attachment window and then STOP :)

1) code which opens userform

Sub RunAttacher()
JVForm.Show
End Sub

2) JVForm has 3 text fields where you should put document no., fiscal year and company code. The same as in FB03. After clicking "proceed"
macro starts.

Private Sub CommandButton1_Click()

Dim Original As Outlook.MailItem
Dim subject As String
Dim MyText As DataObject, TextStr As String
Dim spath As String
Set MyText = New DataObject


'Kill ("Z:\test\*.*")
Set Original = Application.ActiveExplorer.Selection(1)
Original.SaveAs "Z:\TEST\" & TextBox1.Text & ".msg", o1msg
spath = "Z:\TEST\" & TextBox1.Text & ".msg"

MyText.SetText spath
MyText.PutInClipboard

If Not IsObject(Wantuch) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set Wantuch = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = Wantuch.Children(0)
End If
If Not IsObject(Session1) Then
Set Session1 = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject Session, "on"
WScript.ConnectObject Wantuch, "on"
End If
Session1.findById("wnd[0]").maximize
Session1.findById("wnd[0]/tbar[0]/okcd").Text = "/nfb03"
Session1.findById("wnd[0]").sendVKey 0
Session1.findById("wnd[0]/usr/txtRF05L-BELNR").Text = TextBox1.Text
Session1.findById("wnd[0]/usr/ctxtRF05L-BUKRS").Text = TextBox2.Text
Session1.findById("wnd[0]/usr/txtRF05L-GJAHR").Text = TextBox3.Text
Session1.findById("wnd[0]/usr/txtRF05L-GJAHR").SetFocus
Session1.findById("wnd[0]/usr/txtRF05L-GJAHR").caretPosition = 4
Session1.findById("wnd[0]").sendVKey 0
Session1.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
Session1.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_PCATTA_CREA"

Unload Me

End Sub

Now user activates SAP FB03 session and pastes the path by CTRL + V

Unfortunatelly I don't know other solution for pasting the path where email is saved. I can't control explorer window (nothing works here :(, sendkeys, autohotkey..) If anyone knows the solution how to control the explorer window from VBA then kindly share :)

Thanks
Greg
GregWantuch
 
Posts: 2
Joined: Wed Dec 30, 2009 6:36 am


Return to SAP Other

Who is online

Users browsing this forum: No registered users and 3 guests




This website is not affiliated with, sponsored by, or approved by SAP AG.