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

program for calling a tcode

Former Member
0 Likes
4,434

Hi Gurus,

Need to call the t code in a program

Moderator message: Unassigned Points.

@OP - Please do some research before posting, I have warned you several times, do not repeat this again.

Message was edited by: Kesavadas Thekkillath

1 ACCEPTED SOLUTION
Read only

satyabrata_sahoo3
Contributor
0 Likes
3,601

Use CALL TRANSACTION <Transaction name>  in program.

-SS-


25 REPLIES 25
Read only

satyabrata_sahoo3
Contributor
0 Likes
3,602

Use CALL TRANSACTION <Transaction name>  in program.

-SS-


Read only

0 Likes
3,601

This message was moderated.

Read only

Former Member
0 Likes
3,601

Dear meena,

        As per my know, there is no program for call t.code. we can check all tcode maintain using se93

and we can use all tcode using object S_TCODE.

Regards,

Prabaharan B

Read only

Former Member
0 Likes
3,601

Hi meena,

If you want to call the tcode from the report you should use the set parameter id.

here i will paste the sample code for it.

form user_command using v_ucomm type sy-ucomm

                                        wa_selfield type slis_selfield.

            


CASE wa_selfield-fieldname.

WHEN 'MATNR'.

SET PARAMETER ID 'MAT' FIELD wa_selfield-value.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

endform.

I hope this helps you.

Thanks.


Pavan.

Read only

0 Likes
3,601

hi pavan,

thanx in regards .......i tried it but still now error only......dono how to frame it....

Read only

0 Likes
3,601

Hi meena,

what error you are getting?

Read only

0 Likes
3,601

not going for output mode itself

Read only

0 Likes
3,601

Hi Meena,

Explain clearly in which scenario you are using this and you better to post the code here.

Thanks.

Pavan.

Read only

0 Likes
3,601

Hi Meena,

if possible post your code here, so can help you in better way

-Rohit

Read only

Former Member
0 Likes
3,601

Hi,

Use Call Transaction as suggested by SS. But remember to put the tcode in capital letters in Quotes.

Regards

Purnand

Read only

0 Likes
3,601

hi purnand....thanx for ur reply.............done wat u said but still the same error

Read only

0 Likes
3,601

Hi Meena,

Can you please send the code and the screenshot.

Regards

Purnand

Read only

0 Likes
3,601

Hi Purnand,

This is my code........

Tables:mara.

Data:t_mara type standard table of mara.


Select * from mara into table t_mara.

Loop at t_mara into mara.
   Write:/ mara-matnr.
   Hide: mara-matnr.
Endloop.

At line-selection.

   SET PARAMETER ID  'MAT' FIELD mara-matnr.
   Call transaction 'MM03' and skip first screen.

Iam not getting the correct answer for this


Read only

0 Likes
3,601

Hi meena,

your code is working fine for me it seems ok but there may be the issue in the statment 

"Call transaction 'MM03' and skip first screen".

Try without  "and skip first screen"  bcoz  MM01/MM02/MM03 tcode are linked with sub screen,

after first screen a pop screen comes for selecting views and second pop screen open for plant and other fields

so either try without  "and skip first screen"  or try to fill this pop screen values also.

Regards

Rohit

 

Read only

Former Member
0 Likes
3,601

Hi meena,

LEAVE TO TRANSACTION Tcode [AND SKIP FIRST SCREEN].

This statement ends the calling program and starts transaction tcode. This deletes the call stack (internal sessions) of all previous programs. At the end of the transaction, the system returns to the area menu from which the original program in the call stack was started.

If, on the other hand, you do not want to return to the calling program at the end of the new transaction, use the statement:

CALL TRANSACTION tcod [AND SKIP FIRST SCREEN].

This statement saves the data of the calling program, and starts transaction tcode. At the end of the transaction, the system returns to the statement following the call in the calling report. If the LEAVEstatement occurs within the called transaction, the transaction ends and control returns to the program in which the call occurred.

You can use a variable to specify the transaction tcod . This allows you to call transactions statically as well as dynamically.

The addition AND SKIP FIRST SCREEN allows you to prevent the initial screen of the new transaction from being displayed. The first screen to be displayed is then the specified Next screen in the screen attributes of the initial screen. If the first screen calls itself as the next screen, you cannot skip it.

If you are using Call Transaction for BDC programes .. then it have different format.

Regards

Rohit


Read only

0 Likes
3,601

Dear Guru's,

Actually my main requirement is when i call the table in a program, in the output of the program the tmg created for the table want to be displayed.......so only i created on table along with tmg and a tcode for the tmg too........using call transaction method i called the tcode as u guys said.....but i can able to view only the output of the report but not the TMG.....pls suggest me some idea .....

Read only

bharat_rathod2
Active Participant
0 Likes
3,601

use call trnscation and skip first screen .

Read only

Former Member
0 Likes
3,601

This message was moderated.

Read only

Former Member
0 Likes
3,601

Dear Guru's,

Actually my main requirement is when i call the table in a program, in the output of the program the tmg created for the table want to be displayed.......so only i created on table along with tmg and a tcode for the tmg too........using call transaction method i called the tcode as u guys said.....but i can able to view only the output of the report but not the TMG.....pls suggest me some idea .....

Read only

0 Likes
3,601

Hello Meena,

as i understand your problem .... after displaying your output ...if we click any line of the out pt displayed automatically tmg will dispal with related line selection ...

if you displayed your output in ALVs

after display your output u can give option for one more alv  instead of tmg ..like kind of interactive report with second alv u can do tmg related work...

if i am wrong at understand your problem .....kindly more elaborate your problem..

Regards

Rohit

Read only

0 Likes
3,601

Hi Rohit,

Thanks for ur reply......my req is wen ever i call a table in program.....tmg for that table automatically want to be created and to be displayed in the ouput. I am getting any idea for this req.....so pls suggest me any idea

Read only

0 Likes
3,601

Please, try to be more precise when specifiying your requirements.

my req is wen ever i call a table in program.....tmg for that table automatically want to be created and to be displayed in the ouput.

What do you mean by "call a table in program" ?

To call a dialog maintenance, you can try to call FM like VIEW_MAINTENANCE_CALL,

To generate a dialog maintenance, you can try to call FM like VIEW_MAINTENANCE_GENERATE

(Read some online documentation like Call in Function Modules in Integrating Enhanced Table Maintenance in Customer Developments, and more broadly Extended Table Maintenance, also perform some search at scn, help.sap.com or google.)

What did you try before posting, which step(s) were you unable to perform ?

Regards,

Raymond

Read only

0 Likes
3,601

hi this is the program i had done.......

REPORT  ZTEST_VBAK_TMG                          .

Tables: zvbak02.


Data:t_zvbak02 type standard table of zvbak02.
  Select * from zvbak02 into table t_zvbak02.
  Loop at t_zvbak02 into zvbak02.
   Write:/ zvbak02-vbeln,
         / zvbak02-ernam,
         / zvbak02-erdat,
         / zvbak02-erzet,
         / zvbak02-angdt.
  Endloop.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
   EXPORTING
     ACTION                               = 'U'
*   CORR_NUMBER                          = '          '
*   GENERATE_MAINT_TOOL_IF_MISSING       = ' '
*   SHOW_SELECTION_POPUP                 = ' '
     VIEW_NAME                            = 'ZVBAK02'
*   NO_WARNING_FOR_CLIENTINDEP           = ' '
*   RFC_DESTINATION_FOR_UPGRADE          = ' '
*   CLIENT_FOR_UPGRADE                   = ' '
*   VARIANT_FOR_SELECTION                = ' '
*   COMPLEX_SELCONDS_USED                = ' '
*   CHECK_DDIC_MAINFLAG                  = ' '
*   SUPPRESS_WA_POPUP                    = ' '
* TABLES
*   DBA_SELLIST                          =
*   EXCL_CUA_FUNCT                       =
  EXCEPTIONS
    CLIENT_REFERENCE                     = 1
    FOREIGN_LOCK                         = 2
    INVALID_ACTION                       = 3
    NO_CLIENTINDEPENDENT_AUTH            = 4
    NO_DATABASE_FUNCTION                 = 5
    NO_EDITOR_FUNCTION                   = 6
    NO_SHOW_AUTH                         = 7
    NO_TVDIR_ENTRY                       = 8
    NO_UPD_AUTH                          = 9
    ONLY_SHOW_ALLOWED                    = 10
    SYSTEM_FAILURE                       = 11
    UNKNOWN_FIELD_IN_DBA_SELLIST         = 12
    VIEW_NOT_FOUND                       = 13
    MAINTENANCE_PROHIBITED               = 14
    OTHERS                               = 15
           .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

here i can view the tmg in the output......ok.......but the tmg for the table ZVBAK02 was already created ...........instead iam taking another table where tmg not created iam using here in program means......in the output same as wat done here want to be shown.....so kindly understand requirement and provide my suggestion


Read only

0 Likes
3,601

Well, what is the purpose of the GENERATE_MAINT_TOOL_IF_MISSING parameter, I guess...

Regards,

Raymond

Read only

0 Likes
3,601

hi raymond,

what to use in that filed....this is some wat new to me.........in that parameter what i want to include............in documentation too i can view only the explanation of the parameter.......pls send me some syntax