VBA > SAP ALGUÉM CONHECE?

CHDSSANTOS 01/01/2015 18:47:49
#443508
Olá pessoal!

Conhecem o programa ERP chamado SAP?
A empresa que trabalho comprou o modulo financeiro deste sistema e como analista de MIS do financeiro, muitas tarefas que já tinha automatizado na ferramenta antiga voltaram ao zero.
Pesquisei bastante na Internet e até achei algumas coisas bacanas, mas nada que atendesse minha necessidade.
Consegui uma maneira de enviar instruções e informações para tela do programa, mas não consegui nada que me permita identificar o resultado de um campo.
Alguém aqui já teve esta mesma necessidade com o SAP?
Já até procurei cursos, mas de VBA especifico para integração Excel VBA > SAP não achei. Já encontrei alguns cursos de ABAP, mas não é exatamente o que preciso, pois a TI da empresa nunca me liberaria tal acesso. Precisa ser uma solução que, para todos os efeitos, um perfil de usuário seja o bastante.
Bom se alguém tiver algo a compartilhar agradeço muito!
TUNUSAT 02/01/2015 15:34:23
#443534
CHDSSANTOS,

Achei isto ... vê se te ajuda ... mas o SAPo não te dá suporte?!?

==============================================
SAP and VBA (Visual Basic for Applications)

http://abap4.tripod.com/SAP_and_VBA__Visual_Basic_for_Applications_.html
==============================================
These Excel files contain a macro that will retrieve data from an SAP system. Feel free to use the macro however you feel. There is no warranty that this macro will work for you. The original macro was developed and tested using a 3.1H system, and the 4.6 version was provided by Clayton Mergen.

[Ô] The Excel macro to extract data from SAP has been updated (the 4.6 version)

If you are having trouble getting the excel examples to work, the following notes from
Yoherman may help.

To Make your excel work with SAP RFC :

1. For Windows 95/OSR2 you must install Winsock Ver. 2
Download from Microsoft if you don[ô]t have it

2. You must have DLL file :
a. Microsoft Foundation Class 4.2 : MFC42.dll > Owner : Microsoft
b. Microsoft Visual C++ Runtime Library : MSVCIRT.dll,and
MSVCP60.dll
Owner : Microsoft
c. SAP RFC library : LIBRFC32.dll

3. You must have SAP ActiveX and register :
a. WDTAOCX.ocx
b. WDTLOG.ocx
c. WDTFUNCS.ocx

All file tested and work at 3.1I and 4.6X

3.1 Version of Excel macro -

4.6D version of excel worksheet and macro -

The following files provide a Microsoft Access example of retrieving data from SAP. This code was developed by Pierre Johansson, with some input by me, and is based on the Excel code above.

Access code as a text file -
Access Database with code -

Here is an example of a call transaction using Excel, and calling transaction SE16.

Please look at the notes below for some other comments. As it stands, the transaction call is not useful, other than as an example. For example, the excel sample that I have attached calls SE16 to display KNA1. The list that is created (of customers) is not returned to excel. All that is returned to excel is a message indicating the success or failure of the transaction.

NOTE: This example makes a call to SE16, to display table KNA1. All that is returned from the CALL TRANSACTION is the message that appears on the botton line of the SAP screen (if you were doing the transaction from SAP).

NOTE: The results of the transaction are not shown. The transaction is executed, and the message result is returned. This means that this is not suitable for calling transactions that return data that you want to use.

If you want to see the results of a transaction (ie the transaction runs a report) you should do it some other way. A possible way would be to write an RFC enabled function in SAP that would take a report and its parameters as input, and it would send back an internal table with the results of the report.

Performing a Call Transaction via Excel (tested with 4.6D) -

==============================================

Vb codes (or VBA macro code) for access SAP, and run one RFC
http://www.erpgreat.com/abap/vb-codes-or-vba-macro-code-for-access-sap-and-run-one-rfc.htm

==============================================

VBA pulling data from SAP for dummies
http://stackoverflow.com/questions/19452461/vba-pulling-data-from-sap-for-dummies

==============================================

control sap with vba
http://www.mrexcel.com/forum/excel-questions/468098-control-sap-visual-basic-applications.html

==============================================

VÍDEO - A integração entre o Excel, o Access e a plataforma SAP...
http://www.vbasystems.com.br/solucoes.aspx?id=3

==============================================


[][ô]s,
Tunusat.
Faça seu login para responder