2010 Feb 25 4:46 AM
Dear Experts,
I Have created an ALV report . Now I have to add 2 columns in fieldcatalog .
By clicking values in first column it will drag me to tcode cooispi and by clicking
values in second column it should drag me to ck13N. I hv search the forum but donot find satisfactory result.
Plz help..
Regards,
Apoorv
2010 Feb 25 5:32 AM
Hai,
Try this. In this i have given u sample. Change according to your requirement.
DATA: ls_selfield TYPE slis_selfield,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'CALL_TCODE'
TABLES
t_outtab = it_output.
FORM call_tcode USING r_ucomm ls_selfield LIKE ls_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF ls_selfield-fieldname = 'ANLN1'. "ANLN1 is field name in your ALV Grid
CALL TRANSACTION 'AS03' AND SKIP FIRST SCREEN.
ENDIF.
Here u can give conditions for as many fields u want.
ENDCASE.
ENDFORM. " CALL_TCODE
Edited by: Prabu S on Feb 25, 2010 6:33 AM
Dear Sumit,
I remember , but here the called transaction is not custom infact it is SAP-Std tcode .. COOISPI..
So i think i need to use GET parameter in PBO of that screen. But i hv one worry in doing so
will it affect std transaction when i will not call it from my ALV?
Regards,
Apoorv
2010 Feb 25 5:01 AM
Hi Apoorva,
Check this Thread.
http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=82936036
I think you need Interacive ALV rather than Hyper LInk.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND' " This form is implemented below
is_layout = gs_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
it_fieldcat = gt_fieldcat[]
i_save = gc_a
tables
t_outtab = ist_final[].
form user_command using p_ucomm type sy-ucomm "#EC CALLED
wa_selfield type slis_selfield . "#EC CALLED
"wa_selfield contains the Line details, Field Name, Field value Etc so you can check which field is being Clicked
if wa_selfield-FIELDNAME = 'YOUR_FIRST_FIELD' Pass your Field name here
CALL TRANSACTION 'COOIS'
elseif wa_selfield-FIELDNAME = 'YOUR_SECOND_FIELD'
CALL TRANSACTION 'CO3KN'.
ENDIF.
" For More info Take Where Used List on the above Function ModulCheerz
Ram
2010 Feb 25 5:04 AM
i guess the links below might help you ...
http://wiki.sdn.sap.com/wiki/display/ABAP/HYPERLINKinALV
http://wiki.sdn.sap.com/wiki/display/ABAP/FIELDCATALOGOPTIONSINALV
let me know if you still need some help ..
Regards
Manthan
2010 Feb 25 5:32 AM
Hai,
Try this. In this i have given u sample. Change according to your requirement.
DATA: ls_selfield TYPE slis_selfield,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'CALL_TCODE'
TABLES
t_outtab = it_output.
FORM call_tcode USING r_ucomm ls_selfield LIKE ls_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF ls_selfield-fieldname = 'ANLN1'. "ANLN1 is field name in your ALV Grid
CALL TRANSACTION 'AS03' AND SKIP FIRST SCREEN.
ENDIF.
Here u can give conditions for as many fields u want.
ENDCASE.
ENDFORM. " CALL_TCODE
Edited by: Prabu S on Feb 25, 2010 6:33 AM
2010 Feb 25 7:20 AM
Dear Prabu and Ram,
Both codes r working...
But when i m clicking on MATNR it is not getting appear in Material field in CK13N transaction..
I think i hv to use SET and GET parameter for this...
But I dont know the Parameter id for MATNR and AUFNR...
then i check table TPARA but there i also i didnot find ID's..
Can any of u help out?
Regards,
Apoorv
2010 Feb 25 7:26 AM
Hi Apoorv,
There is no standard parameter ID as such, you can define yours.
we had a similar requirement in our last company for Tendor Cost Request
CASE COMMAND.
WHEN '&IC1'. " for double click event
CLEAR WA.
READ TABLE IT_TCR INTO WA_TCR INDEX SELFIELD-TABINDEX .
SET PARAMETER ID: 'TCR' FIELD WA_TCR-TCRNO. " set your parameter ID here.. :-)
CALL TRANSACTION 'ZTCR_MPCHG'.
ENDCASE.Regards,
Sumit Nene ..
2010 Feb 25 7:36 AM
Dear Sumit,
I remember , but here the called transaction is not custom infact it is SAP-Std tcode .. COOISPI..
So i think i need to use GET parameter in PBO of that screen. But i hv one worry in doing so
will it affect std transaction when i will not call it from my ALV?
Regards,
Apoorv
2010 Feb 25 7:43 AM
In that case,
try this..
CALL TRANSACTION 'COOISPL' USING BDC_DATA " put the field name and field value of std t code in BDC_DATA
Regards,
Sumit
Edited by: Sumit Nene on Feb 25, 2010 8:44 AM
2010 Feb 25 10:41 AM
Hi,
To known Parameter Id of field :
1- Push cursor on the field
2- Push F1 to see help
3- push F9 (or technical information) to see technical data
---> You now can found parameter ID
For your example: In CK13N, the parameter ID for material is MAT.
Rgds
2010 Feb 26 4:35 AM
Dear Sumit,
Thanks !!! Now i think i can solve it..
I m allotting points to everyone, kindly check
Regards,
Apoorv
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |