Problem with modify command....

Hi abapers,
loop at itab.
read table ifinal with key kunnr = itab-kunnr.
if sy-subrc = 0.
move: ifinal-dmbtr to itab-dmbtr.
modify itab index sy-tabix.
endif.
endloop.
Now the problem is that when i am using modify index sy-tabix it creating an additional entry
and when i am using only modify itab its working fine so wat could be the reason that modify index sy-tabix is
not working propertly.
Thanks

Hi Aarif,
I am assuming there is one-to-one relationship between itab and ifinal.
Try using following code.
sort itab by kunnr.
sort ifinal by kunnr.
data: l_index like sy-tabix.
l_index = 1.
loop at itab.
  loop at ifinal from l_index.
     if ifinal-kunnr eq itab-kunnr.
        move: ifinal-dmbtr to itab-dmbtr.
    elseif ifinal-kunnr gt itab-kunnr.
       move sy-tabix to l_index.
       exit.
   endif.
endloop.
  modify itab transporting dmbtr.
endloop.
Regards,
Anil Salekar

Similar Messages

  • Problems with 'df' command

    Hello folks,
    I'm having some problems with df command:
    Output:
    [nenemfromhell@myhost ~]$ df -h
    Filesystem Size Used Avail Use% Mounted on
    udev 999M 4.0K 999M 1% /dev
    none 999M 4.0K 999M 1% /dev
    /dev/sda8 133G 125G 2.0G 99% /media/DU
    shm 999M 0 999M 0% /dev/shm
    First: It doesn't show my root partition, but i can check it in gparted.
    Second: /dev/sda8 is a NTFS partition that its size is 12GB
    Thanks.
    Last edited by nenemfromhell (2012-01-20 03:37:30)

    Please include some detail as to how you solved the problem: https://wiki.archlinux.org/index.php/Fo … way_Street

  • Problem with shell commands and scripts from an Applescript Application

    Hi-
    I am fairly new to OSX software development. I am trying to build an application that creates a reverse SSH tunnel to my computer and starts OSXvnc. The idea is that my Mom or anyone else who needs help can connect to me without having to tinker with their firewalls.
    There are plenty of resources on how to do this, and I have found them. What I have a problem with is the following.
    I am building this application in Xcode as an Applescript application, because Applescript and shell scripting are the only forms of programming I know. I use an expect script to connect through SSH, and a "do shell script" for the raw OSXvnc-server application to allow screen sharing.
    The problem is that when I click on the button to launch OSXvnc-server or the button to launch SSH, the application freezes until the process it spawns is killed or finishes. For example, I can set SSH to timeout after 60 seconds of no connection, and then the Applescript application responds again. I even tried using the ssh -f command to fork the process, but that doesn't seem to help.
    I am also using "try" around each of the items.
    What am I doing wrong? How can I make the buttons in my app launch SSH and OSXvnc-server without hanging the application while it waits for them to finish?
    Thanks so much!

    See here for an explanation of the syntax.
    (20960)

  • Problem with issuing command via CustomScriptExtension

    I am trying to issue a CustomScriptExtension command to an Azure virtual machine from within my C# application. The CustomScriptExtension is installed in the VM and working. I verified this by issuing a test command via PowerShell. Essentially I am trying
    to execute what would be the equivalent to the PowerShell command Set-AzureVMCustomScriptExtension, but in code.
    Below is the code segment that I am having problems with:
    ComputeManagementClient client = new ComputeManagementClient(AzureSessionInfo.CloudCredentials);
    IList<ResourceExtensionReference> extReferences = new List<ResourceExtensionReference>();
    IList<ResourceExtensionParameterValue> extParamValues = new List<ResourceExtensionParameterValue>();
    string account = "{\"storageAccountName\":\"" + AzureSessionInfo.StorageAccount + "\",\"storageAccountKey\": \"" + AzureSessionInfo.StorageAccountKey + "\"}";
    string scriptfile = "{\"fileUris\": [\"" + "https://teststorageaccount.blob.core.windows.net/testcontainer" + "\"], \"commandToExecute\":\"powershell -ExecutionPolicy Unrestricted -file " + "ScriptName.ps1" + "\"}";
    byte[] bytes1 = System.Text.Encoding.UTF8.GetBytes(account);
    bytes1 = System.Text.Encoding.UTF8.GetBytes(account);
    string ScriptPrivateConfig = Convert.ToBase64String(bytes1);
    byte[] bytes2 = System.Text.Encoding.UTF8.GetBytes(scriptfile);
    bytes2 = System.Text.Encoding.UTF8.GetBytes(scriptfile);
    string ScriptPublicConfig = Convert.ToBase64String(bytes2);
    ResourceExtensionParameterValue extRef_Parameter1 = new ResourceExtensionParameterValue()
    Key = "CustomScriptExtensionPrivateConfigParameter",
    Value = ScriptPrivateConfig,
    Type = "Private"
    ResourceExtensionParameterValue extRef_Parameter2 = new ResourceExtensionParameterValue()
    Key = "CustomScriptExtensionPublicConfigParameter",
    Value = ScriptPublicConfig,
    Type = "Public"
    extParamValues.Add(extRef_Parameter1);
    extParamValues.Add(extRef_Parameter2);
    ResourceExtensionReference extRef_CustomScript = new ResourceExtensionReference
    Name = "CustomScriptExtension",
    Publisher = "Microsoft.Compute",
    Version = "*",
    ReferenceName = "CustomScriptExtension",
    ResourceExtensionParameterValues = extParamValues
    extReferences.Add(extRef_CustomScript);
    AzureSessionInfo.CloudServiceName = "CS1000001";
    AzureSessionInfo.VMName = "CS1000001";
    AzureSessionInfo.ImageFamilyName = "Windows Server 2012 R2 Datacenter";
    client.VirtualMachines.Update(AzureSessionInfo.CloudServiceName,
    AzureSessionInfo.VMName,
    AzureSessionInfo.VMName,
    new VirtualMachineUpdateParameters
    RoleName = AzureSessionInfo.VMName,
    ResourceExtensionReferences = extReferences
    I receive the following error message back from the call:
    BadRequest: Invalid extension reference parameter value in JSON configuration data for the Role: CS1000001, Reference name: CustomScriptExtension.
    I could only find very little documentation on this. Any help would be appreciated.

    Thanks Mekh... after many hours of researching and trial/error, I figured it out.
    The MSDN article I used previously led me down the wrong path. (see article here: http://msdn.microsoft.com/en-us/library/azure/dn781373.aspx). This may work for RESTful calls but not for .NET API calls.
    The part of the code that was hurting me was where the command strings (account and
    scriptfile) were being converted to Base64 encoding. This is NOT correct for .NET calls. Once I removed that, everything worked fine.
    I came across this after researching the same commands used by Linux scripts. They don't convert to Base64 either so I wonder why this is included in the documentation at all.
    In either case, I figured it out, but the documentation is very poor in this area (or all together non-existent). I don't even see where it is documented as to which JSON parameters names are supposed to be used, or even that JSON is required.
    Also, related to the Update command, if you are truly "updating" the config, you must include everything about the original config (whether it changed or not) along with the changes you want to make. If not then you will undo ALL but the changes
    you issued via the command.

  • Problem with runas command. Elevation error

    Running on Win 8.1 Pro I'm facing a problem with runas.
    What I'm trying to do is launch an mmc as my domain admin account.
    Therefore I type this command from an elevated cmd (Right-click "Run as Administrator"):
    runas /user:Contoso\MyDomainAdmin /noprofile mmc
    This worked like a charm in Windows 7, and on my Win81Pro client it yields:
    RUNAS ERROR: Unable to run - mmc
    740: The requested operation requires elevation.
    The account I'm logged in with, is local admin, and the UAC slider is set in the bottom.
    In the eventviewer, I only see some special logons where my normal account is trying to impersonate my domain admin account, and the next event, the domain admin's session is destroyed.
    If this is by design, how would I then run mmc as my domain admin and at the same time avoid its credentials being stored on the local machine?
    Thanks in advance!

    yes, you need to be local admin to be able to elevate!
    I've tested this on a system here and I reproduce the issue you encountered. Some investigation showed running a program that requires elevation using runas is not  possible http://msdn.microsoft.com/en-us/library/bb756922.aspx
    MCP/MCSA/MCTS/MCITP

  • Problem with java commands

    Hello,
    I am able to run the java command on the command promt, but other commands like javap,javac are not working, its saying
    "javap not recognized and internal or external command operable program or batch file"
    what could be the problem?
    thanks in adv
    vakvarma

    thanks for ur reply
    its the problem with my path settings and i have corrented it

  • TABLE ILLEGAL STATEMENT  error with MODIFY command

    Hi gurus,
    i want you to inform me about table illegal statement error. The error occurs when i use modify as below.
    loop at itab.
       select .......
             where xxx eq itab-xxxx.
           MODIFY itab.
      endselect.
    endloop.
    i know that i have to give the sy-tabix as INDEX parameter to the modify command. but i want to know why i have to do this?
    cause when i debug, i follow the sy-tabix field and it have not a change in select endselect.
    may the reason of the error about cursor in select and cursor effects modify command?
    or why?
    Thx,

    Hello,
    I guess this is because your MODIFY statement is inside the SELECT ... ENDSELECT & not inside the LOOP ... ENDLOOP.
    SAP documentation says:
    Within a LOOP loop, the INDEX addition can be ommitted. In this case the current table line of the LOOP loop is changed.
    You have to change the coding:
    DATA: v_index TYPE i.
    loop at itab.
    v_index = sy-index.
    select .......
    where xxx eq itab-xxxx.
    MODIFY itab INDEX v_index.
    endselect.
    endloop.
    BR,
    Suhas
    PS: The coding practice followed is not very performance oriented as well. May be you should have a look around in some blogs, wikis in SCN & change the code accordingly.
    Edited by: Suhas Saha on Nov 19, 2009 9:41 AM

  • Problem with  AT command in LOOP

    Hi Experts,
    here i ve a problem like, in my table there are 3 PSPHI(projects) values,
    if i loop n calculate the sum it is getting total amt for 3 PSPHI values,
    but i want every end of PSPHI i need sum.
    the below code is working fine if there is no AT coomand, if i put AT END OF PSPHI it is giving 00.00 values.
      LOOP AT it_final into it_output.
       AT END OF PSPHI.
        if it_final-wrttp = '04'
           AND it_final-vorga = 'COIN' 
           AND it_final-beltp  = '02'
           AND it_final-versn = '000'.
       t_pla_rev = t_pla_rev + it_output-wlp01.
        MOVE it_output-wlp01 TO pla_rev.
        sum = sum + pla_rev.
          if sy-subrc EQ 0.
            else.
            write:/10 ' u r not ok'.
        endif.
    e  ndif.
    append it_output.
    *ENDAT.
    ENDLOOP.
    write:/10 'total amt is', sum.
    could anybady check where i gone wrong pls...
    Thanks in advance,
    sudharsan.

    Hi,
    What is your table structure.
    The command  AT ........ENDAT  work in sequential order.
    Let me explain with example.
    if your table itab has two column  column1 and column2
    loop at itab into wa.
    at new column2.
    // This will execute when the Value of column 1 change or column2
    // change.
    endat.
    endlloop.
    The solution of your problem is.
    Change your internal table column order ,
    Put the column first for which you want to calculate the sum.
    Thanks & Regards
    Kulvendra Kumar

  • PROBLEM WITH USER COMMAND AT SIMPLE REPORT

    HII FRNDS
    MY PROBLEM IS
    WHEN I AM BRANCHING TO A LIST REPORT FROM MY ALV REPORT BY USING LEAVE TO LIST-PROCESSING . THEN IN MY LIST REPORT I AM HAVING 2 MORE CUSTOMIZED BUTTON . BUT THE THING IS THAT I AM NOT ABLE TO MAKE THAT BUTTON  FUNCTION .
    CAN ANY BODY HELP ME WITH HOW TO MAKE THAT BUTTON WORK IN THE SIMPLE REPORT . I HAVE USED AT USER COMMAND IN THE BEGINING OF REPORT BUT STILL ITS NOT WORKING .
    THANKING YOU
    ROHIT

    HII FRNDS THIS IS THE CODE
    CASE R_UCOMM.
        WHEN 'DISPLAY1'.
          LOC_INDEX = 1 .
          SET PF-STATUS 'STATUS' EXCLUDING 'DISPLAY1'.
          LOOP AT INT_OUTPUT INTO WA_OUTPUT
                             WHERE CHECKBOX = WC_MARKED.
            APPEND WA_OUTPUT TO INT_DISPLAY .
          ENDLOOP.
          LEAVE TO LIST-PROCESSING .
          PERFORM F9100_DISPLAY_DETAILS USING LOC_INDEX.
    ENDCASE.
    AT USER-COMMAND .
    CASE SY-UCOMM.
    WHEN 'BACK'.
    BREAK-POINT.
           PERFORM F9100_DISPLAY_DETAILS USING LOC_INDEX.
      ENDCASE.
    THE PERFORM F9100 DISPLAYES THE LIST REPORT . THERE ARE NO SPELLING ERRORS FRNDS .

  • Problem with rename command in ftp_command

    hi all ,
    i am facing a problem in renaming a file by rename command...
    this is how i am calling the fm ftp_command
    CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          handle        = g_handle
          command       = 'RENAME l_templine_file l_templine_file1'
        TABLES
          data          = l_i_temp_line
        EXCEPTIONS
          tcpip_error   = 1
          command_error = 2
          data_error    = 3
          OTHERS        = 4.
      IF sy-subrc <> 0.
    here l_templine_file   - dev00227.header.tmp  
    l_templine_file1 - dev00227.header.txt
    the fm is failing that the error meassage is FTP subcommand  error
    can u suggest where i am going wrong in this...

    hi,
    May be the command you are passing is incorrect syntax..
    Pass the values like this..
    l_templine_file =  'c:\dev00227.header.tmp' " this should be with path'
    l_templine_file1 = 'dev00227.header.txt'" this is just the name of file
    If not worked..then Try writing in small letters//
    write
    command = 'rename l_templinefile l_templine1'.
    rewards if useful
    Hope this solves..
    regards,
    nazeer
    Message was edited by:
            nazeer shaik
    Message was edited by:
            nazeer shaik
    Message was edited by:
            nazeer shaik

  • Problem with modifier keys in InputEvent

    I am trying to override DefaultCellEditor.isCellEditable() such that only unmodified double-clicking on my table cells will start edit. Naively, I thought this would be simple: cast the received EventObject to, say, an InputEvent and then query its modifiers. However, although calling toString() on the event object clearly shows the modifier key(s) in the event, getModifers() or getModifiersEx() always tells me there weren't any!!!
    Here is a little SSCCE which shows the problem (I hope -- I'm on a Mac, so YMMV; I sure hope not). We have a table with one row and three columns; only the middle column is editable. This column has a custom editor defined on it, which overrides DefaultCellEditor.isCellEditable() to check whether modifiers are down.
    public class AltDoubleClick extends JFrame
      private class MyDataModel extends AbstractTableModel
        private String[] values =
          {"a string for col 0", "a string for col 1", "a string for col 2"};
        public int getRowCount()
          return 1;
        public int getColumnCount()
          return values.length;
        public Object getValueAt(int row, int col)
          return values[col];
        public boolean isCellEditable(int row, int col)
          return col == 1;
        public void setValueAt(Object value, int row, int col)
          values[col] = (String) value;
      private class MyCellEditor extends DefaultCellEditor
        MyCellEditor()
          super(new JTextField());
        public Component getTableCellEditorComponent(JTable table, Object value,
                                                     boolean isSelected, int row, int column)
          if (value != null && value instanceof String)
            ((JTextField) editorComponent).setText((String) value);
          else
            ((JTextField) editorComponent).setText("");
          return editorComponent;
        public boolean isCellEditable(EventObject e)
          if (e instanceof MouseEvent)
            MouseEvent me = (MouseEvent) e;
            System.out.println("modifiersEx is " + me.getModifiersEx());
            System.out.println("modifiers is " + me.getModifiers());
            System.out.println(me.toString());
            return me.getModifiersEx() == 0 && me.getClickCount() == 2;
          return super.isCellEditable(e);
      public AltDoubleClick()
        Container c = getContentPane();
        table = new JTable();
        table.setModel(new MyDataModel());
        table.getColumnModel().getColumn(1).setCellEditor(new MyCellEditor());
        c.add(new JScrollPane(table));
      private JTable table;
      public static void main(String[] args)
        javax.swing.SwingUtilities.invokeLater(new Runnable()
          public void run()
            AltDoubleClick test = new AltDoubleClick();
            test.setSize(500, 500);
            test.setVisible(true);
    }When I run this and double-click the middle cell with a modifier down, I get the following output:
    modifiersEx is 0
    modifiers is 24
    apple.awt.SelectionMouseEvent[MOUSE_PRESSED,(231,5),absolute(233,67),button=1,
    modifiers=⌥+Button1+Button2,clickCount=2] on javax.swing.JTable[...]or, alternatively:
    modifiersEx is 0
    modifiers is 20
    apple.awt.SelectionMouseEvent[MOUSE_PRESSED,(202,3),absolute(204,65),button=1,
    modifiers=⌘+Button1+Button3,clickCount=2] on javax.swing.JTable[...]As you can see, despite the fact that modifier keys are being printed out by the toString() call (⌥ and ⌘ are the alt/option and apple keys, respectively), I get no indication from getModifers() or getModifiersEx() that they are down!!!
    Can anyone help me see through this confusing mess?

    Walter Laan wrote:
    Read the friendly manual. It explicitly tells you not to use == to check stuff and it should be pretty clear that it won't be zero for a mouse button down event.Good point, and I ought to have been more clear in my OP. I initially wrote it as they suggest, but found that wasn't working either. (This was work that I did in two parts with a gap of a couple of months in between, so I'd forgotten that I had tried that.) However, the return values from getModifiers() and getModifersEx(), in my output statements, shows that there are no modifier bits set -- so no point testing for them:
    * When I double-clicked with the alt/option key down, getModifiers() gave me 24, which is simply BUTTON_1_MASK + BUTTON_3_MASK (which isn't even correct -- I was only using the left mouse button).
    * When instead I held the apple key down, getModifers() gave me 20, which is BUTTON_1_MASK + BUTTON_2_MASK (also not correct -- again I was only using the left button).
    * getModifiersEx() in both cases gave me 0.
    I realise that some of this behaviour (the incorrect mouse buttons info) is down to Apple's runtime, but if the correct modifier is in the apple.awt.SelectionMouseEvent object (as we can see in the toString() return value), then surely it should be available from getModifers() or getModifiersEx()!

  • Problem with running commands

    Hi everybody !
    I'm having a form which on being submitted runs a Linux Shell Script using the Runtime class .
    Shell script consists of a command which prompts the user his username/password . I may sound absurd , but I want to know whether is it possible if I could prompt the user through GUI i.e my JSP page at this point of time .
    Thanks in advance ,
    Bye .

    Pl .help with this problem .It's urgent ,very important & challenging too .
    Someone , somewhere must have faced this problem .
    Thanks a lot.

  • Problem with User Command in alv report

    Hi
    I have developed a ALV grid report with drill down capability to transaction code for user command. I am having a trouble with this.
    CASE ucomm.
        WHEN '&IC1'.
          CLEAR: wa_import.
          IF selfield-fieldname EQ 'ANLN1'.
            READ TABLE t_import INTO wa_import INDEX selfield-tabindex.
            SET PARAMETER ID 'BUK' FIELD wa_import-bukrs.
            SET PARAMETER ID 'ANl' FIELD wa_import-anln1.
            CALL TRANSACTION 'AW01N'.
          ENDIF.
    here my parameter ids are showing the values but when i call the transaction i am not getting the actual asset numbers.
    Can someone help me out this
    Thanks

    Hi,
    add the AND SKIP FIRST SCREEN...addition..
    CALL TRANSACTION 'AW01N' AND SKIP FIRST SCREEN.
    Thanks
    Naren

  • Problem with "Hide" command in advanced actions

    Hi:  I am having an issue with the "Hide" function in advanced actions.  Here's the scenario:  I have a smart shape covering an object on the master slide.  When the user clicks on a click box, I want the smart shape to go away (hide) so that the object on the master slide appears.  I set up the click box and then added the advanced action as follows:
    Conditional Action:
    If
    1 is equal to 1
    Actions:
    Assign v-Tanker with 1
    Play Audio Slide 12Tanker.mp3
    Hide HazWasteDefHider
    No Else action because 1 is always equal to 1.
    The problem is this...When I click the Click box in preview, the first two actions happen, but the last one (Hide HazWasteDefHider) does not.
    What am I doing wrong?  Any advice would be appreciated.

    I have to disagree with my esteemed colleagues on this one.  I NEVER use Standard Actions (SA) unless I know for certain that it will be a very simple action I'm happy to delete and rebuild if it turns out that I ended up needing a Conditional Action (CA) instead.
    Perhaps it's just the types of projects I work on, or perhaps it's a flaw in my character, but in my experience almost every time I've used a SA in a project I've ended up needing a CA later in the development process and wished I'd done that in the first place.  So I've fallen into the habit of ONLY ever using CAs as insurance against wasting time.  I've not found CAAs run any slower than SAs, but they are FAR more versatile.  SA's hem you in too much.
    You can easily make a CA work as a SA by fudging the condition with 1==1 as mentioned above. And you can mix CAs with SAs as consecutive statements in the same CA. But no matter what you do, Captivate does not allow you to change a SA into a CA.  Once created, the die is set in stone for SAs.  It's the fact that you cannot convert one into the other that makes me go straight to the CA option in the drop-down each time.  I just wish I had the option to make CAs the default instead of always needing to change it from SA.
    I would personally prefer that Captivate's developers made the Condition section of a CA optional via a check box or similar so that you could just switch off the condition if you didn't need it.

  • URGENT!! problems with Unix command, please help

    I am trying to use the following Unix command and I keep getting error messaages from stdError. However if I run the same command from the command line it works perfectly. For some reason when I run the command from inside the program it thinks the append symbol ">>" is another file.
    String command = " cat /users/02/wjoc1/Test/list.mod >> /users/02/wjoc1/Test/Blacklist ";
    Process p = Runtime.getRuntime().exec(command);
    The error get is :
    /bin/cat: >>: No such file or directory
    Any help would be greatly appreciated

    The better solution for this problem is write a shell script for the action you wnat to perform and execute it using the runtime.exec().In your case just cut and paste cat /users/02/wjoc1/Test/list.mod >> /users/02/wjoc1/Test/Blacklist in to a file and save it. use that file as a argument for the exec method it will work.
    cheers
    R.Karuna

Maybe you are looking for

  • Import a text file of Tcode in PFCG to generate roles

    Hi All For generating large files by module we get the list of transactions by module from the applicative components. The problem is that the upload functionality of a flat text doesn't work. Does anyone know how to transfer like 700 to 1000 transac

  • Test published web service in Service Registry

    I have published a web service to the Service Registry and what to see if I can test this web service in Service Registry directly. When I go to the 'EndPoint' tab and click on Test Button, I got to WSNavigator page and my web service's WSDL URL is c

  • Batch Input error in background in fb05

    Hi All I am trying to clear vendor open  items for document numbers from BSIK table. i am doing this using fb05 transaction, checking the 'post with clearing' option. The program creates a batch input session. When i process the session in foreground

  • Approval procedure if user change in the unit price at Purchase Order

    Dear Experts, I have defined purchase price list in the item master data. I want an approval if there is any devaition in the purchase price list and unit price which is defined in the purchase order. It will always go for the approval. Regards, Ravi

  • Need help with IE6 box drop problem DW CS4

    Having a problem with this page: http://www.recoverings.com/tarzan.html in IE6. Maincontent drops below the sidebar menu. Looks fine in FF, Safari, IE7. All other pages work well. I assume that this has something to do with the width of the .wrapnail