Error when showing the value of VBDKR-WAERK in Form Painter ABAP - sapscript

I am trying to fix a bug in the Form Painter which is related to the VBDKR-WAERK. The problem is as shown in the screenshot below:
So in place of VBDKR-WAERK should be EUR. The code in Form painter for this part is:
&VBDKR-ZTERM_TX1(IC)&
&'(='SKONTOWERT1(ICZ)' VBDKR-WAERK&)'&
&VBDKR-ZTERM_TX2(IC)&
&'(='SKONTOWERT2(ICZ)' VBDKR-WAERK&)'&
&VBDKR-ZTERM_TX3(IC)&
SKONTOWERT1 and SKONTOWERT2 are type KOMVD-KWERT.
May anyone know what the problem may be?
Please do tell me if you need additional information.
Thank you all in advance!

Field names in SAPScript always have to be entered with leading and closing '&':
VBDKR-WAERK& => &VBDKR-WAERK&
&VBDKR-ZTERM_TX1(IC)&
&'(='SKONTOWERT1(ICZ)' &VBDKR-WAERK&)'&
&VBDKR-ZTERM_TX2(IC)&
&'(='SKONTOWERT2(ICZ)' &VBDKR-WAERK&)'&
&VBDKR-ZTERM_TX3(IC)&

Although the question is not about Smart Forms, I just saw that SAPScript and Smart Forms interpret differently the notation &'pre-text'symbol'post-text'&. SAPScript accepts symbols in pre-text and post-text, but Smart Forms doesn't (with &'(='SKONTOWERT1(ICZ)' &VBDKR-WAERK&)'&, I get the exception FORMATTING_ERROR, message ID SSFCOMPOSER, message number 308, message "Fields within fields are not allowed (SKONTOWERT1).").
This notation works in both technologies:
(=&SKONTOWERT1(ICZ)& &VBDKR-WAERK&)
meaning
Text "(="
followed by variable/symbol SKONTOWERT1 (with ICZ being 3 individual characters each meaning respectively initial value (zero) not output, compress spaces, omit leading zeroes)
followed by one space
followed by variable/symbol VBDKR-WAERK
followed by text ")"

Related

ArangoDB query find name consisting of two or more parts

i am quite new to arangodb and AQL. What i am trying to do is to find names and surnames with query that have two or more parts that may or may not include spaces (" ") to divide those said parts.
As i went through documents, I figured that those fileds should be indexed as full-text indexes and query would be something like
FOR u IN FULLTEXT(collection, field, "search") RETURN u
Now my question is how to utilize the above query for a Persian/Arabic names such as
سید امیر حسین
Keep in mind that this name comes from an input of a user and it could be in the following formats such as
سید امیر حسین/سید امیرحسین/سیدامیر حسین/سیدامیرحسین
Note the various types of names with/without spaces. I tried the follwoing query F
FOR u IN FULLTEXT(collection, field, "سید,|امیر,|حسین,|سیدامیرحسین") RETURN u
But the problem is this will also result of fetching the name because i reckon the use of OR ( | ) operator.
سید محمد
which is not my intention. So what am i doing wrong or missing here ?
Many thanks in advance and excuse my noobiness
PS : arango 3.8.3

Have screen reader pronounce Country codes in a text input as individual letters

I am working on an Angular app that displays selected Country codes in a text field. This input displays Country codes because of space constraints:
<input type="button" #countryListTrigger matInput readonly i18n-placeholder placeholder="COUNTRIES" [ngModel]="selectedCountries" />
Here's what the control looks like with Country codes displayed:
Countries Widget
Right now, screen readers would read the AU like the letter "o" and AT like "#". I know about the tag, but is there a way to achieve the same result on an input value? Otherwise, I could add another (hidden) control that is read instead perhaps?
It starts getting messy if you try to force a screen reader to announce things phonetically. If you add an aria-label that has aria-label="A U" or aria-label="A T", then braille users will be out of luck because they'll read "A space U".
It's unfortunate there isn't really a good solution for this. The screen reader user can read the input value one character at a time so if it sounds weird to them, they have a work around. It's not a great user experience but having screen readers mispronounce stuff has been a problem for a long time.

What is wrong with my Power BI query (using a parameter)?

I'm brand new to using PBI but as far as I can tell, I should be able to substitute a parameter as part of a Direct Query in place of a hard-coded variable...ie
let
Source = Sql.Database("NAMEOFDB", "CMUtility", [Query="sp_get_residentsinfo "& home_name]),.....
instead of
let
Source = Sql.Database("NAMEOFDB", "CMUtility", [Query="sp_get_residentsinfo 'NAME OF HOME'"]),...
However, the parameter-included version just says
DataSource.Error: Microsoft SQL: Incorrect syntax near 'House'.
Details:
DataSourceKind=SQL
DataSourcePath=NAMEOFDB;CMUtility
Message=Incorrect syntax near 'House'.
Number=102
Class=15
"House" is the currently - assigned last word of the home_name variable. What have I done wrong?
PS - I have surmised that I shouldn't need the extra & at the end of the parameter, as I'm not adding anything else to the query, but even with both &s it still doesn't work.
The type of your parameters is text. In SQL, text literals must be quoted, i.e. sp_get_residentsinfo 'NAME OF HOME', but the statement build by you is sp_get_residentsinfo NAME OF HOME.
You should use Text.Replace to escape single quotes in the parameter's value and append a quote before and after it.

Parsing a name from a complex string in Tableau

I have a series of values in Tableau that are long strings intermixed with letters and numbers. I am unable to control the data output, but would like to parse the names from these strings. They follow the following format:
Potato 1TByte 4.5 NFA
Board 256GByte 553 NCA
Launch 4 512GByte 4.5 NFA
Launch 4S 512GByte 4.5 NCA
From each of these, I am attempting to capture the following:
"Potato"
"Board"
"Launch 4"
"Launch 4S"
Each string follows the same format: the name, followed by size, followed by some extra information we don't really care about.
I've tried to put together some text parsing strings, but am coming up short, and am still trying to learn regular expressions.
The Tableau calculated field I was trying to work with was something like the following:
LEFT([String], FIND([String], "Byte") - 2)
The issue is that the text and numbers preceding Byte can be anywhere from 4 to 2 characters and I need a way to identify the length of that.
Any help would be greatly appreciated!
One option which uses a regex replacement:
REGEXP_REPLACE('Launch 4 512GByte 4.5 NFA', ' \d+[A-Z]Byte .*$', '')
This strips off everything from the Byte term to the right, leaving us with only the product name.
You could try the following - this seems to work - Screenshot of Tableau output. Find below the formulas for the various derived columns you see in the screenshot (Your source column is called [Name])
Step1 = LEFT([Name],FIND([Name],"Byte")-1)
Step2 = LEN([Step1])-LEN(REPLACE([Step1]," ",""))
Step3 = FINDNTH([Step1]," ",[Step2])
Step4 = LEFT([Step1],[Step3]-1)
And of course you can nest all these in a single calculated field - kept them as separate columns for easier understanding

Format mask for number field items: trailing and 'leading' zero

I'm having some trouble with displaying numbers in apex, but only when i fill them in through code. When numbers are fetched through an automated row fetch, they're fine!
Leading Zero
For example, i have a report where a user can click a link, which runs a javascript function. There i get detailed values for that record through an application process. The returned values are in JSON. Several fields are number fields.
My response looks as follows (fe):
{"AVAILABLE_STOCK": "15818", "WEIGHT": ".001", "VOLUME": ".00009", "BASIC_PRICE": ".06", "COST_PRICE": ".01"}
Already the numbers here 'not correct': values less than one do not have a zero before the .
I kind of hoped that the format mask on the items would catch this. If i specify FM999G990D000 for the item weight, i'd expect it to show '0.001' .
But okay, i suppose it only works that way when it comes through session state, and not when you set an item value through $("#").val() ?
Where do i go wrong? Is my only option to change my select in the app process?
Now:
SELECT '"AVAILABLE_STOCK": "' || AVAILABLE_STOCK ||'", '||
'"WEIGHT": "' || WEIGHT ||'", '||
'"VOLUME": "' || VOLUME ||'", '||
'"BASIC_PRICE": "' || BASIC_PRICE ||'", '||
Do i need to provide my numberfields a to_char with the format mask here (to_char(available_stock, 'FM999G990D000')) ?
Right now i need to put my numbers between quotes ofcourse, or i get invalid json when i parse it.
Trailing Zero
I have an application process on a page on the after header point, right after an automated row fetch. Several fields are calculated here (totals). The variables used are all specified as number(10, 2). All values are correct and rounded to 2 values after the comma. My format masks on the items are also specified as FM999G999G990D00.
However, when one of the calculated values has only one meaningfull value after the comma, the trailing zeros get dropped. Instead of '987.50', it is displayed as '987.5'.
So, i have a number variable, and assign it like this: :P12_NDB_TOTAL_INCL := v_totI;
Would i need to convert my numbers here too, with format mask?
What am i doing wrong, or what am i missing?
If you aren't doing math on it and are more concerned with formatting, I suggest treating it as a varchar/string instead of as a number wherever you can.