Skip to Content
0
Former Member
Apr 09, 2008 at 02:17 PM

Values r not fetch in internal table

44 Views

Hi Frds

In my report the values are not fetching in the internal table ICOSP

This is my program ,kindly correct my mistake.

DATA : WBS LIKE VBAK-PS_PSP_PNR.

SELECTION-SCREEN: BEGIN OF BLOCK 01.

SELECTION-SCREEN: BEGIN OF BLOCK 02 WITH FRAME .

SELECT-OPTIONS PROJECT FOR WBS.

SELECTION-SCREEN: END OF BLOCK 02.

SELECTION-SCREEN: END OF BLOCK 01.

DATA: BEGIN OF IVBAK OCCURS 0,

VBTYP LIKE VBAK-VBTYP, "SD document category

AUART LIKE VBAK-AUART, "Sales Document Type

NETWR LIKE VBAP-NETWR, "NET VALUE OF THE ORDER ITEM

WAERK LIKE VBAK-WAERK, "SD document currency

PS_PSP_PNR LIKE VBAP-PS_PSP_PNR, "WBS Element

END OF IVBAK.

DATA: BEGIN OF IPRPS OCCURS 0,

PSPNR LIKE PRPS-PSPNR, "WBS Element

POSID LIKE PRPS-POSID, "WBS Element

OBJNR LIKE PRPS-OBJNR, "Object number

PSPHI LIKE PRPS-PSPHI, "Current project number

END OF IPRPS.

DATA: BEGIN OF ICOSP OCCURS 0,

OBJNR LIKE COSP-OBJNR,

GJAHR LIKE COSP-GJAHR,

WRTTP LIKE COSP-WRTTP,

BEKNZ LIKE COSP-BEKNZ,

WTG001 LIKE COSP-WTG001,

WTG002 LIKE COSP-WTG002,

WTG003 LIKE COSP-WTG003,

WTG004 LIKE COSP-WTG004,

WTG005 LIKE COSP-WTG005,

WTG006 LIKE COSP-WTG006,

WTG007 LIKE COSP-WTG007,

WTG008 LIKE COSP-WTG008,

WTG009 LIKE COSP-WTG009,

WTG010 LIKE COSP-WTG010,

WTG011 LIKE COSP-WTG011,

WTG012 LIKE COSP-WTG012,

WTG013 LIKE COSP-WTG013,

WTG014 LIKE COSP-WTG014,

WTG015 LIKE COSP-WTG015,

WTG016 LIKE COSP-WTG016,

  • SUM TYPE CURRENCY ,

END OF ICOSP.

*DATA: ICOSP LIKE COSP OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF ITAB OCCURS 0,

PSPNR LIKE VBAK-PS_PSP_PNR,

NETWR LIKE VBAP-NETWR,

END OF ITAB.

PERFORM IVBAK.

PERFORM IPRPS.

PERFORM ICOSP.

PERFORM MOVE_COSP.

PERFORM MOVE.

PERFORM FIELDCATALOG.

PERFORM BUILD_LAYOUT.

PERFORM ALVDISPLAY.

FORM IVBAK.

SELECT VBTYP AUART NETWR WAERK PS_PSP_PNR FROM VBAK INTO TABLE IVBAK

WHERE PS_PSP_PNR IN PROJECT AND

VBTYP = 'G' AND AUART = 'ZPCQ'.

CLEAR: IVBAK.

ENDFORM. "IVBAK

FORM IPRPS.

SELECT PSPNR POSID OBJNR PSPHI FROM PRPS INTO TABLE

IPRPS WHERE PRPS~PSPHI IN PROJECT.

CLEAR : IPRPS.

ENDFORM. "IVBAP

FORM ICOSP.

LOOP AT IPRPS.

SELECT OBJNR GJAHR WRTTP BEKNZ WTG001 WTG002 WTG003 WTG004 WTG005

WTG006 WTG007 WTG008 WTG009 WTG010 WTG011

WTG012 WTG013 WTG014 WTG015 WTG016

FROM COSP INTO CORRESPONDING FIELDS OF TABLE ICOSP

WHERE OBJNR = IPRPS-OBJNR AND WRTTP = '4'.

ENDLOOP.

CLEAR:ICOSP.

ENDFORM.

Thanks

Pari