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

Regarding CALL TRANSACTION

former_member367551
Participant
0 Likes
1,343

Dear forumers,

Is there a way to call different transactions by using the same data field in an ALV report?

In my spec, it is written to call transactions "IW33 or CN23" in the ALV drill-down functionality on the data field AUFNR. Does anyone know how to get this done? I'm not sure what conditions to check for calling the two different transactions here.

The following is how my codes look like (I'm only calling the transaction IW33 alone for this):-

CLASS lcl_handle_events IMPLEMENTATION.
  METHOD on_double_click.
    CASE column.

      WHEN 'VBELN'.
        READ TABLE i_assets INTO w_assets INDEX row.
        SET PARAMETER ID 'AUN' FIELD w_assets-vbeln.
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

      WHEN 'AUFNR'.
        READ TABLE i_assets INTO w_assets INDEX row.
        SET PARAMETER ID 'ANR' FIELD w_assets-aufnr.
        CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.

    ENDCASE.
  ENDMETHOD.                    "on_double_click
ENDCLASS.                    "lcl_handle_events IMPLEMENTATION

Please do let me know if any of you need any further information regarding my spec too.

Thanks.

Dear forumers,

Is there a way to call different transactions by using the same data field in an ALV report?

In my spec, it is written to call transactions "IW33 or CN23" in the ALV drill-down functionality on the data field AUFNR. Does anyone know how to get this done? I'm not sure what conditions to check for calling the two different transactions here.

The following is how my codes look like (I'm only calling the transaction IW33 alone for this):-

CLASS lcl_handle_events IMPLEMENTATION.
  METHOD on_double_click.
    CASE column.

      WHEN 'VBELN'.
        READ TABLE i_assets INTO w_assets INDEX row.
        SET PARAMETER ID 'AUN' FIELD w_assets-vbeln.
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

      WHEN 'AUFNR'.
        READ TABLE i_assets INTO w_assets INDEX row.
        SET PARAMETER ID 'ANR' FIELD w_assets-aufnr.
        CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.

    ENDCASE.
  ENDMETHOD.                    "on_double_click
ENDCLASS.                    "lcl_handle_events IMPLEMENTATION

Please do let me know if any of you need any further information regarding my spec too.

Thanks.

5 REPLIES 5
Read only

shishupalreddy
Active Contributor
0 Likes
957

Hello ,

Please check the below code...

DATA : w_out TYPE acin_out.

DATA : fs(20) , fname(20).

FIELD-SYMBOLS : <fv>.

*&If a single cell is selected.

REFRESH g_t_cell.

CALL METHOD g_r_grid->get_selected_cells

IMPORTING

et_cell = g_t_cell.

*&If a single cell is selected.

IF NOT g_t_cell[] IS INITIAL.

READ TABLE g_t_cell INTO g_r_cell INDEX 1.

IF sy-subrc EQ 0.

fname = g_r_cell-col_id-fieldname.

READ TABLE t_out INTO w_out INDEX g_r_cell-row_id-index.

CONCATENATE 'W_OUT' '-' fname INTO fs.

ASSIGN (fs) TO <fv>.

IF fname = 'AUFNR'.

SET PARAMETER ID 'ANR' FIELD <fv>.

CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.

ELSEIF fname = 'KDAUF'.

SET PARAMETER ID 'AUN' FIELD <fv>.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

ELSEIF fname = 'KOSTL'.

SET PARAMETER ID 'KOS' FIELD <fv>.

CALL TRANSACTION 'KS03' AND SKIP FIRST SCREEN.

ENDIF.

ENDIF.

ENDIF.

Hope it will help u .....please let me know If you have any issues ..

regards

Read only

Former Member
0 Likes
957

Hi Deborah Tan,

I see the way You have done is correct, what is problem you are facing now.

Regards

Suneel G

Read only

former_member367551
Participant
0 Likes
957

Shishu,

Thanks for providing the sample codes here.. But my question still remains: Is there a way to call two different transactions (in my case, either IW33 or CN23) based on one data field (in my case, AUFNR)?

What I mean is this:-

...
WHEN 'AUFNR'.
  if <condition is true>.
    ... " the necessary codes here
    CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
  else.
    ... " the necessary codes here
    CALL TRANSACTION 'CN33' AND SKIP FIRST SCREEN.
  endif.
....

At the moment, I am not able to do this because I do not know how to even determine the condition.

Suneel,

In my codes, I'm only calling one transaction, which is IW33 from the data field AUFNR.

But in my spec, I need to call either IW33 or CN23 from the same data field, AUFNR. Any ideas on how to check for the conditions here?

Thanks..

Read only

0 Likes
957

Hi,

First you need to determine what you are going to use for conditions, without that you cannot proceed further. So consult with the corresponding Functional Consultant.

And calling different tcodes based on conditions is very much possible.

Regards

Karthik D

Read only

0 Likes
957

Thanks, Karthik.