Skip to Content
author's profile photo Former Member
Former Member

interactive reports

hi,

this is another report program wherein the selected fields in the pop up window are repeated more than once and too particularly the last value...

please help me..

REPORT zbank3custr LINE-COUNT 50(5) NO STANDARD PAGE HEADING.

&----


*& DATABASE TABLE

&----


TABLES : zcust_master3.

&----


*& INTERNAL TABLE

&----


*DATA: wi_custb TYPE STANDARD TABLE OF zcust_master3,

  • wa_custb LIKE LINE OF wi_custb.

DATA : wi_custb LIKE zcust_master3 OCCURS 0 WITH HEADER LINE.

DATA : wi_custb1 LIKE zcust_master3 OCCURS 0 WITH HEADER LINE.

DATA : itab1 LIKE zcust_master3 OCCURS 0 WITH HEADER LINE.

DATA : itab2 LIKE zcust_master3 OCCURS 0 WITH HEADER LINE.

DATA : itab3 LIKE zcust_master3 OCCURS 0 WITH HEADER LINE.

DATA : itab4 LIKE zcust_master3 OCCURS 0 WITH HEADER LINE.

&----


*& DATA

&----


DATA: flag1 TYPE c LENGTH 1,

flag2 TYPE c LENGTH 1,

flag3 TYPE c LENGTH 1,

flag4 TYPE c LENGTH 1,

col TYPE i,

lin TYPE i,

fldname(20),

value(20),

ln TYPE i,

wa1 TYPE c LENGTH 30,

wa2 TYPE c LENGTH 40,

wa3 TYPE c LENGTH 15,

wa4 TYPE c LENGTH 15,

VAR1(30) TYPE C VALUE 'CUSTOMER NAME',

VAR2(40) TYPE C VALUE 'ADDRESS',

VAR3(15) TYPE C VALUE 'CITY',

VAR4(15) TYPE C VALUE 'STATE'.

&----


*& TOP-OF-PAGE

&----


TOP-OF-PAGE.

ULINE.

SKIP 1.

WRITE : 'CUSTOMER REPORTS'.

SKIP 1.

ULINE.

&----


*& START-OF-SELECTION

&----


START-OF-SELECTION.

WRITE : 'PRIMARY LIST'.

SELECT * FROM zcust_master3 INTO CORRESPONDING FIELDS OF TABLE wi_custb1.

LOOP AT wi_custb1.

WRITE:/ wi_custb1-cust_id HOTSPOT ON.

ENDLOOP.

END-OF-SELECTION.

AT LINE-SELECTION.

SET PF-STATUS 'ZBANKCUSTR'.

SELECT * FROM zcust_master3 INTO CORRESPONDING FIELDS OF TABLE wi_custb WHERE cust_id = wi_custb1-cust_id..

col = sy-cucol + 100.

lin = sy-curow + 4.

WINDOW STARTING AT sy-cucol sy-curow

ENDING AT col lin.

WRITE : / flag1 AS CHECKBOX ,VAR1.

WRITE : / flag2 AS CHECKBOX ,VAR2.

WRITE : / flag3 AS CHECKBOX ,VAR3.

WRITE : / flag4 AS CHECKBOX ,VAR4.

AT LINE-SELECTION.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'SUBMIT'.

WRITE: / 'SECONDARY LIST'.

DO.

READ LINE sy-index FIELD VALUE flag1 VAR1 INTO wa1.

IF sy-subrc <> 0.

EXIT.

ELSEIF flag1 = 'X'.

SELECT cust_name FROM zcust_master3 INTO CORRESPONDING FIELDS OF TABLE itab1 WHERE cust_ID = WI_CUSTB1-CUST_ID.

LOOP AT itab1.

WRITE : / itab1-cust_name.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE flag2 VAR2 INTO wa2.

IF sy-subrc <> 0.

EXIT.

ELSEIF flag2 = 'X'.

SELECT address FROM zcust_master3 INTO CORRESPONDING FIELDS OF TABLE itab2 WHERE CUST_ID = WI_CUSTB1-CUST_ID.

LOOP AT itab2.

WRITE : / itab2-address.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE flag3 VAR3 INTO wa3.

IF sy-subrc <> 0.

EXIT.

ELSEIF flag3 = 'X'.

SELECT city FROM zcust_master3 INTO CORRESPONDING FIELDS OF TABLE itab3 WHERE CUST_ID = WI_CUSTB1-CUST_ID.

LOOP AT itab3.

WRITE : / itab3-city.

ENDLOOP.

ENDIF.

READ LINE sy-index FIELD VALUE flag4 VAR4 INTO wa4.

IF sy-subrc <> 0.

EXIT.

ELSEIF flag4 = 'X'.

SELECT state FROM zcust_master3 INTO CORRESPONDING FIELDS OF TABLE itab4 WHERE CUST_ID = WI_CUSTB1-CUST_ID.

LOOP AT itab4.

WRITE : / itab4-state.

ENDLOOP.

ENDIF.

ENDDO.

ENDCASE.

&----


*& END-OF-PAGE

&----


END-OF-PAGE.

ULINE.

SKIP 1.

WRITE : 'CUSTOMER REPORTS'.

SKIP 1.

ULINE.

thanks in advance,

arunsri

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 28, 2007 at 03:27 PM

    You have loop at statements. double check the values in debugging.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.