Addition & increment logic in script

1. There is a field (counter) in a layout where it needs to incremented automatically
eg: where the counter entries in layout should increase as it proceeds like Starts from 1, increases by 1..
2. BSID-ZFBDT + BSID-ZBD1T.. how to write a code for it in test editor do v need to write in print prog even .. If si how to proceed..
please culd u any guys help me...............
related ones wil be reward prompltly..........

Hi,
1. You can use the standard  SAP Script Symbol  -  SAPSCRIPT-COUNTER_x( x = 0 .. 9).  There are 10 counter variables that can be used in the layout for counting purpose. You can use  '+' or '-' formatting options to increment or decrement a counter value.
You can also use DEFINE control command to set a counter value.
2. As one is a date field and another a numeric field you can carry out the following steps.
a. Get the format in yyyy/dd/mm . You can use a FM for this.
b. Remove '/' or '.' or '-' in the date value.
c. Add the 2 fields into a third field of type BSID-ZFBDT
d. You need not format the output. it will be displayed in the mm/dd/yyyy format only.
All this is needed to be done in the print program. Then you can simply print this field in the layout.

Similar Messages

  • Increment logic in script

    Hi All,
    In the Script i am using the SAPSCRIPT-COUNTER_1.
    I have assigned the value '0' to it.
    But after that i want to increment it.i am using the command which is in bold.
    But the value is not incremented.
    /:           DEFINE &COUNTER_1& = '0'
               <b>&COUNTER_1(+)&</b>
    Please Suggest me....
    Regards,
    Swathi

    Hi Swathi K.
    You can use a perform statement in SAPSCRIPT. You must create a program first and use it in your form.
    It's like this:
    IN SAPSCRIPT:
    /: PERFORM <form_name> IN PROGRAM <program_name>
    /: USING &VAR1&
    /: CHANGING &VAR2&
    /: ENDPERFORM
    IN PROGRAM:
    REPORT ZTEST.
    FORM increment TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: value TYPE i.
    READ TABLE IN_PAR WITH KEY ‘VAR1’.
    CHECK SY-SUBRC = 0.
    value = IN_PAR-VALUE + 1.
    READ TABLE OUT_PAR WITH KEY ‘VAR2’.
    CHECK SY-SUBRC = 0.
    OUT_PAR-VALUE = value.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Hope this helped.
    Best regards.
    Reward usefull ideas.
    Valter Oliveira.

  • Is it possible to take incremental logical backups via EXPDP in Oracle 10g

    Guys,
    I am curious that can EXPDP be used to take the incremental logical backups. If so then please let me know how it is possible.
    Regards
    Asif

    There is no incremental specification clause like the one in the export command (INCTYPE). If you ever used the export incremental option, IMO it was not actually an incremental export, it was just enough for a table to change one row to consider the complete Table to be exported on the next exp execution. Not quite a practical approach, overall considering that regularly the more sized tables are those that frequently change.
    ~ Madrid

  • [svn:osmf:] 14580: Commit example showing how to perform additional load logic via a ProxyElement .

    Revision: 14580
    Revision: 14580
    Author:   [email protected]
    Date:     2010-03-04 09:28:35 -0800 (Thu, 04 Mar 2010)
    Log Message:
    Commit example showing how to perform additional load logic via a ProxyElement.  The AsynchLoadingProxyElement (and its corresponding LoadTrait) load the proxied element, but doesn't expose its READY state to the outside world until it performs its own load operation (in this case it just runs a Timer).  Include minor fix to other example.
    Modified Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/AllExamples.as
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/loaderproxy/VideoProxyE lement.as
    Added Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/loaderproxy/AsynchLoadi ngProxyElement.as
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/loaderproxy/AsynchLoadi ngProxyLoadTrait.as

    Nope, what for?
    If you know what you are doing and you discharge yourself there is no need for such.
    BTW, those bands are not that safe, if you use them wrongly you can electrocute yourself pretty easily

  • Error TypeError: null has no such function "getAppView" logical transform script version 4.1.0.866

    Hello,
    I am using Oracle Data Modeler version 4.1.0.866 and when I created a transform script in object logical, motor Oracle Nasnhorm give the error TypeError: null has no such function "getAppView".
    The code is:
    var guipkgs = JavaImporter(java.lang, java.awt, java.awt.event, java.awt.Window, Packages.javax.swing ,java.lang, Packages.javax.swing.border);
    with (guipkgs) {
        log_rep = new Packages.oracle.dbtools.crest.swingui.LogReport(model.getAppView());
        log_rep.setName("CONTADOR");
        var cont = 0;
        var text = "";
    entities = model.getDesign().getLogicalDesign().getEntitySet().toArray();
    for (var t = 0; t<entities.length;t++){
      entity = entities[t];
        Name = entity.getName();
        cont = cont + 1;
        text = text + " " + Name + "\n";  
    text = text + cont + "\n";
                log_rep.setLog(text);
        log_rep.showModalDialog(new java.awt.Dimension(1300, 550));
    Already you can not use log_rep = new Packages.oracle.dbtools.crest.swingui.LogReport(model.getAppView());? Is there any alternative?
    This error does not come with previous versions.
    Thanks.

    Hello,
    I modified the script add following at the beginning of script:
    model = model.getDesign().getLogicalDesign();   and carry on the error TypeError: null has no such function "getAppView".
    var guipkgs = JavaImporter(java.lang, java.awt, java.awt.event, java.awt.Window, Packages.javax.swing ,java.lang, Packages.javax.swing.border);
    with (guipkgs) {
        model = model.getDesign().getLogicalDesign();
        log_rep = new Packages.oracle.dbtools.crest.swingui.LogReport(model.getAppView());
        log_rep.setName("CONTADOR");
        var cont = 0;
        var text = "";
    entities = model.getDesign().getLogicalDesign().getEntitySet().toArray();
    for (var t = 0; t<entities.length;t++){
      entity = entities[t];
        Name = entity.getName();
        cont = cont + 1;
        text = text + " " + Name + "\n"; 
    text = text + cont + "\n";
                log_rep.setLog(text);
        log_rep.showModalDialog(new java.awt.Dimension(1300, 550))
    Any idea?
    Thanks

  • Last 5 seconds of additional content logic pro x..now its frozen after 10 hours ! anybody have any advice?

    I have a brand new iMac, i have logic pro x and have been downloading the additional content needed to work through the david nahmani book.
    i have let it download overnight but it is now stuck with only 5 seconds remaining. it has been like this for the last 3 hours. internet connection iOS working ok.
    can anybody give mw some advice on what i need to do?
    thanks

    Hi there turkster,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    Logic Pro X: Troubleshooting basics
    http://support.apple.com/kb/HT200260
    -Griff W.

  • Incrementing folder name script? help...

    Here is the thing, im into tethering mode in my nikon camera (Picture talk/transfer protocol) in which it automatically saves every shot into a "hot folder" (~desktop/images) i've got my action to automate 4 pictures to be posted into a 4R size contact sheet, saved as jpeg, and closes the window. though the hard part is, i can't figure out how to automatically script it so that after saving and closing the contact sheet, all of the four raw jpg  shots + the newly saved contact_sheet.jpg file would be foldered into a subfolder (inside ~desktop/images) which generates a unique/incrementing folder names everytime. And so, i could continue shooting, and every after 4 shots, i could use my action+ the given script so it automatically does the foldering for me. Below are some examples of what's inside the "image folder" looks like.
    above is the ïmage folder before the script should work
    above is how the script should work, then after, if another 4 shot has been taken, i could execute the action to make and save the contact sheet and hopefully, if i would use the script again, it would put these five new *.jpg files to a incremented folder name like "Contact (1)" then for the next batch "Contact (2)"... and so on...
    Can anyone help me please? Tnx!

    I think creating that folder comes close to this, with a few adjustments. I really understand a few in scripting and so I hope someone could help out..
    function createFolder(file) {
      var parentFolder = file.parent;
      var saveFolder = new Folder( parentFolder + '/' + file.name.substring( 0, 8 ) );
      if( !saveFolder.exists ) saveFolder.create();
      var saveFile = new File( saveFolder + '/' + file.name);
      if( file.copy( saveFile ) ) file.remove();
    function main() {
       var folder = new Folder("~/Desktop/images");
       var files = folder.getFiles();
       for (var i = 0; i < files.length; i++) {
         var f = files[i];
         if (f instanceof File) {
          createFolder(f);
    main();

  • LM05 Standard Picking Confirmation Incremental Logic during Scanning

    Hi SAP Team,
    We have put the Logic in LM05 while confirming the Picking Operation, the warehouse Operator is asked to scan the material one by one while Picking which will automatically increment the Quantity of the Picking.
    This Logic was built in ABAP if the user presses enter after the material is scanned. This will increase the Quantity automatially based on the custom logic. This is working absolutely fine when we test in SAP GUI RF Screens.
    Whereas when the same process is done in RF Scanner once the scan is done, the cursor will jump into the next input field. If we deactivate the RF Scanner setting of TAB then the problem will be solved. But for other fields the user needs to tab after each scanning. Please help us how to solve this problem.
    Nagaraj

    Anyone experienced this or any ans...
    Thanks in advance.

  • ABAP QUERY - SQ02 addition of logic in infoset (END-OF-SELECTION)

    I guys I have read this discussion: http://scn.sap.com/message/8193608#8193608
    but solve partially my problem.
    In particular I need special logic to interpret the single field from field symbol, for example:            
         loop at <goo> assigne <goo_wa>.                  
               tot_qty = tot_qty + <goo_wa>vbap-zmeng.
         endloop.
    I would like to add new row, with my logic into stracture of query %G00.
    thanks for any idea Omar

    resolved, it is must to use for all filed-symbols
    example
    types: beging of l_summary,
         matnr type matnr,
    end of l_summary.
    data: lt_summary type standard table of l_summary,
             ls_summary type line of lt_summary,
             lf_string type string.
    fiel-symbols: <gt> type standard table,
    <ls> type any,
    <lf> type any.
    lf_string = '%G00[]'.
    unassign <gt>
    assign (lf_string) to <gt>.
    if <gt> is assigned.
    loop at <gt> assigning <ls>.
    lf_string = '<ls>-vbap-matnr'.
    unassign <lf>.
    assign (lf_string) to <lf>.
    if <lf> is assigned.
    ls_summary-matnr = <lf>.
    endloop

  • InfoSet: Additional Field Logic

    Hi,
    I am very new to infosets, queries and SAP in general to be honest. So I apologise in advance for asking such a simple question.
    I currently have an infoset that works as expected, which also includes additional fields. I would like to enhance this infoset by creating another additional field that derives it's value from comparing the values in a field from a table in the infoset and another additional field that has already been created and populated.
    To put this into some context: I need to populate an additional field called:CHANGE_DATE by selecting the MAX value between the date from the table AUFK-AEDAT with another additional Field (c_change_date) - which is already populated using a select Into statement in the record processing section. I was expecting to code an IF statement or CASE statement but I am not sure where it would go.
    Any help regarding this problem would be greatly appreciated.
    Thanks
    Kevin

    I have SEARCHED but haven't found much regarding the Local fields of the infoset..

  • Complex Logic - Custom Script - Some other solution?

    Evening All,
    FDM v11.1.1.3
    Goal:_ To have conditional mapping based on a currency column. Original accts translate to summary account plus specific C2 member based on the currency. Solution is needed to aid in Currency Exposure reporting.
    I have been trying to use complex logic with no luck.
    Dimension Background:_
    Custom2 dimension has been built with duel purpose. For P&L accounts it provides Cost Center detail. For Balance Sheet it will provide Currency Exposure Detail. For any P&L accounts C2 is either the exact matching member from the file or C2#0000 if no Cost Center applies.
    So the intent was to read the Account/Currency combination and if Acct=<focus aact> then change C2#0000 to hard-coded C2 value as depicted in the example below.
    Example:_
    Curr=USD A#1020?? -> A#102001.C2#USD_USD
    Curr=AUD A#102038 -> A#102001.C2#USD_AUD
    Curr=GBP A#102047 -> A#102047.C2#USD_GBP
    Curr=GBP A#102051 -> A#102051.C2#USD_GBP
    Attempted Solution:_
    I previously had various Explicit/Between/In/Like definitions. I have tried to create Complex Logic accounts. When I IMPORT the source file. It creates the proper Logic Account records with the proper C2. But two issues emerge:
    1> I have one logical record and one original record
    2> When I VALIDATE I get converted dimension as per normal mapping not the hard coded value (C2#USD_AUD).
    I tried the following but still not getting expected results:
    Explicit Map 102038 -> IGNORE
    Explicit Map L102001_AUD -> 102001 Any advise would be greatly appreciated.

    You don't need a logic group for this. This is just conditional mapping. Take a look at the admin guide for examples.

  • Netinstall: install additional software using a script + AD domain join

    Hi Guys,
    I want to install Macs using NetInstall. I built an image using the System Image Utility.
    It's a NetInstall Iamge and it looks like that:
    Source Mac OS X 10.8. install disk
    partition disk
    enable automated installation
    add packages and post-install scripts
    customize package selection
    create image
    Instaling the OS works.
    Now I want to do the following things.
    - adding a script which installs a programm. it's a .sh script which runs different actions like unpacking a tgz and copying the unpacked files
    To be honest, I have no idea how to add this to the installation
    - rename the device (best with an ongoing number)
    - adding an admin account
    - joining the new device to the ad domain
    Can anyone help me with this issues?
    Regards,
    Andre

    that helped, thanks
    now I have the problem, that the script is not working in netinstall.
    I can run the script on a mac manually and it works.
    But when I add it to the netinstall, the accounts isn't there after the installation.
    my script:
         #!/bin/sh
         . /etc/rc.common
         dscl . create /Users/admin
         dscl . create /Users/admin RealName "admin"
         dscl . create /Users/admin hint "hint"
         dscl . passwd /Users/admin password
         dscl . create /Users/admin UniqueID 501
         dscl . create /Users/admin PrimaryGroupID 80
         dscl . create /Users/admin UserShell /bin/bash
         dscl . create /Users/admin NFSHomeDirectory /Users/admin
         cp -R /System/Library/User\ Template/English.lproj /Users/admin
         chown -R admin:staff /Users/admin

  • A proposed more secure addition to Conky gmail scripts

    I use conky-cli for my status in DWM; furthermore, I use the gmail python script that has been floating around to check my emails (e.g. http://ubuntu-virginia.ubuntuforums.org … ?t=631157).  It had always bothered me that my password was just sitting there, so today I did something about that.  This method essentially replaces any instance where you are using wget.  It's a simple c script which uses libcurl.  Once compiled your password is not just there in plain text, and it's basically a drop in replacement for whatever wget command you are using.
    #include <stdio.h>
    #include <curl/curl.h>
    int main(void)
    CURL *curl;
    CURLcode res;
    curl=curl_easy_init();
    if (curl)
    curl_easy_setopt(curl, CURLOPT_URL, "https://USER:[email protected]/mail/feed/atom");
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
    res=curl_easy_perform(curl);
    curl_easy_cleanup(curl);
    return 0;
    Compile it with gcc and the -lcurl flag.
    I don't know exactly how useful this is to anyone.  I am sure someone else has a better solution, but this was quick and easy for me.
    Thanks.

    measure wrote:Thank you for making the effort to create this; it is impressive.  The obvious question: is there any way around it?
    It's not terribly impressive; I thought of using LD_PRELOAD to attack your program while reading the fakeroot man page, confirmed that the attack would work with:
    su -c chmod go-r /usr/bin/id
    fakeroot id
    su -c chmod go+r /usr/bin/id
    and then cranked out the easiest attack I could think of using LD_PRELOAD.
    No, there is no way around this general class of attack.
    measure wrote:The only fault I can see is that you had to know ahead of time I was using curl_easy_setopt to sneak in.  This of course isn't much of a fault, as a truly secure system should be public.  I know very little about C, but I would imagine there are ways around this.  Is there no way in C to make sure that I am using the curl_easy_setopt in curl/curl.h ?  If this can be done, then your exploit can be accounted for.
    curl_easy_setopt is not 'in' curl/curl.h; curl/curl.h is a header file, and only contains the function prototype.  The actual code of curl_easy_setopt is in libcurl.so (roughly speaking; actually, libcurl.so itself is a symlink to a symlink to the shared library itself).
    As for having to know you were using curl_easy_setopt: replacing that function was just the quickest attack I could code up, given that I had your program's source code.  As I mention in my README, a real attacker would go looking for a pre-prepared shared object and wrapper tool that would dump out all of the target program's code and data from the shared object's startup code (it's not hard; just dump the page containing the program's main function, then dump out the pages before and after that one until SIGSEGV happens).  I would be very surprised if such a tool isn't already widely available.
    measure wrote:Either way though, thank you again for going out of your way to do this.  I really appreciate it.
    I didn't notice the before-and-after times, but I think it took less than fifteen minutes to implement the attack after I saw the reference to LD_PRELOAD in the fakeroot documentation. 
    measure wrote:As you seem to be a creative programmer, here's a challenge (which also somehow selfishly allows me to not learn any C, but get results...hmmm) which may or may not actually be a challenge: can I indeed get the desired information about the curl_easy_setopt I am using? Or any of the functions I use for that matter, I suppose I'd have to be more careful with all of them.  And suppose I could fix this, are there other ways to exploit it?
    By 'the desired information about the curl_easy_setopt [you are] using', I assume you mean 'which library's curl_easy_setopt am I using?'.  The answer is no, and the glibc dynamic linker goes to some trouble to keep you from finding that out.  Even if you could, some code in the shared object would run before your program's main function, and that could easily dump out the sensitive areas of your address space.
    measure wrote:I ask this not because I think someone wants to steal my email address.  This is of course just out of curiosity at this point; but I appreciate your enthusiasm none-the-less.
    The best solution is writing a daemon, and feeding it your password at startup through a pipe.  I don't think you'll be able to do that yourself at the moment; little things like error handling become both more important and trickier to implement properly.
    Making your program setuid would keep LD_PRELOAD attacks like mine from working (because ld.so can detect that a program is setuid, and takes some precautions to block the obvious privilege escalation holes), but I don't know whether libcurl has a similar 'feature'.  (If you must do this, make its owner a special account that is not used for any other purpose; do *not* use the 'nobody' account for this program.)

  • ABAP Query - addition of logic in infoset

    Hi Friends,
    I have generated a query and there is a problem. There is a field 'Cycle count date'. Each material can have more than 1 count date. So my report displays repeated lines with same material and other details remaining same except that there are different count dates. Hence the users think there is a repetition of entries.
    The requirement is to have only the most recent count date displayed and all the other lines should be removed.
    I tried coding for the internal table %G00 (the table in the system generated code) but the infoset is throwing an error that the table is not declared. And if I declare, the system says same internal table declared twice (since it is already declared in the system generated code).
    How do I code for this in the infoset.
    Appreciate your quick response.
    Regards,
    Dikshitha

    Hi
    Here is what you should do:
    1. In the infoset, go to event END-OF-SELECTION(After list).
        Here you'll find table %G00 with final data to be displayed.
    2. You should enter the following ABAP code:
        data: str type string.
       field-symbols: <GOO> type table.
       field-symbols: <GOO_WA> type any.
       str = '%g00[]'.
       ASSIGN (str) TO <GOO>.
       loop at <GOO> assigning <GOO_WA>.
       ...do whatever you like here....
       endloop.
    3. Of course, you don't need to do a loop here, you can do whatever you want.
    This solution was created with the brilihant developer Hayit Yuzis.
    Good luck
    Yasmin Yezerski.

  • How to copy applications using script logic with conditions

    Hi,
    I have two copy data between application A to application B, but only i want to copy the March's Data of Application A. Dimensions are the same in both applications
    I'm going to use this script logic, ¿this script will work?
    *WHEN TIME
    *IS "2009.MAR"
    *DESTINATION_APP=B
    Thanks in advance
    Regards,
    Juan

    Hi all,
    Finally I solved the issue, the problem was that i haven't add this line in the script logic:
    TASK(Execute formulas,USER,%USER%)
    But now i need to pass in the script logic as an input: entity and time. Below is the code I prepare, it has no error but it doesn't work. ¿any idea?
    Thanks in advance
    Regards,
    Juan
    *SSIS PACKAGE *
    'DEBUG(ON)
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when running logic.",1,{"Yes, check for work status settings before running logic","No, do not check work status settings"},{"1","0"})
    PROMPT(SELECTINPUT,,,"Please select entity and time to copy data from LegalAppNceu to LegalApp",%ENTITY_DIM%%TIME_DIM%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%CopyApplication.lgx)TASKTASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    TASK(Execute formulas,CHECKLCK,%CHEKCLCK%)
    SCRIPTLOGIC
    *DESTINATION_APP=LEGALAPP
    *SKIP_DIM= COSTCENTER
    *WHEN ENTITY
    *IS "%ENTITY_DIM%"
    *WHEN TIME_DIM
    *IS "%TIME_DIM%"
    *REC(FACTOR=1)
    *ENDWHEN
    *ENDWHEN
    *COMMIT

Maybe you are looking for