on 10-09-2014 1:02 PM
Hi experts,
Is there a way in SAP Personas to be in one transaction, copy a value from that transaction, then on the press of a script button, open a new transaction in a new session (using /oME2N) but then paste the copied values into the new transaction?
My example is that I am in transaction MM03 Display material. I wish to copy the material number, open transaction ME2N Purchasing Documents per number, default some values and then paste the copied material number into the relevant field.
I get the new transaction to open correctly, but I am unable to then paste the copied value (I assume this is lost when the new session opens), and other default values that are in my script are also lost?
Can this be achieved?
thanks,
Ian
Hi Ian,
the copied values stay alive as long as the script runs. You can paste the values into hidden fields on the screen with the script button. Then you can copy the values again in the script of the script button and use them in this script. But: I believe, you cannot access the fields in the new session. You will have to stay in the same session to manipulate the fields.
Regards
Björn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ian,
Maybe you can try it this way:
1. In 1st Tcode, "Paste Value" of your result into a hidden field on the Personas init screen.
2. Now do 2nd Tcode: first, "Copy Value" of the hidden field into a var, myVar.
3. In a script button, call the Tcode to go to the new screen, then do "Paste Value" of myVar into the field you want.
Does this help?
Dong Zhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dong,
Thank you for your reply. Yes I have tried as you say, but the values are lost when you open a new session (using /o).
Unless you are referring to using Java to store the values, which I have thought about, but I am a complete Java script novice at the moment, so I wouldnt know where to start
thanks,
Ian
That will get very complicated very quickly. Don't forget you need to deal with multiple users doing this at the same time, or indeed the same user doing it in two separate sessions at (almost) the same time. You'll need a way to identify which stored value belongs to which session, and you'll need to lock the table during updates. It sounds like a lot of work to me.
Why are you opening ME2N in a new session? Perhaps there's a way to avoid that?
Steve.
Yes its starting to sound like its simply best to open in the same session and be done with it.
The only reason I wanted to open it in a new session was so the user who is calling it from the Display Material Transaction MM03, did not lose the data from his current session.
I've implemented a workaround whereby I copy the Material Code within my script from the MM03 transaction and paste it to a hidden field in ME2n.
when the user then uses the back button, I have replaced standard back button with a script that then copies the hidden field, and opens transaction MM03 using the copied value as the material number.
Problem sorted, I just needed to think outside the box a bit more.
thanks again for you input Steve,
Ian
Hi Karthikeya,
I have opted to open the new transaction in the same session with a script that copies the original value from MM03 Display material into the new transaction ME2n into a hidden field, so this can be copied again when the user exits out of ME2n.
thanks again for all of your assistance, I do appreciate it,
Ian
That's exactly the approach I was going to suggest. Personas gives you a lot more outside the box than you realise, sometimes
There's almost always an easier way, if you forget about how SAPgui works and think about how your users want to work. SAPgui-thinking is a straight jacket - break free!!!
Steve.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.