Skip to Content
0

Internal table not getting refreshed in module pool

Apr 21, 2017 at 01:21 PM

103

avatar image
Former Member

Dear Experts,

Before posting here, I have searched many SCN posts but of no help.

I have a main screen say 9000 which has a button B1. I have a subscreen which holds a table control say T1.

Now the problem is after entering data in T1 and click on B1, there happens a validation and it throws a message of type E. I have already placed the fields of T1 within chain-endchain and so no problem in feeding new data even after error in table control T1.

Now when I change the data in T1 and again click on B1, changes are not reflecting in its internal table say IT_TAB.

Please note that T1 is in a subscreen, B1 is in main screen. When I click on B1 after changing data in T1, PAI of main screen 9000 is called. I have tried using 'REFRESH CONTROL 'T1' FROM SCREEN 9001 in the PAI of 9000. 9001 say it refers to the subscreen of T1.

Now how do I get the changed values of T1 from screen 9001 to my internal table IT_TAB.

Thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Apr 24, 2017 at 07:07 AM
0

The code to read the table control and update Abap memory must be in the subscreen 9001 PAI logic (LOOP WITH CONTROL), so triggered by some CALL SUBSCREEN <subarea> in the PAI of screen 9000.

Show 8 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Giuseppi,

Thanks for your time. I understand your point. But it doesnt help on this issue.

9000 is my main screen, 9001 is my subscreen which holds a table control. Now when I just edit data in the

table control and click B1, it doesnt goto PAI of 9001 and goes to PAI of 9000 which we can understand as

we dont do any other action on 9001 to trigger its PAI.

In my case, there exists a modify statement based on table control in 9001 in the PAI of 9001 but the control

skips it and goes to directly to PAI of 9000.

I have tried using FM DYNP_VALUES_GET in the PAI of 9000 by passing sy-dynnr as 9001 but still the changed value doesnt get updated.

Is there any other alternative to tackle this issue?

Regards,

Aravindh.

0

When there's a main screen with subscreens, and the user presses any button/function key, then the PAI of the main screen is called, and then the PAI of the subscreens (at the place of CALL SUBSCREEN in the PAI).

Now when I just edit data in the table control and click B1, it doesnt goto
PAI of 9001 and goes to PAI of 9000 which we can understand as we dont do 
any other action on 9001 to trigger its PAI.

I don't agree about what you said. In a normal flow, it always goes to the PAI of subscreens except if you change the normal flow (LEAVE SCREEN, etc.)

0

When a subscreen is included in a main dynpro, the main dynpro PAI logic MUST look like

" exit without check (cancel, exit)
MODULE exit_command AT EXIT-COMMAND.
" every statement that transfer data between dynpro and program
" FIELD, LOOP AT TABLE CONTROL, SUBSCREEN, etc. with check modules
CALL SUBSCREEN subarea.
" only now are you allowed to non-exit function codes...
MODULE user_command.
0
Former Member

Hi Giuseppi,

My code for the main screen 9000 PAI is the same as you mentioned:

MODULE EXIT AT EXIT-COMMAND.

CHAIN.

FIELD A1.

FIELD A2.

MODULE ABC ON CHAIN-REQUEST.

ENDCHAIN.

CALL SUBSCREEN:

9001_SCA,

SUBAREA.

MODULE ACTIVE_TAB_GET

MODULE USER_COMMAND.

How do I get the changed value from subscreen 9001 when pressing B1 triggers PAI of 9000??

Sometimes pressing ENTER will trigger PAI of 9001 and then come to main screen 9000. But Users doesnt need it in business.

Regards,

Aravindh.

0

Is your B1 function code of type "Exit" or not?

0
Former Member
Sandra Rossi

Hi Sandra,

Thanks for your time. B1 is a button in my main screen 9000 and table control is in subscreen 9001.

First time when I enter data in table control , there is no issue as it triggers the 9001 PAI first and control goes to 9000.

But in case of erroneous data entered in table control, when I try to change the data in table control of 9001 and click B1 again, control directly goes to 9000 PAI and changed values are not being passed to my program and thats the issue.

Regards,

Aravindh.

0

Just a correction about what you say:

First time when I enter data in table control , there is no issue 
as it triggers the 9001 PAI first and control goes to 9000.

No, SAP triggers the PAI of the main screen (9000), then it goes to the PAI of the subscreens when it goes through CALL SUBSCREEN in PAI of the main screen.

in case of erroneous data [...] in table control of 9001 [...] control 
directly goes to 9000 PAI 

No. After an error or warning message has been triggered (MESSAGE ... TYPE 'E' or 'W'), the screen is displayed, without going through the PBO, and the next user action makes the dynpro flow logic start from the place where the message was triggered (except if the function is of type "Exit", which goes directly to the MODULE ... AT EXIT-COMMAND).

If the behavior is different, then either you didn't trigger the message with MESSAGE ... TYPE 'E' (which is completely different from DISPLAY LIKE 'E'), or your function code is of type "Exit", or many other possibilities, it's impossible to list everything.

Please do a /H after the error message, press B1 and tell us where it goes.

PS: for information, a function code may be of type "Exit" if it has code "E", as below:

e7hah.png (39.5 kB)
1

So as Sandra wrote, your function code seems to be an "Exit" one like a 'BACK' or 'EXIT' one, so during execution of your code the new input data is not available (MODULE - AT EXIT-COMMAND: 'The only dynpro field transported to the ABAP program is the OK field.')

Convert the function code to a standard application function code type space.

1