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

Help me

Hi all,

Plz review my query and reply me correctiones

TABLES : VBAK,VBAP,VBEP,VEDA.

DATA: BEGIN OF T_VBMTV OCCURS 200,

BSTNK LIKE VBAK-BSTNK,

AUART LIKE VBAK-AUART,

KUNNR LIKE VBAK-KUNNR,

VBELN LIKE VBAK-KUNNR,

FAKSK LIKE VBAK-FAKSK,

POSNR LIKE VBAP-POSNR,

KWMENG LIKE VBAP-KWMENG,

VRKME LIKE VBAP-VRKME,

NETWR LIKE VBAP-NETWR,

WAERK LIKE VBAP-WAERK,

ETENR LIKE VBEP-ETENR,

EDATU LIKE VBEP-EDATU,

END OF T_VBMTV.

SELECT-OPTIONS S_VBELN FOR VBAK-VBELN.

SELECT-OPTIONS S_AUART FOR VBAK-AUART.

SELECT-OPTIONS S_KUNNR FOR VBAK-KUNNR.

SELECT-OPTIONS S_VABN FOR VEDA-VABNDAT.

SELECT KBSTNK KAUART KKUNNR KVBELN K~FAKSK

AVASDA AVINSDAT AVUNTDAT AVABNDAT

PPOSNR PKWMENG PVRKME PNETWR P~WAERK

EETENR EEDATU INTO CORRESPONDING FIELDS OF TABLE T_VBMTV

FROM ( ( ( VBAK AS K INNER JOIN VEDA AS A ON KVBELN = AVBELN )

INNER JOIN VBAP AS P ON KVBELN = PVBELN )

INNER JOIN VBEP AS E ON KVBELN = EVBELN )

WHERE K~VBELN IN S_VBELN

AND K~AUART IN S_AUART

AND K~KUNNR IN S_KUNNR

AND A~VABNDAT IN S_VABN.

IF SY-SUBRC EQ 0.

WRITE :/ T_VBMTV-VBELN.

ELSE.

WRITE :/ 'NO DATA FOUND'.

ENDIF.

Advanced thanks for your reply

i look forward to your reply

Regards

sek

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2005 at 06:03 AM

    Hi sek,

    Give the details of output with the expected output. So that the error could be found out.

    Regards,

    Sailaja

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2005 at 06:05 AM

    Hi Raja,

    are you facing any problem....

    Regards

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

    • occurs is a obsolete ABAP construct.

      instead of

      DATA: BEGIN OF T_VBMTV OCCURS 200,

      BSTNK LIKE VBAK-BSTNK,

      AUART LIKE VBAK-AUART,

      KUNNR LIKE VBAK-KUNNR,

      VBELN LIKE VBAK-KUNNR,

      FAKSK LIKE VBAK-FAKSK,

      POSNR LIKE VBAP-POSNR,

      KWMENG LIKE VBAP-KWMENG,

      VRKME LIKE VBAP-VRKME,

      NETWR LIKE VBAP-NETWR,

      WAERK LIKE VBAP-WAERK,

      ETENR LIKE VBEP-ETENR,

      EDATU LIKE VBEP-EDATU,

      END OF T_VBMTV.

      use

      types: BEGIN OF T_VBMTV_type ,

      BSTNK LIKE VBAK-BSTNK,

      AUART LIKE VBAK-AUART,

      KUNNR LIKE VBAK-KUNNR,

      VBELN LIKE VBAK-KUNNR,

      FAKSK LIKE VBAK-FAKSK,

      POSNR LIKE VBAP-POSNR,

      KWMENG LIKE VBAP-KWMENG,

      VRKME LIKE VBAP-VRKME,

      NETWR LIKE VBAP-NETWR,

      WAERK LIKE VBAP-WAERK,

      ETENR LIKE VBEP-ETENR,

      EDATU LIKE VBEP-EDATU,

      END OF T_VBMTV.

      data: T_VBMTV type standard table of T_VBMTV_type .

      for more on Obsolete ABAP Language Constructs check out the following document.

      https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5ac31178-0701-0010-469a-b4d7fa2721ca

      Regards

      Raja

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2005 at 07:01 AM

    Hi Raja.

    In the definition of Internal Table, u have used :

    VBELN LIKE VBAK-KUNNR

    but u are using INTO CORRESPONDING CLAUSE, so use

    VBELN LIKE VBAK-VBELN.

    And u can write query without using brackets in this manner:

    SELECT KBSTNK KAUART KKUNNR KVBELN K~FAKSK

    AVASDA AVINSDAT AVUNTDAT AVABNDAT

    PPOSNR PKWMENG PVRKME PNETWR P~WAERK

    EETENR EEDATU

    INTO CORRESPONDING FIELDS OF TABLE T_VBMTV

    FROM VBAK AS K

    INNER JOIN VEDA AS A

    ON KVBELN = AVBELN

    INNER JOIN VBAP AS P

    ON KVBELN = PVBELN

    INNER JOIN VBEP AS E

    ON KVBELN = EVBELN

    WHERE K~VBELN IN S_VBELN

    AND K~AUART IN S_AUART

    AND K~KUNNR IN S_KUNNR

    AND A~VABNDAT IN S_VABN.

    Reward Points if this will help u.

    Add a comment
    10|10000 characters needed characters exceeded

    • hi Raja,

      You Can Insert another Join, but

      select vbeln from lips into t_lips for all entries in t_vbmtv

      where vgbel = t_vbmtv-vbeln

      vgpos = t_vbmtv-psonr.

      now you have all deliveries using delivieries from likp you can get wadat_ist.

      vijay

      but don't forget to close your previous thread, by rewarding for helpful answers.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2005 at 08:04 AM

    Hi raja,

    Be bit clear with your specifications. Tell excatly what is your expectation. Initially you had one query , you dint say whether that is cleared , now again you are putting another query , whether that should be used with the same query????????????

    Regards,

    Sailaja

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi All,

      i want include Post Goods issue PGI in my output list and also find the latest date

      in PGI,Installation,Contract signed,Action,Acceptence

      Installation date VEDA – VINSDAT

      Acceptance date VEDA – VABNDAT

      Contract signed VEDA – VUNTDAT

      Goods issue date LIKP - WADAT_IST

      i will send the code plz send how to find latest and PGI

      TABLES : VBAK,VBAP,VBEP,VEDA,LIPS,LIKP.

      DATA: BEGIN OF T_VBMTV OCCURS 200,

      BSTNK LIKE VBAK-BSTNK,

      AUART LIKE VBAK-AUART,

      KUNNR LIKE VBAK-KUNNR,

      VBELN LIKE VBAK-KUNNR,

      FAKSK LIKE VBAK-FAKSK,

      POSNR LIKE VBAP-POSNR,

      KWMENG LIKE VBAP-KWMENG,

      VRKME LIKE VBAP-VRKME,

      NETWR LIKE VBAP-NETWR,

      WAERK LIKE VBAP-WAERK,

      VASDA LIKE VEDA-VASDA,

      VINSDAT LIKE VEDA-VINSDAT,

      VABNDAT LIKE VEDA-VABNDAT,

      VUNTDAT LIKE VEDA-VUNTDAT,

      ETENR LIKE VBEP-ETENR,

      EDATU LIKE VBEP-EDATU,

      WADAT_IST LIKE LIKP-WADAT_IST,

      LATEST_DATE TYPE D,

      END OF T_VBMTV.

      SELECT-OPTIONS S_VBELN FOR VBAK-VBELN.

      SELECT-OPTIONS S_AUART FOR VBAK-AUART.

      SELECT-OPTIONS S_KUNNR FOR VBAK-KUNNR.

      SELECT-OPTIONS S_VABN FOR VEDA-VABNDAT.

      SELECT VBAKBSTNK VBAKAUART VBAKKUNNR VBAKVBELN VBAK~FAKSK

      VEDAVASDA VEDAVINSDAT VEDAVUNTDAT VEDAVABNDAT

      VBAPPOSNR VBAPKWMENG VBAPVRKME VBAPNETWR VBAP~WAERK

      VBEPETENR VBEPEDATU INTO CORRESPONDING FIELDS OF TABLE T_VBMTV

      FROM ( ( ( VBAK INNER JOIN VEDA ON VEDAVBELN = VBAKVBELN )

      INNER JOIN VBAP ON VBAKVBELN = VBAPVBELN )

      INNER JOIN VBEP ON VBAKVBELN = VBEPVBELN

      AND VBAPPOSNR = VBEPPOSNR )

      WHERE VBAK~VBELN IN S_VBELN

      AND VBAK~AUART IN S_AUART

      AND VBAK~KUNNR IN S_KUNNR

      AND VEDA~VABNDAT IN S_VABN.

      PLZ REVIEW THE ABOVE CODE AND REPLY ME THE MODIFICATIONS

      I WANT FIND THE LATEST DATE

      HOW TO GET PGI FROM LIKP COMPARING THE ABOVE QUERY

      ADVACED TAHNKS FOR UR REPLY

      I LOOK FORWAR DTO UR REPLY

      REGARDS

      SEK

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.