‎2009 Jun 03 7:11 AM
Hi All,
In ALV, By Clicking a Particular Field I call another one Report using SUBMIT by passing the clicked field as input. It is working fine and i got the Correct Result. But when i click 'BACK' Button the input screen of that report is shown. I want to skip the initial screen of that report and cme to the ALV Screen of the Original Report. Can anyone Help me to cme out.
Thanks in Advance,
Vimal
‎2009 Jun 03 7:19 AM
Hi,
Try this coding,
TYPE-POOLS : SLIS.
tables : mara,makt,RF42B,sscrfields.
*NODES.
data : field type slis_fieldcat_alv,
fieldcat type slis_t_fieldcat_alv.
data : layout type slis_layout_alv,
lay type slis_layout_alv_spec1.
data : heading TYPE slis_t_listheader,
SM_EVENT TYPE SLIS_T_EVENT,
WA_SM_EVENT TYPE SLIS_ALV_EVENT.
data : begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
matkl like mara-matkl,
end of itab.
data : field1(30).
*----------------------------------------------------------------*
*---------------------------------------------------------------------*
selection-screen : begin of block abc with frame title a1.
selection-screen : skip.
select-options : matnr for mara-matnr memory id MAT,matkl for mara-matkl.
*select-options: maktx for makt-maktx.
selection-screen : skip.
selection-screen : end of block abc.
*---------------------------------------------------------------------*
selection-screen : function key 1,
function key 2.
*---------------------------------------------------------------------*
initialization .
a1 = 'Selection-Screen'.
sscrfields-functxt_01 = text-001.
sscrfields-functxt_02 = text-002.
*---------------------------------------------------------------------*
at selection-screen.
case SSCRFIELDS-UCOMM.
when 'FC01'.
leave program.
when 'FC02'.
call transaction 'MM03'.
endcase.
*---------------------------------------------------------------------*1st part...
‎2009 Jun 03 7:19 AM
Hi,
Try this coding,
TYPE-POOLS : SLIS.
tables : mara,makt,RF42B,sscrfields.
*NODES.
data : field type slis_fieldcat_alv,
fieldcat type slis_t_fieldcat_alv.
data : layout type slis_layout_alv,
lay type slis_layout_alv_spec1.
data : heading TYPE slis_t_listheader,
SM_EVENT TYPE SLIS_T_EVENT,
WA_SM_EVENT TYPE SLIS_ALV_EVENT.
data : begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
matkl like mara-matkl,
end of itab.
data : field1(30).
*----------------------------------------------------------------*
*---------------------------------------------------------------------*
selection-screen : begin of block abc with frame title a1.
selection-screen : skip.
select-options : matnr for mara-matnr memory id MAT,matkl for mara-matkl.
*select-options: maktx for makt-maktx.
selection-screen : skip.
selection-screen : end of block abc.
*---------------------------------------------------------------------*
selection-screen : function key 1,
function key 2.
*---------------------------------------------------------------------*
initialization .
a1 = 'Selection-Screen'.
sscrfields-functxt_01 = text-001.
sscrfields-functxt_02 = text-002.
*---------------------------------------------------------------------*
at selection-screen.
case SSCRFIELDS-UCOMM.
when 'FC01'.
leave program.
when 'FC02'.
call transaction 'MM03'.
endcase.
*---------------------------------------------------------------------*1st part...
‎2009 Jun 03 7:20 AM
2nd part...
start-of-selection.
select matnr matkl from mara into corresponding fields of itab
where matnr in matnr.
append itab.
endselect.
loop at itab.
select maktx from makt into itab-maktx
where matnr = itab-matnr.
modify itab.
endselect.
endloop.
layout-zebra = 'X'.
layout-colwidth_optimize = 'X'.
layout-detail_popup = 'X'.
*layout-CONFIRMATION_PROMPT = 'X'.
layout-COLWIDTH_OPTIMIZE = 'X'.
layout-no_input = 'X'.
CLEAR WA_SM_EVENT.
WA_SM_EVENT-NAME = 'TOP_OF_LIST'.
WA_SM_EVENT-FORM = 'TOP_OF_LIST'.
APPEND WA_SM_EVENT TO SM_EVENT.
field-col_pos = '1'.
field-fieldname = 'MAKTX'.
field-seltext_l = 'Material Desc'.
field-outputlen = '40'.
append field to fieldcat.
clear field.
field-col_pos = '2'.
field-fieldname = 'MATKL'.
field-seltext_l = 'Material Grp'.
field-outputlen = '40'.
append field to fieldcat.
clear field.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_USER_COMMAND = 'PICK'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDCAT
I_DEFAULT = 'X'
I_SAVE = 'A'
* IS_VARIANT =
IT_EVENTS = SM_EVENT
TABLES
T_OUTTAB = ITAB
.
IF sy-subrc <> 0.
ENDIF.
FORM PICK USING COMMAND LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
READ TABLE ITAB INDEX SELFIELD-TABINDEX.
CASE COMMAND.
WHEN '&IC1'.
GET CURSOR FIELD field1.
CHECK field1 EQ 'ITAB-MATNR'.
SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDCASE .Regards,
Nikhil.
Edited by: Nikhil Kanegaonkar on Jun 3, 2009 8:20 AM
‎2009 Jun 03 7:20 AM
Hi,
After submit use Return statment as below
SUBMIT {rep|(name)} [selscreen_options] AND RETURN.
‎2009 Jun 03 7:22 AM
It depends how you are using SUBMIT.
Try this : ... USING SELECTION-SCREEN dynnr and return.
‎2009 Jun 03 7:37 AM
Dear Vimal,
Try this..
Call transaction 'Tcode' and skip first screen.
Before this pass input to this t-code with the help of parameter id.
Hope this will help you.
Regards,
Vijay
‎2009 Jun 03 7:42 AM
Hi,
I m not asking about calling Transaction i wants to call a report using SUBMIT.
submit with selection-table seltab and return. this is for entering into another report not transaction.
after seeing output, while press 'BACK' it is not skip the first screen of rep_name1. How can i skip that?
Edited by: Vimal Raj on Jun 3, 2009 8:44 AM
‎2009 Jun 03 7:48 AM
Hi,
Assign a tcode and call the report using CALL TRANSACTION....AND AND SKIP FIRST SCREEN after setting the required parameter ids.
Check whether its coming back directly to the alv or not, because i have used the same to call a standard tcode and its coming back directly to the alv.
Regards
Karthik D
‎2009 Jun 03 7:52 AM
Dear Vimalraj,
In the case statement of 'BACK' button,
When 'BACK'.
SET SCREEN 3000.
LEAVE PROGRAM.Where 3000 is the screen number of the alv display.
If this is not working, please send in your code so that we can find the mistake.
Thanks and regards,
SakthiSri.
‎2009 Jun 03 7:53 AM
Hi Vimal again,
Sorry dear, i have missed the things.
Let's try this..
SUBMIT pgm_name AND RETURN.
Regards,
Vijay
‎2009 Jun 03 7:51 AM
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_USER_COMMAND = 'PICK'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDCAT
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = SM_EVENT
TABLES
T_OUTTAB = ITAB
.
IF sy-subrc 0.
ENDIF.
FORM PICK USING COMMAND LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
READ TABLE ITAB INDEX SELFIELD-TABINDEX.
CASE COMMAND.
WHEN '&IC1'.
GET CURSOR FIELD field1.
CHECK field1 EQ 'ITAB-MATNR'.
SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
**when 'BACK'.**
**LEAVE TO LIST-PROCESSING.**
ENDCASE .
‎2009 Jun 03 8:12 AM
loop at itp_draw1 into wap_draw1.
wa_seltab-selname = 'STDOKNR'.
wa_seltab-kind = 'S'.
wa_seltab-sign = 'I'..
wa_seltab-option = 'EQ'.
wa_seltab-low = wap_draw1-doknr..
append wa_seltab to seltab.
clear: wa_seltab.
clear: wap_draw1.
endloop.
wa_seltab-selname = 'STDOKAR'.
wa_seltab-kind = 'S'.
wa_seltab-sign = 'I'.
wa_seltab-option = 'EQ'.
wa_seltab-low = 'PDF'.
append wa_seltab to seltab.
clear: wa_seltab.
SUBMIT zplm_document_latest_revision WITH SELECTION-TABLE seltab AND RETURN.
**********************************
STDOKNR & STDOKAR are the inputs for rep1.
After clicking my ALV it skipped the input screen of rep1 and displays the output. Once i press 'BACK' Button in rep1's ALV, It should not go to the inputscreen of rep1 and it cme to the Interactive ALV again. wt is the solution for that?
Hope u Understood my scenario.
‎2009 Jun 03 9:36 AM
Also paste ur code along with your Qn.
check with this !!!
DATA:l_mblnr TYPE mseg-mblnr.
IF cursor-fieldname EQ 'MBLNR'.
READ TABLE it_mseg3 INTO wa_mseg3 INDEX cursor-tabindex.
IF sy-subrc EQ 0.
l_mblnr = wa_mseg3-mblnr.
ENDIF.
SET PARAMETER ID 'MBN' FIELD l_mblnr.
CALL TRANSACTION 'MB03' AND SKIP FIRST SCREEN.
ENDIF.