‎2013 Mar 19 5:31 AM
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
‎2013 Mar 19 5:37 AM
‎2013 Mar 19 5:37 AM
‎2013 Mar 19 5:40 AM
‎2013 Mar 19 5:39 AM
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
‎2013 Mar 19 5:40 AM
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.
‎2013 Mar 19 5:47 AM
hi pavan,
thanx in regards .......i tried it but still now error only......dono how to frame it....
‎2013 Mar 19 6:16 AM
‎2013 Mar 19 6:19 AM
‎2013 Mar 19 6:24 AM
Hi Meena,
Explain clearly in which scenario you are using this and you better to post the code here.
Thanks.
Pavan.
‎2013 Mar 19 9:44 AM
Hi Meena,
if possible post your code here, so can help you in better way
-Rohit
‎2013 Mar 19 5:53 AM
Hi,
Use Call Transaction as suggested by SS. But remember to put the tcode in capital letters in Quotes.
Regards
Purnand
‎2013 Mar 19 5:58 AM
hi purnand....thanx for ur reply.............done wat u said but still the same error
‎2013 Mar 19 6:20 AM
Hi Meena,
Can you please send the code and the screenshot.
Regards
Purnand
‎2013 Mar 19 6:28 AM
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
‎2013 Mar 19 7:09 AM
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
‎2013 Mar 19 6:39 AM
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
‎2013 Mar 19 7:55 AM
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 .....
‎2013 Mar 19 8:01 AM
‎2013 Mar 19 8:07 AM
‎2013 Mar 19 8:07 AM
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 .....
‎2013 Mar 19 8:41 AM
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
‎2013 Mar 19 11:30 AM
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
‎2013 Mar 19 1:08 PM
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
‎2013 Mar 20 9:17 AM
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
‎2013 Mar 20 9:43 AM
‎2013 Mar 20 10:50 AM
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