Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: customised ALV layout like VA05

Former Member
0 Kudos

Hi,

IF P_OPEN = 'X' AND P_MYOR NE 'X' .

SELECT AKUNNR AVBELN ABSTNK AAUDAT AERNAM AAUART AVKORG AVTWEG

ASPART AVKGRP AVKBUR AKURST AFAKSK AGUEBG A~GUEEN

AVBTYP AAWAHR

BVRKME BLGORT BVSTEL BERZET BPOSNR BMATNR BCHARG BZMENG

BNETWR BNETPR BKWMENG BARKTX BWERKS BWAERK B~MEINS

BERNAM CLFSTK C~FKSAK INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM VBAK AS A INNER JOIN VBAP AS B ON AVBELN = BVBELN

INNER JOIN VBUK AS C ON AVBELN = CVBELN

WHERE A~KUNNR IN CUST

AND A~AUDAT IN S_AUDAT

AND A~BSTNK IN EBEL

AND B~MATNR IN MAT1

AND C~LFSTK NE 'C'

and c~lfstk ne ' '

AND C~FKSAK NE 'C'

and c~fksak ne ' '.

AND C~ABSTK NE 'C' .

Is the above query correct for open sales order and what ever the charge

is there in vbap is not getting displayed in ALV output

1 REPLY 1

Jelena
Active Contributor
0 Kudos

There is no universal "open order" selection criteria because different statuses will be set depending on the configuration. Also from the business standpoint what do you consider "open"? Not delivered? Not billed?

Just go to SE16 and check if there is a single record that fits your criteria. How do we know what's in your S_AUDAT, EBEL and MAT1?

Also as a shortcut you might want to use VBAKUK instead of VBAK and VBUK. And instead of NE use = A or B.