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 List

Former Member
0 Likes
1,504

HI,

I need to display ALV list with employee details and if i double click on any of the row,then i have to display the manager details of that employee in an classical report.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = sy-repid

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IS_LAYOUT = ls_layout

T_FIELDCAT = IT_FCAT

FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.

CASE UCOMM.

WHEN '&IC1'.

READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.

here i have given the select statement.. select vorna from pa0002 into lv_vorna where....

write: / lv_vorna.----


>this value should be displayed in the secondary list.

Guide me how to do???

I tried giving LEAVE TO LIST PROCESSING before the write statement.Then the data is gettin displayed in secondary list but i m unable to come back to the first screen.

I need data to be displayed in secondary list and also have to come back to the basic list.

Regards,

Kiruthi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,117

Dear Kiruthi,

FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.

CASE UCOMM.

WHEN '&IC1'.

READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.

You are doing right thing. only thing you missed is to use another Fm Reues_alv_list_display and pass new internal table of manager detail. Then you will be able to come back to basic list and again to secondary list. But don't forget to refresh table.

Hope this will help to solve your problem.

Regard,

Vijay

11 REPLIES 11
Read only

Former Member
0 Likes
1,118

Dear Kiruthi,

FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.

CASE UCOMM.

WHEN '&IC1'.

READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.

You are doing right thing. only thing you missed is to use another Fm Reues_alv_list_display and pass new internal table of manager detail. Then you will be able to come back to basic list and again to secondary list. But don't forget to refresh table.

Hope this will help to solve your problem.

Regard,

Vijay

Read only

0 Likes
1,117

Thanks for ur reply..

But i dont want to display again in ALV report.. just i want to display as a classical report.

could you give me solution for this??

Read only

0 Likes
1,117

Hi

Try this sample:

TYPE-POOLS SLIS.

DATA: T_T001    TYPE TABLE OF T001 WITH HEADER LINE.
DATA: IS_LAYOUT TYPE  SLIS_LAYOUT_ALV.
DATA: GT_REPORT TYPE SY-REPID.

SELECT * FROM T001 INTO TABLE T_T001.

IS_LAYOUT-F2CODE = 'DETA'.
GT_REPORT = SY-REPID.


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM      = GT_REPORT
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IS_LAYOUT               = IS_LAYOUT
    I_STRUCTURE_NAME        = 'T001'
  TABLES
    T_OUTTAB                = T_T001.


FORM USER_COMMAND  USING R_UCOMM     LIKE SY-UCOMM
                         RS_SELFIELD TYPE SLIS_SELFIELD.

  IF R_UCOMM = 'DETA'.
    READ TABLE T_T001 INDEX RS_SELFIELD-TABINDEX.
    LEAVE TO LIST-PROCESSING. 
* Set bar for list    <----------------
    SET PF-STATUS 'STLI' OF PROGRAM 'SAPMSSY0' IMMEDIATELY.
* Write list
    WRITE: T_T001-BUKRS, T_T001-BUTXT.

  ENDIF.
ENDFORM.                    "FORM

Before writing the list u need to set a new STATUS for abap list, u can use the standard status STLI

Max

Read only

0 Likes
1,117

Thanks max..its working fine..

but can u explain me in detail why v have to set the status over there..

Read only

0 Likes
1,117

HI

The ALV fm set an own STATUS gui (STANDARD_FULLSCREEN), this status is active until a new status is set.

So if you don't set a new status, the gui for ALV is also active for the abap list, but this status can't manage the abap list, because it'a status for a dynpro.

So u need to set a status for a list: if u don't need to insert additional button in the gui u can use the std one, else u can create a your own status and then go to:

Extras->Adjust template: here u can import all commands for abap list

Max

Read only

0 Likes
1,117

thanks for the explanation..:-)

Read only

0 Likes
1,117

great answer thanks

Read only

Former Member
0 Likes
1,117

Hi

Try to use the statament WINDOW in order to open a popup where u can write the details:

WINDOW STARTING AT X Y 
         ENDING   AT Z W. 

write: / lv_vorna.

Or

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
    write: / lv_vorna..
    LEAVE SCREEN.

Max

Edited by: max bianchi on May 27, 2009 12:04 PM

Read only

0 Likes
1,117

I tried

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

write: / lv_vorna..

LEAVE SCREEN.

but still i am not able to come back again to basic list when i press back button and nothing is happenin even i press exit and cancel button..

Read only

Former Member
0 Likes
1,117

Can you try to execute the second alv in a new dynpro - modal dialog box ?? and in the PAI , return to your fist ALV.

Read only

Former Member
0 Likes
1,117

Hi,

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 'ME51N' AND SKIP FIRST SCREEN.

ENDCASE .


FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                RS_SELFIELD TYPE SLIS_SELFIELD.

IF R_UCOMM = '&IC1' AND SY-LSIND = '1'.
*RS_SELFIELD-TABNAME = 'ITAB'.

READ TABLE ITAB INDEX  RS_SELFIELD-TABINDEX.

*SELECT * FROM ZAK_CHILD1 INTO TABLE ITAB_CHILD
*WHERE EMPID = ITAB-EMPID.

SELECT P~EMPID P~FNAME P~LNAME P~DESIG C~SLIPNO C~AMOUNT
INTO (ITAB_PARENT-EMPID, ITAB_PARENT-FNAME, ITAB_PARENT-LNAME,
ITAB_PARENT-DESIG, ITAB_PARENT-SLIPNO, ITAB_PARENT-AMOUNT)
FROM ZAK_PARENT1 AS P INNER JOIN ZAK_CHILD1 AS C
ON P~EMPID = C~EMPID
WHERE P~EMPID = ITAB-EMPID.
APPEND ITAB_PARENT.
ENDSELECT.

CLEAR ITAB2[].
LOOP AT ITAB_PARENT.
   MOVE ITAB_PARENT-EMPID TO ITAB2-EMPID.
   MOVE ITAB_PARENT-FNAME TO ITAB2-FNAME.
   MOVE ITAB_PARENT-LNAME TO ITAB2-LNAME.
   MOVE ITAB_PARENT-DESIG TO ITAB2-DESIG.
   MOVE ITAB_PARENT-SLIPNO TO ITAB2-SLIPNO.
   MOVE ITAB_PARENT-AMOUNT TO ITAB2-AMOUNT.
APPEND ITAB2.
ENDLOOP.

PERFORM FIELDCAT1 USING AK_FIELDCAT1.
PERFORM DISPLAY1.

ENDIF.

ENDFORM.                    " USER_COMMAND

FORM DISPLAY1 .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
 EXPORTING
 I_CALLBACK_PROGRAM                = SY-REPID
 I_CALLBACK_USER_COMMAND     = 'USER_COMMAND'
 IS_LAYOUT                         = AK_LAYOUT1
 IT_FIELDCAT                       = AK_FIELDCAT1
 I_SAVE                            = 'X'
 IT_EVENTS                         = AK_EVENT
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.