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 K_{BSTNK K}AUART K_{KUNNR K}VBELN K~FAKSK
A_{VASDA A}VINSDAT A_{VUNTDAT A}VABNDAT
P_{POSNR P}KWMENG P_{VRKME P}NETWR P~WAERK
E_{ETENR E}EDATU INTO CORRESPONDING FIELDS OF TABLE T_VBMTV
FROM ( ( ( VBAK AS K INNER JOIN VEDA AS A ON K_{VBELN = A}VBELN )
INNER JOIN VBAP AS P ON K_{VBELN = P}VBELN )
INNER JOIN VBEP AS E ON K_{VBELN = E}VBELN )
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
Hi Raja,
are you facing any problem....
Regards
vijay
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 K_{BSTNK K}AUART K_{KUNNR K}VBELN K~FAKSK
A_{VASDA A}VINSDAT A_{VUNTDAT A}VABNDAT
P_{POSNR P}KWMENG P_{VRKME P}NETWR P~WAERK
E_{ETENR E}EDATU
INTO CORRESPONDING FIELDS OF TABLE T_VBMTV
FROM VBAK AS K
INNER JOIN VEDA AS A
ON K_{VBELN = A}VBELN
INNER JOIN VBAP AS P
ON K_{VBELN = P}VBELN
INNER JOIN VBEP AS E
ON K_{VBELN = E}VBELN
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.
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