Skip to Content

sort+logical database using field group and extract

Hi Folks,

I have a program which is using Logical database concept and creating a file on application server as below.


 SORT BY
    reguh-zbukr                        "Zahlender Buchungskreis
    reguh-rzawe                        "Payment method
    reguh-ubnks                        "Bankland unserer Bank
    reguh-ubnky                        "Bankkey zur Übersortierung
    reguh-ubnkl                        "Bankleitzahl unserer Bank
    reguh-ubknt                        "Kontonummer bei unserer Bank
    payment_form                       "Brazil: CC, DOC or OP
    regud-xeinz                        "X - Lastschrift
    reguh-zbnks                        "Bankland Zahlungsempfänger
    reguh-zbnky                        "Bankkey zur Übersortierung
    reguh-zbnkl                        "Bankleitzahl Zahlungsempfänger
    reguh-zbnkn                        "Bank-Ktonummer Zahlungsempfänger
    reguh-lifnr                        "Kreditorennummer
    reguh-kunnr                        "Debitorennummer
    reguh-empfg                        "Zahlungsempfänger CPD
    reguh-vblnr                        "Zahlungsbelegnummer
    regup-belnr.   
LOOP.
AT NEW reguh-rzawe
.....
.......
........
PERFORM store_on_file USING j_1bh1.
ENDAT

AT NEW reguh-ubnkl
.....
.......
........
PERFORM store_on_file USING j_1bh2.
ENDAT

AT NEW reguh-ubnkt
.....
.......
........
PERFORM store_on_file USING j_1bh2.
ENDAT


AT NEW VBLNR
.....
.......
........
PERFORM store_on_file USING j_1bh3.

AT DATEN
.....
.......
........
PERFORM store_on_file USING j_1bh4.
ENDAT.

ENDLOOP.

FORM store_on_file USING daten.
  IF hlp_temse CA par_dtyp.            "Temse
    PERFORM temse_schreiben USING daten.
  ELSE.
    TRANSFER daten TO g_name.
  ENDIF.
ENDFORM.

Is Sorting concept different when it comes to logical databases and field groups ?

I had added a new field in the sort reguh-rzawe.I think due to that it is getting into AT NEW UBNKL and AT NEW UBKNT even though those details are same for the payment methods in the payment run.Even though the house bank number and account number is same for all the payment methods it is getting into AT NEW UBNKL and AT NEW UBKNT for every new payment method in the iteration.

vblnr-1

rzawe- A

ubnkl-12345

ubnkt-45678

vblnr-2

rzawe- A

ubnkl-12345

ubnkt-45678

vblnr-3

rzawe- B

ubnkl-12345

ubnkt-45678

vblnr-4

rzawe- B

ubnkl-12345

ubnkt-45678

Can anyone here throw some light on this.

Thanks,

K.Kiran.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Mar 09, 2012 at 04:40 PM

    Read the documentation for the at-new process. As I recall the at-new considers the field named, and all the fields to the left of that in the table. With that in mind, look at how your logic will work. This could result in more, or fewer, breaks than intended(fewer if, for instance, a field to the left was deleted).

    Add comment
    10|10000 characters needed characters exceeded