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

Multiple transaction codes for a SAP program

Former Member
0 Likes
2,257

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

3 REPLIES 3
Read only

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Likes
954

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.

Read only

Former Member
0 Likes
954

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.

Read only

former_member156446
Active Contributor
0 Likes
954

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