hai there
i want to create report like this
this is from table 39
if my code like this
i:=1;
SPH.FIND('-');
REPEAT
// SETRANGE("Shortcut Dimension 1 Code",SPH.Code);
// IF FIND('-') THEN
AmountLoc:=Quantity;
LocName := SPH.Code;
i:= i + 1;
UNTIL (SPH.NEXT = 0) OR (i > SPH.COUNT);
it gonna be
Category A Category B
Item A 15 20
Item B 15 20
Item C 15 20
Item D 15 20
Item E 15 20
Item F 15 20
--> All Lines in Purchase Lines will be showed
but if i Add the setrange
i:=1;
SPH.FIND('-');
REPEAT
SETRANGE("Shortcut Dimension 1 Code",SPH.Code);
IF FIND('-') THEN
AmountLoc:=Quantity;
LocName := SPH.Code;
i:= i + 1;
UNTIL (SPH.NEXT = 0) OR (i > SPH.COUNT);
the result is like this
Category A Category B
Item A 15 20
all I want is like this
Category A Category B
Item A 15 0
Item B 0 20
What mistaken I have made?
please help
0
Comments
You have to insert a repeat.. until loop after getting the first record. Otherwise you are only on the first record. Also you have to use THEN BEGIN..END; if your statements is more than one line. Otherwise code is executed starting from the second line below the if..then block.
Pargesoft
--> this gonna be like this
No Category A Category B
Item A 15 20
what i want is like this
No Category A Category B
Item A 15 0
Item B 0 20
varItem.GET("No.");
varItem.SETRANGE(...);
IF varItem.FIND('-')
...
Pargesoft
FYI, SPH --> table dimension value
before this code, exactly in on pre dataitem , I already filter it
SPH.SETRANGE("Global Dimension Code",1);
Maybe you can write something like:
Pargesoft
There are many problems in that code and first of all you should study training manuals as I said before. We can correct your code here but it'll not be a permanent solution. You should better understand faults in code yourself and correct them by understanding what you are really doing.
Pargesoft
filtering array 1
SPH.SETRANGE(SPH."Global Dimension No.",1);
SPH.FIND('-');
filtering array 2
Cylinder.SETRANGE(Cylinder."Global Dimension No.",2);
Cylinder.FIND('-');
i:= 1;
REPEAT
LocName := SPH.Code;
i:= i +1;
UNTIL
(SPH.NEXT = 0) OR (i > SPH.COUNT);
my problem is... how to use those 2 arrays in execution