A small problem to be aware of when debugging a program using the function module

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.