Application Development 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: 

Populate long text in transaction QM01

Former Member
0 Kudos

Hi,

I'm trying to populate long text in transaction QM01, meaning, when the user creates a new notification, a constant text should appear automatically.

I currently use enhancement QQMA0007 user exit EXIT_SAPMIWO0_001.

I found FM IQS0_ADD_NOTIFICATION_LONGTEXT which works fine when the notification already exists, but when creating a new notification I still have no number to put in the FM parameters.

Does anyone has an idea?

Thank's,

Hagit.

6 REPLIES 6

Former Member
0 Kudos

Hi again,

Does anyone have an idea?

Thank's,

Hagit peretz.

Former Member
0 Kudos

I think you need to find a user exit till which QM number is already retrived using FM GET_NEXT_NUMBER ( similar ) by the transaction.

user-exit or BADI after save would be perfect but you can check at the save processing also.

Cheers,

Ram

Former Member
0 Kudos

Hi Hagit,

In your userexit, put in a call to a subroutine ON COMMIT.

So, its like PERFORM .... ON COMMIT.

This means that when the standard transaction issues a COMMIT WORK, your subroutine will be executed. For sure, once the standard program has issued a COMMIT WORK the notification number will have been generated.

Now, in this subroutine you will be able to add the long text. The only challenge will be to access the notification number. Check out my <a href="/people/brad.williams/blog/2005/04/25/userexits--how-do-i-access-inaccessible-data">blog</a> on accesing data from other programs. You just need to access the field that contains the notification number. You could try first the screen field (use F1 then F9 to get the technical name), or just look in the global data of the program, somewhere you will find the notification number.

So, once you have located it, you just need a field symbol to point to it, and your problem is solved.

Let me know if you need more clarification.

Cheers,

Brad

0 Kudos

Hi Brad,

I have read your blog, it is very interesting and I have learned a lot from it, I wasn't aware to this option before.

The problem is that it does not solve my problem, I have checked the programs and it's all user exists:

SAPLXQQM FUNCTION EXIT_SAPMIWO0_001

SAPMIWO0 FORM USER_EXIT_001_F90

SAPLIQS0 FORM USER_EXIT_001_F90

SAPLIQS0 MODULE (PAI) CUSTOMER_EXIT_001

I have checked all of them, and all the tables do not have the value of the notification number.

I would appreciate it if you could give me another idea for solving the problem.

Thanks,

Hagit.

0 Kudos

Hi Hagit,

First, in the userexit that gets triggered when saving the notification, call a subroutine via PERFORM .... ON COMMIT.

In this subroutine, you will put the code to update the text and access the notification number using field symbols.

When a subroutine is called ON COMMIT, it means that the subroutine waits in memory until the transaction issues a COMMIT WORK. Once the transaction has issued a COMMIT WORK, the subroutine is called.

At this point, the notification number will have been generated.

In this subroutine, put a break point so you can examine all the memory areas to find the notification number. I suggest that the field VIQMEL-QMNUM in program SAPLIQS0 should have it [type (SAPLIQSO)VIQMEL-QMNUM in the watch fields to check its contents].

As an alternative, whilst looking at the transaction, I noticed some BADIs, the BADI CL_EX_NOTIF_CREATE_OBJ looks promising. Have you tried this one? Maybe the notification number is passed to you here.

Cheers,

Brad

0 Kudos

Hi Brad,

I now understand that this all procedure rises after saving the notification, the problem is that I need the text to appear right after <b><u>creating</u></b> the notification.

About the BADI, I'm not familiar with this, if you could give me some tips, maybe I can find the answer there.

Thanks,

Hagit.