Application Development and Automation 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: 
Read only

range and dump

Former Member
0 Likes
767

i had this code


RANGES r_clienti FOR kna1-kunnr.
START-OF-SELECTION.
  CLEAR ok_exit.
  CLEAR sti_knvp2.
  IF NOT s_vendi[] IS INITIAL.
  SELECT kunnr FROM knvp INTO r_clienti-low
                        WHERE kunn2 IN s_vendi
                          AND vkorg EQ 'IT07'
                        AND kunnr IN dd_kunnr
                        AND parvw = 'V2'.           "ae-modif 19.04.08
     r_clienti-option = 'EQ'.
      r_clienti-sign = 'I'.
     APPEND r_clienti.
    ENDSELECT.

    DESCRIBE TABLE r_clienti LINES n_cli.
    IF n_cli < 1000.
      dd_kunnr[] = r_clienti[].
      IF dd_kunnr[] IS INITIAL.
        EXIT.
      ENDIF.
    ENDIF.

i want to take off the select/end select and i made

SELECT kunnr FROM knvp APPENDING TABLE sti_knvp2
                        WHERE kunn2 IN s_vendi
                          AND vkorg EQ 'IT07'
                          AND kunnr IN dd_kunnr
                          AND parvw = 'V2'.           "ae-modif 19.04.08
    LOOP AT sti_knvp2.
      r_clienti-low = sti_knvp2-kunnr.
      r_clienti-option = 'EQ'.
      r_clienti-sign = 'I'.
      MODIFY r_clienti.
    ENDLOOP.
    DESCRIBE TABLE r_clienti LINES n_cli.
    IF n_cli < 1000.
      dd_kunnr[] = r_clienti[].
      IF dd_kunnr[] IS INITIAL.
        EXIT.
      ENDIF.
    ENDIF.

but the report goes in dump and i can't understand why.

who can help me please?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
733

This line should be an APPEND


    LOOP AT sti_knvp2.
      r_clienti-low = sti_knvp2-kunnr.
      r_clienti-option = 'EQ'.
      r_clienti-sign = 'I'.
      MODIFY r_clienti.        "  Should be APPEND
    ENDLOOP.

after you build the Range, you should also SORT and DELETE DUPLICATES.

6 REPLIES 6
Read only

former_member156446
Active Contributor
0 Likes
733

using the ranges will effect the performance... try if you can eliminate it..


SELECT kunnr FROM knvp into vl_kunnr 
                        WHERE kunn2 IN s_vendi
                          AND vkorg EQ 'IT07'
                          AND kunnr IN dd_kunnr
                          AND parvw = 'V2'.           "ae-modif 19.04.08

    LOOP AT sti_knvp2.
      r_clienti-low = vl_kunnr.
      r_clienti-option = 'EQ'.
      r_clienti-sign = 'I'.
      MODIFY r_clienti.
    ENDLOOP.

Read only

Former Member
0 Likes
733

What is the dump message you are getting and what is the structure of the table sti_knvp2 which you are using?

Regds,

Krish

Read only

Former Member
0 Likes
733

If the dump is because of range then you can try using for all entries in r_xxx where <field> eq r_xxx-low. In your case you are using 2 ranges - depending upon which range you feel can have more number of records, you can switch that using for all entries.

Regds,

Krish

Read only

Former Member
0 Likes
733

HI EBONGUE ANDRE ,

CHeck with the firlds in your internal table sti_knvp2.if it contain more fields other than Kunnr,Pls use into corresponding fields of table .

Hope this will work.

<REMOVED BY MODERATOR>

Thanks and regards,

Rajeshwar.

Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:33 PM

Read only

Former Member
0 Likes
734

This line should be an APPEND


    LOOP AT sti_knvp2.
      r_clienti-low = sti_knvp2-kunnr.
      r_clienti-option = 'EQ'.
      r_clienti-sign = 'I'.
      MODIFY r_clienti.        "  Should be APPEND
    ENDLOOP.

after you build the Range, you should also SORT and DELETE DUPLICATES.

Read only

0 Likes
733

thanx yall a lot by appending instead of modify i solve the problem