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 report

Former Member
0 Kudos

Hi all,

i have a problem that,

when i am creating a interactive report normally we will display the details of basic list on a single field which is in vertical. but i need to display the details of secondary lists based on the basic list which is in horizontal.

normal basic list like

matnr

1231321

121698

15987

1785121

and while double click on matnr we can get the secondary list.

But in my case basic list is like

matnr quantity date

135154 4564 02.08.2006

while double click on matnr OR any other field, i need to display the secondary list.

Can anyone give suggestion on this.

Thanks in advance

Venkat

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Venkat,

If u want to write the basic list in the Vertical format then use the Write stmt like this.

Write:/ matnr,

/ MENGE,

/ ERDAT.

If useful reward.

vasanth

7 REPLIES 7

naimesh_patel
Active Contributor
0 Kudos

Hello,

Just hide your matnr after your first basic list.

Like

Loop at itab.

*write your list

w_matnr = itab-matnr.

hide w_matnr.

endloop.

at line-selection.

  • you have the value of the material of selected line in the w_matnr.

so access your table

read table itab with key matnr = w_mantr.

  • right data

Regards,

Naimesh

0 Kudos

use.

AT LINE-SELECTION.

PERFORM

Former Member
0 Kudos

Hello Venkat,

If u want to write the basic list in the Vertical format then use the Write stmt like this.

Write:/ matnr,

/ MENGE,

/ ERDAT.

If useful reward.

vasanth

Former Member
0 Kudos

Hi Venkat,

Try keyword GET CURSOR FIELD <FNAME> VALUE <FVAL>.

(FNAME AND FVAL Are to declared as string prior to this statement), now in variable fname, the field on which you clicked will be stored(for ex: itab-matnr) and in FVAL the value will be stored(R1234) and this key word u will be using in event AT LINE-SELECTION.

Regards:-

Santosh.

P.S. Mark usefull answers

Former Member
0 Kudos

Hello Venkat,

Display Secondary list like

Loop at

write:/ fields

Hide: matnr

endloop.

At New Selection.

Read particular double click line values from list using

Read line sy-lilli value into l_line

based on l_line material value read the data from data base table and display the secondary list

Former Member
0 Kudos

Hi Venkat,

Try this code:

Tables : Mara.

DATA: index type i.

***Select data from table here

***select * from mara where......

write/: mara-matnr .

hide : mara-MATKL,

mara-mtart,

mara-MEINS.

***Endselect.

AT line-selection.

write: mara-matkl, ' ' , mara-MEINS,' ' , mara-mtart.

Hope this helps,

Pragya

Former Member
0 Kudos

Hi Venkat ,

Check this sample code,


REPORT  ztest.

*Consider  a scenario when the user asks for Material Details(Table : MARA )
*displayed in one List and based on the Material selected he wants the corresponding
*Storage Location Data for that Material (Table : MARD ).


TABLES : mara.
TYPES :  BEGIN OF tp_mara,
         matnr TYPE mara-matnr,
         mtart TYPE mara-mtart,
         mbrsh TYPE mara-mbrsh,
         matkl TYPE mara-matkl,
         END OF tp_mara.


TYPES : BEGIN OF tp_marc,
        matnr TYPE marc-matnr,
        werks TYPE marc-werks,
        pstat TYPE marc-pstat,
        ekgrp TYPE marc-ekgrp,
        dispr TYPE marc-dispr,
        END OF tp_marc.


TYPES : BEGIN OF tp_mard,
        matnr TYPE mard-matnr,
        werks TYPE mard-werks,
        lgort TYPE mard-lgort,
        lfgja TYPE mard-lfgja,
        labst TYPE mard-labst,
        umlme TYPE mard-umlme,
        END OF tp_mard.

DATA : t_mara TYPE STANDARD TABLE OF tp_mara,
       t_marc TYPE STANDARD TABLE OF tp_marc,
       t_mard TYPE STANDARD TABLE OF tp_mard,
       wa_mara TYPE tp_mara,
       wa_marc TYPE tp_marc,
       wa_mard TYPE tp_mard.
DATA : w_werks TYPE werks .



SELECTION-SCREEN BEGIN OF BLOCK blck1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR mara-matnr.
PARAMETERS     : p_mtart TYPE mara-mtart .
SELECTION-SCREEN END OF BLOCK blck1.



START-OF-SELECTION.

*Collecting the material details form Table MARA

  SELECT matnr
         mtart
         mbrsh
         matkl
         FROM mara
         INTO TABLE t_mara
         UP TO 200 ROWS
         WHERE matnr IN s_matnr AND
               mtart EQ p_mtart.


END-OF-SELECTION.


*Now I am Dispalying the Material Details in the Primary List

  CLEAR wa_mara.
  LOOP AT t_mara INTO wa_mara.
    IF sy-tabix EQ 1.
      FORMAT INTENSIFIED ON.
      FORMAT COLOR COL_KEY.
      WRITE : /5(16)  'Material Number'.
      FORMAT COLOR COL_NORMAL.
      WRITE :          24(15) 'Material Type',
               40(18) 'Industry Sector',
               58(18) 'Material Group' .
    ENDIF.
    FORMAT INTENSIFIED OFF.
    FORMAT COLOR COL_KEY.
    WRITE : /5(16)   wa_mara-matnr.
    FORMAT COLOR COL_NORMAL.
    WRITE :  24(15)  wa_mara-mtart,
             40(18)  wa_mara-mbrsh,
             58(18)  wa_mara-matkl.


*You can assume some sort of buffer is created in the memory  and the values of
* wa_mara-matnr are put into it when you use the HIDE command

    HIDE wa_mara-matnr.


  ENDLOOP.


*Now when user Double clicks a line (AT LINE-SELECTION event is trigerred) and
*the line contents of the line selected and the contents buffered using
*command  interact and the value for the hidden variable is got into the variable
*refrenced using the HIDE command i.e..  wa_mara-matnr in our case

AT LINE-SELECTION.


  IF sy-lsind = 1.

    FORMAT INTENSIFIED ON.
    WRITE:     'Plant Data for Material  '  COLOR COL_NORMAL,
                35   wa_mara-matnr COLOR COL_TOTAL.

    REFRESH t_marc.

* Now I have the value of the Material in my hidden variable wa_mara-matnr
* Based on this I am selecting the Storage Location Data

    SELECT matnr
           werks
           pstat
           ekgrp
           dispr
           FROM marc
           INTO TABLE t_marc
           WHERE matnr = wa_mara-matnr.

    CLEAR wa_marc.
    FORMAT INTENSIFIED OFF.
    FORMAT COLOR COL_NORMAL.
    LOOP AT t_marc INTO wa_marc.

      IF sy-tabix EQ 1.

        FORMAT INTENSIFIED ON.
        FORMAT COLOR COL_NORMAL.
        WRITE :  /24(6)  'Plant',
                 30(22) 'Maintenance status',
                 52(20) 'Purchasing Group',
                 72(27)  'Material: MRP profile'.

      ENDIF.

      WRITE : /24(6)   wa_marc-werks,
               30(22)  wa_marc-pstat,
               52(20)  wa_marc-ekgrp,
               72(27) wa_marc-dispr.


      CLEAR wa_marc.

    ENDLOOP.

    SKIP 5.

    FORMAT INTENSIFIED ON.
    WRITE:     'Storage Data for Material  '  COLOR COL_NORMAL,
              35     wa_mara-matnr COLOR COL_TOTAL.
    REFRESH t_mard.
    SELECT matnr
           werks
           lgort
           lfgja
           labst
           umlme
           FROM mard
           INTO TABLE t_mard
           WHERE matnr = wa_mara-matnr.

    CLEAR wa_mard.
    FORMAT COLOR COL_NORMAL.


* Display the Storage Location Data in the Secondary List

    LOOP AT t_mard INTO wa_mard.

      IF sy-tabix EQ 1.

        FORMAT INTENSIFIED ON.
        FORMAT COLOR COL_NORMAL.
        WRITE :  /24(6)  'Plant',
                 30(20) 'Storage Location',
                 50(12) 'Fiscal Year',
                 62(15) 'Valuated stock',
                 77(20)    'Stock in transfer'.
      ENDIF.




      WRITE : /24(6)  wa_mard-werks,
               30(20) wa_mard-lgort,
               50(12)  wa_mard-lfgja,
               62(15) wa_mard-labst,
               77(20) wa_mard-labst.


    ENDLOOP.

  ENDIF.


Regards,

AS.