Zum Inhalt springen

Empfohlene Beiträge

Geschrieben

hmm, ich wies nicht obs hier wirklich richtig ist.

Ich hab nen MS Dynamics AX 4.0 auf MS-SQL 2005

und will nun folgendes erreichen.

In Tabelle B2B_Potentials sind für Kunden das zu einer ItemGroup gehörende Potential vermerkt.

Also so in der Art:

BusRelAccount | ItemGroupID | Potential

000001 | 1749 | 5000

000001 | 1536 | 1000

000002 | 1536 | 5000

Nun bräuchte ich eine Funktion die für alle nicht aufgeführten Kombinationen Kunde - ItemGroup das Potential 0,01 einträgt.

Ich habe den folgenden Code mal geschrieben:

static void STUFillB2BPotentials(Args _args)

{

    B2B_Potentials  B2B_Potentials;

    smmBusRelTable  smmBusRelTable;

    InventItemGroup InventItemGroup;


    ttsbegin;


    while select forupdate B2B_Potentials

    {

        while select * from smmBusRelTable

        {

            while select * from InventItemGroup

            {

                if (InventItemGroup.ItemGroupId != '9999' && InventItemGroup.ItemGroupId != '1899' && InventItemGroup.ItemGroupId != '1799')

                {

                    if ( B2B_Potentials.smmBusRelAccount == smmBusRelTable.BusRelAccount && B2B_Potentials.ItemGroupId == InventItemGroup.ItemGroupId)

                    {

                        info (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                        print (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                    }

                    print (strfmt("%1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                }

            }

        }

    }


    ttscommit;

}

Der soll mit erstmal ja nur die ausgeben die schon enthalten sind.

wenn das richtig klappt würde ich beim innersten if die == durch != ersetzen und die zuweisungen der Felder mit einbauen.

Ich habe nun das Problem.

Das er mit nie alle findet die bereits in der B2B_Potentials enthalten sind.

Irgendeiner ne Idee was ich falsch mache?

Geschrieben

args.

manchmal ists ja so einfach.

static void STUFillB2BPotentials(Args _args)

{

    B2B_Potentials  B2B_Potentials;

    smmBusRelTable  smmBusRelTable;

    InventItemGroup InventItemGroup;


    ttsbegin;


        while select * from smmBusRelTable

        {

            while select * from InventItemGroup

            {

                if (InventItemGroup.ItemGroupId != '9999' && InventItemGroup.ItemGroupId != '1899' && InventItemGroup.ItemGroupId != '1799')

                {

                   while select forupdate B2B_Potentials

                   {

                    if ( B2B_Potentials.smmBusRelAccount == smmBusRelTable.BusRelAccount && B2B_Potentials.ItemGroupId == InventItemGroup.ItemGroupId)

                    {

                        info (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                        print (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                    }

                    print (strfmt("%1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                }

            }

        }

    }


    ttscommit;

}

das while select forupdate muss in die innerste schleife. :upps

klar ansonsten geht er ja für jeden gefundenen treffer in der B2B_Potentials alle Kunden und ItemGroups durch.

*in Tischkante beis*

Erstelle ein Benutzerkonto oder melde Dich an, um zu kommentieren

Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde Dich hier an.

Jetzt anmelden

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...