Modification of program LRRSVF20
Hi Experts,
I am applying doc "How to....Report Data in Alternate Units of Measure" in BW3.5
Can you mention OSS Note to modify program LRRSVF20 for unit conversion?
Useful answer will be rewarded with suitable points.
Thanks in advance!
Sapna
Hi Experts,
I am applying doc "How to....Report Data in Alternate Units of Measure" in BW3.5
Can you mention OSS Note to modify program LRRSVF20 for unit conversion?
Useful answer will be rewarded with suitable points.
Thanks in advance!
Sapna
Similar Messages
-
Hey when modifing std program do we have to save as logon language
hey when modifing std program do we have to save as logon language
or vwe have to keep it as std languageHai,
U have to save it in Logon language. The standard languge will be 'DE'.
Thanks,
Swetha -
Reporting data in alternate unit of measure
hi
I was going through the document " How to report data in alternate unit of meaure" .
There they have talked about modification in program LRRSVF20.
Can anyone tell me what does this include "LRRSVF20" does?
Regards,
MoniikaHi,
Please tell me when i create a program "YBW_AUNIT_ENHANCEMENT" UNDER se38 and type: include...
what code i should write under this program?
i am pasting the program LRRSVF20 AND please tell me what should i write in program ""YBW_AUNIT_ENHANCEMENT"?
***INCLUDE LRRSVF20 .
*& Form varchavl_atr_get
form varchavl_atr_get using i_t_sid type rrsi_t_sid
i_chanm type rsd_iobjnm
i_th_var_atr type rro01_th_var_lrech
i_srdate type sy-datum
i_mostrecent type rsr_mostrecent
changing c_th_varchavl type rrsv_th_varchavl.
call method l_r_reader->sid_read_master
exporting
i_readatr = rsdm_c_readatr-specified
i_t_req_atr = l_t_req_atr
i_date = i_srdate
i_mostrecent = i_mostrecent
importing
e_tx_atr = l_tx_atr
changing
c_t_chavlinfo = l_t_chavlinfo
exceptions
others = 1.
if sy-subrc <> 0.
raise inherited_error.
endif.
*{ INSERT
Enhancement Alternate U.o.M.
INCLUDE ybw_aunit_enhancement.
*} INSERT
PERFORM varchavl_atr_fill USING i_th_var_atr
l_tx_atr
CHANGING c_th_varchavl.
endform. " varchavl_atr_get
***INCLUDE YBW_AUNIT_ENHANCEMENT.
TYPE-POOLS: rrs0.
DATA:
l_vnam LIKE rszglobv-vnam,
l_s_cob_pro TYPE rsd_s_cob_pro,
l_s_rkb1d TYPE rsr_s_rkb1d,
l_periv TYPE rro01_s_rkb1f-periv,
l_t_var_range TYPE rrs0_t_var_range,
l_s_var_range TYPE rrs0_s_var_range,
l_t_range TYPE rsr_t_rangesid,
l_s_range TYPE rsr_s_rangesid,
l_unit LIKE rszglobv-meeht,
l_currency LIKE rszglobv-waers.
FIELD-SYMBOLS:
<l_sx_atr> TYPE rsdm_sx_atr,
<l_s_var> TYPE rro01_s_var_lrech,
<l_s_atr> TYPE rsdm_s_atr,
<l_s_atr_cu> TYPE rsdm_s_atr.
Loop over all characteristic values
LOOP AT l_tx_atr ASSIGNING <l_sx_atr>.
Loop over all variables to be replaced by attributes
LOOP AT i_th_var_atr ASSIGNING <l_s_var>.
Fill additional information into pseudo variables
REFRESH l_t_var_range.
InfoObject (i.e. characteristic)
CLEAR l_s_var_range.
l_s_var_range-sign = 'I'.
l_s_var_range-opt = 'EQ'.
l_s_var_range-vnam = '1CHANM'.
l_s_var_range-iobjnm = i_chanm.
l_s_var_range-low = <l_sx_atr>-chavl.
APPEND l_s_var_range TO l_t_var_range.
Attribute
READ TABLE <l_sx_atr>-t_atr ASSIGNING <l_s_atr>
WITH KEY attrinm = <l_s_var>-attrinm.
IF sy-subrc <> 0.
RAISE x_message.
ENDIF.
CLEAR l_s_var_range.
l_s_var_range-sign = 'I'.
l_s_var_range-opt = 'EQ'.
l_s_var_range-vnam = '1ATTRINM'.
l_s_var_range-iobjnm = <l_s_atr>-attrinm.
l_s_var_range-low = <l_s_atr>-attrivl.
APPEND l_s_var_range TO l_t_var_range.
Unit of measure (only for amounts and quantities)
IF ( <l_s_var>-mwkz = 'M' OR <l_s_var>-mwkz = 'Q' ) AND
( <l_s_var>-fixcudim IS INITIAL ).
CLEAR l_s_var_range.
l_s_var_range-sign = 'I'.
l_s_var_range-opt = 'EQ'.
l_s_var_range-vnam = '1CUNM'.
READ TABLE <l_sx_atr>-t_atr ASSIGNING <l_s_atr_cu>
WITH KEY attrinm = <l_s_var>-cunm.
IF sy-subrc = 0.
l_s_var_range-iobjnm = <l_s_atr_cu>-attrinm.
l_s_var_range-low = <l_s_atr_cu>-attrivl.
APPEND l_s_var_range TO l_t_var_range.
ENDIF.
ENDIF.
Key date of query
CLEAR l_s_var_range.
l_s_var_range-sign = 'I'.
l_s_var_range-opt = 'EQ'.
l_s_var_range-vnam = '1DATE'.
l_s_var_range-iobjnm = '0DATE'.
l_s_var_range-low = i_srdate.
APPEND l_s_var_range TO l_t_var_range.
InfoObject properties
CALL FUNCTION 'RSD_COB_PRO_GET_ALWAYS'
EXPORTING
i_iobjnm = i_chanm
IMPORTING
e_s_cob_pro = l_s_cob_pro
EXCEPTIONS
infocube_not_found = 1
error_reading_infocatalog = 2
iobjnm_not_found = 3
illegal_input = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
l_vnam = <l_s_atr>-attrinm.
Call variable exit to get virtual attribute
CALL FUNCTION 'EXIT_SAPLRRS0_001'
EXPORTING
i_vnam = l_vnam
i_vartyp = rrkg_c_vartyp-formula
i_iobjnm = i_chanm
i_s_cob_pro = l_s_cob_pro
i_s_rkb1d = l_s_rkb1d
i_periv = l_periv
i_t_var_range = l_t_var_range
IMPORTING
e_t_range = l_t_range
e_meeht = l_unit
e_waers = l_currency
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
READ TABLE l_t_range INTO l_s_range INDEX 1.
IF sy-subrc = 0.
Attribute value
<l_s_atr>-attrivl = l_s_range-low.
Attribute unit of measure (only for amounts and quantities)
IF <l_s_var>-mwkz = 'M' AND <l_s_var>-fixcudim IS INITIAL.
<l_s_atr_cu>-attrivl = l_unit.
ELSEIF <l_s_var>-mwkz = 'W' AND <l_s_var>-fixcudim IS INITIAL.
<l_s_atr_cu>-attrivl = l_currency.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP. " variables for attributes
ENDLOOP. " characteristic values
Thanks,
Vijaya. -
How to Alternate unit of measure
https://websmp201.sap-ag.de/~sapdownload/011000358700000488512003E/Howto_alternate_uom5.pdf
we were able to understand all the steps - however not clear as to how to modify the standard program " LRRSVF20" given by SAP.
One of the step in HOW TO says "Implement modification in program LRRSVF20"
How to achieve this step?? i have the developer key and able to write SMOD or CMOD but not able to modify the program -"LRRSVF20"
please give the steps
Lets say i do not modify the standard SAP program and make a copy of it ,will just making a copy of this program work?
can any one give the steps in yhis case as well or if any other easy methods better than the given SAP how to document.
thanksIf you want to change some SAP standard program, you need to ask SAP to give you special account/access (other than development key or sap market place access key) to change the code. That means if there are any further problem arise in the system, SAP is not responsible for this program related problems & they are not going to support it.
So it's better to create one new coping it and try to change in your program. -
Questions about a MasterQuize program
Hi, everyone.
I got a in-class case study program like this in the class:
* This class stores/represents a question that has one of two
* answers: True or False.
* <p></p>
* It needs to track the following information:
* <ul>
* <li>Question text</li>
* <li>Correct answer</li>
* <li>The user's answer to the question</li>
* <li>Points value</li>
* <li>Category</li>
* <li>Difficulty rating</li>
* </ul>
// Our question should allow us to do the following:
// - Create question (constructor) -- may be overloaded
// - Print (display) question
// - Check client's answer for correctness
// - Get points value for question (0 or max)
// - Add "No-BS" grading option
// - Getting client's answer
// - Check to see if answered by client
public class TrueFalseQuestion
// Class constants (to simplify changes to common values)
public static final int MIN_DIFFICULTY_LEVEL = 1;
public static final int MAX_DIFFICULTY_LEVEL = 5;
public static final int DEFAULT_DIFFICULTY_LEVEL = 1;
public static final int DEFAULT_POINT_VALUE = 1;
public static final String DEFAULT_CATEGORY_VALUE = "none";
// Class instance variables
private String questionText;
private String correctAnswer;
private String userAnswer;
private int pointsValue;
private String category;
private int difficultyLevel; // TODO: Set a range for difficulty levels
* @param text The literal wording of this question
* @param answer The correct answer for this question
* @param pts The total points available for this question
* @param ctgry Category keyword for this question
* @param level The perceived/intended difficulty level of this question
* <p></p>
* Defines a TrueFalseQuestion object.
public TrueFalseQuestion (String text, String answer, int pts, String ctgry, int level)
// Set starting values for all instance variables
questionText = text.trim();
correctAnswer = answer.trim();
userAnswer = null; // No user answer supplied yet
if (pts >= 1) // We assume that every problem is worth at least 1 point
pointsValue = pts;
else
pointsValue = DEFAULT_POINT_VALUE;
category = ctgry.trim();
if (level >= MIN_DIFFICULTY_LEVEL && level <= MAX_DIFFICULTY_LEVEL) // within range
difficultyLevel = level;
else
difficultyLevel = DEFAULT_DIFFICULTY_LEVEL;
// Simplified (overloaded) constructors
* @param text The literal wording of this question
* @param answer The correct answer for this question
* @param pts The total points available for this question
* <p></p>
* Defines a TrueFalseQuestion with default values for category and difficulty level.
public TrueFalseQuestion (String text, String answer, int pts)
// Call pre-existing constructor with default category and difficulty
this(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
* @param text The literal wording of this question
* @param answer The correct answer for this question
* <p></p>
* Defines a TrueFalseQuestion with the default point value, default category,
* and default difficulty level.
public TrueFalseQuestion (String text, String answer)
// Call pre-existing constructor with default points, category and difficulty
this(text, answer, DEFAULT_POINT_VALUE, DEFAULT_CATEGORY_VALUE,
DEFAULT_DIFFICULTY_LEVEL);
* @param text The literal wording of this question
* @param answer The correct answer for this question
* @param pts The total points available for this question
* @param ctgry Category keyword for this question
* <p></p>
* Defines a TrueFalseQuestion with the default difficulty level.
public TrueFalseQuestion (String text, String answer, int pts, String ctgry)
// Call pre-existing constructor with default points, category and difficulty
this(text, answer, pts, ctgry,
DEFAULT_DIFFICULTY_LEVEL);
* @param text The literal wording of this question
* @param answer The correct answer for this question
* @param ctgry Category keyword for this question
* <p></p>
* Defines a TrueFalseQuestion with the default point value and the default
* difficulty level.
public TrueFalseQuestion (String text, String answer, String ctgry)
// Use default points and difficulty
this(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
* @param text The literal wording of this question
* @param answer The correct answer for this question
* @param pts The total points available for this question
* @param level The perceived/intended difficulty level of this question
* <p></p>
* Defines a TrueFalseQuestion with the default value for the question category.
public TrueFalseQuestion (String text, String answer, int pts, int level)
// Use default category
this(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
// Clients can invoke this method to retrieve the text of the current question.
// We chose to return the text instead of printing it; this allows the client
// to decide how it should be presented (via a GUI, over a network, etc.)
public String getQuestion ()
return questionText;
// This method allows the client to store the user's answer inside the
// TrueFalseQuestion object for easy comparison
public void submitAnswer (String ans)
userAnswer = ans;
// This method reports whether the submitted answer matches the correct answer
public boolean answerIsCorrect(String userAns) // This version does all the work
if (userAns == null) // No response from user (yet)
return false;
else
// Normalize and compare answers
char key = normalize(correctAnswer); // Get 't' or 'f'
char ans = normalize(userAns); // Get 't' or 'f'
return (key == ans);
public boolean answerIsCorrect ()
return answerIsCorrect(userAnswer); // Call previously-defined version
public int getPointsValue()
return pointsValue;
// Return the points awarded for the user's answer. This method does
// NOT support partial credit; answers are either correct or incorrect.
// If the "No-BS" option is selected, blank (unanswered) questions receive
// 1 point automatically; otherwise, the score will be either 0 or the
// question's normal points value.
public int getPointsEarned(boolean useNoBSRule)
System.out.println("useNoBS: " + useNoBSRule + "\tuserAnswer: " + userAnswer + "\tcorrectAnswer: " + correctAnswer);
if (useNoBSRule && (userAnswer == null))
return 1;
else if (userAnswer == null)
return 0; // Without "No-BS", treat blank problems as incorrect
if (answerIsCorrect() == false)
return 0;
else
return pointsValue;
// This method returns true if the user has submitted an answer
// for this question (regardless of whether that answer is correct)
public boolean hasBeenAnswered ()
return (userAnswer != null);
// Private helper method to convert all answers to single lowercase
// letters (in this case, 't' for TRUE and 'f' for FALSE)
private char normalize (String input)
if (input != null)
input = input.trim(); // Remove leading whitespace
input = input.toLowerCase();
return input.charAt(0);
else
return ' ';
import java.util.*;
* This class represents a complete test or quiz.
* Data stored:
* - List of questions
* - Total score earned
* - Total score possible
* - Name/title of test
* - Instructions
* - Category/class assignment
* - Student (test-taker) name
* - Date test is/was taken
* - Time started
* - Time completed
* - Maximum time allotted
* - (List of) Maximum attempts per question
* - List of attempts per question
* - List of difficulty ratings per question
* - Assignment weight
* Methods:
* - Constructor
* - Add question
* - Display question
* - Display test
* - Display instructions
* - Generate random exam
* - Take/administer test
* - Get score
* STUFF TO DO:
* - Add time/date restrictions
* - Add network access restrictions
* - Add other restrictions/allowances?
* @author (your name)
* @version (a version number or a date)
public class Test
// Class constant
public static final int MAX_NUMBER_OF_QUESTIONS = 10;
// Class instance variables
private String testName;
private int scoreEarned; // What the student earned on the exam
private int scorePossible; // Total point values of all questions
private String instructions; // Exam header text
private ArrayList<TrueFalseQuestion> questions; // Create inside constructor
// Methods
public Test (String name, String instr)
testName = name;
scoreEarned = 0;
scorePossible = 0;
instructions = instr;
questions = new ArrayList<TrueFalseQuestion>(); //[MAX_NUMBER_OF_QUESTIONS];
public String getInstructions()
return instructions;
public int getScore()
return scoreEarned;
public void addQuestion (TrueFalseQuestion q)
scorePossible += q.getPointsValue();
questions.add(q); // Automatically append question to end of test
public String displayQuestion (int position)
if (position < questions.size())
return (position+1) + ". " + questions.get(position).getQuestion();
else
return null;
public String displayTest ()
String result = "";
for (int i = 0; i < questions.size(); i++)
result += (i+1) + ". (";
TrueFalseQuestion t = questions.get(i);
result += t.getPointsValue();
result += " points)\n\n" + displayQuestion(i);
result += "\n\n";
return result;
// Get test length (number of questions)
public int length ()
return questions.size();
// Submit answer to a specific question
public boolean answer(int number, String a)
// Question numbers run from 0-(max-1) -- THIS WAS AN OFF-BY-ONE ERROR AT FIRST
if (number >= 0 && number < questions.size())
TrueFalseQuestion t = questions.get(number);
t.submitAnswer(a);
return true; // Question was answered
else
return false; // Unable to answer (nonexistent) question
// Score exam
public void scoreExam (boolean useNoBS)
scoreEarned = 0;
for (int i = 0; i < questions.size(); i++) // For each question in exam
TrueFalseQuestion t = questions.get(i); // get current question
scoreEarned += t.getPointsEarned(useNoBS);
}// Test harness for the Test and *Question classes
import java.util.*;
public class QuizDriver
public static void main(String[] args)
// Create a new Test object
Test exam = new Test("Sample Exam", "Select the correct answer for each question");
setUp(exam);
Scanner sc = new Scanner(System.in);
System.out.println(exam.getInstructions());
// Administer exam
for (int i = 0; i < exam.length(); i++)
// Print out current question
System.out.println(exam.displayQuestion(i));
// Get user answer
System.out.print("Your answer: ");
String ans = sc.nextLine();
if (ans.equals("")) // Handle blank responses for unanswered questions
ans = null;
exam.answer(i, ans);
// Get exam results
exam.scoreExam(true);
System.out.println("Your final score was " + exam.getScore() + " points.");
private static void setUp (Test t)
TrueFalseQuestion x = new TrueFalseQuestion("The sky is blue.", "true", 2);
t.addQuestion(x);
x = new TrueFalseQuestion("The first FORTRAN compiler debuted in 1957", "true", 5);
t.addQuestion(x);
x = new TrueFalseQuestion("Spock was a Vulcan", "false", 3);
t.addQuestion(x);
}This program is far from finishing.
I have many questions about this program, but let me ask this one first:
In the TrueFalseQeustion class, why are there so many constructors? What is the purpose of setting some of the variables to default values?
Thank you very much!!!
Edited by: Terry001 on Apr 16, 2008 10:02 AMnewark wrote:
Stop ignoring the error messages. You seem to think that an error message means you're doing the assignment wrong. It's probably a simple fix. Post the exact error messages, as well as the code that corresponds to them. The error message will tell you exactly what line the problem occurs on, so you know right where to look.Hi,
After some modifications, the program now gives me the result the assignment wants when I run it. But I still have trouble with the MultipleChoiceQuestion class
Here is the complete program
QuizDriver class
// Test harness for the Test and *Question classes
import java.util.*;
public class QuizDriver
public static void main(String[] args)
// Create a new Test object
Test exam = new Test("Sample Exam", "Select the correct answer for each question");
setUp(exam);
Scanner sc = new Scanner(System.in);
System.out.println(exam.getInstructions());
// Administer exam
for (int i = 0; i < exam.length(); i++)
// Print out current question
System.out.println(exam.displayQuestion(i));
// Get user answer
System.out.print("Your answer: ");
String ans = sc.nextLine();
if (ans.equals("")) // Handle blank responses for unanswered questions
ans = null;
exam.answer(i, ans);
// Get exam results
exam.scoreExam(true);
System.out.println("Your final score was " + exam.getScore() + " points.");
private static void setUp (Test t)
Question x;
x = new TrueFalseQuestion("The sky is blue.", "true", 2);
t.addQuestion(x);
x = new TrueFalseQuestion("The first FORTRAN compiler debuted in 1957", "true", 5);
t.addQuestion(x);
x = new TrueFalseQuestion("Spock was a Vulcan", "false", 3);
t.addQuestion(x);
x = new MultipleChoiceQuestion("What is the color of the car\na.Red\nb.Green", "a. Red", 3);
t.addQuestion(x);
x = new MultipleChoiceQuestion("What is the name of this class\na.CSE110\nb.CSE114", "b, CSE114", 3);
t.addQuestion(x);
}Test
public class Test
// Class constant
public static final int MAX_NUMBER_OF_QUESTIONS = 10;
// Class instance variables
private String testName;
private int scoreEarned; // What the student earned on the exam
private int scorePossible; // Total point values of all questions
private String instructions; // Exam header text
private ArrayList<Question> questions; // Create inside constructor
// Methods
public Test (String name, String instr)
testName = name;
scoreEarned = 0;
scorePossible = 0;
instructions = instr;
questions = new ArrayList<Question>(); //[MAX_NUMBER_OF_QUESTIONS];
public String getInstructions()
return instructions;
public int getScore()
return scoreEarned;
public void addQuestion (Question q)
scorePossible += q.getPointsValue();
questions.add(q); // Automatically append question to end of test
public String displayQuestion (int position)
if (position < questions.size())
return (position+1) + ". " + questions.get(position).getQuestion();
else
return null;
public String displayTest ()
String result = "";
for (int i = 0; i < questions.size(); i++)
result += (i+1) + ". (";
Question t = questions.get(i);
result += t.getPointsValue();
result += " points)\n\n" + displayQuestion(i);
result += "\n\n";
return result;
// Get test length (number of questions)
public int length ()
return questions.size();
// Submit answer to a specific question
public boolean answer(int number, String a)
// Question numbers run from 0-(max-1) -- THIS WAS AN OFF-BY-ONE ERROR AT FIRST
if (number >= 0 && number < questions.size())
Question t = questions.get(number);
t.submitAnswer(a);
return true; // Question was answered
else
return false; // Unable to answer (nonexistent) question
// Score exam
public void scoreExam (boolean useNoBS)
scoreEarned = 0;
for (int i = 0; i < questions.size(); i++) // For each question in exam
Question t = questions.get(i); // get current question
scoreEarned += t.getPointsEarned(useNoBS);
}Question
public class Question
// Class constants
public static final int MIN_DIFFICULTY_LEVEL = 1;
public static final int MAX_DIFFICULTY_LEVEL = 5;
public static final int DEFAULT_DIFFICULTY_LEVEL = 1;
public static final int DEFAULT_POINT_VALUE = 1;
public static final String DEFAULT_CATEGORY_VALUE = "none";
// Class instance variables
protected String questionText;
protected String correctAnswer;
protected String userAnswer;
protected int pointsValue;
protected String category;
protected int difficultyLevel; //TODO: set a range for difficulty levels
// Constructors
public Question (String text, String answer, int pts, String ctgry, int level)
questionText = text.trim();
correctAnswer = answer.trim();
userAnswer = null;
if (pts >= 1)
pointsValue = pts;
else
pointsValue = DEFAULT_POINT_VALUE;
category = ctgry.trim();
if (level >= MIN_DIFFICULTY_LEVEL && level <= MAX_DIFFICULTY_LEVEL)
difficultyLevel = level;
else
difficultyLevel = DEFAULT_DIFFICULTY_LEVEL;
// Overloaded (simplied) constructors
public Question (String text, String answer, int pts)
this(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
public Question (String text, String answer, int pts, String ctgry)
this(text, answer, pts, ctgry, DEFAULT_DIFFICULTY_LEVEL);
public Question (String text, String answer, String ctgry)
this(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
public Question (String text, String answer, int pts, int level)
this(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
// Methods
public String getQuestion ()
return questionText;
// Use this method to store user answers
public void submitAnswer (String ans)
userAnswer = ans;
public boolean answerIsCorrect (String userAns)
if (userAns == null)
return false;
else
// Normalize and compare answers
char key = normalize (correctAnswer); //Get the first letter of an answer
char ans = normalize (userAns); //Get the first letter of an answer
return (key == ans);
public boolean answerIsCorrect ()// Why do we need two answerisCorrect() methods?
return answerIsCorrect (userAnswer);
public int getPointsValue ()
return pointsValue;
public int getPointsEarned (boolean userNoBSRule)
System.out.println ("useNoBS: " + userNoBSRule + "\tuseAnswer: " + userAnswer + "\tcorrectAnswer: " + correctAnswer);
if (userNoBSRule && (userAnswer == null))
return 1;
else if (userAnswer == null)
return 0;
if (answerIsCorrect() == false)
return 0;
else
return pointsValue;
public String getCorrectAnswer ()
return correctAnswer;
public boolean hasBeenAnswered ()
return (userAnswer != null);
private char normalize (String input)
if (input != null)
input = input.trim();
input = input.toLowerCase();
return input.charAt(0);
else
return ' ';
TrueFalseQuestion
public class TrueFalseQuestion extends Question
public TrueFalseQuestion (String text, String answer, int pts, String ctgry, int level)
super(text, answer, pts, ctgry, level);
public TrueFalseQuestion (String text, String answer, int pts)
super(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
public TrueFalseQuestion (String text, String answer, int pts, String ctgry)
super(text, answer, pts, ctgry, DEFAULT_DIFFICULTY_LEVEL);
public TrueFalseQuestion (String text, String answer, String ctgry)
super(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
public TrueFalseQuestion (String text, String answer, int pts, int level)
super(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
// Methods
public String[] getPossibleAnswerChoice ()
String[] possibleAnswerChoice = {"true", "false"};
return possibleAnswerChoice;
} MultipleChoiceQuestion
public class MultipleChoiceQuestion extends Question
public MultipleChoiceQuestion (String text, String answer, int pts, String ctgry, int level)
super(text, answer, pts, ctgry, level);
public MultipleChoiceQuestion (String text, String answer, int pts)
super(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
public MultipleChoiceQuestion (String text, String answer, int pts, String ctgry)
super(text, answer, pts, ctgry, DEFAULT_DIFFICULTY_LEVEL);
public MultipleChoiceQuestion (String text, String answer, String ctgry)
super(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
public MultipleChoiceQuestion (String text, String answer, int pts, int level)
super(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
// Methods
String possibleAnswers;
public String getPossibleAnswers ()
return possibleAnswers;
public void addAnswerChoice (String answerChoice)
String ansChoice = answerChoice;
questionText += "\nansChoice";
possibleAnswers = answerChoice;
public void printAnswerChoice ()
System.out.println (questionText);
} I don't understand why the assignment wants me to build a method in the MultpleChoiceQuestion class to store the potential answer choices, I can make the program display the potential answer choices by including them in the questionText as following in the QuizDriver class
Question x;
x = new MultipleChoiceQuestion("What is the color of the car\na.Red\nb.Green", "a. Red", 3);
t.addQuestion(x); I don't know how to allow the client to construct the list of answer choices one at a time(add one potential answer choice by calling the addAsnwerChoices() method once)
Here are a few original sentences of my assignment which describe what I should do with the MultipleChoiceQuestion class
Using TrueFalseQuestion as a model, develop a new MultipleChoiceQuestion class that can be used to represent a problem where the user must select one of several answer choices (e.g., "Select answer (a), (b), (c), or (d)."). This new question type should have all of the same externally-visible functionality as TrueFalseQuestion, except that it must:
maintain a list of potential answer choices
provide a method that allows the client to construct the list of answer choices one at a time (i.e., the client should be able to call an addAnswerChoice() method to pass a new answer option to the MultipleChoiceQuestion.)
display (as part of the question text) the list of answer choices with appropriate letters ("abcd" instead of "0123") I don't understand what these sentences mean.
1. "Maintain a list of potential answer choices"-- this reminds me of the getPossibleAnswerChoice() method in the TrueFalseQuestion class
public String[] getPossibleAnswerChoice ()
String[] possibleAnswerChoice = {"true", "false"};
return possibleAnswerChoice;
}I wonder that if the potential answer choices I have to store in the MultipleChoiceQuestion class are only letters "a", "b", "c", "d", etc, or include the answer text coming after the letters(eg. a.Red, b.Green)
2. "provide a method that allows the client to construct the list of answer choices one at a time". How do I achieve the functionality "one at a time"? Do I need to pass the input of the client (a potential answer choice) to the variable of the method which stores the list of potential answers?
3. "display (as part of the question text) the list of answer choices with appropriate letters". My question here is that: When the client type in one possible answer, should I append it to the variable questionText? (So I use the questionText variable in the methods of the first and second steps)
Thank you very much for your nice help!
Edited by: Terry001 on Apr 21, 2008 8:01 AM -
BW Experts,
At my client I have changed a Std SAP program LRRSVF20. This was transported up all the way to production. Now that we did a Support pack upgrade in dev, This configuration is lost in development. What is the best approach to get it back. Reconfigure it which will give me a new transport request and retransport all the way till production. Or is there a better way.Hi,
You need to redo the changes and then transport it again.
Anyways as a Best Practice, don't change Std SAP programs. You can copy them to a Z or Y pgm and then modify them. Usually if you need to change them ask SAP for a correction and then insert/delete that in the program either by applying the note or using SNOTE.
Cheers,
Kedar -
Spau without modification assistant
Hye all,
Im into upgradation project, In spau tcode > without modification assistant> programs, when im going for version management its displaying some 10 modified versions of tht program, now my Q is that from tht versions which i have to keep in my new version?
Full points will be rewarded.
Thanks,
Vibhahi,
you have to compare with the version which is existed currently in Production(old version) and the latest one.
sudheer.A -
Modification comparison in SE95
Hi,
We are in the process of patch upgrading. After the Upgrade we have applied lot of notes. While applying some manual changes IT ask us to carry out modification comparison first, and it not allowing us to do modification.
It advise to do modification comparison thru T-Code SE95, pl. help me how to proceed further
Thanks
RengarajHi,
The Modification Browser
An overview of all modifications and enhancements found in your system can be displayed from the ABAP Workbench choosing the function Overview ® Modification Browser (SE95). You can also display an overview from the Repository Browser using Environment ® Modification Browser.
The following selection screen appears, where you can input selections that limit what the Modification Browser outputs:
Standard selections can be made on the upper half of the selection screen by entering the person who last changed the object, the number of a transport request or the package. If you enter the number of a transport request into the field Last transport request, the system displays only those objects of the request which were not modified in requests created at a later date. If you insert the request number in the field Request/Task, the system displays all modified objects of the object list.
You can use the Note Assistant to import notes into your system and apply the correction instructions contained therein. In the Modification Browser, you can expand a subtree below each note which contains the objects involved in the note correction.
Standard objects that are supported by the Modification Assistant during modification or upgrade can be displayed using the With Modification Assistant checkbox. All other objects are listed under the Without Modification Assistant category. This category also contains all objects that were modified in the current SAP System before the Modification Assistant was introduced.
Business Add-Ins provide you with an overview of all enhancements and modifications undertaken in your system. Further information on this way to create enhancements can be found in the section on Business Add-Ins.
Appends can be append structures, append views or append search helps.
As on the Display Options tab, you can restrict the display of objects modified or reset using specific criteria on the Reset Objects tab.
Once you have made your selections, the system takes you to the Modification Browser overview.
The Color key pushbutton displays a list of what certain highlighting colors mean within the Modification Browser.
Modifications to programs that cannot be assigned to a modularization unit (for example additional fields or comment lines preceding a subroutine) are displayed in the node External modularization units.
You can branch directly to ABAP Workbench tools from the Modification Browser display by placing your cursor on a specific object and choosing Display or Change.
Changes cannot be made to objects currently being adjusted.
You can also undo modifications from the Modification Browser by placing your cursor on a specific object and choosing Reset to original. Further information can be found in the section Resetting to the Original.
The Reset to original function can also be used with objects that were modified without the help of the Modification Assistant. Using this function causes the object to be deleted from the modification overview. If no original is available for the object, it is now treated as an SAP original (modifications may, however, be lost during upgrade).
If new complete objects (programs, function groups, and so on) are created, the corresponding transport object is added to the transport request. If function modules are deleted or view maintenance modules are generated, the associated function group is added to the transport request. In these cases, the Created/Generated node in the Modification Browser is displayed below the associated complete object.
Objects that have yet to be adjusted also show up in the Modification Browser and are highlighted in color. The objects displayed are compared during an upgrade or when a support package is imported in transaction SPAU by choosing Utilities ® Maintenance ® Upgrade utilities ® Program compare. Read the following sections for more information.
SPDD and SPAU are the transaction that are used after the upgrade for modification. SPDD is for adjusting the DDIC changes and SPAU is for all other repository objects like programs etc.
*Reward points
Regards -
Editing program ZPROGRAM problem
Hello folks,
This is my problem:
I initially started making modification to program ZPROGRAM. However, I reset my machine by mistake and now when I try to put the program in EDIT mode I doesn't allow me because it says: "User ME is currently editing ZPROGRAM."
Any ideas on how to fix this? or how to kill the other log on. I tried resetting my pc several times but no luck.
Please advise.
Ol Pom.Hi,
While relogin system will ask for popup with 3 radiobuttons
1). When ending any existing logons to system, unsaved data
2). If you continue with this logon without ending any exis
system, this will be logged in the system. SAP reserves
view this information.
3). Terminate this Login.
Choose the 1 radio button and press enter
aRs -
Customer open items by franchise wise
Dear Experts,
Is there any SAP standard report is available to see the customer open items (invoice) by sales organization/division and franchise wise.
Thanks
babuDear:
You will need certain modification in program RFDOPR10 to develop a Z report with help of ABAPER. Add the required fields in your selection criteria and you can fetch data from
1. Sales Group - VBAK-VKGRP
2. Division - VBAK-SPART
Check and revert back. At present i don thing that there is a standard report that could meet your need.
Regards -
Excise invoice creation incase of price increase
Dear all,
I am facing a problem in case supplementary billing scenario at my client's place.
Some times price of the material increases and that price will be effected from past date.Then a supplementary excise is created with values consisting of
Differential value + 16% excise on differential price + 2 % Ecess + 1%Hecess + sales tax against all the effected invoices previously created.
" Differential value = (New Price - Old Price)*(total invoiced quantity of the material from effected date to till now ) "
How can i create excise invoice in sap for this case, where there would be no goods movement..
With the help of my abaper i can create debitmemo with this pricing structure with some modifications in program for VFRB - Retro-Billing by individual invoice wise.
But my client is asking for excise invoice creation for this scenario but not debit memo.
Pls guide me the way to do this scenario.
Thanks in advance
Kartheek NHi,
We also have same scenario and we done work around for this solution.
Suppose i have
Base Price 1000
ED 160
ECESS 32
SECC 16
Based on the above we made Billing document VF01 and Excise Invoice through J1IIN. After sending the material there is price change and you require to raise suplementary invoice for the same, in that wat you required to do is
1. Create Sales Order with referene to main billing document
2. Create Billing document with refernce to sales order and note that the Billing category is M becasue as per standard SAP billing category M and U are only relevent for Exicse Invoice cration.
Through the above you can rraise the invoice.
If it helps provide rewards
Rgds
Gautam -
Using the FM SO_NEW_DOCUMENT_ATT_SEND_API1
Hi Gurus,
I am using the FM SO_NEW_DOCUMENT_ATT_SEND_API1.
My requirement needs me to email an attachment.
Why is it that when I input
A
B
C
in my table, the value I am getting is
A B C
wherein I should get an attachment that should look like this one
A
B
C
My output file is a TXT file. I understand that this is using the CONTENT_BIN that uses the binary format.
What I need is an attachment that is using the ASCII format. But when I use the ASCII format, I am getting an error: "error occurred during sending !".
Do I need to make enhacements on the FM?
Thanks in advance.
BenedictHi Benedict,
Please refer to the below code.
Program: ZRAT Creation Date: 12.04.2007 *
Program Title : Retirement Age Trigger *
Program Author: Puneet Jhari *
Program Type : Executable *
Object ID : *
Technical Specification Version: *
Technical Specification Author: *
Code Quality Reviewer : *
Transport No. : SRDK906499 *
Program Description: *
Inputs *
Tables: *
Parameters *
External files: *
Outputs *
Reports: *
Tables: *
Databases: *
Screens: *
Parameters *
External files: *
Other objects: *
Return codes set by ABAP: *
Modification Informaion *
Program Version: *
Date : DD-MMM-YYYY *
Author : *
Description : *
Transport No.: *
REPORT zrat NO STANDARD PAGE HEADING.
*DATA DECLARATION
DATA : BEGIN OF wa_ccode,
bukrs TYPE t001-bukrs,
END OF wa_ccode.
DATA : itab_ccode LIKE TABLE OF wa_ccode.
DATA : BEGIN OF wa_emp,
pernr TYPE pa0001-pernr,
sachp TYPE pa0001-sachp,
sname TYPE pa0001-sname,
END OF wa_emp.
DATA : itab_emp LIKE TABLE OF wa_emp.
DATA : BEGIN OF wa_bdate,
nachn LIKE pa0002-nachn,
vorna LIKE pa0002-vorna,
pernr TYPE pa0002-pernr,
gbdat TYPE pa0002-gbdat,
END OF wa_bdate.
DATA : itab_bdate LIKE TABLE OF wa_bdate.
DATA : new_date LIKE sy-datum.
DATA : diff TYPE i.
DATA : years LIKE p0347-scryy,
months LIKE p0347-scrmm,
days LIKE p0347-scrdd.
DATA : sup_code LIKE pa0001-sachp,
itab_usrid LIKE t526-usrid,
sup_pernr LIKE pa0105-pernr.
DATA : BEGIN OF wa_email,
usrid_long LIKE pa0105-usrid_long,
END OF wa_email.
DATA : sup_email LIKE TABLE OF wa_email.
DATA : gwa_document_data LIKE sodocchgi1,
gc_name TYPE so_obj_nam VALUE 'RETIREMENT',
gc_senst TYPE so_obj_sns VALUE 'P',
gc_size TYPE so_doc_siz VALUE '510',
gi_obj_cnt LIKE TABLE OF solisti1 WITH HEADER LINE,
gi_recievers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
gwa_obj_cnt LIKE LINE OF gi_obj_cnt.
DATA : smtp_addr LIKE adr6-smtp_addr.
DATA : wa_date LIKE sy-datum,
entries LIKE sy-tabix,
name(15),
line1(18) TYPE c,
line2(20) TYPE c,
line3(20) TYPE c,
line4(23) TYPE c,
line5(10) TYPE c,
line6(45) type c,
date(2) TYPE c,
month(2) TYPE c,
year(4) TYPE c.
*START OF SELECTION
SELECT bukrs
FROM t001
INTO TABLE itab_ccode
WHERE land1 EQ 'GB'.
SORT itab_ccode.
DELETE ADJACENT DUPLICATES FROM itab_ccode.
SELECT pernr sachp sname
FROM pa0001
INTO TABLE itab_emp
FOR ALL ENTRIES IN itab_ccode
WHERE bukrs EQ itab_ccode-bukrs AND begda LE sy-datum AND
endda GE sy-datum and persg eq '1'.
SELECT nachn vorna pernr gbdat
FROM pa0002
INTO TABLE itab_bdate
FOR ALL ENTRIES IN itab_emp
WHERE pernr EQ itab_emp-pernr.
*TO CHECK EMPLOYEES WHOSE AGE IS NEAR 75 YEARS.
LOOP AT itab_bdate INTO wa_bdate.
new_date = wa_bdate-gbdat.
*TO CALCULATE THE AGE TILL DATE
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = sy-datum
date2 = new_date
output_format = '05'
IMPORTING
years = years
months = months
days = days
IF sy-subrc <> 0.
ENDIF.
IF years EQ 64 AND months EQ 4.
IF days GE 23 AND days LE 31.
*FETCH THE DATA IF THE AGE IS NEARING 75 YEARS
SELECT SINGLE sachp FROM pa0001 INTO sup_code WHERE pernr EQ
wa_bdate-pernr AND begda LE sy-datum AND endda GE sy-datum.
SELECT SINGLE usrid FROM t526 INTO itab_usrid WHERE sachx EQ
sup_code.
SELECT SINGLE pernr FROM pa0105 INTO sup_pernr WHERE usrid EQ
itab_usrid AND subty EQ '0001'.
clear sup_email[].
SELECT usrid_long FROM pa0105 INTO TABLE sup_email WHERE pernr EQ
sup_pernr AND subty EQ '0010'.
*EMAIL ADDRESS OF THE SUPERVISOR TO BE NOTIFIED
CLEAR gi_obj_cnt.
CLEAR gi_recievers.
CLEAR gwa_document_data.
Loop at sup_email into wa_email.
write sy-uline+0(5).
write sy-uline+10(5).
write sy-uline+20(5).
write sy-uline+30(5).
write sy-uline+40(5).
write sy-uline+50(5).
write sy-uline+60(5).
write sy-uline+70(5).
smtp_addr = wa_email-usrid_long.
gi_recievers-receiver = smtp_addr.
gi_recievers-rec_type = 'U'.
gi_recievers-com_type = 'INT'.
APPEND gi_recievers.
Endloop.
smtp_addr = '[email protected]'.
gi_recievers-receiver = smtp_addr.
gi_recievers-rec_type = 'U'.
gi_recievers-com_type = 'INT'.
APPEND gi_recievers.
gwa_document_data-obj_name = gc_name.
gwa_document_data-obj_descr = 'RETIRE'.
gwa_document_data-sensitivty = gc_senst.
gwa_document_data-obj_langu = sy-langu.
*CONTENT OF THE EMAIL TO BE SENT
line1 = 'Please note that '.
line2 = wa_bdate-vorna.
line3 = wa_bdate-nachn.
line4 = ' will be 65 years on '.
line50(4) = wa_bdate-gbdat4(4).
date = line5+2(2).
month = line5+0(2).
year = wa_bdate-gbdat+0(4) + 65.
CONCATENATE date month year INTO line5 SEPARATED BY '.'.
line6 = '.Please complete the Retirement Procedure.'.
CONCATENATE line1 line2 line3 line4 line5 line6 INTO gwa_obj_cnt
SEPARATED BY space.
APPEND gwa_obj_cnt TO gi_obj_cnt.
CLEAR gwa_obj_cnt.
DESCRIBE TABLE gi_obj_cnt LINES entries.
READ TABLE gi_obj_cnt INDEX entries.
gwa_document_data-doc_size = ( entries - 1 ) * 255 + STRLEN( gi_obj_cnt
*FUNCTION MODULE TO SEND THE EMAIL TO THE CONCERNED PERSONS
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = gwa_document_data
document_type = 'RAW'
commit_work = 'X'
TABLES
object_content = gi_obj_cnt
receivers = gi_recievers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
*MESSAGE TO BE DISPLAYED AFTER THE EXECUTION
endif.
CASE sy-subrc.
WHEN 0.
LOOP AT gi_recievers.
IF gi_recievers-receiver = space.
name = gi_recievers-rec_id.
ELSE.
name = gi_recievers-receiver.
ENDIF.
IF gi_recievers-retrn_code = 0.
WRITE: / name, ': succesfully sent'.
ELSE.
WRITE: / name, ': error occured'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'Too many receivers specified !'.
WHEN 2.
WRITE: / 'No receiver got the document !'.
WHEN 4.
WRITE: / 'Missing send authority !'.
WHEN OTHERS.
WRITE: / 'Unexpected error occurred !'.
ENDCASE.
ENDIF.
ENDIF.
ENDLOOP.
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari. -
BEX 7.0: Formula variable with replacement path not working after BW Upg
Hi all,
We have a formula variable using replacement path for 0MATERIAL characteristic that is used in a calculated key figure, in order to perform conversion factor to change measure units (0MATERIAL attribute).
This was working pretty well until an upgrade from 3.5 to 7.0 EHP 1. The list that is displayed contains all key figures empty instead of the desired values.
Can anyone suggest what could be the possible reason for this?
Thanks in advance.
CCSHi all,
Problem solved!
The solution was based on the u201Chow to...Report Data in alternate units of measureu201D document (for 3x version) . http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b7b2aa90-0201-0010-a480-a755eeb82b6f?quicklink=index&overridelayout=true
Basically, the upgrade has override the previous changes made in the program LRRSVF20, like the "How to" document refers. Namely, the reference to YBW_AUNIT_ENHANCEMENT program.
We have carried out the changes and, apparently, the query is now working fine.
Thanks.
Best Regards,
Cátia Coelho Silva -
Error during archive MM_EKKO - Invoice qty GR quanity
Hi All
System is 4.6C
During archiving of Purchase Orders (Object MM_EKKO), the spool of program RM06EW30 shows following error message
For a PO/item nr: "Quantity invoiced differs from GR quantity"
I understand that it is a standard check before archiving POs . But the issue is that we do not do MIRO (Invoicing) in this system, instead it is done externally in another system. So though there are no invoices anyway in the system.
My questions are:
What does the system check (Document/Table/Fields) before giving the above error message?
Can we remove the check by customizing or is a modification of program required?
Regards
Rajeshsee report FM06AFE0
find
- WE = X, RE = X : geliefert = berechnet ----------------------------*
below this statement you can see the checks that are performed -
Print Preview Purchase Order with release strategy
Hi gurus,
With release stratregy you can not print a PO before release through ME9F. The system will give error message 'No corrosponding document found'. However, you can print PO through 'Print Preview' by clicking on Print icon in ME22N, we need that "Print Preview"doesn't print PO without release. System it shouldn't print.
Thank you!Hi,
Hope you are using Z output type & print program for PO printing. You can restrict this by modification in program. Please do it with help of abaper.
Regards,
Sandeep
Maybe you are looking for
-
this version on my Macbook works, the problem is on my imac which is a similar setup. I open the app and initially looks normal but it reverts to a menu bar showing only FIREFOX, and becomes unresponsive. However if that window is minimized the menu
-
How to run java signed applet in vista with changing IE security options
how to run java signed applet in vista with changing IE security options. If i change the IE security settings to low. it works. without changing the security setting, how to run.
-
Album artwork not showing up (yes there is some in itunes)
Ok i'm having trouble with my iPod and album artwork. I googled the problem and some guy was having the same thing happen to him. The idiots replying though didnt understand and started telling him how to put artwork on it. I know how to do that, its
-
ABAP Netweaver 7.0 Trial wont connect to SAP Logon
I just installed the ABAP Netweaver trial and for some reason am getting the following error when I try to connect from the login gui: partner '127.0.0.1:sapdp00' not reached WSAECONNREFUSED: Connection refused I get the following error when I click
-
Firefox 4 doesn't open start page when started.
Firefox 4 doesn't open start page when started. It opens the tabs that were open when I closed it. According to settings, it should open start page.