ā2010 May 19 4:35 PM
Hi, everybody.
I have the following question: is possible, in SAP, knowing in run-time what is the execution mode of a transaction? I mean, within my code, I want to know if there“s any function module or method which tells me if my screen is in "only display" mode, or in "change" mode (you know, the difference between clicking or not the pencil and glasses icon).
I wish I had been clear enough.
Thank all of you very much in advance.
ā2010 May 20 8:39 AM
Why not using SY-TITLE ?
IF SY-TITLE CS 'Display'.
display mode
ELSE.
change mode
ENDIF.
ā2010 May 19 4:44 PM
Hi,
Your program has control over its screen(s) - so your program should know what the status is.
Regards,
Gerd Rother
ā2010 May 19 4:58 PM
Thanks for your quick answer, Gerd.
That“s the problem. I“m working on a custom tabstrip subscreen implemented from a BAdi, and the status I want to know corresponds to the standard transaction VL0xN. Depending on that status, I have to let the fields on my custom subscreen in only display mode or not.
I hope it“s clearer now.
Thank you again for your respond
ā2010 May 19 5:06 PM
Hi,
Unfortunately I am not familiar with that transaction. I am pretty sure, though, that within the program(s) - probably the program that owns the main screen where this subscreen is shown - there must be some variable (e.g. ACTION or something similar) which holds the status (D for display, C for change, or it uses the values defined in table TACT). So the first thing to do is to find that variable - a good starting point is the SET PF-STATUS somewhere in/beneath a PBO module of that program.
Once you have that variable (some digging and debugging is necessary) you can use the where used list to see if that variable is given outside the program, e.g. by a function module. If so you can use that function module to get the actual status.
Sounds like a lot of work but the more you do such things the easier it gets...
Regards,
Gerd Rother
ā2010 May 19 5:12 PM
Hi again, Gerd.
Once again, thank you very much.
That“s the way I“m working to, actually, right now. I“m facing the standard code of the main program and searching for any variable which can conteins that value you mention. That starting point you suggest can be a beggining.
In the mean time, and while I“m fighting the stanrd code, I will thank any other brilliant idea about the issue.
Thanks a lot, Gerd.
ā2010 May 19 5:27 PM
Hi - Isn't there something in SYST you could use. In our system SYST-TCODE changes from VL02N to VL03N when the Transaction is changed from a Change mode to a Display mode. Or maybe another field in SYST would suit you better -- check them out in debug.
ā2010 May 20 7:13 AM
Hi, Keith.
Regretly not. I already considered that possibility, and it didn“t work. Changing from display to change mode, the code transaction remains with the same value of the beginning, and SYST structure has no changes too.
Thank you anyway for your answer, Keith
ā2010 May 20 7:31 AM
Check this sample program, you can understand how to toggle between change and display.
DEMO_DYNPRO_MODIFY_SIMPLE.
ā2010 May 20 7:43 AM
Hi and thank you, Gautham.
I checked out that program you tell me, but my problem is not about understanding the SCREEN structure and his behavior. In the point I have my BAdi implemented within the standard transaction, I can not use this structure, because it doesn“t report me any relevant information.
Regards.
ā2010 May 19 4:54 PM
This isn't controlled by SAP but by the programmer. Usually this is set in screen fields, associating a command to the push button and this value will be sent through screens in the sy-ucomm variable. It's customary to use a variable with the name OK_CODE to control this value as well.
ā2010 May 19 5:03 PM
Hi, Pedro and thank you, too.
I think that my last post has answered yours... I can“t depend on the ucomm o tcode values to change my fileds status. I keep on waiting for your suggestions.
ā2010 May 20 8:07 AM
ā2010 May 20 8:13 AM
Hi, Mukul, and thanks.
But, unfortunately, not. Changing from one standard tabstrip to the customized mine, this field is always in blank, independently of the active mode.
ā2010 May 20 8:15 AM
Hi,
I am afraid SYST-CALLD won't. Check its documentation (yes, there is one).
Regards, Gerd Rother
ā2010 May 20 8:28 AM
That“s right. In fact, no SYST field works in the way it could help me. I keep on searching, friends... and, once again, thank you very much for your help...
ā2010 May 20 8:39 AM
Why not using SY-TITLE ?
IF SY-TITLE CS 'Display'.
display mode
ELSE.
change mode
ENDIF.
ā2010 May 20 8:45 AM
Hi, Piotr.
I“ve already thought about it. The problem is, in my company, users log on in several languages (Spanish, English, Russian, Italian, and so on...), so I would have to manage that point, and I don“t know if it“s the ideal solution. Anyway, if I can“t achieve this goal through any other way, I will make it like you say, of course.
Thank you very much, Piotr.
ā2010 May 20 8:55 AM
Look also on global variables T180-AKTYP and T180-TRTYP in debugger. They are set to A and V in VL02N / VL03N.
A = Anzeigen = Display
V = VerƤndern = Change
ā2010 May 20 9:08 AM
Piotr, I owe you one, and big :-).
It worked! I can reference that structure from my BAdi throughout a field-symbol and solved.
Thank you very, very, very much, Piotr.
And the rest of the people, of course, thank you very much, too. You“ve just save my life.
Best regards.
Edited by: SAPNuno on May 20, 2010 10:08 AM
ā2010 May 20 10:06 AM
See all groups of modification of other fields on the screen that have the behavior (Display or Modify) you want for the new fields.