%INCREASENO% in OUTPUTNO and ACT_FILE_NO

Hi experts,
When I want to use process chain for Load transactional data from BI Infoprovider there are some variables I cannot understand and could not find any documentation about them.
INFO(%TEMPNO1%,%INCREASENO%)
INFO(%ACTNO%,%INCREASENO%)
TASK(/CPMB/INFOPROVIDER_CONVERT,OUTPUTNO,%TEMPNO1%)
TASK(/CPMB/INFOPROVIDER_CONVERT,ACT_FILE_NO,%ACTNO%)
TASK(/CPMB/INFOPROVIDER_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
Basically I want to hardcode OUTPUTNO, or ACT_FILE_NO in process type in process chain but I do not know what sould I enter for %INCREASENO% ?
And for TRANSFORMATIONFILEPATH when I want to hardcode variable value in process chain there is not enough character limit, do you have comment on this also?
Thanks in advance,
Ergin Ozturk

Hi Ergin,
I believe, that is better you created a new data package and then setup the hard code there.
Once I have needed to do this. The steps is the following:
Step1 - Create a new data package, calling the Process Chain /CPMB/LOAD_INFOPROVIDER .Save it.
Step2 - Enter in organize list package, click on modify package, into the advanced parameters tip the code below and make your chenges. Basically you need to change the transformation file path (for this use UJFS t-code) and the infoprovider.
INFO(%MYTRANSFORMATIONFILE%,ROOTWEBFOLDERSAPP_SETPLANNINGDATAMANAGERTRANSFORMATIONFILESTRA_ODHR06.xls)
INFO(%INFPROVIDER%,ODHR06)
INFO(%TEMPNO1%,%INCREASENO%)
INFO(%ACTNO%,%INCREASENO%)
TASK(VP_BI_BPC_CONVERT,OUTPUTNO,%TEMPNO1%)
TASK(VP_BI_BPC_CONVERT,TRANSFORMATIONFILEPATH,%MYTRANSFORMATIONFILE%)
TASK(VP_BI_BPC_CONVERT,ACT_FILE_NO,%ACTNO%)
TASK(VP_BI_BPC_CONVERT,SUSER,%USER%)
TASK(VP_BI_BPC_CONVERT,SAPPSET,%APPSET%)
TASK(VP_BI_BPC_CONVERT,SAPP,%APP%)
TASK(VP_BI_BPC_CONVERT,FILE,%INFPROVIDER%)
TASK(/CPMB/CLEAR_DATA,INPUTNO,%TEMPNO1%)
TASK(/CPMB/APPEND_LOAD,INPUTNO,%TEMPNO1%)
TASK(/CPMB/APPEND_LOAD,ACT_FILE_NO,%ACTNO%)
Step3 (optional) - If you want to schedule this data package, you can do this in BPC or you can create a process chain in BW that calls a ABAP report UJD_TEST_PACKAGE, with a variant selecting your package.
PS: I have no idea what that ACT_FILE_NO or the other are.
I hope this helps.
Regards
Lucas
Edited by: Lucas Gabriel Corrêa da Costa on Jan 10, 2012 8:12 PM

Similar Messages

  • Import and Copy Opening – One Task & One Prompt Set

      Hi Experts,
    We want to create one data manager package that contains both import from BW with UI and copy opening. We ran into some issues.  Maybe you can help:
    We created a new process chain that contains both tasks, and created a new DM package that has both scripts.  Users only want to enter parameters such as entity and time one time for both tasks...
    When I commented out the Copy opening prompts, relying on the prompts from the Import from BW, I receive an error. The message:
    Task name LOAD
    INFOPROVIDER:
      Replace and Clear Submit
    count: 1114
      Replace and Clear Reject
    count: 0
      Aggregate count: 376
      Submit count: 312
      Reject count: 0
    Invalidate
    selection condition
    I believe it's because we have the %SELECTION% recorded twice in the script (thinking that we will take the variables from the import and continue to use for the Copy opening).
    Also thought to switch around the prompts, hard coding the cube name, and using a dimension selection screen like Copy Opening.
    Any ideas for executing this would be really helpful.  Below please find the standard scripts for
    import and Copy Opening.
    Thank you.
    Eyal Feiler
    'DEBUG(ON)
      PROMPT(INFOPROVIDERSELECTION,%InforProvide%,%SELECTION%,"Please select the InfoProvider
    and set selection (InfoProvider list is restricted by both
    BW and BPC authority)",,)
    PROMPT(KEYDATE,%KEYDATE%,"Key date",0)
    INFO(%TEMPNO1%,%INCREASENO%)
    INFO(%ACTNO%,%INCREASENO%)
    TASK(/CPMB/INFOPROVIDER_CONVERT,OUTPUTNO,%TEMPNO1%)
      TASK(/CPMB/INFOPROVIDER_CONVERT,ACT_FILE_NO,%ACTNO%)
      INFO(%MAI_TRFILE%,\ROOT\WEBFOLDERS\MAI_CONSO\Consolidation\DATAMANAGER\TRANSFORMATIONFILES\EXAMPLES\MA\T_FILE_BW_IPROVIDER.XLS)
    TASK(/CPMB/INFOPROVIDER_CONVERT,TRANSFORMATIONFILEPATH , %MAI_TRFILE%)
    TASK(/CPMB/INFOPROVIDER_CONVERT,SUSER,%USER%)
    TASK(/CPMB/INFOPROVIDER_CONVERT,SAPPSET,%APPSET%)
    TASK(/CPMB/INFOPROVIDER_CONVERT,SAPP,%APP%)
    TASK(/CPMB/INFOPROVIDER_CONVERT,FILE,%InforProvide%)
    TASK(/CPMB/INFOPROVIDER_CONVERT,INFOPROV_SELECTION,%SELECTION%)
    TASK(/CPMB/INFOPROVIDER_CONVERT,KEYDATE,%KEYDATE%)
    TASK(/CPMB/LOAD_IP,PREPROCESSMODE,0)
    TASK(/CPMB/LOAD_IP,TARGETMODE,2)
    TASK(/CPMB/LOAD_IP,INPUTNO,%TEMPNO1%)
    TASK(/CPMB/LOAD_IP,ACT_FILE_NO,%ACTNO%)
    TASK(/CPMB/LOAD_IP,RUNLOGIC,1)
    TASK(/CPMB/LOAD_IP,CHECKLCK,1)
      TASK(/CPMB/LOAD_IP,KEYDATE,%KEYDATE%)
      'supress
    prompts for work status default script and replace - default as yes and yes
    replace.  Default transformation file
    path
    Copy opening
    PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%,%CATEGORY_DIM%,%CURRENCY_DIM%,%TIME_DIM%")
    TASK(/CPMB/OPENING_BALANCES_LOGIC,SUSER,%USER%)
    TASK(/CPMB/OPENING_BALANCES_LOGIC,SAPPSET,%APPSET%)
    TASK(/CPMB/OPENING_BALANCES_LOGIC,SAPP,%APP%)
    TASK(/CPMB/OPENING_BALANCES_LOGIC,SELECTION,%SELECTION%)
    TASK(/CPMB/OPENING_BALANCES_LOGIC,LOGICFILENAME,COPY_OPENING.LGF)

    Hi Vadim,
    Thanks, isn't %SELECTION% passed to the process chain?  I see that the process chain RUN LOGIC contains a field SELECTION.  If the value is passed, then I have to change that too?
    2) If we change the value to SELECTION2, then how does this variable capture the parameters for the dimensions?  I am commenting out the prompt of the copy opening script keeping the first prompt below from the import from BW in order to capture the parameters for both scripts.
    PROMPT(INFOPROVIDERSELECTION,%InforProvide%,%SELECTION%,"Please select the InfoProvider
    and set selection (InfoProvider list is restricted by both
    BW and BPC authority)",,)
    Thanks
    Eyal

  • Run the data copy and comments copy with the same key

    I want to Run the data copy and comments copy with the same key.
    I tried to challenge in the following way, but it is an error.
    1. Add the process in the process chain [/ CPMB / COPY] process in the process chain that could be new to copy the chain [/ CPMB / COPY_COMMENTS] (see capture)
    2. Select the newly can process chain to add a package, make a change to the script as follows:
    PROMPT(RADIOBUTTON,%TARGETMODE%,"Handling of records",0,{"Copy records with match key","Copy by replacing data in same data region of Entity, Category, Time and Audit ID"},{"0","2"})
    PROMPT(RADIOBUTTON,%RUNLOGIC%,"Select whether to run default logic for stored values after copying",0,{"Yes","No"},{"1","0"})
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when importing data.",1,{"Yes, check for work status settings before importing","No, do not check work status settings"},{"1","0"})
    PROMPT(COPYMOVEINPUT,%SELECTION%,%TOSELECTION%,"Select the members to COPY and where to",%DIMS%,0)
    INFO(%TEMPNO1%,%INCREASENO%)
    INFO(%ACTNO%,%INCREASENO%)
    INFO(%SELECTION_KEYDATE%,)
    TASK(/CPMB/COPY_COMMENTS,SELECTION,%SELECTION%)
    TASK(/CPMB/COPY_COMMENTS,TOSELECTION,%TOSELECTION%)
    TASK(/CPMB/COPY_COMMENTS,CHECKLCK,%CHECKLCK%)
    TASK(/CPMB/CM_CONVERT,OUTPUTNO,%TEMPNO1%)
    TASK(/CPMB/CM_CONVERT,ACT_FILE_NO,%ACTNO%)
    TASK(/CPMB/CM_CONVERT,SAPPSET,%APPSET%)
    TASK(/CPMB/CM_CONVERT,SAPP,%APP%)
    TASK(/CPMB/CM_CONVERT,SELECTION,%SELECTION%)
    TASK(/CPMB/CM_CONVERT,TOSELECTION,%TOSELECTION%)
    TASK(/CPMB/CM_CONVERT,KEYDATE,%SELECTION_KEYDATE%)
    TASK(/CPMB/CLEAR_SOURCE_CUBE,CHECKLCK,1)
    TASK(/CPMB/CLEAR_SOURCE_CUBE,SELECTION,%TOSELECTION%)
    TASK(/CPMB/CLEAR_SOURCE_CUBE,KEYDATE,%SELECTION_KEYDATE%)
    TASK(/CPMB/CLEAR_SOURCE_CUBE,DUMPLOADMODE,3)
    TASK(/CPMB/APPEND_LOAD,PREPROCESSMODE,0)
    TASK(/CPMB/APPEND_LOAD,TARGETMODE,0)
    TASK(/CPMB/APPEND_LOAD,INPUTNO,%TEMPNO1%)
    TASK(/CPMB/APPEND_LOAD,ACT_FILE_NO,%ACTNO%)
    TASK(/CPMB/APPEND_LOAD,RUNLOGIC,1)
    TASK(/CPMB/APPEND_LOAD,CHECKLCK,1)
    TASK(/CPMB/APPEND_LOAD,KEYDATE,%SELECTION_KEYDATE%)

    We performed similar transfer of data from one planning model to another using DM package linked to BADI. In your scenario there is additional complexity of doing lookup from DSO and should be possible.
    Also check these references for performing lookup in DSO.
    abap code to populate data from DSO
    something about SAP: How to look for DSO’s tables?

  • BPC10 - Data manager package for dimension  data export and import

    Dear BPC Expers,
    Need your help.
    I am trying to set up a data manager package for first time to export dimension - master data from one application and import in another application ( both have same properties) .
    I created a test data manager package from Organize > add package > with  process chain /CPMB/EXPORT_MD_TO_FILE  and Add
    In the advance tab of each task there are some script logic already populated. please find attached the details of the script logic written under each of the tasks like MD_Source, concvert and target .
    I have not done any chnages in the script inside the task .
    But when i run the package , I have selected a dimension 'Entity' but in second prompt ,it ask for a transformation file , and syatem autometically add the file ... \ROOT\WEBFOLDERS\COLPAL\FINANCE\DATAMANAGER\TRANSFORMATIONFILES\Import.xls
    I have not changed anything there
    in the next prmpt , it ask for a output file ..and it won't allow me enter the file name .....i
    Not sure how to proceed further.
    I shall be greatfull if someone guide me from your experiance  how to set up a simple the data manager package for master data export from dimension . Should I update the transformation file in the script for import file and  output file in the advance tab. how and what  transformation file to be created and link to the data manager package for export / import .
    What are the steps to be executed to run the package for exporting master data from dimension and import it another application .
    Thanks in advance for your guidance.
    Thanks and Regards,
    Ramanuj
    =====================================================================================================
    Detals of the task
    Task : APPL_MD-SOURCE
    (DIMENSIONMEMBER, %DIMENSIONMEMBERS%, "Please select dimension", "Please select members", %DIMS%)
    (TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    (OUTFILE,,"Please enter an output file",Data files (*.txt)|*.txt|All files(*.*)|*.*)
    (RADIOBUTTON,%ADDITIONINFO%,"Add other information(Environment,Model,User,Time)?",1,{"Yes","No"},{"1","0"})
    (%TEMPNO1%,%INCREASENO%)
    (%TEMPNO2%,%INCREASENO%)
    (/CPMB/APPL_MD_SOURCE,SELECTION,%DIMENSIONMEMBERS%)
    (/CPMB/APPL_MD_SOURCE,OUTPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,INPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
    (/CPMB/EXPORT_MD_CONVERT,SUSER,%USER%)
    (/CPMB/EXPORT_MD_CONVERT,SAPPSET,%APPSET%)
    (/CPMB/EXPORT_MD_CONVERT,SAPP,%APP%)
    (/CPMB/EXPORT_MD_CONVERT,OUTPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,INPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,FULLFILENAME,%FILE%))
    (/CPMB/FILE_TARGET,ADDITIONALINFO,%ADDITIONINFO%))
    Task : EXPORT_MD_CONVERT
    (DIMENSIONMEMBER, %DIMENSIONMEMBERS%, "Please select dimension", "Please select members", %DIMS%)
    (TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    (OUTFILE,,"Please enter an output file",Data files (*.txt)|*.txt|All files(*.*)|*.*)
    (RADIOBUTTON,%ADDITIONINFO%,"Add other information(Environment,Model,User,Time)?",1,{"Yes","No"},{"1","0"})
    (%TEMPNO1%,%INCREASENO%)
    (%TEMPNO2%,%INCREASENO%)
    (/CPMB/APPL_MD_SOURCE,SELECTION,%DIMENSIONMEMBERS%)
    (/CPMB/APPL_MD_SOURCE,OUTPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,INPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
    (/CPMB/EXPORT_MD_CONVERT,SUSER,%USER%)
    (/CPMB/EXPORT_MD_CONVERT,SAPPSET,%APPSET%)
    (/CPMB/EXPORT_MD_CONVERT,SAPP,%APP%)
    (/CPMB/EXPORT_MD_CONVERT,OUTPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,INPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,FULLFILENAME,%FILE%))
    (/CPMB/FILE_TARGET,ADDITIONALINFO,%ADDITIONINFO%))
    Task : FILE_TARGET
    (DIMENSIONMEMBER, %DIMENSIONMEMBERS%, "Please select dimension", "Please select members", %DIMS%)
    (TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    (OUTFILE,,"Please enter an output file",Data files (*.txt)|*.txt|All files(*.*)|*.*)
    (RADIOBUTTON,%ADDITIONINFO%,"Add other information(Environment,Model,User,Time)?",1,{"Yes","No"},{"1","0"})
    (%TEMPNO1%,%INCREASENO%)
    (%TEMPNO2%,%INCREASENO%)
    (/CPMB/APPL_MD_SOURCE,SELECTION,%DIMENSIONMEMBERS%)
    (/CPMB/APPL_MD_SOURCE,OUTPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,INPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
    (/CPMB/EXPORT_MD_CONVERT,SUSER,%USER%)
    (/CPMB/EXPORT_MD_CONVERT,SAPPSET,%APPSET%)
    (/CPMB/EXPORT_MD_CONVERT,SAPP,%APP%)
    (/CPMB/EXPORT_MD_CONVERT,OUTPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,INPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,FULLFILENAME,%FILE%))
    (/CPMB/FILE_TARGET,ADDITIONALINFO,%ADDITIONINFO%))
    ================================================================================

    1. Perhaps you want to consider a system copy to a "virtual system" for UAT?
    2. Changes in QAS (as with PROD as well) will give you the delta. They should ideally be clean... You need to check the source system.
    Another option is to generate the profiles in the target system. But for that your config has to be sqeaky clean and in sync, including very well maintained and sync'ed Su24 data.
    Cheers,
    Julius

  • Exporting YTD and PERIODIC data

    Hi all,
    I've adjusted a data manager package so that the YTD and PERIODIC measures are automatically selected for export to a flat file. Whenever I want to save the package the script automatically changes and removes either YTD or PERIODIC.
    Any idea how I can change the script so that both YTD and PERIODIC measures are exported to a flat file?
    Thank you.
    DEBUG(ON)
    'PROMPT(SELECTINPUT,,,,"%DIMS%")
    PROMPT(SELECTINPUT,,,,"ENTITY,TIME,C_CATEGORY")
    'PROMPT(MEASURELIST,%MEASURES%,"Please select measures")
    'PROMPT(TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    PROMPT(TEXT,%FILE%,"Please enter an output application file",)
    'PROMPT(RADIOBUTTON,%ADDITIONINFO%,"Add other information(Appset,Application,User,Time)?",1,{"Yes","No"},{"1","0"})
    'PROMPT(TEXT,%TYPE%,"Please enter the Process Chain Type",)
    INFO(%DIMVALUE%,E=24)
    INFO(%TEMPNO1%,%INCREASENO%)
    INFO(%TEMPNO2%,%INCREASENO%)
    INFO(%MEASURES%,YTD,PERIODIC)
    TASK(/CPMB/APPL_TD_SOURCE,DIMENSIONVALUE,%DIMVALUE%)
    TASK(/CPMB/APPL_TD_SOURCE,MEASURES,%MEASURES%)
    TASK(/CPMB/APPL_TD_SOURCE,OUTPUTNO,%TEMPNO1%)
    TASK(/CPMB/APPL_TD_SOURCE,SELECTION,"%SELECTION%DIMENSION:C_ACCT||DIMENSION:C_DATASRC|INPUT,INPUT_DIFF_ECCS,INPUT_ADJ,INPUT_GW,MJ_MANJE|DIMENSION:FLOW|F_999|DIMENSION:GROUPS|N_GROUP|DIMENSION:INTCO|I_TOTAL|DIMENSION:RPTCURRENCY|LC|")
    TASK(/CPMB/EXPORT_TD_CONVERT,INPUTNO,%TEMPNO1%)
    TASK(/CPMB/EXPORT_TD_CONVERT,TRANSFORMATIONFILEPATH,\ROOT\WEBFOLDERS\Company\LEGAL\DATAMANAGER\TRANSFORMATIONFILES\SYSTEM FILES\Export.xls)
    TASK(/CPMB/EXPORT_TD_CONVERT,SUSER,%USER%)
    TASK(/CPMB/EXPORT_TD_CONVERT,SAPPSET,%APPSET%)
    TASK(/CPMB/EXPORT_TD_CONVERT,SAPP,%APP%)
    TASK(/CPMB/EXPORT_TD_CONVERT,OUTPUTNO,%TEMPNO2%)
    TASK(/CPMB/TD_APPL_SERVER_TARGET,INPUTNO,%TEMPNO2%)
    TASK(/CPMB/TD_APPL_SERVER_TARGET,FULLFILENAME,/interface/BIP/BPC_export/%FILE%)
    TASK(/CPMB/TD_APPL_SERVER_TARGET,ADDITIONALINFO,1)

    Sgt. Rock wrote:
    Should I just break down and buy server space to exchange complete files?
    This the way I do with my co-work production or when work in a team with guys who live out of my country. You can pack/archive the whole project folder into Zip or (Rar - I do that using my PC) which reduces the project folder content globally.
    There are quite many "free hosts" in our days so you can manage your work via Email or Skype and use such servers if you can not afford to buy any hosting space. To my opinion it is best to provide the original project when you use same apps, plugins etc. Any tricky export, audio file compression etc will be time consuming for your partner...
    !http://img59.imageshack.us/img59/4967/aglogo45.gif!

  • Setting the Client Count per WLAN and per AP radio

    Hi
    We use WLC 5508 with 7.4. We tried to set max allowed clients per AP radio to 30 through GUI. We have APs with 80 clients associeted though.
    Has anyone else tried this feature?
    When entering config wlan max-associated-clients max-clients wlan-id we got 
    "WLAN/Guest-Lan/remote-lan is enabled.Please disable to configure max associated clients."
    GUI doesn't show that message, should it?  In GUI, Is it necesary to disable WLAN before too?
    Thanks
    This is the show wlan output

    No, the GUI does some stuff automatically, like disablen/enabling the WLAN when you make the change.
    From teh CLI *you* have to do them.
    HTH,
    Steve
    Please remember to rate useful posts, and mark questions as answered

  • A problem with Threads and loops.

    Hi, I have some code that needs to be constantly running, like while(true)
          //code here
    }However, the code just checks to see if the user has input anything (and then if the user has, it goes to do some other stuff) so I don't need it constantly running and hogging up 98% of the CPU. So I made my class (which has the method that needs to be looped, call it ClassA) implement Runnable. Then I just added the method which needed to be looped into the public void run()
    I have another class which creates an instance of the above class (call it ClassB), and the main(String[] args) is in there.
    public static void main(String[] args)
              ClassA test = new ClassA();
              Thread thread = new Thread(test.getInstanceOfClassA());
              thread.start();
              while(true)
                           //I do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...) but I can't think of away to get it to run - sleep - run -sleep forever. Can someone help me?

    Hi, I have some code that needs to be constantly
    running, like while(true)
    //code here
    }However, the code just checks to see if the user has
    input anything (and then if the user has, it goes to
    do some other stuff) so I don't need it constantly
    running and hogging up 98% of the CPU. Where does the user input come from. Are you reading from an InputStream? If so, then your loop will be blocked anyway when reading from the InputStream until data is available. During that time, the loop will not consume processor cycles.
    public static void main(String[] args)
              ClassA test = new ClassA();
    Thread thread = new Thread(test.getInstanceOfClassA());I have never seen this idiom. If ClassA instanceof Runnable, you simply write new Thread(test).
              thread.start();
              while(true)
    //I do not know what to put
    do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...)Yeah, why would you want to call it more than once given that you have an infinite loop in ClassA.run()?
    Harald.
    Java Text Crunching: http://www.ebi.ac.uk/Rebholz-srv/whatizit/software

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with Threads and "plase wait..."-Window

    Hi everyone,
    I have a problem that I'm not able to solve in any way... I have a time-consuming task (a file decryption) which I execute in a separate thread; I've used the SwingWorker class, like suggested by sun-tutorial, and it works right. The problem is that I have to wait that the decryption have finished before continuing with program-execution. Therefore I would like to display a "please wait"-window while the task runs. I've tryed all the possible ways I know but the problem is always the same: the waitWindow is displayed empty, the bounds are painted but the contents no; it's only painted when the decrypt-task has finished. Please help me, I have no more resources....
    decrypt-file code:
    public class DecryptFile {
      private String cryptedFileNameAndPath;
      private ByteArrayInputStream resultStream = null;
      // need for progress
      private int lengthOfTask;
      private int current = -1;
      private String statMessage;
      public DecryptFile(String encZipFileNameAndPath) {
        cryptedFileNameAndPath = encZipFileNameAndPath;
        //Compute length of task...
        // 0 for indeterminate
        lengthOfTask = 0;
      public ByteArrayInputStream getDecryptedInputStream() {
        return this.resultStream;
       * Called from ProgressBarDemo to start the task.
      public void go() {
        current = -1;
        final SwingWorker worker = new SwingWorker() {
          public Object construct() {
            return new ActualTask();
        worker.start();
       * Called from ProgressBarDemo to find out how much work needs
       * to be done.
      public int getLengthOfTask() {
        return lengthOfTask;
       * Called from ProgressBarDemo to find out how much has been done.
      public int getCurrent() {
        return current;
      public void stop() {
        current = lengthOfTask;
       * Called from ProgressBarDemo to find out if the task has completed.
      public boolean done() {
        if (current >= lengthOfTask)
          return true;
        else
          return false;
      public String getMessage() {
        return statMessage;
       * The actual long running task.  This runs in a SwingWorker thread.
      class ActualTask {
        ActualTask () {
          current = -1;
          statMessage = "";
          resultStream = AIUtil.getInputStreamFromEncZip(cryptedFileNameAndPath); //here the decryption happens
          current = 0;
          statMessage = "";
      }The code that calls decryption and displays waitWindow
          final WaitSplash wS = new WaitSplash("Please wait...");
          final DecryptFile cryptedTemplate = new DecryptFile (this.templateFile);
          cryptedTemplate.go();
          while (! cryptedTemplate.done()) {
            try {
              wait();
            } catch (Exception e) { }
          this.templateInputStream = cryptedTemplate.getDecryptedInputStream();
          wS.close();Thanks, thanks, thanks in advance!
    Edoardo

    Maybe you can try setting the priority of the long-running thread to be lower? so that the UI will be more responsive...

  • Problem with threads and graphics

    I have a thread that chooses paths for a Travelling salesman problem, it then calls a TSPdraw class and passes it the path, which the class then draws. the problem is when i have two threads it creates two windows but only draws a path in one of them. any ideas where i`m going wrong

    Are you using swing components? Swing isn't threadsafe. If you have multiple threads that want to update your UI you need to use the SwingUtilities.invokeLater(...)or invokeAndWait(...). There is a page in the swing tutorial about this at: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

  • Problem with threads and ProgressMonitor

    Dear Friends:
    I have a little problem with a thread and a ProgressMonitor. I have a long time process that runs in a thread (the thread is in an separate class). The thread has a ProgressMonitor that works fine and shows the tasks progress.
    But I need deactivate the main class(the main class is the user interface) until the thread ends.
    I use something like this:
    LongTask myTask=new LongTask();
    myTask.start();
    myTask.join();
    Now, the main class waits for the task to end, but the progress monitor don`t works fine: it shows only the dialog but not the progress bar.
    What's wrong?

    Is the dialog a modal dialog? This can block other UI updates.
    In general, you should make sure that it isn't modal, and that your workThread has a fairly low priority so that the UI can do its updating

  • Problem with threads and/or memory

    I'm developing an application where there are 3 threads. One of them sends a request to the other, and if the 2nd can't answer it, it sends it to the 3rd (similar to CPU -> CACHE -> MEMORY). When i run the program with 1000-10.000 requests, no problem occurs. When i run it with 300.000-1.000.000 requests, it sometimes hangs. Is this a problem with the garbage collector, or should it be related to the threads mecanism.
    (note: eache thread is in execution using a finite state machine)

    i had been running the program inside Netbeans.
    Running the jar using the command line outside
    Netbeans i have no more problems... Does Netbeans use
    it's own JVM?Depends how you set it up, but look under the options. There are settings for the compiler and jvm that it uses.

  • Null And " "

    What is the difference between these two lines of codes?
    String currentFile = null;
    String currentFile = "";
    Edited by: AMARSHI on Jul 10, 2008 7:07 AM

    The reference variable itself, takes up the same amount of space, of course, as all references are the same size. Now, the object on the heap is a different story. With null there isn't one, of course (or if there is there is only one for the entire VM), and for the second a String object will be created in the String pool (once again, only one for the entire VM that every = "" assignment will use). But really, what difference does it make? If there is a difference, it is on the order of a few bytes (at max) for the entire VM, and if this is a concern, your probably doing something else greviously wrong. This miniscule difference should not concern you.
    Edit: And "nulling" variables to "save" memory is also not something you should be concerned with. Either the variable will go out of scope and the object garbage collected anyway, or it's in constant use and so will not be taking up any extraneous heap space. If one of those is not the case, you are, once again, doing something greviously wrong.

  • And/or if statement in rtf templates.

    Hi all,
    I'm using XML Publisher 4.5.
    I have created a word template file (rtf) for my reports. I need to be able to show some content in the template file by using and and/or if statement.
    fx. <?if:doc_type='STANDARD'?> OR <?if:doc_type='DEFAULT'?>
    How can I do this?
    In advance thank you.
    Best regards
    Kenneth

    Hi D,
    Thank you for your answer.
    I have seriously thought about that solution; but I don't think it's a smart way to do it.
    If i do it like that, i need to copy the whole table and paste it inside the if statements.
    I have two xml elements that I need to make the decisions on. POH_PO_TYPE & CP_RELEASE_NUM.
    POH_PO_TYPE can be: STANDARD, RELEASE or BLANKET.
    CP_RELEASE_NUM can be: '' or N
    If POH_PO_TYPE is RELEASE AND CP_RELEASE_NUM is not ''
    OR POH_PO_TYPE is STANDARD
    OR POH_PO_TYPE is BLANKET AND CP_RELEASE_NUM is ''
    THEN show table (which contains the whole PO).
    It shall show the content of the PO in any of these cases.
    BR Kenneth

Maybe you are looking for

  • Payable Approval error out!

    Hi all, I have encoutered an error while performing the payable approval process. Herewith the error messages :- MSG-00001: After SRWINIT MSG-00002: After Get Company Name MSG-00003: After Get NLS Strings MSG-00010: Setting NULL parameters MSG-00011:

  • Word 2007 and Outlook 2007 error 1605

    Hi, I keep getting this error with Word 2007 and Outlook 2007: Microsoft Office word can't open thesaurus. Windows Installer error 1605. Please advise on how to fix this.

  • Discount after exise and before VAT

    Hi, We have a requirement like this Basic Price Rs.100/- Excise 10%       10/- Discount       Rs 20/- Vat 4%        Rs.3.60/-  (100+10-20=90*4) I am not able to resolve this requirement in 5.0 and 6.0 I have resolved in 4,7 by using sub total 6 in Di

  • Wiki Images Missing with external address

    Hey Guys, We have a issue with a wiki server. The set up is a mac pro server with 2 partitions. The data partition holds all service data (this should not make any difference). The School is a Department of Education school so is very limited what ca

  • System Management Delegation

    Hi I have 3 forest. (A, B,C)   - Forest A (1 Root domain)  - Forest B (1 root domain and 1 child) -  Forest C (1 Root domain) I install a new SCCM 2012 R2 CU3 i root domain (Forest B). - Forest A trust Forest B - Forest C no trust with forest B or C