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

How To call a Tcode From a Program and returning back ?

Former Member
0 Likes
11,065

Dear All,

I have a requirement, i have to show all the open orders as in the the tcode va05 and return back to the my program. so how to display the tcode and getting back to my program. please help?

10 REPLIES 10
Read only

Former Member
0 Likes
3,854

hi,

set parameter id ' '.

CALL TRANSACTION 'VA05' and skip first screen . " This way you get to call a tcode from a report program

Thanks

Sharath

Read only

qamar_javed
Participant
0 Likes
3,854

Hi,

use the code:

SET PARAMETER ID pid FIELD fieldname.

CALL TRANSACTION 'VA05'.

"SKIP FIRST SCREEN.

pid can be found out by going to se11 and check the dataelement of the fieldname there in further characteristics you can find the parameter id.

Hope this helps you.

Regards,

Qamar.

Edited by: Qamar Javed on Mar 18, 2009 6:25 PM

Read only

sarbajitm
Contributor
0 Likes
3,854

Keep a custom button on application toolbar.Give a Fcode. then

write down the following code in your program.

SET PF-STATUS <pf-status name>.

AT USER-COMMAND.

CASE sy-ucomm.

When 'Trans'. "assume it is your FCode name

Call Transaction 'VA01'.

ENDCASE.

From Va01 you can back to your list by clicking the BACK button (Green Colored)

hope it solve your Problem.

regards.

Edited by: Sarbajit Majumdar on Mar 18, 2009 6:29 PM

Read only

Former Member
0 Likes
3,854

1. Try using call transaction logic

2. You can use Recording too. I've done it once to go to a delivery transaction and return.

3. Goto system-> status, get the program name, use SUBMIT & RETURN logic

Read only

Former Member
0 Likes
3,854

Hi Praveen,

Try it this way:

Tables:
  mara.

Data:
  t_mara like 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.

Here in the list output double click on a particular matnr, it will take you to t-code mm03 for that matnr and when you click back button from mm03, it will come back to list output.

With luck,

Pritam.

Edited by: Pritam Ghosh on Mar 18, 2009 2:08 PM

Read only

Former Member
0 Likes
3,854

Hi Praveen,

You can call like this

submit SAPMV75A and return.

Regards,

Naresh.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
3,854

Hi,

Use something like:-


SET PARAMETER ID '<param_id>' FIELD '<field_name>'.

CALL TRANSACTION 'VA05' AND SKIP FIRST SCREEN.

Get the parameter id from transaction va05 by pressing F1 on field on initial screen and check the technical settings, write this parameter id in place of <param_id>

For the value to set, you have to pass these values form tha calling program, so use the field name containing the value for that field in place of <field_name>.

You will be moved to the second screen of transaction VA05.

Click back button to return back to your program.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
3,854

Hi,

Use like this

SET PARAMETER ID '<paramid>' fieldname '<fnam>

CALL TRANSACTION 'VA05' and SKIP first screen

Regards,

Jyothi CH.

Read only

Former Member
0 Likes
3,854

Hi,

Basic syntax to call the transaction is:

SET PARAMETER ID <id name> FIELD <filedname>.
 CALL TRANSACTION <TCOde> AND SKIP FIRST SCREEN.

If your are using ALV then snippet is :

FORM user_command  USING okcode    LIKE sy-ucomm
                       lselfield TYPE slis_selfield.

  CASE okcode.
    WHEN '&IC1'. " SAP standard code for double-clicking
      CASE lselfield-sel_tab_field."check if double click is only on
        WHEN 'ITAB-AUFNR'."aufnr not on any other field
          SET PARAMETER ID 'ANR' FIELD lselfield-value.
          CALL TRANSACTION 'IW32' AND SKIP FIRST SCREEN.
      ENDCASE.
  ENDCASE.

Endform.

Pooja

Read only

qamar_javed
Participant
0 Likes
3,854

Hi Praveen,

If you have got your answer mark it as answered.

Regards,

Qamar.