The difference between data references and field symbols

来源:互联网 发布:信息的编程加工教案 编辑:程序博客网 时间:2024/05/17 06:24

An interviewer asked me a question when I had a SAP Labs interview in Shanghai last month. The question is What's the difference between data references and field symbols?I think it must be the deepest question I have ever met.We rarely use data references and field symbols in development due to oo programing is less popular than procedural programing in China's SAP project.Although I had lots of oo expericences in SAP development I never tried to figure out the difference.After I looked for some information in Internet and SAP Help website, I got some new ideas about it.First of all,let's list the semantic concept of them.

Data references are pointers to data objects. You can only dereference a data reference using a special assignment to a field symbol.(From SAP Help website)

Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. (From SAP Help Website)

It clearly defined that data references are pointers and field symbols are placeholders.If you learned C language before you should realize that point is a very import tool.In my opinion,data references are pointer in C and field symbols are similar to the signal "*" .It measn actually you can only manipulate data reference by using its physical memory address.If you want to using its content you must assign it to a relevant field symbol.

I won't prove it in ABAP/4 code until I can log on SAP system.....to be contined

原创粉丝点击