‎2012 May 02 12:19 PM
Dear Experts,
I have made a select statement as follows :
In selection Parameter so_coken - is values L1,j1,j2,j3,j4,j5,j6..
SELECT cobk~belnr cobk~kokrs cobk~gjahr cobk~perab cobk~perbi cobk~vrgng coep~sgtxt
INTO CORRESPONDING FIELDS OF TABLE gt_cobk
FROM cobk INNER JOIN coep
ON cobk~kokrs = coep~kokrs AND cobk~belnr = coep~belnr
WHERE cobk~kokrs IN so_kokrs
AND cobk~vrgng IN so_vrg AND cobk~gjahr = p_gjahr
AND cobk~perab = p_period AND cobk~perbi = p_period
AND cobk~stflg = '' AND cobk~stokz = ''
AND coep~sgtxt+0(2) IN so_coken.
But now there is a change so that the entries in the field COEP~Sgtxt looks like
L1testsegment
J1testsegment
J2testsegment and so on.
So I need only the first 2 letters from this field.How can i modify my select statement.
I tried to change it like in the select statement coep~sgtxt+0(2) IN so_coken.But its not working.
Thanks
K
‎2012 May 02 12:47 PM
Fathima,
I believe Offset in the Select Query is not possible. You will need to select the data from the table and then apply a loop to filter-out the records based on your need. Maximum, you can tweak the last cond a below
AND coep~sgtxt IN so_coken
And Contents of so_coken as below
L1*
J1*
J2* .. and on..
This will redude the number of entries but still Loop is needed
‎2012 May 02 12:47 PM
Fathima,
I believe Offset in the Select Query is not possible. You will need to select the data from the table and then apply a loop to filter-out the records based on your need. Maximum, you can tweak the last cond a below
AND coep~sgtxt IN so_coken
And Contents of so_coken as below
L1*
J1*
J2* .. and on..
This will redude the number of entries but still Loop is needed