Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Tables work area not stable when calling function module?

jrgkraus
Active Contributor
0 Kudos
308

I am working on a user exit. The user exit is being called via CALL CUSTOMER-FUNCTION. Both main program and function group have a TABLES object:

Now, before the call, I have a value of 0001 in the field VKORG and ZQ in field ARTPR:

stepping into the call, I notice that the value VKORG is gone, whilst ARTPR remains:

How can this be? Why is VKORG being cleared in this step and ARTPR (and other fields as well) keep their values?

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
243

AFAIK, TABLES work area are shared within a program group. But "an additional program pool is always created when function pools and class pools are loaded" (ref). The Customer Exit is part of a function pool, so the VIQMEL of the Exit Function Group should not be the VIQMEL of the Main Program?

  • Could you try to add in Debug some watchpoint on structures or fields of VIQMEL(SAPMIWO0) and VIQMEL(SAPLXQQM) - I suppose VIQMEL(SAPLXQQM)-VKORG was cleared in another exit?
  • Note that every Customer Exit/Dynpro of the same function group could update VIQMEL(SAPLXQQM)
3 REPLIES 3

raymond_giuseppi
Active Contributor
244

AFAIK, TABLES work area are shared within a program group. But "an additional program pool is always created when function pools and class pools are loaded" (ref). The Customer Exit is part of a function pool, so the VIQMEL of the Exit Function Group should not be the VIQMEL of the Main Program?

  • Could you try to add in Debug some watchpoint on structures or fields of VIQMEL(SAPMIWO0) and VIQMEL(SAPLXQQM) - I suppose VIQMEL(SAPLXQQM)-VKORG was cleared in another exit?
  • Note that every Customer Exit/Dynpro of the same function group could update VIQMEL(SAPLXQQM)

Maciej_Domagała
Contributor
243

Global structure VIQMEL (declared with TABLES) is simply overwritten by the MOVE statement that you have shown in fm EXIT_SAPMIWO0_009 - because this structure is used as an actiual parameter to formal parameter p_viqmel (changing) of form user_exit_009_f90 which calls CALL CUSTOMER-FUNCTION '009' (importing p_viqmel).

Sandra_Rossi
Active Contributor
0 Kudos
243

Difficult to say, you show the values of VIQMEL, not P_VIQMEL, and also I don't see the arguments passed to USER_EXIT_009_F90. Maybe in LIQS0I90. Excerpt:

  PERFORM user_exit_009_f90(sapmiwo0) USING    xcount_pai
                                               tqtabs-tabcd
                                               xuserscr_pai
                                      CHANGING viqmel.
Excerpt from MIWO0F90:
FORM user_exit_009_f90 USING    p_xcount TYPE n
                                p_tabcd  LIKE tqtabs-tabcd
                                p_uscr_pai LIKE tq80-userscr1
                       CHANGING p_viqmel LIKE viqmel.

  CALL CUSTOMER-FUNCTION '009'
       EXPORTING
         i_viqmel = p_viqmel
         i_tabcd  = p_tabcd
         i_subnr  = p_xcount
         i_uscr   = p_uscr_pai
       IMPORTING
         e_viqmel = p_viqmel.

ENDFORM.