cancel
Showing results for 
Search instead for 
Did you mean: 

Help me

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi

Using above query

Table Name likp-WADAT_IST post Goods Issue Date

Include this table and fields t_vbmtv.

how we will get using the same queay any possibility

Plz reply me

Advanced tahnsk to ur reply

Regards

Raj

former_member188685
Active Contributor
0 Kudos

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.

former_member188685
Active Contributor
0 Kudos

Hi Raja,

are you facing any problem....

Regards

vijay

athavanraja
Active Contributor
0 Kudos

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-b4d...

Regards

Raja

Former Member
0 Kudos

Hi sek,

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

Regards,

Sailaja