28/01/2013

INTERACTIVE REPORTS

                      INTERACTIVE REPORT 

*&---------------------------------------------------------------------*
*& Report         ZCXXX_INTERACTIVE
*& Author         XXXX
*& Start Date     27/09/2010
*& Purpose        DISPLAY THE COMPANY DETAILS AS BASIC  LIST
*&                AND CUSTOMER DETAILS AND Reconciliation
*&                Account As Secondary Details
*&                USING EVENT
*& COPIED FROM    NA
*&
*& *******************************************************************
*& MODIFICATION LOGS :
*& CHANGE REQUEST   CllDEV12354
*& SUPPLIERS         xxxxxxxxxx
*&                                                                     *
*&---------------------------------------------------------------------*
REPORT  ZCXXX_INTERACTIVE                       .

TYPES : BEGIN OF ty_t001,
        bukrs TYPE t001-bukrs,
        butxt TYPE t001-butxt,
        ort01 TYPE t001-ort01,
        land1 TYPE t001-land1,
        waers TYPE t001-waers,
        END OF ty_t001.

DATA : WA_T001 TYPE TY_T001,
       IT_T001 TYPE TABLE OF TY_T001.

DATA V_BUKRS TYPE BUKRS .


*****CUSTOMER MASTER DATA *****************
TYPES : BEGIN OF ty_cust,
        kunnr TYPE kna1-kunnr,
        BUKRS TYPE BUKRS ,
        AKONT TYPE AKONT ,
        END OF ty_cust.


DATA : IT_CUST TYPE TABLE OF TY_CUST,
       WA_CUST TYPE          TY_CUST.


***********************************************
*        SELECTION SCREEN
***********************************************
SELECT-OPTIONS  S_BUKRS FOR WA_T001-BUKRS.

*************************************************
*    START OF SELECTION
*************************************************
START-OF-SELECTION.
SELECT  BUKRS "COMPANY CODE
        BUTXT "NAME OF THE COMPAIVY
        ORT01 "C&Y
        LAND1 "COUNTRY KEY a
        WAERS "CURRENCY KEY
        INTO TABLE IT_T001
        FROM T001
        WHERE BUKRS IN S_BUKRS.
*************************************************
*    END OF SELECTION
*************************************************
END-OF-SELECTION.

IF NOT IT_T001 IS INITIAL.
WRITE : 15 'COM.CODE1', 15 'TEXT', 45 'CITY', 70 'COUNTRY'.
ULINE.



LOOP AT IT_T001 INTO WA_T001.
WRITE : /5 WA_T001-BUKRS,
        15 WA_T001-BUTXT,
        45 WA_T001-ORT01 ,
        70 WA_T001 .
CLEAR WA_T001.
ENDLOOP.

ENDIF.

********************************************************
*    AT LINE SELECTION
********************************************************
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.
    V_BUKRS = SY-LISEL+4(4).
*        RETERIVE ALL THE  CUSTOMER FOR THE SELECTED COMPANY CODE

SELECT  KUNNR "CUSTOMER
        BUKRS "COMPANY CODE
        AKONT "RECON.ACC
        INTO TABLE IT_CUST
        FROM KNB1 WHERE BUKRS = V_BUKRS.

*DISPALY THE DATA

IF NOT IT_CUST IS INITIAL.
WRITE : 15 'COM.CODE1', 15 'CUSTOMER',30 'RECON ACC'.
ULINE.

LOOP AT IT_CUST INTO WA_CUST.
WRITE : 5  WA_CUST-BUKRS, "COMPANY CODE
        15 WA_CUST-KUNNR, "CUSTOMER
        30 WA_CUST-AKONT. "RECONCILIATION ACCOUNT
CLEAR WA_CUST.
ENDLOOP.
ELSE.

WRITE : 'NO FURTHER DETAILS FOUND FOR THE SELECTED COMP. CODE ' .
ENDIF.

ENDCASE.

1 comment:

  1. its successfully worked and awesome result thanks sir........

    ReplyDelete