‎2009 Aug 11 10:28 PM
Hi,
For some SAP programs , there are multiple tcodes in SE80.
As program is same with selection screen same as , for example 1000, how the functionality differes with different tcodes?
how is the code written to handle different tcodes in the same program?
Thanks for help in advance.
Regards,
Yogita
‎2009 Aug 11 11:20 PM
There is no uniform way to do this. Different application areas use various methods to differentiate between create / change / display mode while processing the same screen in different transaction codes.
For instance, in SD (and some other application areas) the Screen Sequence Control tables are queried at the beginning of a transaction, and in table T180 there is a field (TRTYP) that will determine what mode is the transaction for, so based on that the module pool will decide what functionality is available. But this is not a method that's used everywhere - as said, there are many ways to accomplish this.
‎2009 Aug 12 12:51 AM
Hi,
We have Different types of Programs such as Executable, Modulepool and Functionpools.
We can design different selection-screens, Normal Screens through all of the above program types with different transactions.
Based on transaction we can write its own functionality.
Ex: ZZ01 for change => all fields in editable mode
ZZ02 is for Display => all fields in display mode.
(Module Pool, Normal Screen.)
declare one Module under PBO. Module FIELD_ATTRIBUTES.
Write code like this:
loop at screen.
If sy-tcode = 'ZZ01'.
screen-input = 1.
elseif sy-tcode = 'ZZ02'.
screen-input = 0.
endif.
modify screen.
endloop.
This is very small example. If you compare F-02 and FBS1 transactions, you can observe this method. We can observe more input fields in FBS1. This is based Configuration also.
Thank you,
Balaji Peethani,
Tanuku.
‎2009 Aug 12 12:58 AM
adding to what said about...
if sy-tcode = 'ONE'.
do this and this..
elseif sy-tcode = 'TWO'
do this and this..
endif.
the same thing can be done based on called program and the flag values... like if flag = 'V' sales so do this if flag = 'K' purchasing so do this...