2009 Jun 05 4:28 AM
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 IMPLEMENTATIONPlease 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 IMPLEMENTATIONPlease do let me know if any of you need any further information regarding my spec too.
Thanks.
2009 Jun 05 4:36 AM
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
2009 Jun 05 4:41 AM
Hi Deborah Tan,
I see the way You have done is correct, what is problem you are facing now.
Regards
Suneel G
2009 Jun 05 4:55 AM
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..
2009 Jun 05 5:19 AM
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
2009 Jun 05 8:49 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |