SAP data extraction with multiple macros

Franz68

New Member
Joined
Sep 14, 2017
Messages
2
Hi all,

I'm retrieving data from the SAP Erp system using a main macro that calls several macros, using a structure like this:

sub Main()

call Macro1 'get parameters from the Excel worksheet
call Macro2 'input some basic parameters in SAP
call Macro3 'get first data from a SAP transaction
call Macro4 'get first data from another SAP transaction
call Macro5 'get first data from another SAP transaction

end sub

My problem is that the execution stops after the first data are retrieved from SAP, so at the end of Macro3.

The only way I found until now, is to insert in any subsequent macro (I'm retrieving data from more than 2 SAP transactions...) the check if the data needs to be retrieved or not (there are checkboxes on the worksheet to tell Excel which report needs to be downloaded).
But this is increasing the number of code lines...

There is anyone there that has better ideas?

Thanks a lot in advance

Ciao from Berlin
Franz
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I found the solution... I was, encapsulating the macros to call the transactions in a If... elseif... series, due to copy from a previous version that was using VBScripts to call the transactions... But now every macro needs to be enclosed only in an If... end if.

Ciao
Franz
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top