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

Problem with updating variable in pai

0 Likes
1,368

2.png

Dear Experts,

I would like to define a screen with 3 fields as in the attachment, and i.e if the material was not found, all 3 fields should be cleaned. I have tried to clean the 3 fields in PAI, when the material not be found, but in PBO they are not empty and still have the values like before cleaning.

Does anyone know why and how could i solve this?

Thanks and regards

Ton

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,067

You say "if the material was not found" so I guess you trigger an error message (MESSAGE ... TYPE 'E')

There is no implicit "field transport" in case of error message, but you may trigger it explicitly for some fields using the function module DYNP_VALUES_UPDATE.

But maybe in matter of User eXperience, the field should not be cleared in case of error, to let the user see the error and correct himself?

Read only

0 Likes
1,067

Thank you Sandra Rossi for you answer. You are right, the field should not be cleared. But i find out, when we clear the variables in PAI, they stay with the same values like before clearing in PBO. I think in dialog processing, the behaviour of variable is little bit same with the behaviour of message but i'm not sure about it. I'm newbie in ABAP Development 🙂

Is this right or what is your opinion? Please tell me 🙂

Regards

Ton

Read only

0 Likes
1,067

pis296 Maybe you didn't fully understand my answer: the "field transport" means the transfer of values of screen fields to the global variables of the program and vice versa. If you trigger an error message then the global variables are not transferred to the screen. This is how dynpros work. You have DYNP_VALUES_UPDATE to do the "field transport" manually. Another solution is to trigger a status message and display it like an error (MESSAGE ... TYPE 'S' DISPLAY LIKE 'E') so that the fields keep being transported.

Read only

0 Likes
1,067

Oh sorry if i did not fully understand you :). I think what you actually mean is the database LUW? So when i correctly understand, it is the same with this topic here https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_message_dialog.htm right?

Regards

Ton