B1UP UF with nested Line Loop
AnsweredHi
I have UF-003 (SQL report) that select salesorder I want to add a new line to with itemno. 99990.
Select DocEntry, DocNum, Cardcode , Cardname, Doctotal, U_Camp, U_hoved_OrdreTeller from ordr where Docdate >= [%0] and Docdate <=[%1] and U_Hoved_OrdreTeller = 3
On this form I have added a UF-007 Line Loop that calls UF-004 for each line
The UF-004 (macro) open the salesorder from the SQL and calls UF-005
OpenForm(17|$[$BOY_1.DocEntry.STRING]);
Activate();
UF(UF-005);
AutoPressNextPopup();
Close();
UF-005 Line Loop check if line with itemno 99990 exits if not at end it calls UF-006

UF-006 macro) add line with itemno 99990 if called.
SET($[$38.1.0]|99990);
The problem I have is that if I add UF-005 to salesorder I want to add the line it works without problem.
If I nest this into the Line loop for the SQL form, I get an error on the first salesorder, and on all other salesorder from the SQL, it replace whatever is on line 1 with itemno 99990.
It selects the correct salesorders from the SQL, but seem to miss the count of linenumber in the salesorder. Any suggestion on what to modify ?
The error message on the first salesorder fom UF-006 is:
10:47:50 Executing: SET($[$38.1.0]|99990);
10:47:51 Exception in macro: System.Exception: Error setting Matrix '38' - Column '1' - Row '0' with value '99990' [Check that it is visible and active] (Item - Form item is not editable)
On rest no errors, but it replace line 1 instead of adding a new line..
-
Official comment
Hello Leif,
In this case you don't need a nested lineloop, for what I understand yyou have a report and you need a lineloop that opens the Sales Orders and add a line when a condition is met.
You can use Dynamic Syntax for this,instead of using a second lineloop you can use the same Line Macro that opens the sales order, just use the command with the B1UP Extension using LAST. For example: Set($[$38.1.0.LAST|]99990); this will add this item in the last line. You can also add conditions into macros.
https://support.boyum-it.com/hc/en-us/articles/204284188-Guide-Understanding-Dynamic-Syntax
The following article explains this in more detail, i you have further questions regarding this topic, please contact your SAP Partner.
Please sign in to leave a comment.
Comments
1 comment