For good Method

Hi All,
I want to add some sequence number to Vector container.
for example, 3,4,5,6,7,8,9,10
how to make best way to add those number to container,
I do not like the following code
for(int i=3;i<11;i++){
    container.add(i);
}the thing is, I do a quick search on an object array, i get the start Index, and end Index.
since maybe there is a lot of records match the search conition, let me see, 3,000.
Any hint would be great appricated.
Thanks in advanced!

Hi,
As from ur question, i can see that ur trying to hold the premitive values,
if you need to hold primitive types, arrays are the way to go, since the collection classes can only hold instances of Object. The class java.util.Arrays includes some useful algorithms for processing arrays,
And in case if ur using the objects, Array list would be the bettter option, Just find the below link why arraylist is better,
http://java.sun.com/developer/TechTips/txtarchive/2002/Sept02_GlenM.txt
Bhuvan

Similar Messages

  • Looking for a good method or APP to have client sign a form in a text box

    I am looking for a good method or App to take an existing form/Document and have a client sign, date etc.  I will want to create the text boxes in a stationary location.  Possibly to also take a picture to add to form.
    Has anyone used any apps to accomplish this?
    Apps I have tried.
    Signnow
    Sign PDF
    Sign Easy
    Sign Easy is about the best except the signatures (text boxes, dates, etc) are free floating and confuse people where to add them on form each time.  Clients have no clue how to use it.
    Any suggestions would be helpful.  I may be over complicating this also, as there could just be a PDF app that I utilize.
    Thanks,
    Jim

    Maybe more than you need...
    PDF readers
    PDF Expert – the PDF handling app for the iPad. "It allows you to markup documents with highlights and handwriting, insert text and stamps, sign and even merge PDFs."
    https://itunes.apple.com/us/app/pdf-expert-5-fill-forms-annotate/id743974925?mt= 8
    iAnnotate – turns your tablet into a world-class productivity tool for reading, marking up, and sharing PDFs, Word documents, PowerPoint files, and images.  Has a secure document edition designed for corporations.
    http://www.branchfire.com/iannotate/

  • BAPI for goods moment is not working in loop

    Dear ABAPers,
    If i am using BAPI ( for MB1n transabtion for goods movement type 309 )with in loop first one is working fine and remaining is not working.
    If i run individually all r working fine.
    I am sending cdoe as below.
    Pl hava look on that.
      LOOP AT ITAB.
        CLEAR: GM_RETURN, GM_RETMTD,GM_HEADER,GM_CODE,GM_HEADRET.
        REFRESH: GM_RETURN,GM_ITEM.
        GM_HEADER-PSTNG_DATE = SY-DATUM.
        GM_HEADER-DOC_DATE   = SY-DATUM.
        GM_CODE-GM_CODE      = '04'.                            " MB1B
        CLEAR GM_ITEM.
        MOVE '309'                 TO GM_ITEM-MOVE_TYPE     .
        MOVE ITAB-MATNR  TO GM_ITEM-MATERIAL.
        MOVE ITAB-MENGE_REC TO GM_ITEM-ENTRY_QNT.
        MOVE ITAB-MATNR_REC TO GM_ITEM-MOVE_MAT.
        MOVE ITAB-MEINS_REC TO GM_ITEM-BASE_UOM.
        MOVE ITAB-WERKS_REC  TO GM_ITEM-PLANT.
        MOVE ITAB-LGORT_REC  TO GM_ITEM-STGE_LOC.
        MOVE ITAB-CHARG TO GM_ITEM-BATCH.
        MOVE ITAB-CHARG_REC TO GM_ITEM-MOVE_BATCH.
        APPEND GM_ITEM.
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            GOODSMVT_HEADER  = GM_HEADER
            GOODSMVT_CODE    = GM_CODE
          IMPORTING
            GOODSMVT_HEADRET = GM_HEADRET
            MATERIALDOCUMENT = GM_RETMTD
          TABLES
            GOODSMVT_ITEM    = GM_ITEM
            RETURN           = GM_RETURN.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
      RETURN        =
        IF GM_RETURN[] IS NOT INITIAL.
          LOOP AT GM_RETURN.
            IF GM_RETURN-TYPE = 'E'.
              ERR_CNT = ERR_CNT + 1.
              V_MESSAGE = GM_RETURN-MESSAGE.
              UPDATE Y_MB1B SET STS_CODE = 'PE'
                               UPDATE_BY = SY-UNAME
                               UPDATE_DATE = SY-DATUM
                               MESS = V_MESSAGE
                   WHERE SRL = ITAB-SRL.
            ENDIF.
          ENDLOOP.
        ELSE.
          IF GM_RETMTD IS NOT INITIAL.
            REC_CNT = REC_CNT + 1.
            CONCATENATE 'Document' GM_RETMTD 'posted' INTO V_MESSAGE SEPARATED BY SPACE.
            UPDATE Y_MB1B SET STS_CODE = 'PS'
                       UPDATE_BY = SY-UNAME
                       UPDATE_DATE = SY-DATUM
                       MESS = V_MESSAGE
           WHERE SRL = ITAB-SRL.
          ENDIF.
        ENDIF.
      ENDLOOP.
    Pl gimme solution.
    Cheers,
    Simha.

    Hi,
                   here is the code check this for ur ref
    method IF_EX_LE_SHP_GOODSMOVEMENT~CHANGE_INPUT_HEADER_AND_ITEMS .
    ******** Data Declaration *************
      data: ls_lips type lips.
      data: ls_goods_header type BAPI2017_GM_HEAD_01.
      data: ls_gm_code type BAPI2017_GM_CODE.
      data: ls_goods_mvt type BAPI2017_GM_ITEM_CREATE.
      data: lt_goods_mvt type table of BAPI2017_GM_ITEM_CREATE.
      data: lt_return type table of BAPIRET2.
      data:ls_MATERIALDOCUMENT type BAPI2017_GM_HEAD_02-MAT_DOC.
      data: ls_MATDOCUMENTYEAR type BAPI2017_GM_HEAD_02-DOC_YEAR.
      constants: c_bwart type lips-bwart value '309'.
      ls_goods_header-PSTNG_DATE = sy-datum.
      ls_goods_header-DOC_DATE   = IS_LIKP-bldat.
      ls_goods_header-pr_uname = sy-uname.
      ls_gm_code-GM_CODE         = '06'.
      loop at it_xlips into ls_lips
           where OIC_MOT = 'PK'.
        if ( ls_lips-uepos is initial and ls_lips-pstyv = 'TAQ').
          ls_goods_mvt-MATERIAL = ls_lips-MATNR.
          ls_goods_mvt-PLANT = ls_lips-WERKS.
          ls_goods_mvt-STGE_LOC = ls_lips-LGORT.
          ls_goods_mvt-MOVE_TYPE = c_bwart.
          ls_goods_mvt-ENTRY_QNT = ls_lips-LFIMG.
          ls_goods_mvt-MOVE_MAT = ls_lips-UMMAT.
          ls_goods_mvt-MOVE_PLANT = ls_lips-UMWRK.
          ls_goods_mvt-MOVE_STLOC = ls_lips-UMLGO.
          append ls_goods_mvt to lt_goods_mvt.
        endif.
      endloop.
    by this call function BAPI Material document is created ****
      data : LS_GOODSMVT_HEADRET     TYPE BAPI2017_GM_HEAD_RET.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          GOODSMVT_HEADER  = ls_goods_header
          GOODSMVT_CODE    = ls_gm_code
        IMPORTING
          GOODSMVT_HEADRET = LS_GOODSMVT_HEADRET
        TABLES
          GOODSMVT_ITEM    = lt_goods_mvt
          RETURN           = lt_return.
      IF lt_return[] is NOT initial.
    <b>Reward points</b>
    Regards

  • Transaction variant for Goods Issue going back to MB1A transaction screen

    Hello,
    I have created a transaction variant ZMB1A for Goods issue.
    When the goods issue transaction completed by using ZMB1A system again going back to the initial screen of MB1A. (Since it is the base of MB1A)
    Here the issue is everytime user had to enter the ZMB1A transaction. (for example if the user wants to issue material for different plants).
    Please suggest any suitable method to avoid the above multiple t code execution.
    Regards
    Rifaie M

    Hi,
    In SHD0, do the complete processing of Transaction MB1A during creation of Transaction Variant "ZMB1A" till posting of the Material document.
    To create a new T-Code as ZMB1A, go to Transaction SE93 and here enter Transaction Code as ZMB1A and Click Create button. Now enter Short text of Transaction and select option "Transaction with Variant (Variant transaction)" and press enter.
    Here enter following;
    Transaction             MB1A
    Transaction variant     ZMB1A
    Activate "Cross-client"
    Select Professional User Transaction
    Activate SAP GUI for HTML
    Activate SAP GUI for Java
    Activate SAP GUI for Windows
    Now Click SAVE button.
    Now you can start using Transaction ZMB1A which will call Transaction Variant ZMB1A.

  • What is the Arguement for getFailureStepLog() Method?

    I'm not that good with Java, so I'm not sure but oracle has a slew of information on different Java Methods for ODI and getting information from the Repository. But I don't see any information on what the Argument is for these methods.
    For example, I can build a Refreshing Variable to get the Session Number:
    SELECT <%=odiRef.getSession("SESS_NO")%> FROM DUAL
    The Arguments for the odiRef.getSession() are listed in the KM Dev Guide.
    However all the online oracle pages do not list the Arguments?? Like below:
    http://docs.oracle.com/cd/E21764_01/apirefs.1111/e17060/oracle/odi/domain/runtime/session/OdiSession.html#getFailureStepLog__

    Why do you think it needs an argument to return ?
    Return the step log (OdiSessionStepLog) that caused the session's failure. If the session didn't failed, than method will always return null. However, it can be null even if session is failed (e.g. session failed at preparation time).
    It takes session id automatically from failed step.

  • Work flow for Goods issue MIGO_GI

    Hi friends,
    I want to develop a work flow for good issue MIGO_GI  transaction.  Is there any standard work flow this scenario.
    When I deliver the 4 materials, the Material cost is 100*4 = 400, if the Material cost is greatr than 500, mail should trigger to the manager, if it less it will go to the first approver.
    please advice me in this.,
    regards,
    Ajay

    I think no stanadard workflow will provide you with such a validation, Better to design your own customized workflow template,
    Follow the below steps.
    1. Open PFTC select the task type workflow template
    2. Click F5 and define the relevant fields and make the agent assignemnt for the workflow template as general task from the menu  addtional agent  ---> agent assginement  --> maintain --> general task.
    3.  Check the BOR BUS2017 this might be useful.
    Check the method GoodsMovement.SAPCreate and its parameters  interface, if you can get the total values of the then include a condition and validate th total cost if is satrisfyies send mail and workitem to approver, if it does not satisfy then send only workitem to approver.
    Check the below BADI's
    MB_BAPI_GOODSMVT_CREATE        MB_GOODSMOVEMENT
    MB_BATCH_MASTER                MB_GOODSMOVEMENT
    MB_DOCUMENT_BADI               MB_GOODSMOVEMENT
    from where you can trigger your customized workflow by using the standard fm SAP_WAPI_CREATE_EVENT or SAP_WAPI_START_WORKFLOW*

  • Weblogic7/examples/clustering/ejb Automatic failover for idempotent methods ?

    This one should be easy since it is from the examples folder of bea 7 about
              clustering.
              Ref : \bea7\weblogic007\samples\server\src\examples\cluster\ejb
              I am referring to the cluster example provided with the weblogic server 7.0
              on windows 2000.
              I deployed Admin server and 2 managed server as described in document.
              Everything works fine as shown by the example. I get load balancing and
              failover both. Too Good.
              Client.java is using the while loop to manage the failover. So on exception
              it will go thru the loop again.
              I understand from the documentation that the stateless session EJB will
              provide the automatic failover for Idempotent stateless bean
              Case Failover Idempotent : ( Automatic )
              If methods are written in such a way that repeated calls to the same method
              do not cause duplicate updates, the method is said to be "idempotent." For
              idempotent methods, WebLogic Server provides the
              stateless-bean-methods-are-idempotent deployment property. If you set this
              property to "true" in weblogic-ejb-jar.xml, WebLogic Server assumes that the
              method is idempotent and will provide failover services for the EJB method,
              even if a failure occurs during a method call.
              Now I made 2 changes to the code.
              1 . I added as follows to the weblogic-ejb-jar.xml of teller stateless EJB
              <stateless-clustering>
              <stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
              <stateless-bean-load-algorithm>random</stateless-bean-load-algorithm>
              <stateless-bean-methods-are-idempotent>true</stateless-bean-methods-are-idem
              potent>
              </stateless-clustering>
              So I should get the automatic failover .............
              2. Also I added the break statement in the catch on line around 230 in
              Client .java
              catch (RemoteException re) {
              System.out.println(" Error: " + re);
              // Replace teller, in case that's the problem
              teller = null;
              invoke = false;
              break;
              So that the client program does not loop again and again.
              Now I compile and restart all my three servers and redeploy application (
              just to be sure )
              I start my client and I get a automatic load balancing between the server
              which makes me happy.
              But Failover ....?
              I kill one of the managed application server in cluster at any particular
              test fail point.
              I expect the exception to be taken care automatically by error/failover
              handler in the home/remote stub
              But the client program fails and terminates.
              1. What is wrong with the code ?
              2. Does the automatic failover with the indempotent methods also has to be
              taken care by coding the similar while loop for stateless ejb ?
              Your help will be appreciated ASAP.
              Let me know if you need any thing more from my system. But I am sure this
              will be very easy as it is from the sample code.........
              Thanks
              

    Sorry I meant to send this to the ejb newsgroup.
              dan
              dan benanav wrote:
              > Do any vendors provide for clustering with automatic failover of entity
              > beans? I know that WLS does not. How about Gemstone? If not is there
              > a reason why it is not possible?
              >
              > It seems to me that EJB servers should be capable of automatic failover
              > of entity beans.
              >
              > dan
              

  • Looking for good JSP editors??

    Hi,
    I am new to JSP but very old to ASP. I am looking for good JSP editors if there are any for free to dl.
    Do we have any JSP editors...like in Microsoft which gives you dropdown list of parameters and properties.methods... ???
    Thanks,
    Kavans.

    Sounds like your looking for a good IDE. As far as free ones
    go, netbeans is as good as any. Comes with a lot of nice
    features.. such as code completion, and has the latest version
    of tomcat integrated.

  • Workflow for Goods Receipt (MIGO)

    Hi Everybody,
    I am new to workflow. I have one assignment that i am thinking to do using workflow. The scenerio is there are two different users. First user will create and hold the goods receipt (Migo) and other will approved and post the goods receipt (Migo). I am thinking to do it through workflow. As soon as the first user click the hold or post button (but it will not posted as it is suppose to be posted by 2nd user), the workflow will trigger and it will go to 2nd user who will confirm and post the goods receipt. There is one object Bus2017 that have some events and methods for goods receipt but seems like it is not useful. can anyone suggest me how can i do this process using workflow? Thanks

    Hi,
    There is no standard event when you save document as a hold...
    however you can trigger workflow manually using FM SAP_WAPI_START_WORKFLOW or using SAP_WAPI_EVENT_CREATE(if you choose to create a custom event)...
    Try finding some user exit for this...
    Regards
    Gautam

  • Outbound IDoc for Goods Movement

    HI
    We need to generate XML files for goods movement posted in SAP at Goods Receipt (MIGO) and Post Goods Issue (VL02N). Requirement is asynchronous update where the receiving system will poll the xml file at the end of the day.
    I have not been able to find any standard outbound idoc for goods movement.Can someone advise how they tackled any similar requirement? Any other approach also appreciated.
    Thanks
    Sriram

    Answer to the question, which would be useful to all.
    <b>MIGO</b>
    MB_CF001 - Customer Function Exit in the Case of Updating a Mat. Doc.
    This exit is called on update task, populate segments (edidc & edidd) of WMMBID02 (WMMBXY message type) and use MASTER_IDOC_DISTRIBUTE. Also you need to maintain the ALE Distribution model in WE64 for this message type.
    Inside the code you can restrict based on movement type. No need to issue COMMIT.
    <b>VL02N</b>
    You can use BAdi: LE_SHP_DELIVERY_PROC to perform this.
    Create Implementation and use the method SAVE_AND_PUBLISH_DOCUMENT.
    Hope this help to others as well.

  • BOR for Good receipt(MIGO)

    Hi ,
    Can anybody please tell me whats the Business Object for Goods receipt(MIGO) which triggers idoc MBGMCR02
    Thanks
    Izhar

    Hi Raman,
    When we create a GR in MIGO and say SAVE
    then BUS2017 object gets triggered or MKPF.
    And which Method ?
    Thanks so much

  • Siri tunes back on after respring, anyway to turn off for good?

    using the tweak "nownow" need to turn off siri for good in order to use it with the proper activation method. i turned off siri, but after respring, it turns back on.. any setiing change or jb tweak that can fix this?

    The discussion of jailbreaking or OS hacking is not allowed on the forum.

  • Different GOGS GL account for goods issue

    Hello SAP export,
    The F&A department requests to generate different COGS GL account based on Customer Account Assignment Group when goods issue (or billing). Customer Account Assignment Group field name is KNVV-KTGRD. The solution is NOT possible at T-CODE OBYC (with GBB transaction (MM FI configuration for goods issue) because we are using the same materials. (All materials are with same valuation class in MATERIAL master).
    I had posted this question in SD forums but the export suggests me to post in FI forum.
    If you know any workable solution, please help.
    Great thanks in the advance!

    Hi,
    Check the link for how to have default a G/L account on a Purchase Order account assignment for an inventory item & how to post to a separate G/L account for  inventory item by having GR posting
    http://www.bluemarlinsys.com/ns/0603-03.asp
    OR
    you can have a thought of having different valuation grouping codes where you can have different G/L posting with respect to plant for same materiel
    valuation grouping code........valuation area
    0001......................................P001(plant-1)
    0002----
    P002(plant-2)
    Regards,
    Biju K

  • Ive deleted contacts from my contacts list but they still pop up when i go to text and type in the name of a current contact. .  How can i delete them off my phones memory for good?

    Ive deleted contacts from my contacts list but they still pop up when i go to text and type in the name of a current contact. .  How can i delete them off my phones memory for good? iPhone 4S

    At the present time, the only way to clear that is to restore the phone as new.  Perhaps a future iOS update will give us the option to clear that cache.

  • Report for vendor no., vendor name for good receipt documents on KSB1

    Hello,
    My client needs vendors on KSB1 report. I told them about offseting  account, but it doesn't show vendor for good receipt documents.
    Is there any place else they can view vendor, vendor name for those good receipt documents .
    Any MM report or AP report .
    Thanks,
    T.G

    Hi,
    Please go to FBL1N, In Dynamic Selection give document as "WE", this will give and enable Purchase Order Number
    This will give you Vendor Name, Purchase Order and  FI Document number or u can try MB51, there you will not get Vendor Name, but you will get Vendor Code, Material Document Number and Purchase Order Number
    Br,Vivek
    Edited by: View_taurian on Oct 22, 2011 12:01 AM

Maybe you are looking for

  • I'm not receiving any mail into the Junk Mailbox

    Hi I had a problem with the ports of the 2 accounts that I have set up in Mail (one of those is mac.com) due to an excess of space used. I tried several options and it finally it worked. As a result, a week later I realised that I was not receiving a

  • How to Stop Thread Within TestStand

    I am a relative "newbie" to TestStand in this aspect.  I am creating an sequence to generate CAN Bus Traffic in hopes of getting to a more accurate throughput measurement.  The Subsequence I am creating is a designed infinite loop and I am specifying

  • Writing current to DAQ using AOPoint control

    I'm using the CWAOPoint control to write a value of type current to my DAQ card 6024E but I get the following error: "The specified device does not support the requested action (the driver recognises the device, but the action is inappropriate for th

  • Can't get the tables normally using RFC call to BC

    SAP Business Connector Developer. ->IDataUtil.getIDataArray function (can't work properly using RFC CALL)( I think it's the source of problem) I use the SAP Business Connector Developer(4.7) to get data from db2. and I create a JAVA service in th BC

  • Equalizer window won't stay put in iTunes 7.7

    I upgraded a secondary drive to iTunes 7.7 and now the Equalizer window continues to return to a default position every time I start up iTunes. This has never happened with any previous version of iTunes. I trashed all iTunes preference files but thi