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

Reading Dynpro values after PAI and Buttons with Functioncode 'E'??

oliver_schmidt1979
Discoverer
0 Likes
1,381

Hi there,

this is my first question for the Community, so I hope this discussion pool is right and no one else asked this question before:

So here is my problem:

I have called a Dynpro and defined in PAI:

PROCESS AFTER INPUT.

  MODULE DYNPRO_CANCEL AT EXIT-COMMAND.

and some field checks :

FIELD WA_VERARBEITUNG-KUNNR MODULE KUNNR_PRUEFEN.

In Module DYNPRO_CANCEL I process the CANCEL, BACK and EXIT Buttons with Functioncode 'E'  !

Functioncode 'E' to override the Field checks.

Now I want to create a Message for this Cancel-Buttons like 'Data have change. Would you like to save?'.

For that I have to check the Dynpro values for changing.

So here is the Problem because at Functioncode 'E' the Dynpro gives only ok_code back and no values to check them against the original wa (workarea).

I have tried to work with CALL FUNCTION 'DYNP_VALUES_READ' to read all the data manually, but the return values are all Char255 and I can't convert all values back in original data. I can convert most of them but not for all 😞

So here is the question:

Are there any other option to realize such a scenario like reading Dynpro values after PAI and Buttons with Functioncode 'E' or comparing the Dynpro values with workarea at this time???

I hope I can explain this question correctly and you have an answer for this problem.

Thanks a lot for helping.


Oliver Schmidt

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,264

Hello Oliver,

Try to do this using at-datar or let me know if it doesn't work.SY-DATAR is to be used along with a flag.

In PAI set flag using SY-DATAR.

ie

if sy-datar is not initial.

flag = 1.

endif.

Now in

Module exit_command..

if sy-datar is initial and flag is initial.

...

else.

.....

endif

endmodule

hiran.

Hi there,

this is my first question for the Community, so I hope this discussion pool is right and no one else asked this question before:

So here is my problem:

I have called a Dynpro and defined in PAI:

PROCESS AFTER INPUT.

  MODULE DYNPRO_CANCEL AT EXIT-COMMAND.

and some field checks :

FIELD WA_VERARBEITUNG-KUNNR MODULE KUNNR_PRUEFEN.

In Module DYNPRO_CANCEL I process the CANCEL, BACK and EXIT Buttons with Functioncode 'E'  !

Functioncode 'E' to override the Field checks.

Now I want to create a Message for this Cancel-Buttons like 'Data have change. Would you like to save?'.

For that I have to check the Dynpro values for changing.

So here is the Problem because at Functioncode 'E' the Dynpro gives only ok_code back and no values to check them against the original wa (workarea).

I have tried to work with CALL FUNCTION 'DYNP_VALUES_READ' to read all the data manually, but the return values are all Char255 and I can't convert all values back in original data. I can convert most of them but not for all 😞

So here is the question:

Are there any other option to realize such a scenario like reading Dynpro values after PAI and Buttons with Functioncode 'E' or comparing the Dynpro values with workarea at this time???

I hope I can explain this question correctly and you have an answer for this problem.

Thanks a lot for helping.


Oliver Schmidt

4 REPLIES 4
Read only

D_Chia
Active Participant
0 Likes
1,264

there is a system variable available and populated to 'X' when any screen field value(s) is changed/manipulated.

SY-DATAR

Read only

Former Member
0 Likes
1,265

Hello Oliver,

Try to do this using at-datar or let me know if it doesn't work.SY-DATAR is to be used along with a flag.

In PAI set flag using SY-DATAR.

ie

if sy-datar is not initial.

flag = 1.

endif.

Now in

Module exit_command..

if sy-datar is initial and flag is initial.

...

else.

.....

endif

endmodule

hiran.

Read only

0 Likes
1,264

IS it cleared?? Did you get the answer??

Read only

0 Likes
1,264

Wow, thanks a lot Hiran Kumar Pabba and D. Chia.

Sometimes you work in one direction and you forget the simple things.

That's it and it helps me a lot.

Thank you very much.

Oliver