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

Report

Hi All,

I m creating a report, facing 1 problem that i take sales document date and billing date, in my report i select the sales document date in the select query and billing date in the loop....all is working fine....

<b>But i want to take billing date in the selection-screen....problem is that not selection according we give criteria...of billing date....it takes all data.....</b>

Tell me that we can give condition of selection-screen in loop.....

When i give the sales document date in selection-screen, records r coming according we give date....

This is my code......plz tell me my mistake..........

-


<b>These r the date fields:-</b>

AUDAT LIKE VBAK-AUDAT , "SALES DOC. DATE

FKDAT LIKE VBRK-FKDAT , "BILLING DATE

************

<b>this is selction-screen ......</b>

SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME.

SELECT-OPTIONS: VKBUR FOR VBAK-VKBUR, " Sales Office

KUNNR FOR VBAK-KUNNR, " Sold to party

FKDAT FOR VBRK-FKDAT, " OBLIGATORY . " Created on

FKART FOR VBRK-FKART, " Billing Type

AUDAT FOR VBAK-AUDAT.

SELECTION-SCREEN END OF BLOCK A.

********************

<b>now it is select query.....</b>

SELECT DISTINCT AVKBUR AKUNNR AVBELN AAUDAT ANETWR ABSTNK B~VBELN

INTO (ITAB-VKBUR, ITAB-KUNNR, ITAB-VBELN, ITAB-AUDAT, ITAB-NETWR, ITAB-BSTNK, ITAB-VBELN1)

FROM VBAK AS A INNER JOIN VBRP AS B ON AVBELN = BAUBEL

WHERE A~VKBUR IN VKBUR

AND A~KUNNR IN KUNNR

AND A~AUDAT IN AUDAT.

APPEND ITAB .

ENDSELECT.

SORT ITAB BY VBELN.

LOOP AT ITAB .

SELECT FKDAT NETWR MWSBK KNUMV FKART FROM VBRK INTO (ITAB-FKDAT, ITAB-NETWR1, ITAB-MWSBK, ITAB-KNUMV, ITAB-FKART)

WHERE VBELN = ITAB-VBELN1.

  • AND FKDAT IN FKDAT.

MODIFY ITAB INDEX SY-TABIX TRANSPORTING FKDAT NETWR1 MWSBK KNUMV FKART.

ENDSELECT .

ENDLOOP.

***********************************************************************************************

wat can i do for selection the data according <b>Billing date</b>...

Regards,

<b>Anil Kumar</b>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 24, 2007 at 05:56 AM

    You have this line commented

     AND FKDAT IN FKDAT.

    SELECT FKDAT NETWR MWSBK KNUMV FKART FROM VBRK INTO (ITAB-FKDAT, ITAB-NETWR1, ITAB-MWSBK, ITAB-KNUMV, ITAB-FKART)
    WHERE VBELN = ITAB-VBELN1.
    * AND FKDAT IN FKDAT.  " << Uncomment this line
    

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      From this commented line, there is no effect......

      • AND FKDAT IN FKDAT.

      again, when i uncomment it, and execute the report, it now showing all data...

      not according to date that i given in Billing Date........

      <b>

      Anil Kumar</b>

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2007 at 06:36 AM

    LOOP AT ITAB .

    SELECT FKDAT NETWR MWSBK KNUMV FKART FROM VBRK INTO (ITAB-FKDAT, ITAB-NETWR1, ITAB-MWSBK, ITAB-KNUMV, ITAB-FKART)

    WHERE VBELN = ITAB-VBELN1.

    • AND FKDAT IN FKDAT.

    MODIFY ITAB INDEX SY-TABIX TRANSPORTING FKDAT NETWR1 MWSBK KNUMV FKART.

    ENDSELECT .

    ENDLOOP.

    remove endselect and add table in select statement

    LOOP AT ITAB .

    SELECT FKDAT NETWR MWSBK KNUMV FKART FROM VBRK INTO table (ITAB-FKDAT, ITAB-NETWR1, ITAB-MWSBK, ITAB-KNUMV, ITAB-FKART)

    WHERE VBELN = ITAB-VBELN1.

    AND FKDAT IN FKDAT.

    MODIFY ITAB INDEX SY-TABIX TRANSPORTING FKDAT NETWR1 MWSBK KNUMV FKART.

    ENDLOOP.

    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.