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: 

compress issue

Former Member
0 Kudos

hi experts

is there any way to compress a 35 char field to 10 char fields to compare with in select query and without using any function module .

gaurav

4 REPLIES 4

Former Member
0 Kudos

Gaurav

you cannot do so. however if you want to eliminate unnecessary blanks within your string, you can try your hand at keyword CONDENSE, which inturn can reduce the length of the string.

Shane

0 Kudos

hi shane the problem is as such in code

in this code dfkkop-gpart is 10 char consumer no and selw1-dfkkzp is another 35 char variable and i want to compare these two fields at the time of select query as dfkkzp contains 5 lakhs entries and it will fetch all the entries at the run time and i dont want to use function module into this.

select opbel

augst

gpart

vkont

hvorg

tvorg

bldat

budat

faedn

betrw

blart

xblnr

into table int_dfkkop

from dfkkop

for all entries in int_erch

where augst in ('9','')

and gpart = int_erch-gpartner

and bukrs = '0002'.

sort int_dfkkop by gpart opbel.

select keyz1

posza

selw1

selw2

selw3

betrz

bldat

into table int_dfkkzp

from dfkkzp.

sort int_dfkkzp by selw1 selw2 selw3 bldat descending .

delete int_dfkkzp where selw1 is initial .

loop at int_dfkkzp.

int_dfkkzp-gpart = int_dfkkzp-selw1.

int_dfkkzp-vkont = int_dfkkzp-selw2.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = int_dfkkzp-gpart

IMPORTING

OUTPUT = int_dfkkzp-gpart .

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = int_dfkkzp-vkont

IMPORTING

OUTPUT = int_dfkkzp-vkont .

modify int_dfkkzp.

endloop.

sort int_dfkkzp by gpart vkont .

0 Kudos

gaurav

looking at your code what i understood is first you are selecting some dfkkop-gpart which is 10 char long. then you have to fetch data from selw1-dfkkzp comparing gpart against selw1. but the problem is field selw1 is 35 char long. rite now ur concern is how to compare there two fields. if this is the situation then i would suggets you to find the continuation of gpart continuation in selw1 field. i mean to say let say from gpart you are getting one record with customer number as 1000. then you have to look whether this 1000 is appearing in selw1 in a single cntinuation. if so then along with select query use the keyword LIKE AND GIVE VARIABLE AS 'dfkkop-gpart'. however i would not like to use this technique personally as it is very inefficient and will take long run time. in your second select query if you can filter some records putting where clause along with your select query, then you can delete records from internal table by comparing first internal table dfkkop-gpart field. it will be performance wise efficient. hope it makes sense to you.

shane

Former Member
0 Kudos

Hi,

use below logic

declare additional field gpart1(35) in table int_dfkkop

data begin of int_dfkkop occurs 0,

---

--

gpart1(35) type c,

end of int_dfkkop.

use code in bold

select opbel

augst

gpart

vkont

hvorg

tvorg

bldat

budat

faedn

betrw

blart

xblnr

into table int_dfkkop

from dfkkop

for all entries in int_erch

where augst in ('9','')

and gpart = int_erch-gpartner

and bukrs = '0002'.

sort int_dfkkop by gpart opbel.

<b>loop at int_dfkkop.

int_dfkkop-gpart1 = int_dfkkop-gpart.

modify int_dfkkop transporting gpart1.

endloop.</b>

<b>if not int_dfkkop[] is initial.</b>

select keyz1

posza

selw1

selw2

selw3

betrz

bldat

into table int_dfkkzp

from dfkkzp

<b>for all entries in int_dfkkop

where selw1 = int_dfkkop-gpart1.</b>

sort int_dfkkzp by selw1 selw2 selw3 bldat descending .

delete int_dfkkzp where selw1 is initial .

loop at int_dfkkzp.

int_dfkkzp-gpart = int_dfkkzp-selw1.

int_dfkkzp-vkont = int_dfkkzp-selw2.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = int_dfkkzp-gpart

IMPORTING

OUTPUT = int_dfkkzp-gpart .

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = int_dfkkzp-vkont

IMPORTING

OUTPUT = int_dfkkzp-vkont .

modify int_dfkkzp.

endloop.

sort int_dfkkzp by gpart vkont .

Regards

amole