Skip to Content
0
Former Member
Jul 31, 2007 at 05:46 AM

Program

11 Views

Frnds,

my requirement is i hav to list out all divisions , its related text , date and bussiness area.

so wht shuld i write after for all entries select statement . i think we shuld go for READ STATEMENT .... can anyone tell me how to count the no of bussiness partners plzz.

<CODE>

REPORT ZDISTRICT_CUST_AUCSALES.

TABLES: /BIC/AUCSALES00, /BIC/TCOKEY.

DATA: BEGIN OF ITAB OCCURS 0,

/BIC/COKEY LIKE /BIC/TCOKEY-/BIC/COKEY,

TXTSH LIKE /BIC/TCOKEY-TXTSH,

END OF ITAB.

DATA: BEGIN OF ITAB2 OCCURS 0,

BILL_DATE LIKE /BIC/AUCSALES00-BILL_DATE,

/BIC/COKEY LIKE /BIC/AUCSALES00-/BIC/COKEY,

BPARTNER LIKE /BIC/AUCSALES00-BPARTNER,

END OF ITAB2.

DATA: COUNT TYPE I,

BILDT LIKE /BIC/AUCSALES00-BILL_DATE.

SELECT-OPTIONS: S_BILDT FOR /BIC/AUCSALES00-BILL_DATE.

**AT SELECTION-SCREEN.

  • IF NOT s_bildt IS INITIAL.

  • write:/ 'please enter a value'.

  • SELECT * FROM /BIC/AUCSALES00

  • INTO BILDT

  • WHERE BILL_DATE EQ S_BILDT.

  • ENDIF.

  • IF SY-SUBRC <> 0.

  • WRITE:/ 'please enter a '.

  • MESSAGE E010 WITH 'NOT A VALID DATE'(003) S_BILL_DATE 'Found'(004).

  • ENDIF.

SELECT * from /BIC/TCOKEY into CORRESPONDING FIELDS OF table itab.

IF NOT ITAB[] IS INITIAL.

SELECT BILL_DATE

/BIC/COKEY

BPARTNER

FROM /BIC/AUCSALES00

INTO TABLE ITAB2

FOR ALL ENTRIES IN ITAB

WHERE /BIC/COKEY = ITAB-/BIC/COKEY

AND BILL_DATE IN S_BILDT.

ENDIF.

SELECT COUNT( DISTINCT BPARTNER ) ????? this is also not comming right

FROM /BIC/AUCSALES00

INTO COUNT.

IF SY-SUBRC NE 0.

WRITE:/ 'doesnot contain any data'.

ENDIF.

LOOP AT ITAB.

WRITE:/ ITAB-/BIC/COKEY,

ITAB-TXTSH,

ITAB2-BILL_DATE,

ITAB2-BPARTNER,

COUNT.

ENDLOOP.

*

  • AT END OF BPARTNER.

  • SUM.

  • WRITE:/45 'TOTAL NUMBER OF CUSTOMER:',45 ITAB-CUSTOMER.

  • ENDAT.

</CODE>

My output shuld be

<code>

DISTRICT

DRISTIC NAME

BILL DATE

CUSTOMER

314200

E.E.(O&M) AMBIKAPUR 12052006 9

314201 AE/JE (R) AMBIKAPUR 12052006 5

314202 AE(R) SOCIETY 12052006 0

314205 A.E(TOWN) AMBIKAPUR 12052006 7

314210 J.E.BATAULI 12052006 4

314212 J.E. BHAIYATHAN 12052006 0

314215 J.E. BISHRAMPUR 12052006 0

314220 J.E. KUSMI 12052006 9

314225 J.E. PRATAPPUR 12052006 5

</code>

thnks to u alll....

regards,

kamal

Message was edited by:

KAMAL jain