Hi Experts,
I am facing a strange issue with the select-option field with BATCH number. This is my join statement.
SELECT VBRK~FKDAT
VBRK~SPART
VBRK~NETWR
VBRK~KUNAG
VBRK~KUNRG
VBRK~SFAKN
VBRP~VBELN
VBRP~VKBUR
VBRP~POSNR
VBRP~MATNR
VBRP~ARKTX
VBRP~FKIMG
VBRP~VRKME
VBRP~VGBEL
VBRP~VGPOS
LIPS~POSNR
LIPS~VBELN
LIPS~LFIMG
LIPS~CHARG
LIPS~PSTYV
INTO TABLE IT_VBRK2
FROM VBRP JOIN VBRK ON VBRP~VBELN = VBRK~VBELN
JOIN LIPS ON VBRP~VGBEL = LIPS~VBELN
AND VBRP~MATNR = LIPS~MATNR
WHERE VBRK~FKDAT IN SO_FKDAT
AND VBRP~MATNR IN SO_MATNR
AND VBRP~VKBUR IN SO_VKBU2
AND VBRP~VBELN IN SO_VBELN
AND VBRK~KUNAG IN SO_KUNAG
AND VBRP~SPART IN SO_SPART
AND LIPS~CHARG IN SO_CHARG.
But the select-options is not working when CHARG is given in range. But for individual values it is working. I wrote a simple select query to study the issue as below.
DATA: W_CHARG TYPE LIPS-CHARG.
SELECT-OPTIONS: SO_MCHA FOR W_CHARG.
TYPES: BEGIN OF TY_LIPS,
CHARG TYPE MCHA-CHARG,
END OF TY_LIPS.
DATA: IT_LIPS TYPE STANDARD TABLE OF TY_LIPS,
WA_LIPS LIKE LINE OF IT_LIPS.
SELECT CHARG FROM LIPS INTO TABLE IT_LIPS WHERE CHARG IN SO_MCHA.
LOOP AT IT_LIPS INTO WA_LIPS.
WRITE: / WA_LIPS-CHARG.
ENDLOOP.
But then also CHARG is not showing as per the values given in the select-options. It is showing superfluous values also. Any thoughts on this?
BR.