‎2010 Jun 15 6:43 AM
hi all,
SELECT SINGLE bktxt "Document header text
FROM bkpf
INTO l_bktxt
WHERE bktxt = r_bktxt "Document header text - by user
and bukrs = c_comapny "Company Code
AND blart = 'PA' "Document Type
OR blart = 'PB'
OR blart = 'PC'
OR blart = 'PD'
OR blart = 'PE'
OR blart = 'PF'
OR blart = 'PH'
OR blart = 'CA'
OR blart = 'CB'
OR blart = 'CD'
OR blart = 'CE'
OR blart = 'CF'
OR blart = 'CK'
OR blart = 'CM'
OR blart = 'CN'.
i am checking the BKTXT against BKPF with r_bktxt, Whether it is there or not.
but the problem is, if the bktxt is not matched then it should not get any value.
but it is getting some other value matching with blart.
Please give me any suggestion.
Regards,
Sri
‎2010 Jun 15 6:53 AM
Hi,
Try to use brackets in ur select querry as belwo.
SELECT SINGLE bktxt "Document header text
FROM bkpf INTO l_bktxt
WHERE bktxt = r_bktxt "Document header text - by user
and bukrs = c_comapny "Company Code
AND ( blart = 'PA' "Document Type
OR blart = 'PB'
OR blart = 'PC'
OR blart = 'PD'
OR blart = 'PE'
OR blart = 'PF'
OR blart = 'PH'
OR blart = 'CA'
OR blart = 'CB'
OR blart = 'CD'
OR blart = 'CE'
OR blart = 'CF'
OR blart = 'CK'
OR blart = 'CM'
OR blart = 'CN' )
‎2010 Jun 15 6:53 AM
Hi,
Try to use brackets in ur select querry as belwo.
SELECT SINGLE bktxt "Document header text
FROM bkpf INTO l_bktxt
WHERE bktxt = r_bktxt "Document header text - by user
and bukrs = c_comapny "Company Code
AND ( blart = 'PA' "Document Type
OR blart = 'PB'
OR blart = 'PC'
OR blart = 'PD'
OR blart = 'PE'
OR blart = 'PF'
OR blart = 'PH'
OR blart = 'CA'
OR blart = 'CB'
OR blart = 'CD'
OR blart = 'CE'
OR blart = 'CF'
OR blart = 'CK'
OR blart = 'CM'
OR blart = 'CN' )
‎2010 Jun 15 7:04 AM
hi,
try to use IN ..
SELECT SINGLE bktxt "Document header text
FROM bkpf
INTO l_bktxt
WHERE bktxt = r_bktxt "Document header text - by user
and bukrs = c_comapny "Company Code
AND blart in ('PA','PB','PC','PD'.......).
regards,
syed
‎2010 Jun 15 7:29 AM
Hi Sri,
you are checking multiple document type. so you have to mention in brackets. Pls try below code.
SELECT SINGLE bktxt "Document header text
FROM bkpf
INTO l_bktxt
WHERE bktxt = r_bktxt "Document header text - by user
and bukrs = c_comapny "Company Code
AND ( blart = 'PA' "Document Type
OR blart = 'PB'
OR blart = 'PC'
OR blart = 'PD'
OR blart = 'PE'
OR blart = 'PF'
OR blart = 'PH'
OR blart = 'CA'
OR blart = 'CB'
OR blart = 'CD'
OR blart = 'CE'
OR blart = 'CF'
OR blart = 'CK'
OR blart = 'CM'
OR blart = 'CN' ).
Rgds,
Arun