Skip to Content
author's profile photo Former Member
Former Member

compress issue

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 24, 2006 at 11:20 AM

    Hi,

    Can you paste your sample data.

    But you can use CONDENSE c NO-GAPS.

    eg: v_field(30) type c.

    c_zero(1) type c.

    v_field = ' 0000100089880'.

    condense v_field. "v_field = 0000100089880

    shift left v_field deleting leading c_zero.

    now v_field = 100089880

    Thanks,

    Ramakrishna

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi Ramakrishna

      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 .

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2006 at 02:20 PM

    Hi Gaurav,

    Try following code.

    data: v(14) type c value '00000000001000',

    req(4),

    START-OF-SELECTION.

    unpack v to req.

    write:/ req.

    -Anu.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.