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

Values r not fetch in internal table

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Apr 09, 2008 at 02:23 PM

    <REMOVED BY AUTHOR>

    Edited by: Thomas Zloch on Apr 9, 2008 4:26 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 09, 2008 at 02:35 PM

    hi,

    try this Code

    
    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.
    
    TYPES: BEGIN OF ivbak,
      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.
    
    TYPES: BEGIN OF iprps,
      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.
    TYPES: BEGIN OF icosp,
      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,
    pspnr LIKE vbak-ps_psp_pnr,
    netwr LIKE vbap-netwr,
    END OF itab.
    
    DATA : i_ivbak TYPE STANDARD TABLE OF ivbak,
           i_prps TYPE STANDARD TABLE OF iprps,
           i_icosp TYPE STANDARD TABLE OF icosp,
           wa_ivbak TYPE ivbak,
           wa_prps TYPE prps,
           wa_icosp TYPE icosp.
    
    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 i_ivbak
      WHERE ps_psp_pnr IN project AND
      vbtyp = 'G' AND auart = 'ZPCQ'.
    ENDFORM. "IVBAK
    
    *&---------------------------------------------------------------------*
    *&      Form  IPRPS
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    FORM iprps.
      SELECT pspnr posid objnr psphi
      FROM prps INTO TABLE
      i_prps WHERE prps~psphi IN project.
    ENDFORM. "IVBAP
    
    *&---------------------------------------------------------------------*
    *&      Form  ICOSP
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    FORM icosp.
      IF i_prps[] IS NOT INITIAL.
        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 i_icosp
        FOR ALL ENTRIES IN i_prps
        WHERE objnr = i_prps-objnr AND wrttp = '4'.
      ENDIF.
    ENDFORM.                    "ICOSP
    
    

    Regards

    Sandipan

    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.