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

Interactive report to open T-code in new window

kasithunuguntla
Participant
0 Likes
788

Hi,

I have an interactive report which should open VA03 in new window when clicked on Sales order number of report output.

Please advise.

Regards

Kasi

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
582

Here is a sample program to help you achieve your requirement.



report zrich_0002 no standard page heading.

data: ivbak type table of vbak with header line.
data: ispa type table of  rfc_spagpa  with header line.

data : cursor_field(30),
       field_value(30) .

select-options: s_vbeln for ivbak-vbeln.

start-of-selection.

  select * into corresponding fields of table ivbak
      from vbak
          where vbeln in s_vbeln.

  loop at ivbak.
    write:/ ivbak-vbeln.
  endloop.

at line-selection.
  get cursor field cursor_field value field_value.
  case cursor_field.
    when 'IVBAK-VBELN'.

      ispa-parid   = 'AUN'.
      ispa-parval  = field_value.
      append ispa.

      call function 'ABAP4_CALL_TRANSACTION'
        starting new task ivbak-vbeln
        exporting
          tcode                         = 'VA03'
          skip_screen                   = 'X'
       tables
          spagpa_tab                    = ispa
       exceptions
         call_transaction_denied       = 1
         tcode_invalid                 = 2
         others                        = 3.
  endcase.

Regards,

Rich Heilman

Hi,

I have an interactive report which should open VA03 in new window when clicked on Sales order number of report output.

Please advise.

Regards

Kasi

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
583

Here is a sample program to help you achieve your requirement.



report zrich_0002 no standard page heading.

data: ivbak type table of vbak with header line.
data: ispa type table of  rfc_spagpa  with header line.

data : cursor_field(30),
       field_value(30) .

select-options: s_vbeln for ivbak-vbeln.

start-of-selection.

  select * into corresponding fields of table ivbak
      from vbak
          where vbeln in s_vbeln.

  loop at ivbak.
    write:/ ivbak-vbeln.
  endloop.

at line-selection.
  get cursor field cursor_field value field_value.
  case cursor_field.
    when 'IVBAK-VBELN'.

      ispa-parid   = 'AUN'.
      ispa-parval  = field_value.
      append ispa.

      call function 'ABAP4_CALL_TRANSACTION'
        starting new task ivbak-vbeln
        exporting
          tcode                         = 'VA03'
          skip_screen                   = 'X'
       tables
          spagpa_tab                    = ispa
       exceptions
         call_transaction_denied       = 1
         tcode_invalid                 = 2
         others                        = 3.
  endcase.

Regards,

Rich Heilman