Application Development and Automation 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: 
Read only

PARAMETER with MEMORY ID not refreshed

Former Member
0 Likes
2,271

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,417

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

8 REPLIES 8
Read only

0 Likes
1,417

Hi,

the memory id for purchase order is BES not EBS.

Best regards,

BG

Read only

0 Likes
1,417

Sorry for the typo, it's BES, but still doesn't work

Read only

Former Member
0 Likes
1,418

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

Read only

0 Likes
1,417

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

Read only

0 Likes
1,417

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

Read only

0 Likes
1,417

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.

Read only

0 Likes
1,417

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

Read only

0 Likes
1,417

I see, thank you very much, Max