‎2012 Sep 20 5:39 AM
Hi Expert,
I have only 1 parameter in my selection screen, connected to ID EBS (PO number)
In the code, I increment the PO number by 1 and set the parameter.
However, after the program completes and I press "BACK", the parameter still shows the old PO number.
Only when I quit the program and execute it again, it will show the new PO number in the selection screen.
Is there any way to show the new PO number after I press "BACK"?
PARAMETERS: P_EBELN LIKE EKKO-EBELN MEMORY ID EBS.
START-OF-SELECTION.
P_EBELN = P_EBELN + 1.
SET PARAMETER ID 'EBS' FIELD P_EBELN.
WRITE: / P_EBELN.
Thank you,
TY
‎2012 Sep 20 6:31 AM
Hi
Affer backing to selection-screen all the system always restores the old selection data, this is a standard behavior and you can't prevent it
The system re-fill the selection-screen with old data just after the event INITIALIZATION, you can try to check this simple code:
PARAMETERS: P_EBELN LIKE EKKO-EBELN.
INITIALIZATION.
GET PARAMETER ID 'EBS' FIELD P_EBELN.
BREAK-POINT.
START-OF-SELECTION.
P_EBELN = P_EBELN + 1.
SET PARAMETER ID 'EBS' FIELD P_EBELN.
WRITE: / P_EBELN.
It's just like your code, but I use the event INITIALIZATION to get the value from PARAMETER ID: at the break-point you can see the value is got correctly, but in the selection-screen it'll be shown the old value.
The old data are stored in a memory and the system refreshs it after leaving the program: that explains behavior you see
Max
‎2012 Sep 20 6:07 AM
Hi,
the memory id for purchase order is BES not EBS.
Best regards,
BG
‎2012 Sep 20 6:25 AM
‎2012 Sep 20 6:31 AM
Hi
Affer backing to selection-screen all the system always restores the old selection data, this is a standard behavior and you can't prevent it
The system re-fill the selection-screen with old data just after the event INITIALIZATION, you can try to check this simple code:
PARAMETERS: P_EBELN LIKE EKKO-EBELN.
INITIALIZATION.
GET PARAMETER ID 'EBS' FIELD P_EBELN.
BREAK-POINT.
START-OF-SELECTION.
P_EBELN = P_EBELN + 1.
SET PARAMETER ID 'EBS' FIELD P_EBELN.
WRITE: / P_EBELN.
It's just like your code, but I use the event INITIALIZATION to get the value from PARAMETER ID: at the break-point you can see the value is got correctly, but in the selection-screen it'll be shown the old value.
The old data are stored in a memory and the system refreshs it after leaving the program: that explains behavior you see
Max
‎2012 Sep 20 6:50 AM
Even though INITIALIZATION event will execute before displaying the selection screen again, this event will can be used to initialize the selection-screen parameters only once, just after LOAD-OF-PROGRAM ( Initialization ).
If generated Purchase order number to be displayed explicitly for each selection screen call, event AT SELECTION-SCREEN OUTPUT should be used.
Regards, Vinod
‎2012 Sep 20 7:13 AM
Hi
Mine is just only an example in order to explain the behavior is corret, so it's not an error.
Yes he should use AT SELECTION-CREEN OUTPUT event, but then he need to solve others issue, because this event is called as soon as an action is done.
I'm waiting a response from TY in order to know what he really needs.
Max
‎2012 Sep 20 7:28 AM
Thank you, Max and Vinod
Now I understand it is standard behaviour, and I can refresh the parameter as below:
PARAMETERS: P_EBELN LIKE EKKO-EBELN MEMORY ID EBS.
AT SELECTION-SCREEN OUTPUT.
GET PARAMETER ID 'BES' FIELD P_EBELN.
START-OF-SELECTION.
P_EBELN = P_EBELN + 1.
SET PARAMETER ID 'EBS' FIELD P_EBELN.
WRITE: / P_EBELN.
However, if I call this program with SUBMIT, the input PO number will always be overwritten by the "AT SELECTION-SCREEN OUTPUT" statement.
SUBMIT ZPROG01 WITH P_EBELN = '12345'.
Although I input PO number = 12345, if the original BES parameter stored "1000",
the program will still shows 1001 instead of 12346.
But this can be solved by calling SET PARAMETER before I call SUBMIT.
‎2012 Sep 20 7:43 AM
Hi
yes your're right the event wi'll always overwrite the value, this is the other issue I've spoken before and this is the why I didn't suggest it at the beginning
Max
‎2012 Sep 20 10:36 AM