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: 

Interactive Report

Former Member
0 Kudos
78

Hi Experts,

I am creating an interactive report. Here i am displaying all customer details in basic list. In secondary list i am displaying vendor details. If i am clicking the customer number, i want to display only that particular customer vendor details. I tried it, but i am getting total vendor details. Please tell me.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
51

REPORT ZSRK_071 .

TABLES : KNA1.

SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.

DATA : BEGIN OF IT_KNA1 OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

END OF IT_KNA1.

DATA : BEGIN OF IT_LFA1 OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

KUNNR LIKE LFA1-KUNNR,

NAME1 LIKE LFA1-NAME1,

END OF IT_LFA1.

DATA : CF1(15),

L_KUNNR LIKE KNA1-KUNNR.

AT LINE-SELECTION.

GET CURSOR FIELD CF1 VALUE L_KUNNR.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = L_KUNNR

IMPORTING

OUTPUT = L_KUNNR.

READ TABLE IT_LFA1 WITH KEY KUNNR = L_KUNNR.

SY-LSIND = 1.

WRITE : / IT_LFA1-LIFNR , IT_LFA1-KUNNR, IT_LFA1-NAME1.

START-OF-SELECTION.

SELECT KUNNR NAME1

FROM KNA1

INTO TABLE IT_KNA1

WHERE KUNNR IN S_KUNNR.

IF NOT IT_KNA1[] IS INITIAL.

SELECT LIFNR KUNNR NAME1

FROM LFA1

INTO TABLE IT_LFA1

FOR ALL ENTRIES IN IT_KNA1

WHERE KUNNR EQ IT_KNA1-KUNNR.

ENDIF.

SORT IT_LFA1 BY LIFNR KUNNR.

LOOP AT IT_KNA1.

HIDE : IT_KNA1-KUNNR,

IT_KNA1-NAME1.

WRITE : / IT_KNA1-KUNNR , IT_KNA1-NAME1.

ENDLOOP.

4 REPLIES 4

former_member1245113
Active Contributor
0 Kudos
51

Hi Sri,

at line-selection

use get cursor field fname value fval.

this will give you the field value lets say the customer value.

write the select query according and display.

***for more info please go through the key word docu for GET CURSOR.

also you can use the HIDE technic ,, please go through the key word docu.

hide should be used with in the loop statement.

Hope this will serve your purpose.

Thanks and regards

Ramchander Rao.K

0 Kudos
51

Hi Ramachandra,

Thanks for your answer. Can you please tell me clearly. I tried this one, but i didn't get it.

Thanks.

Former Member
0 Kudos
52

REPORT ZSRK_071 .

TABLES : KNA1.

SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.

DATA : BEGIN OF IT_KNA1 OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

END OF IT_KNA1.

DATA : BEGIN OF IT_LFA1 OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

KUNNR LIKE LFA1-KUNNR,

NAME1 LIKE LFA1-NAME1,

END OF IT_LFA1.

DATA : CF1(15),

L_KUNNR LIKE KNA1-KUNNR.

AT LINE-SELECTION.

GET CURSOR FIELD CF1 VALUE L_KUNNR.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = L_KUNNR

IMPORTING

OUTPUT = L_KUNNR.

READ TABLE IT_LFA1 WITH KEY KUNNR = L_KUNNR.

SY-LSIND = 1.

WRITE : / IT_LFA1-LIFNR , IT_LFA1-KUNNR, IT_LFA1-NAME1.

START-OF-SELECTION.

SELECT KUNNR NAME1

FROM KNA1

INTO TABLE IT_KNA1

WHERE KUNNR IN S_KUNNR.

IF NOT IT_KNA1[] IS INITIAL.

SELECT LIFNR KUNNR NAME1

FROM LFA1

INTO TABLE IT_LFA1

FOR ALL ENTRIES IN IT_KNA1

WHERE KUNNR EQ IT_KNA1-KUNNR.

ENDIF.

SORT IT_LFA1 BY LIFNR KUNNR.

LOOP AT IT_KNA1.

HIDE : IT_KNA1-KUNNR,

IT_KNA1-NAME1.

WRITE : / IT_KNA1-KUNNR , IT_KNA1-NAME1.

ENDLOOP.

0 Kudos
51

Hi Sreekanth Reddy,

Thanks for ur answer.

Thanks.