‎2007 Feb 12 10:56 AM
Hi Experts,
I am facing error the following code, when I tried to user like %.
SELECT OBJNR "Object Number
LMVRG "Confirmed Qty.
XMVRG "Scrapped Qty.
AGRND "Reason Code
BLDAT "Document date
VORNE "Reporting Point
FROM CEZP
INTO TABLE TCEZP
for all entries in tmdks
WHERE <b>objnr like %tmdks-aufnr</b>
and PLNKN <> '99999999'
AND WERKS IN S_WERKS
AND BLDAT IN S_BUDAT
AND STFLG = SPACE " Identifier for reversal document
AND STOKZ = SPACE. " Identifier for "document was reversed
Please advise.
Thanks in advance,
Viven
‎2007 Feb 12 11:01 AM
Hello Chander,
Do like this.
DATA: RA_OBJNR TYPE RANGE OF OBJNR WITH HEADER LINE.
DATA: LV_OBJNR(10).
LOOP AT TMDKS.
RA_OBJNR-SIGN = 'I'.
RA_OBJNR-OPTION = 'CP'.
CONCATENATE TMDKS-AUFNR '*' INTO V_OBJNR.
RA_OBJNR-LOW = LV_OBJNR.
APPEND RA_OBJNR.
CLEAR RA_OBJNR.
ENDLOOP.
<b>IF NOT RA_OBJNR[] IS INITIAL.</b>
SELECT OBJNR "Object Number
LMVRG "Confirmed Qty.
XMVRG "Scrapped Qty.
AGRND "Reason Code
BLDAT "Document date
VORNE "Reporting Point
FROM CEZP
INTO TABLE TCEZP
<b>WHERE objnr in RA_OBJNR</b>
and PLNKN <> '99999999'
AND WERKS IN S_WERKS
AND BLDAT IN S_BUDAT
AND STFLG = SPACE " Identifier for reversal document
AND STOKZ = SPACE. " Identifier for "document was reversed
ENDIF.
Vasanth
‎2007 Feb 12 10:59 AM
Put the entries from table tmdks into a range using the option value of 'CP'. You will also need the wildcard symbol on the values in the range table.
Ranges r_aufnr for tmdks-aufnr.
r_aufnr-option = 'CP'.
r_aufnr-sign = 'I'.
loop at tmdks.
concatenate '' tmdks-aufnr '' into r_aufnr-low.
append r_aufnr.
endloop.
Message was edited by:
Martin Shinks
‎2007 Feb 12 11:00 AM
take this inot a variable as follows -
d_var = tmdks-aufnr.
concatenate % d_var into d_var.
then write ur select query liek this -
SELECT OBJNR "Object Number
LMVRG "Confirmed Qty.
XMVRG "Scrapped Qty.
AGRND "Reason Code
BLDAT "Document date
VORNE "Reporting Point
FROM CEZP
INTO TABLE TCEZP
for all entries in tmdks
WHERE objnr like d_var
and PLNKN <> '99999999'
AND WERKS IN S_WERKS
AND BLDAT IN S_BUDAT
AND STFLG = SPACE " Identifier for reversal document
AND STOKZ = SPACE. " Identifier for "document was reversed
‎2007 Feb 12 11:01 AM
Hello Chander,
Do like this.
DATA: RA_OBJNR TYPE RANGE OF OBJNR WITH HEADER LINE.
DATA: LV_OBJNR(10).
LOOP AT TMDKS.
RA_OBJNR-SIGN = 'I'.
RA_OBJNR-OPTION = 'CP'.
CONCATENATE TMDKS-AUFNR '*' INTO V_OBJNR.
RA_OBJNR-LOW = LV_OBJNR.
APPEND RA_OBJNR.
CLEAR RA_OBJNR.
ENDLOOP.
<b>IF NOT RA_OBJNR[] IS INITIAL.</b>
SELECT OBJNR "Object Number
LMVRG "Confirmed Qty.
XMVRG "Scrapped Qty.
AGRND "Reason Code
BLDAT "Document date
VORNE "Reporting Point
FROM CEZP
INTO TABLE TCEZP
<b>WHERE objnr in RA_OBJNR</b>
and PLNKN <> '99999999'
AND WERKS IN S_WERKS
AND BLDAT IN S_BUDAT
AND STFLG = SPACE " Identifier for reversal document
AND STOKZ = SPACE. " Identifier for "document was reversed
ENDIF.
Vasanth
‎2007 Feb 12 11:03 AM