Plz meke me understand the given code!!!!!!

Dear All,
I am giving you the code below. Please any one can explain me the whole program and the purpose. specially form LOOP section to the end of the program.
I will be very kind if someone will help to make me understood.
Regards,
Abhay.
TABLES:bseg.
DATA: it_bseg LIKE bseg OCCURS 0 WITH HEADER LINE.
DATA: it_zseco LIKE zseco OCCURS 0 WITH HEADER LINE.
*DATA: it_zseco TYPE zseco OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:s_bukrs FOR bseg-bukrs,
               s_gjahr FOR bseg-gjahr,
               s_belnr FOR bseg-belnr.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
  PERFORM get_data.
*&      Form  get_data
FORM get_data .
  SELECT *
        FROM bseg INTO TABLE it_bseg
        WHERE  belnr IN s_belnr AND
               bukrs IN s_bukrs AND
               gjahr IN s_gjahr.
  IF sy-subrc = 0.
    LOOP AT it_bseg .
      MOVE-CORRESPONDING it_bseg TO it_zseco.
      it_zseco-bupla_old = it_bseg-bupla.
      it_zseco-zdate = sy-datum.
      it_zseco-usernam = sy-uname.
      it_zseco-ztime = sy-uzeit.
      IF it_bseg-bupla NE 'B001'.
        it_bseg-bupla = 'B001'.
        MODIFY it_bseg.
      ENDIF.
      it_zseco-bupla_new = 'B001'.
      APPEND it_zseco.
      CLEAR it_zseco.
    ENDLOOP.
    MODIFY bseg FROM TABLE it_bseg.
    MODIFY zseco FROM TABLE it_zseco.
    MESSAGE i000 WITH 'tables BSEG & ZSECO updated successfully'.
  ELSE.
    MESSAGE i000 WITH 'No data found'.
  ENDIF.

Selection screen with fields for company code, fiscal year and document number.
Extract all entries matching this selection criteria from table BSEG (document line items) into an internal table.
Populate an internal table it_zseco with each document extracted and the current user/date/time.
Sets the value of field bupla in BSEG to B001 if it does not currently have this value.
Updates these changes to table BSEG.
Updates the audit into to table ZSECO.
Why it's doing this (in this rather shabby way) I don't know.
Regards,
Nick

Similar Messages

  • Getting Compilation error in the given code,

    Hello:
    If i use setResizable(false), then maximization option will be disabled,but i want to do close and minimization option will be disabled, then what methods shall i use? Although you have given setClosable(false) and setIconifiable(false), but both methods are not working properly, plz set the methods in the given code or plz give the proper code what i need to use.
    I shall be highly grateful to you, if you kindly help me.
    import java.awt.*;
    import javax.swing.*;
    public class Test{
              public static void main(String args[]){
                   SampleFrame frame = new SampleFrame();
                        frame.setDefaultCloseOperation(3);
                        frame.setVisible(true);
    class SampleFrame extends JFrame{
              public SampleFrame(){
                   setSize(width,height);
                   setResizable(false);
                   setClosable(false); // getting error
                   setIconifiable(false); // getting error
    public static final int width = 300;
    public static final int height = 200;
    }

    I'd post the simple answer, but the reply button never seems to work on your posts.

  • How to notify() the main method in the given code snippet

    consider the given code snippet
    code
    public class WaitTest {
    public static void main(String [] args) {
    System.out.print("1 ") ;
    synchronized(args) {
    System.out.print("2 " ) ;
    try {
    args.wait();
    catch(InterruptedException e){}
    System.out.print("3 ");
    code
    Here since there are no threads to notify the main()method the statement System.out.print("3 "); never gets executed.And i cannot use the non static notify() from a static context.In this case how will I notify the main() method.

    A thread can only do one thing at a time.
    It cannot be waiting and notifying at the same time.
    notify only works if another thread is waiting.
    wait() only stops if another thread notify/notifyAll() it at the same time.

  • Plz help me on the hangman code

    Consider the venerable "hangman" game, in which a player attempts to guess a word one letter at a time. If you are unfamiliar with hangman, simply google it; you'll be playing in no time.
    Consider the following abstract view of hangman. The input is an unknown word and a sequence of character guesses. There is also an implicit parameter, which is the number of incorrect guesses that may be made before losing the game. Even though you wouldn't implement an interactive hangman game this way, let's model this as:
    static public int hangman (String puzzle, String guesses, int limit)
    Requires: puzzle != null, guesses != null, limit >=0
    Effects: returns the number of the guess that solves the
    puzzle within the given limit on incorrect guesses.
    If the puzzle is not solved within the limit, returns -1.
    e.g.
    hangman ("cat", "abct", 1) is 4 (solved)
    hangman ("cat", "abct", 0) is -1 (hit the limit)
    hangman ("cat", "abcd", 5) is -1 (gave up)
    I wrote the following code but it gives me an error of array index out of bounds exception though it compiles correctly. If someone can help me in correcting the code or point out my mistake.
    public class hangman
    public static int hang(String puz,String gue,int lim)
         int i,j,flag=0,ret=0;
         char p[],g[];
         p=puz.toCharArray();
         g=gue.toCharArray();
         one:
              for(i=0;i<g.length;i++)
                   two:
                   for(j=0;j<p.length;j++)
                        if(g==p[j])
                             //take the element off the p array and resize p
                             if(p.length==1)
                             break one;
                             else
                             char b[]=new char[p.length];
                             for(int k=j+1;k<p.length;k++)
                                  p[k-1]=p[k];
                                  b=p;
                                  p=new char[p.length-1];
                             for(int l=0;i<p.length;l++)
                             p[l]=b[l];
                             continue one;
                        else
                        if(j==p.length-1)
                             flag++;
                        else
                        continue two;
              if(flag>lim)
              return -1;
              else
              return 0;
    public static void main(String args[])
    int ret;
    ret=hang("cat","abct",1);
    System.out.println(ret);

    I wrote the following code but it gives me an error
    of array index out of bounds exception though it
    compiles correctly.I just want to point out a fundamental misunderstanding that this statement suggests you have.
    Compiling just converts your source code into equivalent bytecode. The only errors you'll get during compilation are if the syntax is bad (like you forgot a semicolon, misspelled a method name, have an extra closing brace, etc.) or if you're trying to ues a vairialbe that the copmiler can't be sure will have been initialized, etc.
    Compilation does NOT execute your code, and it has no way to determine the logical problem with, for instance, int[] arr = new int[0];
    int x = arr[999]; The fact that x has zero elements and you're trying to access element 999 only comes to light at execution time.
    So "I get an error at runtime even though it compiles fine" is kind of meaningless.
    Note that I'm not trying to pick on you here. I just want to shift your thinking away from this fundamental misconception you seem to have.

  • Problem in sending mail with the given code

    package booodrive;
    Some SMTP servers require a username and password authentication before you
    can use their Server for Sending mail. This is most common with couple
    of ISP's who provide SMTP Address to Send Mail.
    This Program gives any example on how to do SMTP Authentication
    (User and Password verification)
    This is a free source code and is provided as it is without any warranties and
    it can be used in any your code for free.
    Author : Sudhir Ancha
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
      To use this program, change values for the following three constants,
        SMTP_HOST_NAME -- Has your SMTP Host Name
        SMTP_AUTH_USER -- Has your SMTP Authentication UserName
        SMTP_AUTH_PWD  -- Has your SMTP Authentication Password
      Next change values for fields
      emailMsgTxt  -- Message Text for the Email
      emailSubjectTxt  -- Subject for email
      emailFromAddress -- Email Address whose name will appears as "from" address
      Next change value for "emailList".
      This String array has List of all Email Addresses to Email Email needs to be sent to.
      Next to run the program, execute it as follows,
      SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
      private static final String SMTP_HOST_NAME = "sample.com";
      private static final String SMTP_AUTH_USER = "demo";
      private static final String SMTP_AUTH_PWD  = "demo";
      private static final String emailMsgTxt      = "Online Order Confirmation Message. Also include the Tracking Number.";
      private static final String emailSubjectTxt  = "Order Confirmation Subject";
      private static final String emailFromAddress = "[email protected]";
      // Add List of Email address to who email needs to be sent to
      private static final String[] emailList = {"[email protected]"};
      public static void main(String args[]) throws Exception
        SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
        smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
        System.out.println("Sucessfully Sent mail to All Users");
      public void postMail( String recipients[ ], String subject,
                                String message , String from) throws MessagingException
        boolean debug = false;
         //Set the host smtp address
         Properties props = new Properties();
         props.put("mail.smtp.host", SMTP_HOST_NAME);
         props.put("mail.smtp.auth", "true");
        Authenticator auth = new SMTPAuthenticator();
        Session session = Session.getDefaultInstance(props, auth);
        session.setDebug(debug);
        // create a message
        Message msg = new MimeMessage(session);
        // set the from and to address
        InternetAddress addressFrom = new InternetAddress(from);
        msg.setFrom(addressFrom);
        InternetAddress[] addressTo = new InternetAddress[recipients.length];
        for (int i = 0; i < recipients.length; i++)
            addressTo[i] = new InternetAddress(recipients);
    msg.setRecipients(Message.RecipientType.TO, addressTo);
    // Setting the Subject and Content Type
    msg.setSubject(subject);
    msg.setContent(message, "text/plain");
    Transport.send(msg);
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    return new PasswordAuthentication(username, password);
    package booodrive;
    public class Test {
         public static void main(String args[]){
              SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    I am not able to send mail using the above given codes. Can anyone please help?
    Rony
    Edited by: RonyFederer on Aug 10, 2008 9:04 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Your first step is to diagnose the problem.
    1. Does the code compile? If not, what error messages appear?
    2. Does the code run? If not, what error messages appear? What's in the stack trace?
    3. Does the code do what you expect it to do? If not, what are the differences?

  • Help needed in understanding the Java code.

    Hi All,
    I have recently started learning the Java language. I came across this example and had a problem in understanding the output of the program. I could follow that if the continue statement is present in the below program the output is "Found 9 p's in the string" . But if the continue statement is removed I could not understand why the output would be "Found 35 p's in the string" .Is it because of the spaces and characters other than p... (eter ier icked a eck of ickled eers)
    Example-----------------------
    The continue statement skips the current iteration of a for, while , or do-while loop. The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop. The following program, ContinueDemo , steps through a String, counting the occurences of the letter "p". If the current character is not a p, the continue statement skips the rest of the loop and proceeds to the next character. If it is a "p", the program increments the letter count.
    class ContinueDemo {
    public static void main(String[] args) {
    String searchMe
    = "peter piper picked a " +
    "peck of pickled peppers";
    int max = searchMe.length();
    int numPs = 0;
    for (int i = 0; i < max; i++) {
    // interested only in p's
    if (searchMe.charAt(i) != 'p')
    continue;
    // process p's
    numPs++;
    System.out.println("Found " +
    numPs + " p's in the string.");
    Here is the output of this program:
    Found 9 p's in the string.
    To see this effect more clearly, try removing the continue statement and recompiling. When you run the program again, the count will be wrong, saying that it found 35 p's instead of 9.

    The answer is already in your example - "The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop."
    It unloads the current loop iteration when condition is matching. Loop is again starting from boolean expression inside loop declaration.
    Java Programming - java forum

  • Please help me in understanding the following code.

    public static void main(String args[]){
    int x=0,c=0;
    for(int i=0;i<3;i++)
    x = x + x++;
    System.out.println(x);
    why this program always prints zero(0) as output. I am not able to understand the execution sequence of it.

    bkyadav wrote:
    at certain point of time in porgram
    (x++) should be treated as x = x+1; but that is not happening.Here's the rule : you have to proceed the expression from left to right.
    For example :
    int x = 8;
    x = x + ++x; // x = 8 + 9 = 17
    int x = 8;
    x = x + x++; // x = 8 + 8 = 16
    int x = 8;
    x = x + --x; // x = 8 + 7 = 15Also, in the for statement of your example :
    for(int i=0;i<3;i++)the value of i+ is first tested before being incremented for the next iteration otherwise the test on value of i+ = 0 would have been skipped.

  • Convert the given code into JTREE !!!

    package ref;
    import java.lang.reflect.*;
    class Provider {
    public int i=0,j=2;
    private float f=3.0f;
    static double d=5.8;
    int a[] = new int[10];
    final int g=10;
    String str;
    protected double y[][]=new double[5][3];
    public Provider() {
    protected Provider(int c) {
    public final void add(float f,double d,String s) throws ClassCastException {
    private int add(int a,int b) {
    return j;
    public double sub(int a,int b,int c,int d) {
    return d;
    }//end of provider class
    class Requester {
    public void requesttoprovide(Object o) {
    Class c1;
    Method method[];
    Field field[];
    Constructor constructor[];
    try {
    c1=Class.forName(o.getClass() .getName() );//return fully qualified name
    method=c1.getDeclaredMethods() ;
    field=c1.getDeclaredFields() ;
    constructor=c1.getDeclaredConstructors() ;
    for(int i=0;i<method.length ;i++) {
    System.out.println(" Method # " + i + " = " + method);
    System.out.println(" Method Return Type is = " + method[i].getReturnType() );
    switch(method[i].getModifiers()) {
    case Modifier.PUBLIC :
    System.out.println(" METHOD'S MODIFIER IS = 'PUBLIC' ");
    break;
    case Modifier.PRIVATE :
    System.out.println(" METHOD'S MODIFIER IS = 'PRIVATE' ");
    break;
    case Modifier.ABSTRACT :
    System.out.println(" METHOD'S MODIFIER IS = 'ABSTRACT' ");
    break;
    case Modifier.FINAL :
    System.out.println(" METHOD'S MODIFIER IS = 'FINAL' ");
    break;
    case Modifier.PROTECTED :
    System.out.println(" METHOD'S MODIFIER IS = 'PROTECTED' ");
    break;
    case Modifier.STATIC :
    System.out.println(" METHOD'S MODIFIER IS = 'STATIC' ");
    break;
    case Modifier.TRANSIENT :
    System.out.println(" METHOD'S MODIFIER IS = 'TRANSIENT' ");
    break;
    case Modifier.VOLATILE :
    System.out.println(" METHOD'S MODIFIER IS = 'VOLATILE' ");
    break;
    case Modifier.NATIVE :
    System.out.println(" METHOD'S MODIFIER IS = 'NATIVE' ");
    break;
    case Modifier.SYNCHRONIZED :
    System.out.println(" METHOD'S MODIFIER IS = 'SYSCHRONIZED' ");
    break;
    case Modifier.STRICT :
    System.out.println(" METHOD'S MODIFIER IS = 'STRICT' ");
    break;
    default :
    System.out.println(" NO MODIFIER GIVEN ");
    }//end of switch
    System.out.println(" Method Found in a Class Name i.e = " + method[i].getDeclaringClass() );
    for(int i=0;i<field.length ;i++) {
    System.out.println(" Field # " + i + " = " + field[i]);
    System.out.println(" Type of Field is = " + field[i].getType()) ;
    switch(field[i].getModifiers()) {
    case Modifier.PUBLIC :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'PUBLIC' ");
    break;
    case Modifier.PRIVATE :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'PRIVATE' ");
    break;
    case Modifier.ABSTRACT :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'ABSTRACT' ");
    break;
    case Modifier.FINAL :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'FINAL' ");
    break;
    case Modifier.PROTECTED :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'PROTECTED' ");
    break;
    case Modifier.STATIC :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'STATIC' ");
    break;
    case Modifier.TRANSIENT :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'TRANSIENT' ");
    break;
    case Modifier.VOLATILE :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'VOLATILE' ");
    break;
    case Modifier.NATIVE :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'NATIVE' ");
    break;
    case Modifier.SYNCHRONIZED :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'SYSCHRONIZED' ");
    break;
    case Modifier.STRICT :
    System.out.println(" THE MODIFIER FOR THIS FIELD IS = 'STRICT' ");
    break;
    default :
    System.out.println(" NO MODIFIER GIVEN ");
    }//end of switch
    for(int i=0;i<constructor.length ;i++) {
    System.out.println("Constructor # " + i + " = " + constructor[i]);
    switch(constructor[i].getModifiers() ) {
    case Modifier.PUBLIC :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'PUBLIC' ");
    break;
    case Modifier.PRIVATE :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'PRIVATE' ");
    break;
    case Modifier.ABSTRACT :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'ABSTRACT' ");
    break;
    case Modifier.FINAL :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'FINAL' ");
    break;
    case Modifier.PROTECTED :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'PROTECTED' ");
    break;
    case Modifier.STATIC :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'STATIC' ");
    break;
    case Modifier.TRANSIENT :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'TRANSIENT' ");
    break;
    case Modifier.VOLATILE :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'VOLATILE' ");
    break;
    case Modifier.NATIVE :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'NATIVE' ");
    break;
    case Modifier.SYNCHRONIZED :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'SYSCHRONIZED' ");
    break;
    case Modifier.STRICT :
    System.out.println(" CONCTRUCTOR'S MODIFIER IS = 'STRICT' ");
    break;
    default :
    System.out.println(" NO MODIFIER GIVEN ");
    }//end of switch
    //System.out.println(" " + constructor[i].getParameterTypes() );
    }catch(Exception e) {
    System.out.println(e.getMessage() );
    public class MainClass {
    public static void main(String args[]) {
    Provider p=new Provider();
    //Class obj=p.getClass() ;
    //System.out.println(obj.getName() );
    Requester req=new Requester();
    req.requesttoprovide(p) ;

    hi welcome to java forum,
    please do one thing for me so that i can help you, can you put your code in a code tag [code ][code ] (without spaces) so that your code can be readable easily

  • I had difficulties in understanding the above code .

    If i mention like this :
    With respect to QueueRecievier.recieve(1000);
    Will the QueueRecievier would wait 10 secs in interval for recieving each Message ??
    JMS with respect to QueueRecievier.recieve
    Anybody Please help.
    Edited by: kiran7881 on Mar 21, 2009 9:11 AM

    bkyadav wrote:
    at certain point of time in porgram
    (x++) should be treated as x = x+1; but that is not happening.Here's the rule : you have to proceed the expression from left to right.
    For example :
    int x = 8;
    x = x + ++x; // x = 8 + 9 = 17
    int x = 8;
    x = x + x++; // x = 8 + 8 = 16
    int x = 8;
    x = x + --x; // x = 8 + 7 = 15Also, in the for statement of your example :
    for(int i=0;i<3;i++)the value of i+ is first tested before being incremented for the next iteration otherwise the test on value of i+ = 0 would have been skipped.

  • Help needed in understanding the code.

    Hi All,
    I am just trying to understand the Java code in one Self Serice page. However, I am having tough in understanding the CO code. In the prosessRequest class, I have the below code.
    oapagecontext.putTransactionValue("AddAssignmentInsertRowFlag", "N");
    oaapplicationmodule.getTransaction().commit();
    As soon as, oaapplicationmodule.getTransaction().commit();
    gets executed, its calling some other class. Not sure what is being called, but i can see the log messages that its executing some other class which actually does the calls to DB APIs and inserting data into main tables.
    Can you please explain me what is being called to make DB API calls. I would greatly appreciate your help.
    Thanks in Advance!
    - Rani
    ****************************Here is the full code of class for your reference****************************
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    if("SelectedResourceLink".equals(oapagecontext.getParameter("event")))
    Debug.log(oapagecontext, this, "SelectedResourceLink has been pressed", 3);
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SELECTED_RESOURCES_LAYOUT&akRegionApplicationId=275", true, "RP");
    String s = (String)oapagecontext.getTransactionValue("AssignmentType");
    super.processFormRequest(oapagecontext, oawebbean);
    Debug.log(oapagecontext, this, "in processFormRequest()", 3);
    OAApplicationModule oaapplicationmodule = oapagecontext.getRootApplicationModule();
    if(!"Y".equals(oapagecontext.getParameter("paMass")))
    String s1 = oapagecontext.getParameter("event");
    if("lovUpdate".equals(s1))
    Debug.log(oapagecontext, this, "*** User Selected a value from LOV ***", 3);
    String s3 = oapagecontext.getParameter("source");
    Debug.log(oapagecontext, this, "*** lovInputSourceId = " + s3 + " ***", 3);
    if("ProjectNumber".equals(s3) && "Project".equals(s))
    Hashtable hashtable = oapagecontext.getLovResultsFromSession(s3);
    String s10 = (String)hashtable.get("ProjectId");
    Debug.log(oapagecontext, this, "*** ProjectId ***" + s10, 3);
    oapagecontext.putTransactionValue("paProjectId", s10);
    if("Project".equals(s))
    Debug.log(oapagecontext, this, "*** Setting default value for Delivery assignment ***", 3);
    oaapplicationmodule.invokeMethod("defaultProjectAttrs");
    if("RoleName".equals(s3))
    Hashtable hashtable1 = oapagecontext.getLovResultsFromSession(s3);
    Debug.log(oapagecontext, this, "*** RoleName Hashtable Contents ***" + hashtable1.toString(), 3);
    String s11 = (String)hashtable1.get("RoleId");
    Debug.log(oapagecontext, this, "*** RoleId ***" + s11, 3);
    Debug.log(oapagecontext, this, "*** AssignmentType = " + s + "***", 3);
    if("Open".equals(s))
    Debug.log(oapagecontext, this, "*** Calling defaultJobAttrs for Open Assignment***", 3);
    Serializable aserializable[] = {
    s11
    oaapplicationmodule.invokeMethod("defaultJobAttrs", aserializable);
    if("Template".equals(s) || "Open".equals(s))
    Debug.log(oapagecontext, this, "*** Defaulting Competencies ***" + s11, 3);
    OAViewObject oaviewobject = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("RoleCompetenciesVO");
    oaviewobject.setMaxFetchSize(-1);
    oaviewobject.setWhereClauseParam(0, s11);
    oaviewobject.executeQuery();
    Debug.log(oapagecontext, this, "*** End LOV event ***", 3);
    String s4 = "";
    String s8 = "";
    OASubTabLayoutBean oasubtablayoutbean1 = (OASubTabLayoutBean)oawebbean.findIndexedChildRecursive("AddAssignmentSubTabLayout");
    if("Project".equals(s) && !oasubtablayoutbean1.isSubTabClicked(oapagecontext))
    OAViewObject oaviewobject1 = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("AddNewAssignmentVO");
    s4 = (String)oaviewobject1.first().getAttribute("ProjectId");
    s8 = (String)oaviewobject1.first().getAttribute("ProjectNumber");
    Debug.log(oapagecontext, this, "*** lProjectId = " + s4, 3);
    Debug.log(oapagecontext, this, "*** lProjectNumber = " + s8, 3);
    if("Project".equals(s) && !oasubtablayoutbean1.isSubTabClicked(oapagecontext) && !StringUtils.isNullOrEmpty(s8))
    Debug.log(oapagecontext, this, "Delivery Assignment, Project Number is there but no Project Id", 3);
    if(s4 == null || s4.equals(""))
    ViewObject viewobject = oapagecontext.getApplicationModule(oawebbean).findViewObject("ObtainProjectId");
    if(viewobject == null)
    String s14 = "SELECT project_id FROM PA_PROJECTS_ALL WHERE segment1 =:1";
    viewobject = oaapplicationmodule.createViewObjectFromQueryStmt("ObtainProjectId", s14);
    viewobject.setWhereClauseParam(0, s8);
    viewobject.executeQuery();
    int j = viewobject.getRowCount();
    if(j != 1)
    Debug.log(oapagecontext, this, "Error : Project Number is Invalid or not unique", 3);
    OAException oaexception4 = null;
    oaexception4 = new OAException("PA", "PA_PROJECT_NUMBER_INVALID");
    oaexception4.setApplicationModule(oaapplicationmodule);
    throw oaexception4;
    oracle.jbo.Row row = viewobject.last();
    if(row != null)
    Object obj2 = row.getAttribute(0);
    if(obj2 != null)
    s4 = obj2.toString();
    if(s4 != null)
    oapagecontext.putTransactionValue("paProjectId", s4);
    if(oaapplicationmodule.findViewObject("AddNewAssignmentsVO") != null)
    oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().setAttribute("ProjectId", s4);
    } else
    Debug.log(oapagecontext, this, "Error : No rows returned in Project Number query", 3);
    OAException oaexception5 = null;
    oaexception5 = new OAException("PA", "PA_PROJECT_NUMBER_INVALID");
    oaexception5.setApplicationModule(oaapplicationmodule);
    throw oaexception5;
    String s12 = "F";
    if(s4 != null && !s4.equals(""))
    String s13 = Security.checkUserPrivilege("PA_ASN_CR_AND_DL", "PA_PROJECTS", s4, oapagecontext, false);
    if("F".equals(s13))
    OAException oaexception3 = null;
    oaexception3 = new OAException("PA", "PA_ADD_DELIVERY_ASMT_SECURITY");
    oaexception3.setApplicationModule(oaapplicationmodule);
    Debug.log(oapagecontext, this, "ERROR:" + oaexception3.getMessage(), 3);
    throw oaexception3;
    OAViewObject oaviewobject2 = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("AddNewAssignmentVO");
    Object obj = oaviewobject2.first().getAttribute("BillRateOverride");
    Object obj1 = oaviewobject2.first().getAttribute("BillRateCurrOverride");
    Object obj3 = oaviewobject2.first().getAttribute("MarkupPercentOverride");
    Object obj4 = oaviewobject2.first().getAttribute("DiscountPercentOverride");
    Object obj5 = oaviewobject2.first().getAttribute("TpRateOverride");
    Object obj6 = oaviewobject2.first().getAttribute("TpCurrencyOverride");
    Object obj7 = oaviewobject2.first().getAttribute("TpCalcBaseCodeOverride");
    Object obj8 = oaviewobject2.first().getAttribute("TpPercentAppliedOverride");
    Object obj9 = null;
    Object obj10 = null;
    Debug.log(oapagecontext, this, "in AddAssignmentsTopCO processFcstInfoRg(): getting the implementation options", 3);
    Object obj11 = oaviewobject2.first().getAttribute("BrRateDiscReasonCode");
    Object obj12 = oapagecontext.getTransactionValue("rateDiscReasonFlag");
    Object obj13 = oapagecontext.getTransactionValue("brOverrideFlag");
    Object obj14 = oapagecontext.getTransactionValue("brDiscountOverrideFlag");
    String s22 = oapagecontext.getParameter("BillRateRadioGroup");
    if("BRCurrencyRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRCurrencyRadioButton chosen", 3);
    if(obj == null || obj1 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception6 = new OAException("PA", "PA_CURR_BILL_RATE_REQUIRED");
    oaexception6.setApplicationModule(oaapplicationmodule);
    throw oaexception6;
    } else
    if("BRMarkupRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRMarkup%RadioButton chosen", 3);
    if(obj3 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception7 = new OAException("PA", "PA_MARKUP_PERCENT_REQUIRED");
    oaexception7.setApplicationModule(oaapplicationmodule);
    throw oaexception7;
    } else
    if("BRDiscountRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRDiscount%RadioButton chosen", 3);
    if(obj4 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception8 = new OAException(oapagecontext.getMessage("PA", "PA_DISCOUNT_PERCENT_REQUIRED", null));
    oaexception8.setApplicationModule(oaapplicationmodule);
    throw oaexception8;
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) || "Admin".equals(s) || "Template".equals(s))
    Debug.log(oapagecontext, this, "Need not have this check for team templates ", 3);
    } else
    if(obj13 != null && obj13.equals("Y") && obj12 != null && obj12.equals("Y") && "BRCurrencyRadioButton".equals(s22) && StringUtils.isNullOrEmpty((String)obj11))
    Debug.log(oapagecontext, this, "error 1", 3);
    OAException oaexception9 = new OAException("PA", "PA_RATE_DISC_REASON_REQUIRED");
    oaexception9.setApplicationModule(oaapplicationmodule);
    throw oaexception9;
    if(obj14 != null && obj14.equals("Y") && obj12 != null && obj12.equals("Y") && "BRDiscountRadioButton".equals(s22) && StringUtils.isNullOrEmpty((String)obj11))
    Debug.log(oapagecontext, this, "error 2", 3);
    OAException oaexception10 = new OAException("PA", "PA_RATE_DISC_REASON_REQUIRED");
    oaexception10.setApplicationModule(oaapplicationmodule);
    throw oaexception10;
    Debug.log(oapagecontext, this, "*** Selected transfer price radio shr = " + s22, 3);
    oapagecontext.putTransactionValue("BROGroupSelected", s22);
    Debug.log(oapagecontext, this, "*** 1 :Selected bill rate radio = " + s22, 3);
    if(s22 != null)
    oapagecontext.putSessionValue("BROGroupSelected", s22);
    s22 = oapagecontext.getParameter("TransferPriceRadioGroup");
    Debug.log(oapagecontext, this, "*** Selected transfer price radio = " + s22, 3);
    if("TPCurrencyRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "***TPCurrencyRadioButton chosen", 3);
    if(obj5 == null || obj6 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception11 = new OAException("PA", "PA_CURR_RATE_REQUIRED");
    oaexception11.setApplicationModule(oaapplicationmodule);
    throw oaexception11;
    } else
    if("TPBasisRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "***TPBasisRadioButton chosen", 3);
    if(obj7 == null || obj8 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception12 = new OAException("PA", "PA_BASIS_APPLY_PERCENT_REQD");
    oaexception12.setApplicationModule(oaapplicationmodule);
    throw oaexception12;
    oapagecontext.putTransactionValue("TPORadioGroupSelected", s22);
    if(oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("RoleId") != null)
    Debug.log(oapagecontext, this, "*** Role Id is + " + oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("RoleId"), 3);
    if(oapagecontext.getParameter("SearchCompetencies") != null)
    String s2 = "OA.jsp?akRegionCode=PA_COMP_SEARCH_LAYOUT&akRegionApplicationId=275&paCallingPage=AddAssignment";
    oapagecontext.redirectImmediately(s2, true, "RP");
    OASubTabLayoutBean oasubtablayoutbean = (OASubTabLayoutBean)oawebbean.findIndexedChildRecursive("AddAssignmentSubTabLayout");
    if(s.equals("Project") && oasubtablayoutbean.isSubTabClicked(oapagecontext) && !StringUtils.isNullOrEmpty((String)oapagecontext.getTransactionValue("paProjectId")))
    String s5 = "PA_ASN_FCST_INFO_ED";
    String s9 = "F";
    s9 = Security.checkUserPrivilege(s5, "PA_PROJECTS", (String)oapagecontext.getTransactionValue("paProjectId"), oapagecontext, false);
    if(s9.equals("F"))
    Debug.log(oapagecontext, this, "Error : PA_ASN_FCST_INFO_ED previelge not found", 3);
    OAException oaexception2 = null;
    oaexception2 = new OAException("PA", "PA_NO_SEC_FIN_INFO");
    oaexception2.setApplicationModule(oaapplicationmodule);
    throw oaexception2;
    if(oapagecontext.getParameter("GoBtn") != null)
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) && "0".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    OAException oaexception = new OAException("PA", "PA_NO_RESOURCE_SELECTED");
    oaexception.setApplicationModule(oapagecontext.getRootApplicationModule());
    Debug.log(oapagecontext, this, "ERROR:" + oaexception.getMessage(), 3);
    throw oaexception;
    String s6 = "T";
    if(s.equals("Admin") && "Y".equals(oapagecontext.getTransactionValue("paMass")) && "1".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    Debug.log(oapagecontext, this, "resource id[19] is " + (String)oapagecontext.getTransactionValue("paResourceId"), 3);
    if(oapagecontext.getTransactionValue("AdminSecurityChecked") == null)
    String s7 = Security.checkPrivilegeOnResource("-999", (String)oapagecontext.getTransactionValue("paResourceId"), SessionUtils.getResourceName((String)oapagecontext.getTransactionValue("paResourceId"), oapagecontext), "PA_ADM_ASN_CR_AND_DL", null, oapagecontext, false);
    if("F".equals(s7))
    OAException oaexception1 = new OAException("PA", "PA_ADD_ADMIN_ASMT_SECURITY");
    oaexception1.setApplicationModule(oapagecontext.getRootApplicationModule());
    Debug.log(oapagecontext, this, "ERROR:" + oaexception1.getMessage(), 3);
    throw oaexception1;
    if("SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    oapagecontext.putTransactionValue("Save", "N");
    else
    oapagecontext.putTransactionValue("Save", "Y");
    String as[] = oaapplicationmodule.getApplicationModuleNames();
    String as1[] = oaapplicationmodule.getViewObjectNames();
    Debug.log(oapagecontext, this, "no of app module: " + as.length, 3);
    Debug.log(oapagecontext, this, "no of view: " + as1.length, 3);
    for(int i = 0; i < as.length; i++)
    Debug.log(oapagecontext, this, "app module: " + as, 3);
    for(int k = 0; k < as1.length; k++)
    Debug.log(oapagecontext, this, "app module: " + as1[k], 3);
    Debug.log(oapagecontext, this, "*** assignmentType = " + s, 3);
    Debug.log(oapagecontext, this, "*** projectId = " + oapagecontext.getTransactionValue("paProjectId"), 3);
    if("Project".equals(s) && !StringUtils.isNullOrEmpty((String)oapagecontext.getTransactionValue("paProjectId")) && !"Y".equals(oapagecontext.getParameter("paMass")))
    Debug.log(oapagecontext, this, "*** Setting default staffing owner for add delivery assignment -- projectId = " + oapagecontext.getTransactionValue("paProjectId"), 3);
    oaapplicationmodule.invokeMethod("setDefaultStaffingOwner");
    OAViewObject oaviewobject3 = (OAViewObject)oaapplicationmodule.findViewObject("RoleCompetenciesVO");
    oaviewobject3.setMaxFetchSize(0);
    oaviewobject3.setRangeSize(-1);
    oracle.jbo.Row arow[] = oaviewobject3.getAllRowsInRange();
    for(int l = 0; l < arow.length; l++)
    RoleCompetenciesVORowImpl rolecompetenciesvorowimpl = (RoleCompetenciesVORowImpl)oaviewobject3.getRowAtRangeIndex(l);
    Debug.log(oapagecontext, this, "roleCompetenciesVORowImpl" + rolecompetenciesvorowimpl, 3);
    rolecompetenciesvorowimpl.setPlsqlState((byte)0);
    oapagecontext.putTransactionValue("AddAssignmentInsertRowFlag", "N");
    oaapplicationmodule.getTransaction().commit();
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) && !"1".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    if(!"SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Save, Mass, NumSelectedResources>1", 3);
    Debug.log(oapagecontext, this, "work flow has been launched", 3);
    OADialogPage oadialogpage = new OADialogPage((byte)3, new OAException("PA", "PA_MASS_ASSIGNMENT_CONFIRM"), null, "OA.jsp?akRegionCode=PA_RESOURCE_LIST_LAYOUT&akRegionApplicationId=275&addBreadCrumb=N", null);
    oadialogpage.setRetainAMValue(false);
    oapagecontext.redirectToDialogPage(oadialogpage);
    return;
    Debug.log(oapagecontext, this, "SaveAndSubmit, Mass, NumSelectedResources>1", 3);
    putParametersOnSession(oapagecontext);
    int i1 = 0;
    int j1 = 0;
    String s21 = "SelectedResourceId";
    int l1 = Integer.parseInt(oapagecontext.getTransactionValue("paNumSelectedResources").toString());
    Debug.log(oapagecontext, this, "size of resourceArray = " + l1, 3);
    String as2[] = new String[l1];
    for(; !"END".equals(oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1)))); i1++)
    if(oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))) != null)
    Debug.log(oapagecontext, this, "resource id = " + oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))).toString(), 3);
    as2[j1] = oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))).toString();
    j1++;
    SessionUtils.putMultipleParameters("paResourceId", as2, oapagecontext);
    Debug.log(oapagecontext, this, "redirect to Mass Submit for Approval page", 3);
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_MASS_SUBMIT_LAYOUT&akRegionApplicationId=275&paCallingPage=MassAdd&paProjectId=" + oapagecontext.getTransactionValue("p_project_id"), false, "RP");
    return;
    if("RETURN_TO".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Return to Option Selected ", 3);
    String s15 = (String)oapagecontext.getTransactionValue("PrevPageUrl");
    int k1 = s15.indexOf("OA.jsp?");
    s15 = s15.substring(k1);
    Debug.write(oapagecontext, this, "*** RETURN_TO URL: " + s15, 3);
    oapagecontext.redirectImmediately(s15);
    } else
    if("ADD_ANOTHER".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Add Another Option Selected", 3);
    oaapplicationmodule.invokeMethod("resetAddNewAssignment");
    if(oaapplicationmodule.findViewObject("RoleCompetenciesVO") != null)
    oaapplicationmodule.findViewObject("RoleCompetenciesVO").clearCache();
    String s16;
    if(!s.equals("Project") && !s.equals("Admin"))
    s16 = "OA.jsp?akRegionCode=PA_ADD_ASSIGNMENTS_PAGE_LAYOUT&akRegionApplicationId=275&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAssignmentType=" + s + "&OA_SubTabIdx=0";
    else
    s16 = "OA.jsp?akRegionCode=PA_ADD_ASSIGNMENTS_PAGE_LAYOUT&akRegionApplicationId=275&paResourceId=" + oapagecontext.getTransactionValue("paResourceId") + "&paAssignmentType=" + s + "&OA_SubTabIdx=0";
    Debug.log(oapagecontext, this, "nextUrl " + s16, 3);
    if("Template".equals(s))
    oapagecontext.redirectImmediately(s16, true, "S");
    else
    oapagecontext.redirectImmediately(s16, false, "S");
    } else
    if("UPDATE_DETAILS".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Update Details Selected ", 3);
    String s17 = "";
    if("Staffed".equals(s))
    s17 = "ProjStaffedAsmt";
    else
    if("Admin".equals(s))
    s17 = "AdminAsmt";
    else
    if("Project".equals(s))
    s17 = "PersonStaffedAsmt";
    else
    if("Open".equals(s))
    s17 = "OpenAsmt";
    else
    if("Template".equals(s))
    s17 = "TemplateAsmt";
    String s19 = "OA.jsp?akRegionCode=PA_ASMT_LAYOUT&akRegionApplicationId=275&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAssignmentId=" + oapagecontext.getTransactionValue("wfOutAssignmentId") + "&paCalledPage=" + s17 + "&addBreadCrumb=RP";
    Debug.log(oapagecontext, this, "UPDATE_DETAILS: URL: " + s19, 3);
    oapagecontext.redirectImmediately(s19, false, "RP");
    if(s.equals("Staffed") || s.equals("Admin") || s.equals("Project"))
    String s18 = (String)oapagecontext.getTransactionValue("wfOutResourceId");
    String s20 = (String)oapagecontext.getTransactionValue("wfOutAssignmentId");
    Debug.log(oapagecontext, this, "outResourceId " + s18, 3);
    Debug.log(oapagecontext, this, "outAssignmentId " + s20, 3);
    if("SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    if(s.equals("Staffed"))
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SUBMIT_ASMT_APR_LAYOUT&akRegionApplicationId=275&paAsgmtId=" + s20 + "&paResourceId=" + s18 + "&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAsgmtAprStatus=ASGMT_APPRVL_WORKING&paAssignmentType=" + s + "&paCallingPage=AddAssignment", false, "RP");
    return;
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SUBMIT_ASMT_APR_LAYOUT&akRegionApplicationId=275&paAsgmtId=" + s20 + "&paResourceId=" + s18 + "&paAsgmtAprStatus=ASGMT_APPRVL_WORKING&paAssignmentType=" + s + "&paCallingPage=AddAssignment", false, "RP");

    Hi Rani,
    As soon as the transaction is commited the methods in the VORowImpl Class are called.
    You can check in the VORowImpl class and search for the log messages.
    Thanks,
    Gaurav

  • I can not download my adobe reader,the checking code always failed. W7 SYSTEM.

    I can not download my adobe reader,the checking code always failed. MY COMPUTER IN W7 SYSTEM.

    wanghuaqiong wrote:
    I can not download my adobe reader,the checking code always failed. MY COMPUTER IN W7 SYSTEM.
    Sorry, I don't understand the checking code part. Could you please give more details?

  • Regarding required ABAP knowledge to understand the APO-BW developments

    Hi All,
    Could you pls let me know what kind of ABAP skills that an APO consultant must have to understand the development code in the  routines and user exits.
    Best regards,
    Ramya

    Hi Ramya,
    For ABAP consultant to work in APO, mainly you need to learn and
    focus on working with structures. 
    Other areas for focus will be Badi's, user exits, function modules,
    routines, enhancements which are more or less similar to other modules
    Regards
    R. Senthil Mareeswaran.

  • How to understand this strange code?

    Hi,everyone
    When I analysing the petstore source code ,I find it very difficult to understand the following code,who can help me?please send email to [email protected]
    thank you!
    public XMLFilter setup(XMLReader reader) throws PopulateException {
    return new XMLDBHandler(reader, rootTag, XML_INVENTORY) {
    public void update() throws PopulateException {}
    public void create() throws PopulateException {
    createInventory(getValue(XML_ID), getValue(XML_QUANTITY, 0));
    return;
    }

    This function is returning an anonymous class.
    This new class is constructed and defined on the fly in this code.

  • Need to understand the relation between ManualResetEvent and thread

    please help me to understand the below code
    what is resetEvent.Set() and WaitOne() ? what it does ?
    var resetEvent = new ManualResetEvent(false);
    ThreadPool.QueueUserWorkItem(
    arg =>
    DoWork();
    resetEvent.Set();
    resetEvent.WaitOne();
    again help me to understand the below code
    var events = new List<ManualResetEvent>();
    foreach(var job in jobs)
    var resetEvent = new ManualResetEvent(false);
    ThreadPool.QueueUserWorkItem(
    arg =>
    DoWork(job);
    resetEvent.Set();
    events.Add(resetEvent);
    WaitHandle.WaitAll(events.ToArray());
    why this line WaitHandle.WaitAll(events.ToArray()); is required ?
    why adding ManualResetEvent instance to list ?
    looking for discussion. thanks

    WaitOne() will cause the current (main) thread to wait until the thread pool thread has called the Set() method. If you don't call the WaitOne() method, the code line below ThreadPool.QueueUserWorkItem(...) will get executed before the delegate that you
    pass do the ThreadPool.QueueUserWorkItem method has actually finished its execution because the threads are being executed simultaneously:
    var resetEvent = new ManualResetEvent(false);
    ThreadPool.QueueUserWorkItem(
    arg =>
    //this will be executed simultaneously on thread B
    Thread.Sleep(10000);
    //tell thread A to continue
    resetEvent.Set();
    //thread A waits here until thread B calls the Set() method...
    resetEvent.WaitOne();
    string s = "abc"; //this line won't get executed until thread B has called the Set() method provided that the WaitOne() method is called by thread A above.
    >>why this line WaitHandle.WaitAll(events.ToArray()); is required ?
    It causes the main thread to wait until the Set method of all ManualResetEvent objects in the events list has been called. Othwerwise the execution of the main thread would continue immediately after the foreach loop has been executed. By this time the DoWork
    method of all jobs has not yet been completed because they are being executed on another thread.
    WaitHandle.WaitAll(events.ToArray());
    string s = "abc"; //this line won't get executed until all the Set() method of all ManualResetEvent objects in events has been called
    >>why adding ManualResetEvent instance to list ?
    Because you (appearantly) want to wait for all objects in the list, i.e. you want to wait for the DoWork method to complete for all jobs before you continue the execution of the main thread (and go on to assign the string s to the value "abc"
    in the above example).
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • Problem in understanding the code

    this particular code is given as stadard example in sap unicode conversion
    this particular code is replcement for 'translate code page syntax'
    this code describes  how to use particular cl_abap_conv_in_ce classs
    i cannot understand the   'buffer'  field in this code
    can any one tell me what is the meaning of buffer = '41424320' from where did he get this value?
      DATA:
        text(100) TYPE c,
        int TYPE i,
        buffer(4) TYPE x,
        conv TYPE REF TO cl_abap_conv_in_ce.
      conv = cl_abap_conv_in_ce=>create(
              encoding = 'UTF-8'
              endian = 'L' ).
      buffer = '41424320'.
      conv->convert(
        EXPORTING input = buffer
        IMPORTING data = text ).
      buffer = '02010000'.
      conv->convert(
        EXPORTING input = buffer
        IMPORTING data = int ).

    thank you mahmet i also want to check weather  i am doing the  code correct or not
    i have old syntax in my program like    'TRANSLATE header-id FROM CODE PAGE file_tab-codepage'.
    i am replacing the above syntax with the follwing code and can u correct me if  i am wrong
    data:
    buffer1 type xstring,
    conv type ref to cl_abap_conv_in_ce,
    int type i.
    conv = cl_abap_conv_in_ce=>create(
              encoding = 'file_tab-codepage'
              endian = 'L' ).
      buffer1 = '41424320'.
      conv->convert(
        exporting input = buffer1
        importing data = header-id ).

Maybe you are looking for