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

Info from screen

Former Member
0 Likes
2,355

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,231

Why not using SY-TITLE ?

IF SY-TITLE CS 'Display'.

  • display mode

ELSE.

  • change mode

ENDIF.

19 REPLIES 19
Read only

gerd_rother
Active Participant
0 Likes
2,231

Hi,

Your program has control over its screen(s) - so your program should know what the status is.

Regards,

Gerd Rother

Read only

0 Likes
2,231

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

Read only

0 Likes
2,231

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

Read only

0 Likes
2,231

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.

Read only

0 Likes
2,231

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.

Read only

0 Likes
2,231

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

Read only

0 Likes
2,231

Check this sample program, you can understand how to toggle between change and display.

DEMO_DYNPRO_MODIFY_SIMPLE.

Read only

0 Likes
2,231

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.

Read only

PedroGuarita
Active Contributor
0 Likes
2,231

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.

Read only

0 Likes
2,231

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.

Read only

Former Member
0 Likes
2,231

SYST-CALLD field will give you required value.

cheers

Read only

0 Likes
2,231

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.

Read only

0 Likes
2,231

Hi,

I am afraid SYST-CALLD won't. Check its documentation (yes, there is one).

Regards, Gerd Rother

Read only

0 Likes
2,231

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...

Read only

Former Member
0 Likes
2,232

Why not using SY-TITLE ?

IF SY-TITLE CS 'Display'.

  • display mode

ELSE.

  • change mode

ENDIF.

Read only

0 Likes
2,231

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.

Read only

0 Likes
2,231

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

Read only

0 Likes
2,231

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

Read only

0 Likes
2,231

See all groups of modification of other fields on the screen that have the behavior (Display or Modify) you want for the new fields.