So, What's ur question??
Background Info: I am doing a course of ABAP module of SAP in a institute renowned for it's SAP faculty.. The faculty of my batch is Mr. Santosh kumar, a realtime faculty, and a damn good one, i say. This post is particularly about his style of responding to silly doubts when asked (When a real doubtful question is asked, he really gives best explaination leaving no traces of doubt in us).
Just like everyday, today's class begun almost 15 minutes late from scheduled 7.30 am. Today's topic was Variables and Data types that are used in ABAP programming, and my tutor did a great job. No doubt in why he's payed so much for just a 1 hour class, he's really worthy of it.
(Note: The next two paragraphs contain purely technical information, so the non techies may leave them)
Just like every programming language, ABAP has it's own way of declaring variables, and has different keywords to specify datatypes(like c for character, i for integer, N for numeric character etc...). One of the most beautiful features of ABAP is it's built in type conversion, i.e. variable of one data type is assigned to another variable of different data type, SAP converts the value internally (For eg, If we assign a string 10045 to a integer variable, built in conversion routines convert the string 10045 into a number 10045). In process of explaining this, he wrote the following small program..
Just like everyday, today's class begun almost 15 minutes late from scheduled 7.30 am. Today's topic was Variables and Data types that are used in ABAP programming, and my tutor did a great job. No doubt in why he's payed so much for just a 1 hour class, he's really worthy of it.
(Note: The next two paragraphs contain purely technical information, so the non techies may leave them)
Just like every programming language, ABAP has it's own way of declaring variables, and has different keywords to specify datatypes(like c for character, i for integer, N for numeric character etc...). One of the most beautiful features of ABAP is it's built in type conversion, i.e. variable of one data type is assigned to another variable of different data type, SAP converts the value internally (For eg, If we assign a string 10045 to a integer variable, built in conversion routines convert the string 10045 into a number 10045). In process of explaining this, he wrote the following small program..
Data: i1 type i,
i2(4) type c,
i3 type i.
i1 = 100.
i2 = '20'.
i3 = i1+i2.
write:/ 'Sum of ', i1 ,' and ',
i2 ,' is ', i3.
Here, since i3 is of type integer, the character string 20 is converted into integer 20 and then added to i1's value i.e. 100 and the resultant 120 is stored in i3, and all the values are displayed in output using the write statement. One more point to remember here is that Character strings are always left justified i.e. If we declare a character string of size 10 and assign a string 'Hello' to it, it will be stored as H e l l o x x x x x i.e. out of the 10 spaces, the assignment will be done from left. All other data types are right justified i.e. the assignment takes place from right hand side (eg. if 100 is assigned to i4(10), it will be x x x x x x x 1 0 0).
The above program was given as an example to explain about the built in type conversion of ABAP. At the end of the class, confused by the justification of elements, a guy started the doubts session by lifting his hand indicating to sir that he wants to ask a doubt.
Guy: "Sir, i have a doubt."
Sir: "What is it?"
Guy: "What would be the output of above program sir?"
Sir: "What do you think it would be?"
Guy: "Umm... the character string 20 would be converted to numeric 20..." (He stopped here with a doubtful gaze)
Sir: (looking at the whole class) "Isn't that what i've explained from past 15 minutes?"
Guy: "Hmm.. So, it would be a addition arithmetic on two numbers, 100 and 20, so it would be 120.."
Sir: "So, what is your doubt?"
Almost everyone in the class chuckled, including me (i have the least idea that i am going to be the next). This is the way he handles silly doubts. By the time we are done with the question-answer session, the instructor would have asked us twice the number of questions we asked him. But damn, I never know we have all the answers within us. Probably, like the way God is within all of us.
Also, during the class, he explained about Numeric Character type, A datatype which has the combinational behavior of integer and character strings(The integer type holds a number, where as Numeric Character holds no. of numbers.. i.e. just like an integer array. ABAP dont have the concept of integer arrays, only Numeric characters). The class ended with the following disc..
Me: "Sir, can we select a number or a substring of numbers within a Numeric Character value? just like as we do with strings?"
Sir: "Well, if you are writing a program, Will you write a function which has no use?"
Me: "No, sir"
Sir: "Do you believe SAP is a great tool?"
Me: "Yes"
Sir: "When you dont write any useless routine in your program, do you think the people who developed SAP will?"
Me: "No, sir"
Sir: "Is it of any use to have a function, to select numbers within a number?"
Me: "Umm.. No, sir"
Sir: "So do you think there is a function that can be used to select a substring from an Numeric Character value?"
Me: "No, sir"
Sir: "So, what's your question?"
Of course he later gave the explaination that if i really want to do such a thing, just assign the Numeric Character to a Character string, and then perform the position based string operations. You see, my doubt isn't that much silly.
The above program was given as an example to explain about the built in type conversion of ABAP. At the end of the class, confused by the justification of elements, a guy started the doubts session by lifting his hand indicating to sir that he wants to ask a doubt.
Guy: "Sir, i have a doubt."
Sir: "What is it?"
Guy: "What would be the output of above program sir?"
Sir: "What do you think it would be?"
Guy: "Umm... the character string 20 would be converted to numeric 20..." (He stopped here with a doubtful gaze)
Sir: (looking at the whole class) "Isn't that what i've explained from past 15 minutes?"
Guy: "Hmm.. So, it would be a addition arithmetic on two numbers, 100 and 20, so it would be 120.."
Sir: "So, what is your doubt?"
Almost everyone in the class chuckled, including me (i have the least idea that i am going to be the next). This is the way he handles silly doubts. By the time we are done with the question-answer session, the instructor would have asked us twice the number of questions we asked him. But damn, I never know we have all the answers within us. Probably, like the way God is within all of us.
Also, during the class, he explained about Numeric Character type, A datatype which has the combinational behavior of integer and character strings(The integer type holds a number, where as Numeric Character holds no. of numbers.. i.e. just like an integer array. ABAP dont have the concept of integer arrays, only Numeric characters). The class ended with the following disc..
Me: "Sir, can we select a number or a substring of numbers within a Numeric Character value? just like as we do with strings?"
Sir: "Well, if you are writing a program, Will you write a function which has no use?"
Me: "No, sir"
Sir: "Do you believe SAP is a great tool?"
Me: "Yes"
Sir: "When you dont write any useless routine in your program, do you think the people who developed SAP will?"
Me: "No, sir"
Sir: "Is it of any use to have a function, to select numbers within a number?"
Me: "Umm.. No, sir"
Sir: "So do you think there is a function that can be used to select a substring from an Numeric Character value?"
Me: "No, sir"
Sir: "So, what's your question?"
Of course he later gave the explaination that if i really want to do such a thing, just assign the Numeric Character to a Character string, and then perform the position based string operations. You see, my doubt isn't that much silly.

0 Comments:
Post a Comment
<< Home