Autocode Generate

hi,
i am using following query for auto code generation group wise
declare @temp as char(20)
IF $[OITM.ItmsGrpCod] = 101
BEGIN
set @temp=(select isnull(max(right(ItemCode,6)),0) + 1 from OITM where (ItmsGrpCod= 101) and (len(ItemCode)=7))
set @temp='FAB'+isnull(replicate(0,6-len(@temp)),'')+@temp
select cast(@temp as char(20))
END
ELSE IF $[OITM.ItmsGrpCod] = 104
BEGIN
set @temp=(select isnull(max(right(ItemCode,6)),0) + 1 from OITM where (ItmsGrpCod= 104) and (len(ItemCode)=7))
set @temp='BRD'+isnull(replicate(0,6-len(@temp)),'')+@temp
select cast(@temp as char(20))
END
but this does not increment code automatically every time it shows me FAB000001 and BRD000001
thanks
rahul

solved

Similar Messages

  • Matrixx 7 autocode does not generate ucb and subsystem wrapper for "procedures" code style

    Under matrixx 6.1.3  when procedure style code generation is specified  (-procs), autocode generates subsystem and ucb style wrappers (see below):
    Executing the command:   
    autostar -l c -o "test.c" -d "/usr/local/apps/matrixx-6.1.3/solaris_mx_61.3/case/ACC/templates/c_sim.dac" -procs "test.rtf"   
    *        AutoCode/C       Code Generator V6.1           *
    *      (C) Copyright 1998.  Integrated Systems Inc.     *
    *      Unpublished work; Restricted rights apply.       *
    *      All rights reserved.  Portions U.S. Patent.      *
    Loading 'test.rtf' ...
    Initializing ...
    Processing names ...
    Building symbols ...
    Executing '/usr/local/apps/matrixx-6.1.3/solaris_mx_61.3/case/ACC/templates/c_sim.dac' :
                 Generating procedures declarations ...
                 Generating procedures definitions ...
                 Generating subsystem-style wrapper (subsys_1)
                 around procedure tt1 ...
                 Generating UCB-style wrapper(s) around procedure(s) ...
    Output generated in test.c.
    However, matrixx 7.1.4 does not generate the wrappers. see below :
    Executing the command:   
    autostar -l c -o "test.c" -d "/data/binaries/SUN8/apps/matrix714/solaris_mx_71.4/case/ACC/templates/c_sim.dac" -procs "test.rtf"   
    *           AutoCode/C       Code Generator V7.1               *
    *  (c) Copyright 1987-2004.  National Instruments Corporation  *
    *          All rights reserved.  Portions U.S. Patent.         *
    Loading 'test.rtf' ...
    Initializing ...
    Processing names ...
    Building symbols ...
    Executing '/data/binaries/SUN8/apps/matrix714/solaris_mx_71.4/case/ACC/templates/c_sim.dac' :
                 Generating internal procedure declarations ...
                 Generating procedures definitions ...
                 Generating MAKEFILE in test.mk
    Output generated in test.c.
    Code generation complete.
    Please note that the autocode user's guide for matrixx7 indicates that these wrappers are generated when -procs is specified.
    -procs: Sets the template parameter procs_only_b as True, and default template only generates Procedure SuperBlocks and generates UCBsand subsystem wrappers for each of these procedures.  
    Is ther a way to create the same behavior under matrixx7 when -procs option is used?
    Thanks

    Hello,
    These wrappers were separated into different templates.  What you would need to do is to run the templates that you need. You can find these templates in the C:\Program Files\National Instruments\MATRIXx\mx_71.4\case\ACC\templates folder.
    Hope this helps.
    Ricardo S.
    National Instruments

  • Initialisation of iinfo table when using states

    Hi, I'm running into someting weird today and I'm not sure I understand well what to do. Right now what I'm triing to do is to run my software autocoded with part of it autocoded as a UCB.
    1- When I'm running the whole software autocoded, everything is fine. Case close!!!!
    Then I try to breakup stuff!
    2- I toke part of the code and autocoded it using the UCB templates
    3- Create a small UCB in the whole code that call the autocoded done in number 2
    So in the big software, I have this call to the UCB :
        NAVFAST_DLL_7_sr.STATES = 1;
        NAVFAST_DLL_7_sr.OUTPUTS = 1;
        /* USRxx(INFO,T,U,NU,X,XDOT,NX,Y,NY,RP,IP) */
        NAVFAST_DLL(&NAVFAST_DLL_7_sr, TIME, NAVFAST_DLL_7_u, 83, &X->
                                  NAVfast_7_S1[0], &XD->NAVfast_7_S1[0], 325, NAVFAST_DLL_7_y, 62, &
                                  dummy_f[0], &dummy_i[0]);
    In the UCB (NAVFAST_DLL), I have the call of the INIT part :
        int iinfo[] = {0, INFO->INIT, INFO->STATES, INFO->OUTPUTS};
        double rinfo[] = {T, TSAMP};
        if(INFO->INIT)
            NAVfast2_ucbhook(iinfo, rinfo, U, &NU, X, XDOT ,&NX, Y, &NY, RP, IP);
            INFO->INIT = FALSE;
            return;
    After that we got the code that I have autocoded in part 2 :
        void NAVfast2_ucbhook(iinfo, rinfo, U, NU, X, XD ,NX, Y, NY, R_P, I_P)
                   int     iinfo[], I_P[], *NU, *NX, *NY;
                   double  rinfo[], R_P[], U[], X[], XD[], Y[];
           //... Struct declaration
        if( (*NU != 83) || (*NY != 62) || (*NX != 325) ) {
              iinfo[0] = UCB_ERROR; goto EXEC_ERROR;
        if( iinfo[1] == 1 ) {
          Init_Application_Data();
          if( iinfo[3] == 1 && *NX != 0 ) {
             return;
        //... Rest of the code
    So as you can see here, the first time I inter into the INIT part, the call to Init_Application_Data() and it will exit directly because the iinfo[3] (outputs flag) is equal to 1 and my number of states is different that 0. So it means that all my sub functions are not initialise! After that, I look in the documentation (SystemBuild User Guide 14-4) and found you that I need to call the INIT part twice ?!?!?
        "INIT Mode
        INIT mode is performed once at the start of a simulation. During the INIT
        mode call, the value of the IINFO(2) flag is set to 1. If the UCB reference
        has states, the UCB is called in INIT mode twice.
            • Once while executing OUTPUT mode
            • Again while executing STATE mode"
    So does it mean that I have to call the ubchook function with the iinfo[3] = 1 and iinfo[2] = 0 once and then recall this fucntion with iinfo[3] = 0 and iinfo[2] = 1 under the INIT part of the UCB ?
    Do like this :
        int iinfo[] = {0, INFO->INIT, 0, INFO->OUTPUTS};
        double rinfo[] = {T, TSAMP};
        if(INFO->INIT)
            NAVfast2_ucbhook(iinfo, rinfo, U, &NU, X, XDOT ,&NX, Y, &NY, RP, IP);
            iinfo[2] = INFO->STATES;
            iinfo[3] = 0;
            NAVfast2_ucbhook(iinfo, rinfo, U, &NU, X, XDOT ,&NX, Y, &NY, RP, IP);
            INFO->INIT = FALSE;
            return;
    Thanks
    Charles-Etienne
    NGC Aerospace

    This is an interesting observation about some of details required to implement the 'model of computation' of a SystemBuild model within the generated code.
    Before I continue, may I make a suggestion that if you intend to use procedure code outside of a complete autocode-generated system, you might want to consider using the SDK interfaces. Briefly, the SDK is a template-based solution to generate APIs (C, C++ or Ada) to properly call procedure SuperBlocks from 'other' code. It's very easy to use and implements all the necessary details. Consult your version's documentaion for more as the mechanism to activate the SDK have changed between versions but the structure of the APIs are the same.
    Now, on to the post...
    The most important detail regarding this question is the context of the generated code. In this case, you're using the UCBHOOK mechanism and trying to call that API from other code.
    The problem is that the UCBHOOK is designed to be used as "wrapper code" around an autocode procedure and the 'hook' code is intended to be linked back into the simulator as a UCB for simulation purposes. It was not intended to be a general-purpose API call, that's why we created the SDK!
    Because the UCBHOOK is designed for use with the Simulator, that code must conform to the requirements of a hand-written SystemBuild UCB. And it is in attempting to match the autocode-generated implementation with what the Simulator does results in some odd code.
    What's happening is the code is reflecting a difference in how states are initialized within the Simulator's UCB context and the generated code. Briefly, the simulator must be very generic in how it calls UCB code. The simulator makes many separate calls to a UCB to perform match distinct operations, thus the complexity of the iinfo structure.
    Now autocode generated code is not generic, it is optimized. So, in the case of a procedure, a procedure is a form of a discrete superblock with inherited timing attributes. Autocode optimize discrete superblock initialization by initializing it at the same time as the output computation at T=0.0. Therefore, for autocode discrete-based superblocks, there is only ONE init phase and it's coupled with the first OUTPUT phase.
    So, since the Simulator does not perform such optimization, the Simulator calls the UCBHOOK several times, as it is documented. This is incompatable with the autocode code, therefore there's code in the UCBHOOK (as you've hilighted) to prevent extra initialization as to match the autocode implementation.
    Like I said, the UCBHOOK is designed as a UCB that conforms to the Simulator's 'model of computation'.
    If you intend to have your 'outside' code use the ucbhook, you will have to match how the simulator calls UCBs. In the case you describe, calling the UCBHOOK multiple times for initialization is required.
    In general, I'd not recommend using the UCBHOOK called from 'outside' code, I'd prefer you use the SDK as the complexity of the simulator's calls to UCBs is not trivial.
    Regards,
    Bob Pizzi
    MATRIXx R&D - AutoCode

  • Is NetBeans good for beginners?

    I'm taking a Java class right now and I'm finding the assignments difficult. I'm completely new to Java and my teacher is no help.
    I downloaded NetBeans beforehand out of curiosity, I don't know it very well but I figured it would be helpful for these assignments, would it be a good idea to use for a beginner or do I have the wrong idea?

    I have the exact opposite opinion, in that, I believe NetBean is wonderful for beginners, it is an IDE where you can go and code your designs and get the benefit of autocomplete context sensitive helps, integrated debugger and many other features. In that way IDE's are perfect for beginners.
    Now the down side--Do NOT become one of the mass victims of laziness that find the autocode generator and get tons of grabage "ready to run". If you don't know how to hand code it, then don't do it until you can hand code it. Also at some point, you really need to find out what a ClassPath is and how it affects your programming, also you need to learn to do the command line work--how to compile a ".java" file into a ".class" file. How to make Jars and executable Jars, and yes, even run the debugger from the command line.
    I know no faster way to get people up and productive in Java than to give them an IDE and the tutorial and tell them to get going, I've successfully had to train dozens of new programmers on Java and the IDE, tutorial, and Mentoring is the best approach I've fond to date.
    On the other hand, I've seen many a person become overwhelmed with the minutia of things that have to be setup and done right or manually in the Editor/command line world that they just back off for a while and do something else--".Net" is full of those that just didn't want to go through the pain of the all at once path that the Editor/command line imposes.
    The best advise anyone can give you is this: what do you want to do--implement now and learn the details as you go, or hit it all at once. Both are there for your choice.
    My preference--is take the IDE, but learn the details as you go and don't use the autocode generator for anything.
    BTW: I still don't use the autocode generators--I'm too much of a control freak and hate the style of code they generate.

  • Read Variable Block

    Is there any way to have read variable blocks without global variable actually defined in AutoCode generated code.
    The thing is we would like to link AutoCode generated code with other code, and want to access the global variable defined in that code.
    The read variable block redefines that variables and it generates multiple definition of same variables, which is giving linking error.
    Thanks
    Regards
    Ishant

    Ishant,
    The only potential way of modifying this would be through modifying the template, however this would be at your own risk.  You would probably be better off simply locating the declaration in the generated code, which shouldn't be too difficult if your variable has a unique name, and commenting it out when you go to link the autocode.
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

  • Generating Code with NetBeans

    I'm using NetBeans IDE 6.1 UML editor to generate java code. When I choose the "Generate Code" option and select the options I want. The console shows the message:
    Generating source from template "Java/CompilationUnit.java" ...ERROR: java.lang.NullPointerException
    How do I find where the Null Pointer Exception is being thrown?

    Rick.Lohmeyer wrote:
    I'm using NetBeans IDE 6.1 UML editor to generate java code. When I choose the "Generate Code" option and select the options I want. The console shows the message:
    Generating source from template "Java/CompilationUnit.java" ...ERROR: java.lang.NullPointerException
    How do I find where the Null Pointer Exception is being thrown?You go over to the NetBeans forum and ask them the same questions, since this is not a Java question, but a IDE specific question. Also if you are not a fairly seasoned programmer, then may I happily wish you cheers with all the frustration and grief that inevitably awaits you in your autocoding endeavors.

  • Autocode with UCB in Fortran

    Hi,
    I use a schema for modeling a system and I use some UCB blocks inside. The source codes are written in C and Fortran languages. In Xmath environment there are no problerms: I can do the simulation; Matrixx compiles and links all the codes.
    I have a problem when I make the autocode: I do this by autocode tool in the block browser, and the code generated is in C.
    All the name of the Fortran procedures are written in lower case but the Fortran wants the procedures's names in higher case (it is case sensitive) so there is an error when these procedures are called.
    Also, the TIME parameter is passed by value and not by address: I have to put the '&' before the parameter. I use the C compiler with '_stdcall' mode for parameters pass
    ing.
    I don't use a particular template to make the autocode: I use the standard function in the graphic tool.
    If there is a way to do this automatically, please tell me.
    Thanks,
    Francesco

    When using a UCB in SystemBuild both a Fortran template (usr01.f) and a C template (usr01.c) are available in the SystemBuild\src directory. To use a UCB in SystemBuild and in AutoCode a different UCB template is needed. This is the sa_user.c file in case\acc\src. There is no template for Fortran so I would recommend creating a wrapper c file based on the UCB template that in turn calls your Fortran code.
    Joseph D.
    National Instruments

  • Linux / AIX Autocode

    Hello All,
    I am looking to do something a little unconventional - run an autocoded model over on a Linux (or AIX) machine as a target. 
    Are there templates that exist to support running the model on one of these platforms? 
    We have the basic autocode / build working, but I really want to take advantage of the threading w/o having to generate my own templates if they are already in the community.

    Without knowing anything specific it's impossible to help you.
    Please post:
    What exact error your get (logfiles) on which place doing what.
    Markus

  • Using SQVI to generate report of open and released delivery schedule lines

    All,
    I'm using SQVI  to generate an excel spreadsheet for some buyers to show open released schedule lines because they are a 1 line item per scheduling agreement company.
    I used the logical database MEPOLDB instead of a table joint and pulled fields from EKKO(vendor, SA #,&purchasing group), EKPO(Material Number), EKEH(schedule line type), and EKET(delivery date, scheduled qty,previous qty).
    Does this sound like I'll get the results I want on paper as long as I use the right selection criteria, because the report I'm getting isn't quite what I expect? I am unable to identify which lines are authorized to ship vs. trade-off zone, planning, etc. in the report thus far.

    Hi Mark,
                 I have faced same requirement. I am not sure about transporting to TST and PROD. I done by this way.
    After generating SQVI program in DEV , I assigned that program  to a transaction and tested in DEV. Later i have regenarated SQVI in Production. then I assigned the generated Program to same transaction in DEV. And transported the Tcode assignment of program to Production..
    About authorization , if its not sensitive report, BASIS can restrict at transaction level.
    Regards,
    Ravi.

  • Error while generating a role

    Hi SAP Techies,
    I am getting the following error while generating a role,
    "18 field value(s) for object K_CCA were not entered in the profile"
    Can you please provide me a solution to fix this problem.
    Thanks.
    Regards,
    Agustuss

    How many cost centres are you putting in the role?  Do you have cost centre set as an org level?
    From your User Name I assume that you are at the BBC...Do you still use a program to populate the cost centres in the role based on the cost centre group names?  If so it is possible that you are trying to put too many cost centres in the field and the the profile will not generate because of this (we had it back in 2001 when I was working there).
    Do you have the technical error message details?

  • Credit memo generate in case of free goods

    Dear Friends
    one material price is rs450/- and with 5+1 when customer place order 5 pc that time system delivery 6 bec 1 is free. when customer return 1pc then what will be the credit memo pricing for each material.
    Thanking you
    Arun

    Dear Friends
    I am just clearly adding question with exact requirement.
    material per pc 450/- and scheme is 5+1
    order qty 5   Price is 450*5=2250
    dlv qty 6
    now client generate credit memo request for one pc in sap it is coming Rs450/- pc
    but client requrement is not this
                               2250/6=Rs. 375/- that mean they will give rs 375/- per pc not Rs 450/- per pc. for that what should i do customisation for credit memo request pricing.
    regards
    arun

  • PXI 6070E, Unable to capture waveform on ACH0 while generating a wavefrm on DAC0

    I'm trying to plot the sinewave being generated continuously (verified with a scope) by DAC0 that is wired to ACH0. All I get is noise. When I disconnect DAC0 (but leave it running) and connect an external function generator to ACH0, it plots just fine. Has anyone seen this problem?

    Hello,
    Have you tried changing the input mode? I'm not very sure what input mode you are using but I would recommend to use differential.
    For troubleshooting bad readings, it is always advisable to read the signals from MAX (Measurement and Automation Explorer) first, and then use other programs like LabView, LabWindows/CVI or Measurement Studio.
    If you want to use differential mode, here's how you would connect the signals: Connect DAC0 OUT to ACH0, and AOGND to ACH8.
    Finally, here's a link to an interesting Knowledge Base: Data Acquisition: Troubleshooting Offset, Incorrect, and Noisy Readings
    Good luc
    k with your application!

  • Generate prov.xml for Creative Cloud. Return Code 27

    We're trying to follow this guide (Creative Cloud Help | Using Adobe Provisioning Toolkit Enterprise Edition) to serialize a package (or something). We're stuck on generating prov.xml. My best attempt at an entry is:
    C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\CCP\utilities\APTEE>adobe_prtk.exe --tool=VolumeSerialize --generate --serial=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx --regsuppress=ss --eulasuppress --locales=en_US --provfilepath=C:\Program Fil
    es (x86)\Common Files\Adobe\OOBE\PDApp\CCP
    It says half of this is optional, but I'm skeptical.
    Anyway, I'm getting return code 27. This indicates that it is unable to edit the prov.xml file specified. I didn't specify a prov.xml file, I'm trying to make one. The syntax I'm using differs from what I found on the page I linked, as that was giving me syntax errors. I lifted this off someone else's code. I've tried just about every variation I can think of. Any help would be appreciated.
    This is on Windows

    One of these links may help
    http://helpx.adobe.com/creative-cloud/packager.html
    http://forums.adobe.com/community/download_install_setup/creative_suite_enterprise_deploym ent

  • Installation Problem on 11g, RHEL 5 - Unable to generate temporary script

    Hello all,
    This is for the first time i am encountering this kind of error on 11g. Half way through installation i get this error.
    All parameters set correct, used the official installation technique (works fine previously), except for this time i am getting a weird error, which does not allow me to continue with the installation.
    Please help.
    Environment
    Oracle 11g
    RHEL 5
    Error on GUI -
    OUI-10053: Unable to generate temporary script: {0}. Unable to continue install
    Error on command prompt -
    OUI-10053:Unable to generate temporary script: /u01/app/oraInventory/orainstRoot.sh. Unable to continue install.
    Help appreciated.
    Thanks

    Hi Monu Koshy
    Can you please control the user rights and also the df ?
    ls -al /u01/app/oraInventory/
    df -h /u01/app/oraInventory/
    Regards,
    Hub

  • Manage-bde command is not generating recovery key on network location

    Hi,
    I am trying to save the recovery key to the network share location and start up key in the USB drive while enabling bit locker.When the OS drive gets encrypted, the default folder for recovery password shows that it contains 1 file but not getting anything
    inside it when i checked the properties of the folder.
    i have already changed the group policy as "choose default folder for recovery password".
    I am using the command to enable the bit-locker as "manage-bde.exe -on C: -rk
    <network location to save recovery key> -sk <location of the USB drive>
    -rp to enable the bit-locker. It is generating the start up key in the USB but not the recovery key on network share.
    Can anyone suggest what i am missing or what else i should do to generate the recovery key on network share.
    Does manage-bde process be able to save the recovery key on network share or it hand over to some other process to perform this task.
    Thanks
    Gaurav Ranjan

    I got you Manoj, but I want to ask you one think that what if i lost the startup  key or my USB stick. I have my recovery key on the network share.  In order to log-in my machine I need the recovery password. From where i will get the recovery
    password(48 digit). Surely from the recovery key on the network share. So how can i get the recovery password if only we have the recovery key.
    I know both are different in context. Both are two different thing. I have lost my USB stick along with the recovery password and I have to log-in my machine. How can i do that i want to know that. Do there is any method to get recovery password from the
    recovery key on network share. I have retrieved the recovery password when the recovery key in AD. But this time it is on network share.
    Also one think which I need to solve is that the manage-bde -protectors -add command creates a new .bek file along with the older one. So the .bek file which get shown at the time of the start up of the machine is different from that stored in the network.
    So i am getting confused as which .bek file is for which machine and hard to retrieve the password.
    Is there any method to store recovery key on network without the -protectors -add command line so that both the .bek file should be matched and can easily be known for indiviual machine in an OU. As if both the .bek files will be different it would be difficult
    to to retrieve the recovery password for the machines.
    Please do inform if you need some more information about the scenario if i missed something.
    Thanks
    Gaurav Ranjan

Maybe you are looking for