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: 

can u pelase tell me how to get in secondary list

Former Member
0 Kudos

actually i am displaying data for every month by totalling every day

yr1

jan 12

feb 13

.

.

dec 20

howevr the above data shows for every month quantity, as per the quantity(hotspot) i suppose to get the data for the respected material description of each quantity. thank u .

1 ACCEPTED SOLUTION

Manohar2u
Active Contributor
0 Kudos

To get for each day, you need to have another internal table with whole day wise data.

Then at <b>AT line sel</b>ection read the record with <b>get cursor</b> and pass the matnr and month to main internal table to display in secondary list.

Regds

Manohar

10 REPLIES 10

Former Member
0 Kudos

Hello,

Write ur code in the

AT line-selection Event.

If useful reward the points,

Regards,

Vasanth

Manohar2u
Active Contributor
0 Kudos

To get for each day, you need to have another internal table with whole day wise data.

Then at <b>AT line sel</b>ection read the record with <b>get cursor</b> and pass the matnr and month to main internal table to display in secondary list.

Regds

Manohar

madan_ullasa
Contributor
0 Kudos

hi krish,

u will have to code it under the event "at line selection".

u will also have to use "HIDE" command here. When you are looping in the table having these values in your basic list, use hide statement after write statement.

regards,

Madan...

Former Member
0 Kudos

hi manohar can u detail me some what. or if possible give me an example.

Former Member
0 Kudos

Hi Krish,

This is the example for interactive rep having two secondary lists..once you get into the basic list click on the mat no it will take you to the next screen and so on we can have around 20 secondary lists.

REPORT ZINTERACTIVE_REPORT .

TABLES: MARA,MARC,MARD.

SELECT-OPTIONS: SMATNR FOR MARA-MATNR.

***********************************************************

  • INITIALIZATION.

***********************************************************

INITIALIZATION.

SMATNR-LOW = '1300-1400'.

SMATNR-HIGH = '1300-2000'.

SMATNR-SIGN = 'I'.

SMATNR-OPTION = 'BT'.

APPEND SMATNR.

***********************************************************

  • START-OF-SELECTION.

***********************************************************

START-OF-SELECTION.

WRITE:/10 'MATERIAL NO',25 'PLANT LOCATION',45 'STORAGE LOCATION'.

ULINE.

SELECT * FROM MARA WHERE MATNR IN SMATNR.

WRITE:/10 MARA-MATNR,30 MARA-MBRSH,50 MARA-MTART.

HIDE MARA-MBRSH.

ENDSELECT.

***********************************************************

  • AT LINE-SELECTION.

***********************************************************

AT LINE-SELECTION.

IF SY-LSIND EQ 1.

SELECT * FROM MARC WHERE MATNR EQ MARA-MATNR.

WRITE:/ MARC-MATNR,MARC-WERKS.

HIDE MARC-MATNR.

ENDSELECT.

ENDIF.

IF SY-LSIND EQ 2.

SELECT * FROM MARD WHERE WERKS EQ MARC-WERKS.

WRITE:/10 MARD-MATNR, 25 MARD-WERKS,45 MARD-LGORT.

HIDE MARD-MATNR.

ENDSELECT.

ENDIF.

***********************************************************

  • TOP-OF-PAGE DURING LINE-SELECTION.

***********************************************************

TOP-OF-PAGE DURING LINE-SELECTION.

IF SY-LSIND EQ 1.

WRITE:/1 'MATERIAL NO',15 'PLANT LOCATION'.

ULINE.

ENDIF.

TOP-OF-PAGE DURING LINE-SELECTION.

IF SY-LSIND EQ 2.

WRITE:/10 'MATERIAL NO',25 'PLANT LOCATION',45 'STORAGE LOCATION'.

ENDIF.

Please reward points if you find this as a right solution

Regards,

Harini

Former Member
0 Kudos

Hai Krish

Interactive Report

A simple report or even a classical report displays a clustered list with all the requested output at one go.

What ever it is displayed, it is final. That means, the user can not interact with with that list.

A simple report or even a classical report displays a clustered list with all the requested output at one go.

What ever it is displayed, it is final. That means, the user can not interact with with that list.

In the interactive reports, we can create as many as 21 lists.

The first list is called ‘Basic list’ and all the successive lists are called ‘Secondary lists’. Each list is again an interactive.

The Basic list is not deleted when secondary list is created.

A secondary list may either overlay the basic list or appear in an additional dialog window on the same screen.

The system variable associated with list number is ‘SY-LSIND’.

For basic list SY-LSIND = 0 and for secondary lists, SY-LSIND varies from 1 to 20.

User can interact with the list by the following ways.

Double clicking or single click and pressing F2 (function key) or single click with ‘hotspot on’.

OR

Selecting from menu bar or from application tool bar.

All the events used in classical reports can be used in Basic List.

The event ‘End-of-page’ can be used in Secondary Lists also.(the other six events can not be used in secondary lists)

You can not place ‘select-options’ in secondary lists.

The following additional events are

applicable to secondary lists.

Top-of-page during line-selection.

At line-selection.

At user-command.

When you double click on any field in the basic list, you will be navigating to secondary list with detailed information pertaining to clicked field.

As such we need to store the clicked field information at some variable.

‘Hide’ temporarily stores the content of clicked field for later use.

The default title of the out put is the text what we enter during creation of program.

This title can be changed using:

SET TITLEBAR ‘AAA’.

GUI status includes:

Menu bar

Application tool bar and

Activating standard tool bar

GUI status can be created using

SET PF-STATUS ‘BBB’.

You can have 8 menus ( out of which, 2 menus are reserved for ‘System’ and ‘Help’).

Each menu can have 15 menu items.

Each menu item can have 3 levels of submenus.

You can create 35 items in application tool bar.

Thanks & regards

Sreeni

Former Member
0 Kudos

Hi Krish,

U will have to code it under the event "at line selection".

u will also have to use "HIDE" command here.

When you are looping in the table having these values in your basic list, use hide statement after write statement.

Can refer to the following code :-

DATA TEXT(20).

START-OF-SELECTION.

PERFORM WRITE_AND_HIDE USING SPACE SPACE.

<b>

AT LINE-SELECTION.

</b>

CASE TEXT.

WHEN 'List index'.

PERFORM WRITE_AND_HIDE USING 'X' SPACE.

WHEN 'User command'.

PERFORM WRITE_AND_HIDE USING SPACE 'X'.

WHEN OTHERS.

SUBTRACT 2 FROM SY-LSIND.

PERFORM WRITE_AND_HIDE USING SPACE SPACE.

ENDCASE.

CLEAR TEXT.

FORM WRITE_AND_HIDE USING P_FLAG_LSIND P_FLAG_UCOMM.

WRITE / 'SY-LSIND:'.

PERFORM WRITE_WITH_COLOR USING SY-LSIND P_FLAG_LSIND.

TEXT = 'List index'.

<b>

HIDE TEXT.

</b>

WRITE / 'SY-UCOMM:'.

PERFORM WRITE_WITH_COLOR USING SY-UCOMM P_FLAG_UCOMM.

TEXT = 'User command'.

HIDE TEXT.

IF SY-LSIND > 0.

WRITE / 'PICK here to go back one list level'.

ENDIF.

ENDFORM.

FORM WRITE_WITH_COLOR USING P_VALUE

P_FLAG_POSITIVE.

IF P_FLAG_POSITIVE = SPACE.

WRITE P_VALUE COLOR COL_NORMAL.

ELSE.

WRITE P_VALUE COLOR COL_POSITIVE.

ENDIF.

ENDFORM.

Hope this will help u,

Cheers,

Anirban.

Message was edited by: Anirban Dutta

Manohar2u
Active Contributor
0 Kudos

Refer to this simple interactive report, copy paste and run.

REPORT  YMANO_TEST                              .

data : begin of itab occurs 0,
       mon(10) type c,
       qty type i,
       end of itab.
data : begin of itab1 occurs 0,
       mon(10) type c,
       dat like sy-datum,
       qty type i,
       end of itab1.

start-of-selection.

  itab-mon = 'Jan'.
  itab-qty = 100.
  append itab.

  itab-mon = 'Feb'.
  itab-qty = 100.
  append itab.

  itab-mon = 'Mar'.
  itab-qty = 100.
  append itab.

  itab1-mon = 'Jan'.
  itab1-dat = '20060101'.
  itab1-qty = 50.
  append itab1.

  itab1-mon = 'Jan'.
  itab1-dat = '20060111'.
  itab1-qty = 50.
  append itab1.


  loop at itab.
    write 😕 itab-mon, itab-qty.
    hide itab.
  endloop.

AT LINE-SELECTION.
  loop at itab1 where mon = itab-mon.
    write 😕 itab1-mon, itab1-dat, itab1-qty.
  endloop.

Regds

Manohar

Former Member
0 Kudos

Hi Krish

Please see the code below..This will help You

*Tables used in the Program.

tables: ztemp_mnt068, zdept_mnt068.

*DATA DECLARATION.

data: it1 like ztemp_mnt068 occurs 10 with header line,

it2 like zdept_mnt068 occurs 10 with header line.

*MAIN PROCESSING LOGIC

start-of-selection.

select * from zdept_mnt068 into table it2.

sort it2 by dept.

loop at it2.

at first.

write: / 'Dept',

20'Location'.

uline.

endat.

write: / it2-dept,

20 it2-deptloc.

  • Storing the value of the output field.

hide: it2-dept, it2-deptloc.

endloop.

top-of-page during line-selection.

write: 'Department-wise Employee Report'.

skip.

uline.

skip.

at line-selection.

select * from ztemp_mnt068 into table it1

where dept = it2-dept.

loop at it1.

at first.

write: / 'Dept',

20'Code',

35'Name',

55'Salary'.

uline.

endat.

  • Displaying Secondary List

write: / it1-dept,

20 it1-code,

35 it1-name,

55 it1-salary.

clear it1.

endloop.

Thanks and Regards

Former Member
0 Kudos

Hi Krish,

Consider this Code.

Note : Have a HOTSPOT on Month and not on Quantity, simple reason that Months are unique(only 12).


REPORT zarun_2.

*Internal Table for Primary List
DATA : BEGIN OF it_basic OCCURS 0,
       month(3) TYPE c,
       quan     TYPE p DECIMALS 2,
       END OF it_basic.

*Internal Table for Secondary List
DATA : BEGIN OF it_secondary OCCURS 0,
       month(3)   TYPE c,
       matl     TYPE mara-matnr,
       quan     TYPE p DECIMALS 2,
       END OF it_secondary.


START-OF-SELECTION.

  it_basic-month = 'JAN'.
  it_basic-quan  = '133.50'.
  APPEND it_basic.
  CLEAR it_basic.

  it_basic-month = 'FEB'.
  it_basic-quan  = '120.50'.
  APPEND it_basic.
  CLEAR it_basic.


  it_secondary-month = 'JAN'.
  it_secondary-matl  = 'MATERIAL1'.
  it_secondary-quan  = '100.50'.
  APPEND it_secondary.
  CLEAR it_secondary.

  it_secondary-month = 'JAN'.
  it_secondary-matl  = 'MATERIAL2'.
  it_secondary-quan  = '33.50'.
  APPEND it_secondary.
  CLEAR it_secondary.



  it_secondary-month = 'FEB'.
  it_secondary-matl  = 'MATERIAL3'.
  it_secondary-quan  = '110.50'.
  APPEND it_secondary.
  CLEAR it_secondary.

  it_secondary-month = 'FEB'.
  it_secondary-matl  = 'MATERIAL4'.
  it_secondary-quan  = '10.00'.
  APPEND it_secondary.
  CLEAR it_secondary.

  FORMAT COLOR  COL_HEADING  ON.
  WRITE : / 'BASIC LIST'.
  FORMAT COLOR  COL_HEADING  OFF.
  SKIP 3.

  LOOP AT it_basic.
*Have a Hot Spot on Month not on Quantity(Months are Unique only 12)

    FORMAT HOTSPOT ON.
    WRITE : / it_basic-month.
    FORMAT HOTSPOT OFF.
    WRITE        it_basic-quan.

 <b>   HIDE it_basic.</b> "Dont forget this
  ENDLOOP.


AT LINE-SELECTION .

  IF sy-lsind EQ 1.  "Only single Drill Down taken care

    FORMAT COLOR  COL_HEADING  ON.
    WRITE : / 'SECONDARY LIST'.
    FORMAT COLOR  COL_HEADING  OFF.
    SKIP 3.
    LOOP AT it_secondary WHERE  month = it_basic-month.

      IF sy-tabix EQ 1.      "To write Month Details(Only once)

        FORMAT COLOR COL_NORMAL INTENSIFIED ON .
        WRITE : / 'MONTH : ',
                   it_secondary-month.

        FORMAT COLOR COL_NORMAL  INTENSIFIED OFF.
        SKIP 2.
      ENDIF.

      WRITE : / it_secondary-matl,
            it_secondary-quan.
    ENDLOOP.

  ENDIF.

Regards,

Arun Sambargi.

Message was edited by: Arun Sambargi