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 not saved 'user status' in User Exit

reedtzj
Active Participant
0 Kudos
1,852

Hi all,

I have a problem that I sincerely hope someone has a solution to.

1. I use transaction IW52, change PM notification.

2. I then change the current user status to another.

3. Press Save.

4. User Exit is called up before save (see below).

In CS (Customer Service) there is a UE called "QQMA0014 QM/PM/SM: Checks before saving a notification" that I am using for this.

I need to get hold of the changed user status but I have failed so far. Reason is that based on the user status change an IDoc should be sent.

I have tried all the FM STATUS_READ* but they only give back already saved user statuses. I had hoped that especially the FM STATUS_READ_MULTI would be of help but I can not get the needed change information from this FM either. I also had a look for already saved information in memory but failed to find anything useful.

My last resort might be to make a modification directly after the user status change and then do an EXPORT TO MEMORY and then in the UE do an IMPORT FROM MEMORY. But, as a long timer with R/3, I do not like that approach - making modifications.

Has anyone faced a similar problem before and managed to solve it? (I do not think this is so special for a Notification transaction - it might have been a project in PS as well or another transaction that has the user status functionality.)

Regards, Johan

Message was edited by: Johan von Reedtz

7 REPLIES 7

Former Member
0 Kudos
785

Hi Johan,

Try this by inserting it into your ZXQQMU20 program.

DATA: l_dynpfields TYPE TABLE OF dynpread

WITH HEADER LINE.

l_dynpfields-FIELDNAME = 'RIWO00-ASTXT'.

APPEND l_dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'SAPLIQS0'

dynumb = '1060'

TABLES

dynpfields = l_dynpfields

EXCEPTIONS

OTHERS = 1.

Now, your l_dynpfields-FIELDVALUE contains the new or existing user-status. You need to check (in table JEST using I_VIQMEL-OBJNR) weather it was already set. If not, then it means that a user has enetered a new status. Therefore, it is ready to be checked against sending an Idoc.

Another solution would be to define a worklow (TC SWDD) being triggered when the status has changed. This solution seems better at the moment, but involves slightly more work to be done, though...

Thanks,

Wojtek

0 Kudos
785

Hi Wojtek

Thanks for your answer.

Actually I managed to solve this problem in the meantime but have not used SDN since my question.

I found out that FM STATUS_READ solves this problem as also Hans points out in his answer as well.

I will designate points when possible for your helpful answer. At the moment I do not see the star for this so I can not do it.

Regards, Johan

0 Kudos
785

Points awarded. Thanks to Charles for guiding me!

Regards, Johan

Former Member
0 Kudos
785

Hi,

FM "STATUS_TEXT_EDIT" should do it. If you want to get the old status use the same FM with parameter bypasssing buffer.

Hope it will help

Hans

0 Kudos
785

Hi Hans

Thanks for your answer.

Actually I managed to solve this problem in the meantime but have not used SDN since my question.

I used FM STATUS_READ exactly as you also suggests. When searching through the Internet I found quite some questions for this but almost no answer.

My assuption is that FM STATUS_READ does work is that almost all R/3 transactions use status settings in a similar manner. This is then done in the same functions group as the FM STATUS_READ is located and therefore one is able to retrieve the not saved statuses.

I will designate points when possible for your helpful answer. At the moment I do not see the star for this so I can not do it.

Regards, Johan

0 Kudos
785

You need to change your posting to a question before you can award points. SDN allows you to post questions which can be awarded, and discussions which have no rewards. Your question was posted as a discussion, that is why the little stars are missing to award points.

0 Kudos
785

Points awarded. Thanks to Charles for guiding me!

Regards, Johan