Application Development 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: 

INTERACTIVE LISTS

Former Member
0 Kudos
159

Hi Experts,

I created a material plant and storage report.

When i click on material index its navigating to plant details using select query and when i click on plant details am getting storage details.

But my requirement is if i select one material on basic list i should get plant details of that particular material.

i used sy-lsind = 1.

Kindly resolve this issue.

if sy-listi = 1.

select matnr

werks

ekgrp

from marc

into table i_marc

where matnr = i_mara-matnr.

loop at i_marc.

write : /5 i_marc-matnr , 15 i_marc-werks, 25 i_marc-ekgrp.

endloop.

elseif sy-listi = 2.

select matnr

werks

lgort

from mard

into table i_mard

where werks = i_marc-werks.

loop at i_mard.

write : / i_mard-werks , i_mard-lgort.

endloop.

endif.

Warm Regards,

Vishwa

1 ACCEPTED SOLUTION

Former Member
0 Kudos
119

Hi,

What method are you using to capture user selection.

Get Cursor or Hide.

Cheers.

6 REPLIES 6

former_member233090
Active Contributor
0 Kudos
119

REPORT  zintractive                             .

TYPES : BEGIN OF str_mard,
        matnr TYPE mard-matnr,
        lgort TYPE mard-lgort,
        werks TYPE mard-werks,
        END OF str_mard.

DATA : wa_mard TYPE str_mard,
       it_mard TYPE TABLE OF str_mard.

TYPES : BEGIN OF str_makt,
        matnr TYPE makt-matnr,
        maktg TYPE makt-maktg,

        END OF str_makt.

DATA : wa_makt TYPE str_makt,
       it_makt TYPE TABLE OF str_makt.

TYPES : BEGIN OF str_mara,
        matnr TYPE mara-matnr,
        ersda TYPE mara-ersda,
        ernam TYPE mara-ernam,
        laeda TYPE mara-laeda,
        mtart TYPE mara-mtart,
        matkl TYPE mara-matkl,
        meins TYPE mara-meins,
        END OF str_mara.

DATA : wa_mara TYPE str_mara,
       it_mara TYPE TABLE OF str_mara.

TYPES : BEGIN OF str_final,
       matnr TYPE mara-matnr,
       ersda TYPE mara-ersda,
       ernam TYPE mara-ernam,
       laeda TYPE mara-laeda,
       mtart TYPE mara-mtart,
       matkl TYPE mara-matkl,
       meins TYPE mara-meins,
       lgort TYPE mard-lgort,
       werks TYPE mard-werks,
       END OF str_final.

DATA: wa_final TYPE str_final,
      it_final TYPE TABLE OF str_final.

PARAMETERS : plant TYPE mard-werks,
             stor LIKE mard-lgort.

SELECT matnr lgort werks
FROM mard
INTO TABLE  it_mard
WHERE lgort = stor AND werks = plant.
.

SELECT  matnr maktg
FROM makt
INTO TABLE  it_makt FOR ALL ENTRIES IN it_mard
WHERE matnr = it_mard-matnr AND spras = 'E'.

SELECT matnr ersda ernam  laeda mtart matkl meins
FROM mara
INTO TABLE it_mara FOR ALL ENTRIES IN it_makt
WHERE matnr = it_makt-matnr.

LOOP AT it_makt INTO wa_makt.
  WRITE : /1 wa_makt-matnr COLOR 1,
          40 wa_makt-maktg COLOR 2.
  *HIDE wa_makt-matnr*.------------------------------------------->*must for interactive report*
ENDLOOP.

CLEAR wa_mard-matnr.

AT LINE-SELECTION.
  REFRESH it_final.
  CLEAR wa_final.
  ULINE.
  IF sy-lsind = 1.
    WRITE :  /1 'MATERIAL NO' COLOR 2,
             20 'CREATION DATE' COLOR 3,
             32 'PERSON CREATED',
             50 'DATE OF LIST' ,
             65 'MATERIALTYPE',
             80 'MATGROUP' ,
             90 'UNITOFMEASURE',
             110 'STORLOCATION' COLOR 4,
             130   'PLANT' COLOR 5.
    ULINE.
  ENDIF.

  LOOP AT it_mara INTO wa_mara WHERE matnr = wa_makt-matnr.

    wa_final-matnr = wa_mara-matnr.
    wa_final-ersda = wa_mara-ersda.
    wa_final-ernam = wa_mara-ernam.
    wa_final-laeda = wa_mara-laeda.
    wa_final-mtart = wa_mara-mtart.
    wa_final-matkl = wa_mara-matkl.
    wa_final-meins = wa_mara-meins.

    READ TABLE it_mard INTO wa_mard WITH KEY matnr = wa_makt-matnr.

    wa_final-lgort = wa_mard-lgort.
    wa_final-werks = wa_mard-werks.

    APPEND  wa_final TO it_final.

  ENDLOOP.

  LOOP AT it_final INTO wa_final.

    WRITE :  /1  wa_final-matnr COLOR 2,
             20 wa_final-ersda COLOR 3,
             37 wa_final-ernam,
             50 wa_final-laeda ,
             70 wa_final-mtart ,
             85 wa_final-matkl ,
             95 wa_final-meins,
             115   wa_final-lgort COLOR 4,
             130   wa_final-werks COLOR 5.
  ENDLOOP.

TOP-OF-PAGE.
  WRITE : /1 'MATERIAL NO' COLOR 1,
         40  'DISCRIPTION' COLOR 2.
  ULINE .

cheers,

Bhavana

Edited by: Bhavana Amar on Aug 6, 2010 3:34 PM

Edited by: Bhavana Amar on Aug 6, 2010 3:35 PM

Former Member
0 Kudos
120

Hi,

What method are you using to capture user selection.

Get Cursor or Hide.

Cheers.

0 Kudos
119

Hi,

I dint use any GET CURSOR.

Regards,

Vishwa

0 Kudos
119

Hi,

Use the Hide statement

0 Kudos
119

Hi,

I have the same program and thats what i have posted it dunno why it is not posting properly

use sy-lsind and hide statement

case sy-lsind.

when '1'.

select stmt....

loop at internal table

write your first list and then add the Hide statement here(This should be that value where you want to click on basic list)

endloop

when '2'

samething

Cheers,

Bhavana

0 Kudos
119

Hi Bhavana,

<removed by moderator>

Regards,

Vishwa

Edited by: Thomas Zloch on Aug 6, 2010 2:03 PM - do not ask for personal information