‎2008 Jun 24 10:51 AM
Hi Guru,
I have one header in my output in which I have Material Documnet Number. If I click on that It should call FB03 transaction.
Can we do that, if yes then pls suggest me.
Points will be rewarderd.
Thanks,
Sandeep Garg
‎2008 Jun 24 10:52 AM
ya
u can do this
in transaction fb03 for material document number find out the parameter id for that.
fill the parameter id
using syntax
SET PARAMATER ID 'wrk' field
and
call using method
Call transaction 'FBO3'
or
CALL TRANSACTION <tcod> AND SKIP FIRST SCREEN
Regards,
priya
‎2008 Jun 24 10:54 AM
‎2008 Jun 24 10:58 AM
u have to use.... like below..
SET PARAMETER ID 'INF' FIELD l_pir.
SET PARAMETER ID 'LIF' FIELD l_line+10(10).
SET PARAMETER ID 'MAT' FIELD l_line+23(18).
SET PARAMETER ID 'EKO' FIELD 'NA'.
SET PARAMETER ID 'WRK' FIELD l_line+44(4).
CALL TRANSACTION 'ME13'.
SET PARAMETER are used to set the values for the parameters for the transaction called...
Edited by: Amitava De on Jun 24, 2008 3:28 PM
‎2008 Jun 24 11:06 AM
Hi,
I will give you a sample code in which on click of a record its calling tcode mm03.Its an ALV report.
***************************************************
*&----
*
*& Report ZSAND_SUBTOTAL *
*& *
&----
*& *
*& *
&----
REPORT ZSAND_SUBTOTAL LINE-COUNT 65 .
*&----
*& Report ZALV_LIST
*&
*&----
*&
*&
*&----
TABLES : mseg.
TYPE-POOLS : slis.
DATA : BEGIN OF itab OCCURS 0,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
menge LIKE mseg-menge,
line_color(4) TYPE c,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
menge LIKE mseg-menge,
line_color(4) TYPE c,
END OF itab1.
data: it_sortcat type slis_sortinfo_alv occurs 1,
wa_sort like line of it_sortcat.
DATA: it_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
data: var1(1).
DATA var2.
data:mytabix like sy-tabix.
data:wtab1 like line of itab,
wtab2 like line of itab.
DATA : t_fcat TYPE slis_t_fieldcat_alv,
t_eve TYPE slis_t_event,
t_subtot TYPE slis_t_sortinfo_alv,
subtot LIKE LINE OF t_subtot,
wa_fcat LIKE LINE OF t_fcat,
gd_layout TYPE slis_layout_alv.
DATA : gt_menge LIKE mseg-menge,
st_menge LIKE mseg-menge.
data:it_extab type SLIS_t_EXTAB,
wa_extab like line of it_extab.
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : doc FOR mseg-mblnr.
SELECTION-SCREEN : END OF BLOCK blk1.
START-OF-SELECTION.
PERFORM build_cat USING t_fcat.
PERFORM build_layout.
PERFORM build_eve.
perform fill_sort.
PERFORM get_data.
PERFORM display.
*&----
*& Form build_cat
*&----
*text
*----
*-->TEMP_FCAT text
*----
FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MBLNR'.
wa_fcat-seltext_m = 'Material Doc.'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-seltext_m = 'Material'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'WERKS'.
wa_fcat-seltext_m = 'Plant'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MENGE'.
wa_fcat-seltext_m = 'Quantity'.
wa_fcat-do_sum = 'Y'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
ENDFORM. "build_cat
*&----
*& Form build_eve
*&----
*text
*----
FORM build_eve.
DATA : wa_eve TYPE slis_alv_event.
data:mytabix type sy-tabix.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = t_eve
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc <> 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE t_eve into wa_eve WITH KEY name = slis_ev_top_of_page.
*INTO wa_eve.
IF sy-subrc = 0.
mytabix = sy-tabix.
MOVE 'TOP_OF_PAGE' TO wa_eve-form.
append wa_eve to t_eve.
*modify t_eve from wa_eve index mytabix transporting form.
ENDIF.
READ TABLE t_eve into wa_eve WITH KEY name = slis_ev_end_of_page.
*INTO wa_eve.
IF sy-subrc = 0.
mytabix = sy-tabix.
MOVE 'END_OF_PAGE' TO wa_eve-form.
append wa_eve to t_eve.
*modify t_eve from wa_eve index mytabix transporting form.
ENDIF.
ENDFORM. "build_eve
*&----
*& Form build_layout
*&----
*text
*----
FORM build_layout.
*gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-info_fieldname = 'LINE_COLOR'.
gd_layout-subtotals_text = 'SUBTOTAL'.
*gd_layout-totals_text = 'TOTAL'.
gd_layout-EDIT = 'X'.
ENDFORM. " BUILD_LAYOUT
*&----
*& Form get_data
*&----
*text
*----
FORM get_data.
SELECT mblnr matnr werks menge FROM mseg INTO CORRESPONDING FIELDS OF
TABLE itab
WHERE mblnr IN doc.
SORT itab BY mblnr.
sort itab by mblnr matnr.
read table itab into wtab1 index 1.
mytabix = 1.
loop at itab into wtab2 from 2.
if wtab1-mblnr = wtab2-mblnr and wtab1-matnr = wtab2-matnr.
wtab1-menge = wtab1-menge + wtab2-menge.
modify itab from wtab1 index mytabix.
else.
modify itab from wtab1 index mytabix.
clear wtab1.
mytabix = sy-tabix.
move wtab2 to wtab1.
endif.
clear wtab2.
endloop.
delete ADJACENT DUPLICATES from itab comparing mblnr matnr.
ENDFORM. "get_data
*&----
*& Form display
*&----
*text
*----
FORM display.
*
wa_extab-fcode = '&ETA'.
append wa_extab to it_extab.
wa_header-typ = 'H'.
wa_header-info = 'SANDY is Great'.
append wa_header to it_header.
clear wa_header.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZSAND_SUBTOTAL'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USERCOMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = gd_layout
IT_FIELDCAT = t_fcat
IT_EXCLUDING = it_extab
IT_SPECIAL_GROUPS =
IT_SORT = it_sortcat
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = t_eve[]
IT_EVENT_EXIT = 'BUILD_EVE'
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = itab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "display
*
**&----
***& Form top_of_page
*&----
*
*text
*----
FORM top_of_page.
if var1 is initial.
wa_header-typ = 'H'.
wa_header-info = 'SANDY is Great'.
append wa_header to it_header.
clear wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = it_header
I_LOGO = 'HR_LOGO'
I_END_OF_LIST_GRID =
.
var1 = 'X'.
endif.
ENDFORM. "top_of_page
FORM end_of_page.
if var2 is initial.
wa_header-typ = 'H'.
wa_header-info = 'SANDY is Great'.
append wa_header to it_header.
clear wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = it_header
I_LOGO = 'HR_LOGO'
I_END_OF_LIST_GRID =
.
var2 = 'X'.
endif.
ENDFORM. "top_of_page
&----
*& Form fill_sort
&----
text
----
--> p1 text
<-- p2 text
----
form fill_sort .
wa_sort-spos = 1.
wa_sort-fieldname = 'MBLNR'.
wa_sort-SUBTOT = 'X'. "subtotals any totals column by this field
gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
wa_sort-spos = 2.
wa_sort-fieldname = 'MATNR'.
gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
endform. " fill_sort
FORM status USING rt_extab TYPE slis_t_extab.
set pf-status 'ZSTANDARD'.
endform.
form USERCOMMAND USING R_UCOMM type sy-ucomm
rselfield type slis_selfield .
set parameter id 'MAT' field rselfield-value .
call transaction 'MM03' and skip first screen.
endform.
I hope this will help you.
Help children of U.N World Food Program by rewarding points and encourage others to answer your queries.
‎2008 Jun 24 11:06 AM
Hi Sandeep,
First of all find what are the parameters used in the transaction.
Then set the PARAMETER ID for the respective transaction.
Then Call Transaction <XXXXX> skip first screen.
&*******************Reward Point if helpful******************&
‎2008 Jun 24 11:16 AM
ya,
u can do that..using the command...
CALL TRANSACTION <tcod><additions>.
Regards,
Bhumika
‎2008 Jun 24 11:19 AM
hi ,
very easy man.
if u r using ALV ..thein in the REUSE_ALV_GRID_DISPLAY
u have a paremeter USER COMMAND..THEN PUT USER COMMAND IN SINGLE QUOTES.
AND THEN
&----
*& Form SET_USER_COMMAND
&----
text
-
FORM SET_USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_mara INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
set parameter id 'BLN' FIELD RS_SELFIELD-.
CALL TRANSACTION FB03 AND SKIP FIRST SCREEN
ENDCASE.
ENDFORM. "SET_USER_COMMAND
Rewarsd ponts if useful
regrads
parthu