Sometimes you need to change the layout and the content of data in the lists. This article will help you to understand and influence the layout of the DataRepeater.
Before you start to manipulate the DataRepeater you need to understand the customization technology that you can reach at this link:
http://wiki.produmex.name/doku.php?id=implementation:scan:customizationtechnology
This article is based on this wiki page:
http://wiki.produmex.name/doku.php?id=implementation:scan:datarepeater
In Produmex Scan we call the lists DataRepaters
You can see the content of the lines split by characters ‘##’ in the customization screen. The names of the lines always start with ‘DataRepeater.UI’
If you would like to manipulate the displayed content then you should convert the concatenated string into an SQL table with our example splitter functions shown below. This table can be used in a query in order to load the data you need.
You will need a splitter function to separate data. If it does not exist, you can create it with these queries:
MSSQL
CREATE FUNCTION [dbo].[SplitStringForDataRepeater2]
( @string NVARCHAR(MAX), @string2 NVARCHAR(MAX) )
RETURNS @output TABLE(splitdata NVARCHAR(MAX) , splitdata2 NVARCHAR(MAX))
BEGIN
DECLARE @start INT, @end INT , @start2 INT, @end2 INT
SELECT @start = 1, @end = CHARINDEX('##', @string) , @start2 = 1, @end2 = CHARINDEX('##', @string2)
WHILE @start < LEN(@string) + 1 BEGIN
IF @end = 0
BEGIN
SET @end = LEN(@string) + 2
SET @end2 = LEN(@string2) + 2
END
INSERT INTO @output (splitdata, splitdata2)
VALUES(SUBSTRING(@string, @start, @end - @start),
SUBSTRING(@string2, @start2, IIF(@end2 - @start2<0,0,@end2 - @start2)))
SET @start = @end + 2
SET @end = CHARINDEX('##', @string, @start)
SET @start2 = @end2 + 2
SET @end2 = CHARINDEX('##', @string2, @start2)
END
RETURN END
HANA
CREATE FUNCTION SPLITSTRINGFORDATAREPEATER2 (strstring nvarchar(5000), strstring2 nvarchar(5000) )
RETURNS TABLE (splitdata nvarchar(5000) , splitdata2 nvarchar(5000) )
LANGUAGE SQLSCRIPT AS
BEGIN
DECLARE strstart INT;
DECLARE strend INT;
DECLARE strstart2 INT;
DECLARE strend2 INT;
DECLARE _items nvarchar(5000) ARRAY;
DECLARE _index integer;
_index := 1;
strstart := 1;
strend := LOCATE(strstring, '##');
strstart2 := 1;
strend2 := LOCATE(strstring2, '##');
WHILE strstart < LENGTH(strstring) + 1 DO
IF strend = 0 THEN
BEGIN
strend := LENGTH(strstring) + 2;
strend2 := LENGTH(strstring2) + 2;
END;
END IF;
_items[:_index] := SUBSTRING(strstring, strstart, strend - strstart) || '|||' || SUBSTRING(strstring2, strstart2, strend2 - strstart2);
_index := :_index + 1;
strstart := strend + 2;
strend := LOCATE(strstring, '##', strstart);
strstart2 := strend2 + 2;
strend2 := LOCATE(strstring2, '##', strstart2);
END WHILE;
rst = UNNEST(:_items) AS ("items");
RETURN
SELECT SUBSTRING("items", 1, LOCATE("items", '|||') - 1) as "SPLITDATA", SUBSTRING("items", LOCATE("items", '|||') + 3, (LENGTH("items") - LOCATE("items", '|||') ) ) as "SPLITDATA2" FROM :rst;
END;
Hide the displayed data from the DataRepeater
In this example we want to get rid of the stock data from the ‘Guided Counting’ list, because we want to force the user to do blind counting.
Find the name of the screen and the field in the customization assist window, in this case this is the ‘QuickInventoryCountingQuantitiesScreen’ and ‘DataRepeater.UIQuantity’.
Open the BXPCUSTFD user defined table in SAP and add the following line. Be sure the ‘Visible’ value is ‘No’. You can define any code or name at will.
Code | Name | Data Repeater | Field Name | Module | Screen | Visible |
1 | 1 | DataRepeater | UIQuantity | BXMobileWH9 | QuickInventoryCountingQuantitiesScreen | No |
The result
Overwrite the displayed data in the DataRepeater
In this example we only want to get rid of the stock data from the ‘Guided Counting’ list, because we want to force the user to do blind counting. The counted quantity will remain. (Don’t forget to delete the line from the BXPCUSTFD user defined table that we created in the previous section, because we won’t need it in this case)
Find the name of the screen and the field in the customization assist window, in this case this is the ‘QuickInventoryCountingQuantitiesScreen’ and ‘DataRepeater.UIQuantity’.
Also find the name of the ‘DataRepeater_InternalDataLoad’ event, in this case this is ‘BXMobileWH9_QuickInventoryCountingQuantitiesScreen_DataRepeater_InternalDataLoad’.
Now we will use the ‘SplitStringForDataRepeater2’ function that we created earlier.
Create a user query in the query Manager. The name of the query must be the same as the name of the ‘InternalDataLoad’ event.
Query name: BXMobileWH9_QuickInventoryCountingQuantitiesScreen_DataRepeater_InternalDataLoad
Query:
SELECT
LEFT(S.splitdata, CHARINDEX(' / ',S.splitdata)) as "DataRepeater.UIQuantity"
FROM
dbo.SplitStringForDataRepeater2( $[DataRepeater.UIQuantity], '') as S
Take note:
- The input parameter of the ‘SplitStringForDataRepeater2’ is the field name of the DataRepeater
- The alias in the SELECT statement is also the name of the field that we want to overwrite
Result
Add extra lines and data to the DataRepeater
In this example we want to show the bin locations where the stock is currently located on the GRPO screen.
Review the possible ‘Position Data’ values. There are some differences between possible values on Android and on Windows scanner.
Value | Android | Windows |
x | horizontal position (% of screen width from left) | |
y | vertical position (% of screen height from top) | |
w | width (% of screen width) | |
h | not applicable | height (% of screen height) |
f | not applicable | font size (pixel) only on ‘Button’ and for DataRepeater |
lines | The number of extra lines to be added to the screen, only for DataRepeater | |
row |
the row where the field is positioned to as compared to its original position The sequence for the value starts with 1. If a field is customized, but no row value is defined, the field is automatically displayed as the last field on the screen. |
not applicable |
fullrow |
Its value is 1 (fullrow:1). By default, if no x or w value is defined, the given field is displayed in its full width. If you define the x or w value for a field and no other field should be positioned next to it, the fullrow value can be used |
not applicable |
We need to add a line to the CUSTFD table, to make place for the new data. You can define any code or name at will.
Code | Name | Data Repeater | Field Name | Module | Position Data | Screen | Visible |
1 | 1 | DataRepeater | CustomLine01 | BXMobileWH9 | y:50;lines:2 | GoodsReceiptPOLinesScreen | Yes |
Take note of the ‘Position data’. You can add multiple parameters with semicolon separators. In this example we define the new list element with two lines (‘lines’ parameter) and its position in the DataRepeater row is 50 (‘y’ parameter). Feel free to modify these values according to your scanner device.
Then we need to fill this new line with data.
Create a user query in SAP. The name of the query is the same as the name of the screen and the end of its name is ‘_DataRepeater_InternalDataLoad’. In this case this is the ‘BXMobileWH9_GoodsReceiptPOLinesScreen_DataRepeater_InternalDataLoad’.
Query name: BXMobileWH9_GoodsReceiptPOLinesScreen_DataRepeater_InternalDataLoad
Query:
SELECT
S.splitdata,
STRING_AGG(T1.BinCode,', ') AS [DataRepeater.CustomLine01]
FROM
dbo.SplitStringForDataRepeater2($[DataRepeater.UIItemCode],'') AS S
LEFT JOIN
OIBQ T0 ON T0.ItemCode = LEFT(S.splitdata, CHARINDEX(' * ',S.splitdata))
LEFT JOIN
OBIN T1 ON T0.BinAbs = T1.AbsEntry
WHERE
T0.OnHandQty > 0
GROUP BY
S.splitdata
Take note:
You need to add the S.Splitdata in the SELECT statement, because that’s the way the query can link the new data to the existing data. (see the first line after SELECT)
The new data appeared.
In this case I have set up the parameters in the CUSTFD table to an Android device. If you want to optimize the appearance for another device you need to modify the ‘Position Data’.
Comments
0 comments
Please sign in to leave a comment.