cancel
Showing results for 
Search instead for 
Did you mean: 

ALV display

Former Member
0 Kudos

Hi all,

I have a requirement like in my 1st view the summary level detail should be displayed in an ALV.

In my second view header level detail should be displayed. Im able to display my summary detail in the first view in form of an ALV. Now I have to select any line and its corresponding item level details should be displayed in the second view in the form of an ALV.

All useful ans will be rewarded.

Accepted Solutions (0)

Answers (3)

Answers (3)

uday_gubbala2
Active Contributor
0 Kudos

Hi Madhvi,

How are you displaying this 2nd ALV in your application? Does it come within a popup or do you make a selection in the first view & click on some button to navigate to your 2nd view?

You can create your 2 context nodes in your component controller level so that your item details node is a subnode of your basic header information node. Now create a supply function for your item details node so that whenever you select any row from the basic header node the system would automatically fill up the information for the item details node. Now map this item details subnode from your component controller to your 2nd view & use the same procedure that you have used to displaying the data in ALV as you had done in your MAIN view. (I hope that you have declared 2 usages of the SALV_WD_TABLE in your component as you would need 2 different references to work with.)

Regards,

Uday

Former Member
0 Kudos

Hi,

please check the thread its about webdynpro only

Former Member
0 Kudos

Hi,

[https://forums.sdn.sap.com/click.jspa?searchID=19919795&messageID=6469252]

or check this sample code

Re: how to write code alv with interactive?when i clicked 1field i will generated next-level report,is it possible in alv?

Answer

  1. 1 Just check the following code

Building Interactive ALV list

using 'REUSE_ALV_LIST_DISPLAY'.

REPORT ZPURCHASE_ORDER.

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

***********

  • TYPE-POOLS DECLARATION

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

***********

TYPE-POOLS:

SLIS.

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

***********

  • DATA DECLARATIONS

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

***********

DATA:

W_EBELN TYPE EKKO-EBELN,

W_PROG TYPE SY-REPID,

T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

FS_FIELDCAT LIKE LINE OF T_FIELDCAT,

T_EVENTCAT TYPE SLIS_T_EVENT,

W_EVENTCAT LIKE LINE OF T_EVENTCAT.

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

***********

  • SELECT-OPTIONS DECLARATION

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

***********

SELECT-OPTIONS:

S_EBELN FOR W_EBELN.

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

***********

  • INTERNAL TABLE AND FIELD-STRING DECLARATIONS

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

***********

DATA:

T_EKKO LIKE

STANDARD TABLE

OF EKKO,

FS_EKKO LIKE LINE OF T_EKKO.

DATA:

T_EKPO LIKE

STANDARD TABLE

OF EKPO,

FS_EKPO LIKE LINE OF T_EKPO.

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

***********

  • START-OF-SELECTION

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

***********

START-OF-SELECTION.

SELECT *

FROM EKKO

INTO TABLE T_EKKO

WHERE EBELN IN S_EBELN.

W_PROG = SY-REPID.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = W_PROG

I_CALLBACK_USER_COMMAND = 'PICK'

I_STRUCTURE_NAME = 'EKKO'

TABLES

T_OUTTAB = T_EKKO

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*&----


-


*

*& Form pick

*&----


-


*

  • -->UCOMM text

  • -->SELFIELD text

*----


-


*

FORM PICK USING COMMAND LIKE SY-UCOMM

SELFIELD TYPE SLIS_SELFIELD.

READ TABLE T_EKKO INTO FS_EKKO INDEX SELFIELD-TABINDEX.

CASE COMMAND.

WHEN '&IC1'.

SELECT *

FROM EKPO

INTO TABLE T_EKPO

WHERE EBELN EQ FS_EKKO-EBELN.

W_PROG = SY-REPID.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_STRUCTURE_NAME = 'EKPO'

CHANGING

CT_FIELDCAT = T_FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

DELETE T_FIELDCAT WHERE FIELDNAME EQ 'EBELN'.

DELETE T_FIELDCAT WHERE FIELDNAME EQ 'BUKRS'.

DELETE T_FIELDCAT WHERE FIELDNAME EQ 'LGORT'.

DELETE T_FIELDCAT WHERE FIELDNAME EQ 'WERKS'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = W_PROG

IT_FIELDCAT = T_FIELDCAT

IT_EVENTS = T_EVENTCAT

TABLES

T_OUTTAB = T_EKPO

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDCASE. " CASE COMMAND

ENDFORM. " FORM PICK

FORM T_EVENTCAT.

W_EVENTCAT-NAME = 'TOP_OF_PAGE'.

W_EVENTCAT-FORM = 'TOP'.

APPEND W_EVENTCAT TO T_EVENTCAT.

ENDFORM.

FORM TOP.

READ TABLE T_EKPO INTO FS_EKPO INDEX 1.

WRITE:/ 'Purchase Document Number'(001),30 FS_EKPO-EBELN,

/ 'Company Code'(002), 30 FS_EKPO-BUKRS,

/ 'Plant'(003), 30 FS_EKPO-WERKS,

/ 'Storage Location'(004),30 FS_EKPO-LGORT.

ENDFORM.

Edited by: Neha Thukral on Dec 15, 2008 7:59 AM

Edited by: Neha Thukral on Dec 15, 2008 8:00 AM

Former Member
0 Kudos

Hello Neha,

I was talking about webDynpro application. Im creating an ALV in my webdynpro.

So please suggest me for the same.