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 report

Former Member
0 Likes
454

hi,

if i have a basic list which has 20 columns and if i want to go to different transaction based on the selection of the column, please let me find some help regarding this.

1 ACCEPTED SOLUTION
Read only

Manohar2u
Active Contributor
0 Likes
428

Refer to this interactive sample report

http://www.sap-img.com/abap/an-interactive-alv-report.htm

<b>FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN '&IC1'.

READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.

PERFORM BUILD_FIELDCATLOG_EKPO.

PERFORM EVENT_CALL_EKPO.

PERFORM POPULATE_EVENT_EKPO.

PERFORM DATA_RETRIEVAL_EKPO.

PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.

PERFORM DISPLAY_ALV_EKPO.

ENDCASE.

ENDFORM. </b> "user_command

Based on the RS_SELFIELD field you can call different respective transctions.

Regds

Manohar

2 REPLIES 2
Read only

Manohar2u
Active Contributor
0 Likes
429

Refer to this interactive sample report

http://www.sap-img.com/abap/an-interactive-alv-report.htm

<b>FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN '&IC1'.

READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.

PERFORM BUILD_FIELDCATLOG_EKPO.

PERFORM EVENT_CALL_EKPO.

PERFORM POPULATE_EVENT_EKPO.

PERFORM DATA_RETRIEVAL_EKPO.

PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.

PERFORM DISPLAY_ALV_EKPO.

ENDCASE.

ENDFORM. </b> "user_command

Based on the RS_SELFIELD field you can call different respective transctions.

Regds

Manohar

Read only

Clemenss
Active Contributor
0 Likes
428

Hi,

if you use ALV technique for your basic list, it is wasy and flexible. See many example reports create by SAP, search for reports named BALV.

If the list is created with write statements, then Double-click on the list will trigger AT LINE-SELECTION. For field information, use this syntax:

GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>]

[VALUE <val>] [LENGTH <len>].

This statement transfers the name of the field on which the cursor is positioned during a user action into the variable <f>. If the cursor is on a field, the system sets SY-SUBRC to 0, otherwise to 4.

When writing the list, use Hide statement to save the values.

Get some more information about the line selected using

<pre>

AT LINE-SELECTION.

DESCRIBE FIELD sy-lisel LENGTH l

IN CHARACTER MODE TYPE t.

WRITE: 'SY-LSIND:', sy-lsind,

/ 'SY-LISTI:', sy-listi,

/ 'SY-LILLI:', sy-lilli,

/ 'SY-CUROW:', sy-curow,

/ 'SY-CUCOL:', sy-cucol,

/ 'SY-CPAGE:', sy-cpage,

/ 'SY-STARO:', sy-staro,

/ 'SY-LISEL:', 'Length =', l, 'Type =', t,

/ sy-lisel.

</pre>

Compare also information given by SAP at

http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba3ef35c111d1829f0000e829fbfe/frameset.htm

Anyway I'd recommend to go forward to ALV technique - just for the flexibility gained.

Best regards,

Clemens