A system standard was copied yesterday afternoon. ProgramAdd a display field to its sap list viewer control. After the field is added to the internal table, the display field cannot be displayed in list viewer after debugging for an hour. Check that all the calls have been added, that is, when the function module reuse_alv_fieldcatalog_merge is run to the system, the added fields will survive and survive. As it is about to get off work, it is a bad habit to work overtime to solve the problem.
When I arrived this morning, I opened the program and continued to check. I added a breakpoint to the place where reuse_alv_fieldcatalog_merge was called. I went deep into the function module and continued to observe it. As a result, the fields that were not displayed yesterday are displayed on their own today. This is too strange.
Looking back at the work done during this period, I think of the latest standard tutorial, and suddenly realized that the function group of the function module will be loaded as a whole when the function module is called, at the same time, the global data objects in the function group are also loaded together and maintained throughout the program running.
This problem can be explained in this way. Yesterday's debugging was carried out under the transaction code se38, and no transaction code was exited no matter how the program was changed, in this way, the internal Session of the entire program is not exited. In this way, the salv function group of reuse_alv_fieldcatalog_merge is always stuck in this internal session, so that the global variables in some salv do not change in the call time value, in this way, the output results cannot reach the expected content. Today, the system exits se38 and re-reads and runs the program. After exiting, the memory occupied by the internal session is cleared. When re-runs, the function group is loaded again and the corresponding global variables are initialized, in this way, the result calculated using the new value is correct.
As a result, it is really important to learn basic knowledge. Without a recent standard tutorial, this problem cannot be explained. It can only be attributed to rpwt, but now I can explain the cause and write this article.ArticleI am very pleased to hear from my friends later.