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 basic list concept

Former Member
0 Likes
636

Suppose in a basic list i have 7 parallel detail list.i am in basic list is there any way to go directly to 7 th detail list from basiclist or from 1st detail list to 7 th detail list vice-versa.

plz tell me..i am waiting.. for reply

thanx

arya

1 ACCEPTED SOLUTION
Read only

naveen_inuganti2
Active Contributor
0 Likes
610

Hi....

Ya.. it is possible with AT-USERCOMMAND event.... Here you can set push button for 7th list... so you can navigate easyily...

if it is the interactive ALV report...

Here is the procedure to handle Interactive ALV.

1.

declare events table like this.

data :

i_events type slis_t_event,

w_events like line of i_events.

2.

Build events table .

w_events-name = 'USER_COMMAND' .

w_events-form = 'USER_COMMAND' .

append w_events to i_events.

clear w_events.

w_events-name = 'PF_STATUS_SET' .

w_events-form = 'PF_STATUS_SET' .

append w_events to i_events.

clear w_events.

3.

pass this events table through REUSE_ALV_GRID_DISPLAY.

4.

USER_COMMAND and PF_STATUS_SET call back subroutines should be like this in your case. These are nowhere called using PERFORM statement in ur program.

5.

USER_COMMAND subroutine should be like this.

&----


*& Form user_command

&----


form user_command using ucomm like sy-ucomm

selfield type slis_selfield.

case ucomm .

when '&IC1'. This is for double click on ALV output.

skip 10.

position 10.

write 'Double click was executed'.

endcase.

endform. "user_command

selfield structure

You can also handle Interactive ALV using this structure.

types: begin of slis_selfield,

tabname type slis_tabname,

tabindex like sy-tabix,

sumindex like sy-tabix,

endsum(1) type c,

sel_tab_field type slis_sel_tab_field,

value type slis_entry,

before_action(1) type c,

after_action(1) type c,

refresh(1) type c,

col_stable(1) type c,

row_stable(1) type c,

  • colwidth_optimize(1) type c,

exit(1) type c,

fieldname type slis_fieldname,

grouplevel type i,

collect_from type i,

collect_to type i,

end of slis_selfield.

6.

PF_STATUS_SET' subroutine should be like this.

&----


*& Form pf_status_set

&----


form pf_status_set using extab type slis_t_extab.

set pf-status 'STATUS1' excluding g_extab.

endform. "pf_status_set

...try this code..

let me know if you want any forther clarification...

Thank you,

Naveen.I

Edited by: Naveen Inuganti on Jun 19, 2008 11:32 AM

6 REPLIES 6
Read only

naveen_inuganti2
Active Contributor
0 Likes
611

Hi....

Ya.. it is possible with AT-USERCOMMAND event.... Here you can set push button for 7th list... so you can navigate easyily...

if it is the interactive ALV report...

Here is the procedure to handle Interactive ALV.

1.

declare events table like this.

data :

i_events type slis_t_event,

w_events like line of i_events.

2.

Build events table .

w_events-name = 'USER_COMMAND' .

w_events-form = 'USER_COMMAND' .

append w_events to i_events.

clear w_events.

w_events-name = 'PF_STATUS_SET' .

w_events-form = 'PF_STATUS_SET' .

append w_events to i_events.

clear w_events.

3.

pass this events table through REUSE_ALV_GRID_DISPLAY.

4.

USER_COMMAND and PF_STATUS_SET call back subroutines should be like this in your case. These are nowhere called using PERFORM statement in ur program.

5.

USER_COMMAND subroutine should be like this.

&----


*& Form user_command

&----


form user_command using ucomm like sy-ucomm

selfield type slis_selfield.

case ucomm .

when '&IC1'. This is for double click on ALV output.

skip 10.

position 10.

write 'Double click was executed'.

endcase.

endform. "user_command

selfield structure

You can also handle Interactive ALV using this structure.

types: begin of slis_selfield,

tabname type slis_tabname,

tabindex like sy-tabix,

sumindex like sy-tabix,

endsum(1) type c,

sel_tab_field type slis_sel_tab_field,

value type slis_entry,

before_action(1) type c,

after_action(1) type c,

refresh(1) type c,

col_stable(1) type c,

row_stable(1) type c,

  • colwidth_optimize(1) type c,

exit(1) type c,

fieldname type slis_fieldname,

grouplevel type i,

collect_from type i,

collect_to type i,

end of slis_selfield.

6.

PF_STATUS_SET' subroutine should be like this.

&----


*& Form pf_status_set

&----


form pf_status_set using extab type slis_t_extab.

set pf-status 'STATUS1' excluding g_extab.

endform. "pf_status_set

...try this code..

let me know if you want any forther clarification...

Thank you,

Naveen.I

Edited by: Naveen Inuganti on Jun 19, 2008 11:32 AM

Read only

0 Likes
610

is it possible for interactive prog only.. from 1st to 7th ...

Read only

0 Likes
610

Hi...

Just go through following code.... its for normal interactive reports...

TYPES : BEGIN OF st_kna1,

kunnr TYPE kna1-kunnr, "CUSTOMER NUMBER

name1 TYPE kna1-name1, "CUSTOMER NAME

END OF st_kna1.

TYPES : BEGIN OF st_vbak,

kunnr TYPE kna1-kunnr,

vbeln TYPE vbak-vbeln, "SALES DOCUMENT NUMBER

erdat TYPE vbak-erdat, "DATE ON WHICH THE RECORD WAS CREATED

audat TYPE vbak-audat, "DOCUMENT DATE

auart TYPE vbak-auart, "SALES DOCUMENT TYPE

ernam TYPE vbak-ernam, "NAME OF PERSON WHO CREATED THE OBJECT.

augru TYPE vbak-augru, "ORDER REASON

END OF st_vbak.

TYPES : BEGIN OF st_vbap,

vbeln TYPE vbak-vbeln,

posnr TYPE vbap-posnr, "SALES DOCUMENT ITEM

matnr TYPE vbap-matnr, "MATERIAL NUMBER

charg TYPE vbap-charg, "BATCH NUMBER

matkl TYPE vbap-matkl, "MATERIAL GROUP

posar TYPE vbap-posar, "ITEM TYPE

END OF st_vbap.

DATA : it_kna1 TYPE STANDARD TABLE OF st_kna1,

it_vbak TYPE STANDARD TABLE OF st_vbak,

it_vbap TYPE STANDARD TABLE OF st_vbap,

wa_kna1 TYPE st_kna1,

wa_vbak TYPE st_vbak,

wa_vbap TYPE st_vbap.

DATA : v_fld(15),

v_kunnr TYPE kna1-kunnr,

v_vbeln TYPE vbak-vbeln.

-


SELECT-OPTIONS

PARAMETERS

-


SELECT-OPTIONS so_kunnr FOR v_kunnr. "CUSTOMER NUMBER

PARAMETERS : p_max TYPE i. "NUMBER OF HITS

-


START-OF-SELECTION

-


START-OF-SELECTION.

PERFORM get_customerdata.

SET PF-STATUS 'MENU1'.

-


AT LINE-SELECTION

-


AT LINE-SELECTION.

IF sy-lsind = 1.

PERFORM get_salesheader.

ELSEIF sy-lsind = 2.

PERFORM get_salesitemdata.

ENDIF.

-


AT USER-COMMAND

-


AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'DISP'.

PERFORM get_salesheader.

WHEN 'ITEM'.

PERFORM get_salesitemdata.

WHEN 'VA03'.

SET PARAMETER ID 'AUN' FIELD wa_vbak-vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

ENDCASE.

-


TOP-OF-PAGE

-


TOP-OF-PAGE.

ULINE AT /1(56).

WRITE : /1 sy-vline ,

2(15) text-004 COLOR 1 ,

sy-vline ,

20(35) text-005 COLOR 1 ,

sy-vline.

ULINE AT /1(56).

-


TOP-OF-PAGE DURING LINE-SELECTION.

-


TOP-OF-PAGE DURING LINE-SELECTION.

CASE sy-lsind.

WHEN 1.

PERFORM get_topofpage1.

WHEN 2.

PERFORM get_topofpage2.

ENDCASE.

-


FORM GET_CUSTOMERDATA

-


FORM get_customerdata.

SELECT kunnr name1

FROM kna1

INTO TABLE it_kna1

UP TO p_max ROWS

WHERE kunnr IN so_kunnr.

IF sy-subrc EQ 0.

LOOP AT it_kna1 INTO wa_kna1.

WRITE : / sy-vline,

2(15) wa_kna1-kunnr ,

sy-vline ,

20 wa_kna1-name1,

sy-vline.

HIDE : wa_kna1-kunnr , wa_kna1-name1.

CLEAR wa_kna1.

ENDLOOP.

ULINE AT : /1(56).

ELSE.

MESSAGE w000(z50871msg).

ENDIF.

ENDFORM. "GET_CUSTOMERDATA

-


FORM GET_SALESHEADER

-


FORM get_salesheader.

SET PF-STATUS 'MENU2'.

GET CURSOR FIELD v_fld VALUE v_kunnr.

IF v_fld = 'WA_KNA1-KUNNR'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = v_kunnr

IMPORTING

output = v_kunnr.

SELECT kunnr vbeln erdat audat auart ernam augru

FROM vbak

INTO TABLE it_vbak

WHERE kunnr = v_kunnr.

IF sy-subrc EQ 0.

LOOP AT it_vbak INTO wa_vbak.

WRITE : / sy-vline ,

2(22) wa_vbak-vbeln ,

sy-vline,

27(25) wa_vbak-erdat ,

sy-vline ,

55(15) wa_vbak-audat ,

sy-vline ,

73(15) wa_vbak-auart ,

sy-vline,

91(16) wa_vbak-ernam ,

sy-vline,

109(13) wa_vbak-augru,

123 sy-vline.

HIDE : wa_vbak-vbeln.

CLEAR wa_vbak.

ENDLOOP.

ULINE AT : /1(123).

ELSE.

MESSAGE i015(z50871msg).

ENDIF.

ELSE.

MESSAGE i013(z50871msg).

ENDIF.

ENDFORM. "GET_SALESHEADER

-


FORM GET_SALESITEMDATA

-


FORM get_salesitemdata.

SET PF-STATUS space.

GET CURSOR FIELD v_fld VALUE v_vbeln.

IF v_fld = 'WA_VBAK-VBELN'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = v_vbeln

IMPORTING

output = v_vbeln.

SELECT vbeln posnr matnr charg matkl posar

FROM vbap

INTO TABLE it_vbap

WHERE vbeln = v_vbeln.

LOOP AT it_vbap INTO wa_vbap.

WRITE : /1 sy-vline,

2(13) wa_vbap-posnr ,

sy-vline,

18(18) wa_vbap-matnr ,

sy-vline,

40(13) wa_vbap-charg ,

sy-vline,

56(16) wa_vbap-matkl ,

sy-vline,

75 wa_vbap-posar,

112 sy-vline.

CLEAR wa_vbap.

ENDLOOP.

ULINE AT : /1(112).

ELSE.

MESSAGE i014(z50871msg).

ENDIF.

ENDFORM. "GET_SALESITEMDATA

-


FORM GET_TOPOFPAGE1

-


FORM get_topofpage1.

ULINE AT : /1(123).

WRITE : / sy-vline ,

2 text-000 ,

wa_kna1-kunnr ,

75 text-001 ,

wa_kna1-name1,

123 sy-vline.

ULINE AT : /1(123).

WRITE : / sy-vline ,

2(22) text-006 COLOR 1,

sy-vline,

27(25) text-007 COLOR 1 ,

sy-vline ,

55(15) text-008 COLOR 1 ,

sy-vline ,

73(15) text-009 COLOR 1 ,

sy-vline,

91(16) text-010 COLOR 1 ,

sy-vline,

109(13) text-011 COLOR 1,

123 sy-vline.

ULINE AT : /1(123).

ENDFORM. "GET_TOPOFPAGE1

-


FORM GET_TOPOFPAGE2

-


FORM get_topofpage2.

ULINE AT : /1(112).

WRITE : / sy-vline ,

2 text-000 ,

wa_kna1-kunnr ,

35 text-001 ,

wa_kna1-name1 ,

85 text-003 ,

wa_vbak-vbeln ,

112 sy-vline.

ULINE AT : /1(112).

WRITE : /1 sy-vline,

2(13) text-012 COLOR 1,

sy-vline,

18(18) text-013 COLOR 1 ,

sy-vline,

40(13) text-014 COLOR 1 ,

sy-vline,

56(16) text-015 COLOR 1 ,

sy-vline,

75 text-016 COLOR 1 ,

112 sy-vline.

ULINE AT : /1(112).

ENDFORM. "GET_TOPOFPAGE2

Thanks,

Naveen.I

Read only

0 Likes
610

Hi naveen..

im trying your code ,in that you have set PF-STATUS 'menu1'.and 'menu2'. could you you please tell me what i can do in that pf-status.means which settings will required to it.

Thankx in Advanced.

Somnath

Read only

Former Member
0 Likes
610

Hi,

at line selection.

if sy-lsind = 7.

sy-lsind = 1.

endif.

Read only

Former Member
0 Likes
610

at line selection.

*use sy-lsind in interactive list to go directly page 7 from 1 as follows-

if sy-lsind = 1.

sy-lsind = 7.

endif.