ExtractValue for multiple elements - extract-value

Need to get:
firstdatavalue
seconddatavalue
values from text
and dont know if using EXTRACTVALUE is best option
<TextblockParameter>
<tagName>firstdata</tagName>
<value>firstdatavalue</value>
</TextblockParameter>
<TextblockParameter>
<tagName>seconddata</tagName>
<value>seconddatavalue</value>
</TextblockParameter>

Related

Querring Humio (LogScale)

i'm trying to create this query for Humio and can't figure out the syntax I need.
I want to use the regex() function on fieldA, put its result in a new field RESULT and then look for RESULT inside the text of fieldB.
I tried something like:
regex(regex="...(?<RESULT>...)...", field=fieldA)
| in(field=fieldB, values=[*RESULT*])
but I can only pass free text to the value of the in() function.
How can I pass the value of the new field?

Editable ALV with no limitation of lines

I need to create a report that displays an empty ALV with 4 columns and that is editable (the user can input on the fields of the ALV).
The ALV is going to be used as an input for the user and the data is then going to be read from the ALV.
What would be the best approach for this?
When youre setting the fieldcatalog, you need to declare "editable". For example
wa_fieldcat-fieldname = 'REMARKS'.
wa_fieldcat-scrtext_m = 'Purchase Order'.
wa_fieldcat-col_pos = 1.
wa_fieldcat-outputlen = 10.
wa_fieldcat-editable = 'X'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
Then you need to declare in your process after input(PAI) the check changed data of the alv.
alv->checked_changed_data

Show table by button click

TABLES: mara, marc.
"marc is N
"mara is 1
SELECTION-SCREEN PUSHBUTTON 15(10) text-001 USER-COMMAND press.
DATA: lt_mara TYPE TABLE OF mara WITH HEADER LINE,
ls_mara TYPE mara.
DATA: lt_marc TYPE TABLE OF marc WITH HEADER LINE,
ls_marc TYPE marc,
Sum type P length 8 DECIMALS 2.
PARAMETERS: p_mtart TYPE mara-mtart.
SELECT-OPTIONS: so_werks FOR marc-werks.
SELECT * FROM mara INTO TABLE lt_mara
WHERE mtart = p_mtart.
IF sy-subrc = 0.
SELECT * FROM marc INTO TABLE lt_marc
FOR ALL ENTRIES IN lt_mara
WHERE matnr = lt_mara-matnr
AND werks IN so_werks.
LOOP AT lt_marc INTO ls_marc.
READ TABLE lt_mara INTO ls_mara
WITH KEY matnr = ls_marc-matnr.
sum = ls_mara-brgew + ls_mara-ntgew .
WRITE:/ ls_mara-mtart, ls_marc-matnr , ls_marc-werks , ls_mara-brgew, ls_mara-ntgew,sum.
ENDLOOP.
ELSE.
MESSAGE TEXT-e02 TYPE 'E' .
ENDIF.
How Can make this happen:I want that on click of the button to show the table.Please the code to be as simple as possible and as easy to understand as possible.if you can't make it with a button make it with a radiobutton or smth else.
Thanks in advance!
If you want to keep it simple, you can use "sy-ucomm" which stores your last triggered action. With your button, it'd look like this:
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'PRESS'.
*code for displaying your table via ALV or WRITE goes here*
ENDCASE.
The most common way to display internal tables like this is with an ALV, a simple example of how to build up an ALV can be found here:
https://archive.sap.com/discussions/thread/873601
If you'd like it to do the WRITE: to screen under one circumstance, and display the ALV Grid in another, you should use Select Options and parameters.
Your code needs the addition of EVENTS, please take a look here on what they are and how to use them:
http://www.erpworkbench.com/abap/abap-events.htm

Is there way to change column values of selected rows through Propel?

Rows are selected like that:
$book->getBookGenreToBooks()->???()
I want to change the column «checked» of all selected rows.
Your given solution in your answer is very inefficient since it creates for each update a new query. A better way is to do all changes in one query:
BookGenreQuery::create()
->filterByBookId($book->getId())
->update(array('Checked' => 1));
I don't know how exactly your relations and fields are named by you should get the idea behind it.
$genresToBook = $book->getBookGenreToBooks();
foreach ($genresToBook as $genreToBook) {
$genreToBook->setChecked(1); //Set any data here
}
$genresToBook->save();
This isn't exactly what I want, but that works fine to me.

Sizing a spark list

I'm using spark Lists and PopupAnchors to build a drop down menu system, but I'm having trouble getting it to size reliably - the list always seems to want to take up 5 itemRenderers worth of space, but some of the menus I need to implement can be 3 or less items long. How can I have the list dynamically size to the number of elements in it, and no larger?
This is a fun one. You need to set the property on the VerticalLayout of the spark list.
Try this snippet:
(yourSparkList.layout as VerticalLayout).requestedRowCount = yourDataProvider.length;
This assumes you've got a list named yourSparkList and a dataprovider called yourDataProvider which is populating the list.
If your lists get long, you should set a MAXIMUM constant like so:
public static const MAXIMUM:int = 5;
if(yourDataProvider.length <= MAXIMUM){
(yourSparkList.layout as VerticalLayout).requestedRowCount = yourDataProvider.length;
}else{
(yourSparkList.layout as VerticalLayout).requestedRowCount = MAXIMUM;
}
BTW, there's also a requestedMaxRowCount and a requestedMinRowCount property.

Resources