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

Interactive ALV Issue

Former Member
0 Likes
1,222

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,182

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...

12 REPLIES 12
Read only

Former Member
0 Likes
1,183

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...

Read only

0 Likes
1,182

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

Read only

Former Member
0 Likes
1,182

Hi,

After submit use Return statment as below

SUBMIT {rep|(name)} [selscreen_options] AND RETURN.

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,182

It depends how you are using SUBMIT.

Try this : ... USING SELECTION-SCREEN dynnr and return.

Read only

Former Member
0 Likes
1,182

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

Read only

Former Member
0 Likes
1,182

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

Read only

0 Likes
1,182

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

Read only

0 Likes
1,182

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.

Read only

0 Likes
1,182

Hi Vimal again,

Sorry dear, i have missed the things.

Let's try this..

SUBMIT pgm_name AND RETURN.

Regards,

Vijay

Read only

Former Member
0 Likes
1,182

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 .

Read only

Former Member
0 Likes
1,182

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.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,182

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.