Start MS word, execute macro IN BACKGROUND
Hello Colleagues,
With the upgrade to SAP 6.04, we've got the opportunity to use MS word IN a SAP GUI container to write some letters to our customers. I've been asked to create a background job to retrieve some information from the Word document via a VSB macro into an EDIFACT message.
This al works fine in the foreground (of course), but in the background the I receive an error message regarding the Control Framework that he GUI can not be activated. So the issue is the triggering of the macro, or the use of MS word, but to start MS Word in the background with the i_oi_ole_container_control.
The following code triggers the error message.
data: g_container_control type ref to i_oi_ole_container_control.
data g_dynpro_custom_container type ref to cl_gui_docking_container.
call method
g_container_control->init_control
exporting
r3_application_name = 'i.s.h.med: WordContainer'(000)
inplace_enabled = 'X'
inplace_scroll_documents = 'X'
inplace_resize_documents = 'X'
inplace_show_toolbars = 'X'
parent = g_dynpro_custom_container
register_on_close_event = 'X'
register_on_custom_event = 'X'
importing
retcode = retcode.
Does anyone has a clue how to overcome this issue?
Best regards,
Johan Ellen
Edited by: C. CareForICT on Dec 7, 2009 2:48 PM
Edited by: C. CareForICT on Dec 7, 2009 2:54 PM
I'm sorry, but I don't think you understand the issue (or I don't understand your answer!!).
The word file (*.doc) is stored IN SAP. Together with i.s.h.med (part of IS-Healthcare) the functionality is introduced to use MS word and store the word file IN SAP.
When I want to create an EDIFACT message I need some information from the word document. Therefor I made a FM that retrieve the .doc file from the SAP database, start MS word, triggers a Macro and the returned content of the macro is used in the EDIFACT message. This must work in the background.
I do understand that the presentation layer doesn't work in the background, but I hoped that there is a solution available to start MS word in an invisible state, without the presentation layer, but with the ability to trigger the macro's of the .doc .
So XML is not an option, I need MS word.
Thanks,
Johan Ellen
Similar Messages
-
Database Alert Macros issue while executing the macros in Background
Hi All,
I am facing some problems while executing the Database alert macros in Background/Process Chain.
There are two macros for which the problem exists.
1.Excess Projected Inventory above Max
The logic here is, the alert should work for Only Fixed Lot size Procedure.
If the Stock on hand (projected EA) > (Safety Stock (EA) + Full SOQ (EA)) then alert = "Projected inventory is XX% above MAX".
XX is the Percent above Max.
Note: SOQ => fixed lot size.
2.Excess Actual Days of Supply
The Logic here is, the alert should work for all Lot size Procedures except for "Fixed lot size".
Actual Days Supply >=180 days. (current -> future buckets)
- For every receipt cell check the Actual Days Supply - if >= 180 days.
The macros are working perfectly as expected.Hi Abhi,
Hope you are doing good.
Yes exactly, the macros are working in foreground/Interactively but not in the Background via Process chain. Let me send the details again.
Issue :
I am facing some problems while executing the Database alert macros in Background/Process Chain.
There are two macros for which the problem exists.
1.Excess Projected Inventory above Max
The logic here is, the alert should work for Only Fixed Lot size Procedure. But in Background the alerts are getting created for Lot for Lot and other Planning procedures..
If the Stock on hand (projected EA) > (Safety Stock (EA) + Full SOQ (EA)) then alert = "Projected inventory is XX% above MAX".
XX is the Percent above Max.
Note: SOQ => fixed lot size.
2.Excess Actual Days of Supply
The Logic here is, the alert should work for all Lot size Procedures except for "Fixed lot size". But in Background the alerts are getting created for the Fixed Lot size procedures too..
Actual Days Supply >=180 days. (current -> future buckets)
- For every receipt cell check the Actual Days Supply - if >= 180 days.
The macros are working perfectly as expected in Foreground/Interactively but the samething is not happening while executing the macro in Background/Process Chain.
I have tried running these macros in different sequences(Default/Start/Macro) but couldn't able to resolve the issue.
Thanks in Advance,
Jay. -
Macro not executed in the background
Hi all,
I have created a macro to delete the forecast and it is working fine in the foreground, whenever i'm running it in the background, it is not getting executed, no forecast is getting deleted. In the job logs, it is giving the following message:
"No data has been changed; data must not be save".
I have tried with different logics for the macro, all are working fine in the foreground, coming to backgroung, nothing is working.
Please help me out.
Thank you
Regards,
RajHello Raj,
For executing in background, you need to set up the 'DP Background' jobs. You must ensure that you define a proper Selection ID in Interactive Planning and assign this selection ID to the DP background job. If the proper selection data is not picked up by the Macro, then it may not execute. Hope you have followed that process of setting up Background DP jobs correctly.
Also note that when you execute the Macro in background, if data has not been changed, you generally get a message saying 'data not saved'. -
Error executing macro Forecast Invoice Plan
Hello,
We are facing the error in a process chain of DP background processing. The error description is : "Error executing macro Forecast Invoice Plan. " In the details, it shows that the same error is there for all the CVCs of that planning area.
Can someone please throw some light on possible root cause for this error?
Thanks & Regards,
AmitHi Amit,
To start with, check your macro in /SAPAPO/ADVM - Macro Workbench.
Is it green?
If no, try to activate.
If yes, check and reactivate
Question: is your macro working in interactive?
Thanks and Regards
Julien -
Issue with How Do I Run an Executable in the Background ?
Hi,
I am trying to run a LabVIEw executable in the background, but none of the methods described in the discussion forum and on ni.com seems to be working. I am using LV 2011 on a Win 7 64-bit machine in case this matters.
I tried the method described in "How Do I Run an Executable in the Background as a Start-Up Application?" (http://digital.ni.com/public.nsf/websearch/4A8B626B55B96C248625796000569FA9?opendocument&Submitted&&... but I still see a fragment of a window at the bottom near the start-button (Exhibit 1). Exhibit 2 shows that it only consists of the title bar. (I have customized the window appearance as described, and added the two items
HideRootWindow=True
UseTaskBar=FALSE
to the *.ini file.)
I also tried disabling all the other items in the Customize Window Appearance menu with the same result.
Then I tried the method described in "Running a LabVIEW Executable as a Background Process" (http://digital.ni.com/public.nsf/allkb/EFEAE56A94A007D586256EF3006E258B) adding the FP.Open method to the VI and setting the state to hidden. I got the same result (Exhibit 1).
Is there anything I need to do in addition or different for my windows version? I appreciate your help. Thank you.
Solved!
Go to Solution.
Attachments:
LabVIEW Executable.zip 4058 KB(I have customized the window appearance as described, and added the two items
HideRootWindow=True
UseTaskBar=FALSE
to the *.ini file.)
No you did not
They need to go in the exe's ini so the exe sees them
Jeff -
Run-time error 5097 on Selection.InsertFile in Word 2013 macro
We have been running Word 2003 macros to generate large volumes of document files for 10+ years.
Now running the same code using Word 2013, we are getting Run-time error '5097' on this line of code:
Selection.InsertFile filename:=pFileName
We have over 40 code sets that potentially call in 20,000+ Word document files. 98% of the time this code will work; but several files will not insert when this code attempts to execute.
Any ideas?
Thanks,
Dawn CoxHi Dawn,
Thanks for the detail information for this issue.
Since the file even can't be inserted manually, this issue is not relative to the code. To get more effective response, I would suggest that you reopen a new thread in
Microsoft Community- Word or
TechNet- Word forum.
And to help other communities to narrow this issue, I also suggest that you provide a sample file for testing.
Hope it is helpful.
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Execution of Macro in Background job
We have created a macro in APO DP that uses 4 characteristics and a key figure. As part of the macro we are executing a Z-function that we have created. The problem occurs when executing the macro in a background job. When the background job is executed the macro processes correctly (performs the correct calculations) for the first CVC that is processes, but it is not able to process the rest of the CVCs.
<b>ERROR: "There are no plannable characteristic combinations",</b>
The function copies data from the CVC that is being processed (source CVC) to another CVC (target CVC). The values for the target CVC to which the data has to be copied for a particular key figure are determined from the paramaters that are given to the function in the macro.
The steps followed in the function are the following:
1- Determine the relation between source and target CVC, ie, from the source CVC that is being processes in the macro, the function determines the target CVC to which the data has to be copied.
2- Call BAPI "BAPI_PBSRVAPS_GETDETAIL2" to retrieve the valuesthat are in the Planning Book for the source CVC.
3- Perform the addition of data (value retrieved from the source CVC is added to the target CVC).
4- Write value to the target CVC using BAPI "BAPI_PBSRVAPS_CHANGEKEYFIGVAL2".
When using the BAPIs the aggregation level used is the same aggregation as the one specified in the Background job used for the execution of the macro.
This macro is executed in a background job, and the copy/calculation is performed correctly for the first CVC (first CVC contained in the data selection used in the background job) processed, but then it does not do anything else for the rest of CVC's. The error message given by the log of the background job is <b>"There are no plannable characteristic combinations",</b> when in fact, the characteristic combinations do exist in the Planning Object Structure.Hi Ian
There are not any other macros in the planning book.
In addition, if we execute the macro in interactive mode we have another error at the end of the execution (after doing all the combinations):
<b>Invalid data status</b>.
and we don't know why.
Regards -
Robohelp is unable to start Microsoft Word - one more time
Hello,
I read the previous post on this error and though the message is the same, I do not think the circumstances are.
I am using xp prof, office 2010 (recently installed), and after that I recently d/l Robohelp 9 from the website.
I am having many problems involving this message, but I set out today to get the simplest problem i could.
So, i opened RH 9 from the start menu/all programs. I selected 'new project' and filled in the title and file name (project2_title, project2_file)
The RH explorer opens. Word 2010 opens. The RH explorer still has an hourglass. After 1-2 minutes, the hourglass is gone and the error message 'Robohelp is unable to start Microsoft Word' appears.
I click 'ok'
Hourglass, blanked out RH explorer which eventually does return.
I click ctrl_t for a new topic, get the dialog, accept the defaults, and eventually the hour glass goes away and I have the same error message.
I click ok and i do not have the new topic when i expand the topic list.
When i first started this, i was able to add a topic, but no longer. (last week was when i started).
I have also tried to open the existing topic that was created using rh7 and having opened it, tried generating primary layout. I got an error file with an error for almost every topic. (But this can be the next problem).
Thanks for any help you can offer.
MiriamHello Miriam Schneidmill,
You can try this workaround.
First of all close Robohelp Word
Go to C:\Users\Username\AppData\Microsoft\Templates
and look for RoboHELP.dot and just rename that file extension to old, ggod or anything you wish, say Robohelp.bad.
Then close this.
Now try to open Robohelp Word and see are you facing the same issue or not?
Hope it helps!!!
Thank you -
Front-end functions cannot be executed in the background in SM37
Hi ,
I have developed a BDC program for Tcode HRUSER . The program is working fine in Frontend but when Executed in Background through SM37 gives a error -:
"Front-end functions cannot be executed in the background".
I am not using any function like GUI_DOWNLOAD or anything like that .
Thanks
Nikhil Arya.Hi ,
No , the program is not taking any inputs from the user .
when i am executing the program in background mode it is just showing the messages at the end which i am writing in the program for eg:
"creating a user for employee 2306328".
So , only the list of messages comes at the end .
Thanks
Nikhil Arya. -
Hello,
I'm designing my own website and want to know how to change the background color of a particular word without changing the background color of the rest of the text in a textbox. If i can't do this, how can I create a Table, similar to Excel with iWeb?
Thank you very much!
Roger.If i can't do this, how can I create a Table, similar to Excel with iWeb?
Read this :
Create and add a TABLE in iWeb »
More about a TABLE in iWeb »
Sample 1
Sample 2 -
Restrict 'Executing report in background' from selection screen
I want user to not to select option for executing report in background from Selection Screen of the program.
i.e. 'Execute Program in Background' option in 1st menu bar tab should either be disabled OR if user clicks on it then he should get error message on selection screen itself.
Thanks,
FalguniHi Falguni,
Write the code based on function code SJOB in the event AT SELECTION-SCREEN. Write the following code :
AT SELECTION-SCREEN
CASE SY-UCOMM.
WHEN 'SJOB'.
MESSAGE E000 WITH 'You cannot schedule background job'.
ENDCASE.
Thanks & Regards,
Faheem. -
Execute listcube in background - where is the file stored on app server
Hi,
I want to execute listcube in background.
to execute in background, the only output option available is Store in file (appl server).
My question is where is this file stored.
there is no information in the job log nor is there any spool.
Also, can I determine myself where is this output file written.I have a couple of questions that could lead to an answer to your question...
Does your BW environment have one or more application servers, in addition to the Database Central Instance (DBCI)? If so, do you use logon groups for SAP Logon so that the logon loads are balanced?
I'm asking these questions because if you have a multiple application server environment and logon balancing, you may not be logging onto the same server every time that you're executing LISTCUBE and it will save to the directory path of the server you're logged onto. -
When I start Firefox, I only get the background of my browser in the Firefox window. I the normal window for 1 second, but then it changes in only the background window. So without toolbar, or navigation. I already reinstalled it, but that doesn't fix the problem.
Try to disable hardware acceleration in Firefox.
Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
https://hacks.mozilla.org/2010/09/hardware-acceleration/
https://support.mozilla.org/kb/how-do-i-upgrade-my-graphics-drivers -
hi
we have one requirement for execute report in background
we want to run the report ME5A for a large date range and at plant level.
Due to this, transaction data selected is large and so reportis taking very long time when executed in foreground.
so requirement is
execute report in background (i know possible in SAP)
download the report output on desktop automatically
can you pl suggest how to do this without customisation
regards
saraHi Sara,
Go to ME5A then enter the required field then go to Programme and then select the option execute in background -
Stop all Message delivery until start-up class executes
On fail-over, I need to be able to keep any messages from topics/queues from being
sent to the destinations until a start-up class has been executed and initialized
the application. The problem is that the mdb's get deployed prior to the start-up
class and immediately receive messages. This causes problems since the mdb's
rely on the start-up class executing prior to onMessage().
Is there a way to disable message delivery on start-up, prior to the deployment
of the mdb's? I have implemented a temporary solution of checking to see if the
start-up class has been bootstrapped, and if no, do a thread sleep for a specified
time period and repeat...
I had the same issue. We wrote a startup class that spawns a new thread to
make a JMX call to see if the server is up. Once the server is up, the
thread would deploy the MDB using JMX.
Adarsh
Looks like you came up with a good workaround.
"Josh Zook" <[email protected]> wrote in message
news:3cbd9fff$[email protected]..
>
> On fail-over, I need to be able to keep any messages from topics/queues
from being
> sent to the destinations until a start-up class has been executed and
initialized
> the application. The problem is that the mdb's get deployed prior to the
start-up
> class and immediately receive messages. This causes problems since the
mdb's
> rely on the start-up class executing prior to onMessage().
>
> Is there a way to disable message delivery on start-up, prior to the
deployment
> of the mdb's? I have implemented a temporary solution of checking to see
if the
> start-up class has been bootstrapped, and if no, do a thread sleep for a
specified
> time period and repeat...
Maybe you are looking for
-
Javascripting no longer works on version 23 breaks ckeditor
My website ZenCart uses CKEditor in the admin to update product and web pages. I just replaced my hard drive and download the newest version of Firefox. The new version 23 breaks CKEditor - it no longer shows up and allows me to edit my products and
-
Header text not printed for scheduling agreement
Hi All, I have issue with header text print out for scheduling agreement (SA). In SA when I am manually writing some note and then taking print out, system is giving me correct output with maual note. I have one standard text (ST) which I need to be
-
EP 6.0 and BW in one system
Hello everyone, We currently run EP 6.0 SP2 and BW 3.1 on separate systems and are looking at upgrading to EP 6.0 SP11 and BW 3.5. We have a Netweaver sandbox system setup with both running in one system and I was thinking we could consolidate these
-
What is the best way to query planned orders or work orders for make items and identify the buy component that is short for supply and vice versa?
-
Can't Hear Videos, but i can hear 'em?
i have a video on my ipod that i can see but i can't hear. whats up with that?