Which variables can be used in TSE05 templates? - abap

I am using TSE05 to create a template for new ABAP Reports (my previous question for reference).
In there I can use variables/placeholders like $PROG for the report name or $TOP for the name of the top include.
Is there a complete list of variables/placeholders which I can use inside those templates? Those two are the only ones I have found so far.

The variables are hard-coded in standard program SAPLSEUR form FETCH_TEMPLATE.
The template lines are read from TSE05
SELECT line FROM tse05 INTO TABLE temptab
WHERE app_obj = 'ADDM'
AND keyword = tse05key
ORDER BY PRIMARY KEY.
(here tse05key can be REPORT, INCLUDE etc.. based on the object type you're creating)
Then it looks for some hard-coded placeholders from TSE05 template lines, and replaces them with the correct information
LOOP AT temptab ASSIGNING <line>.
REPLACE '$PROG' IN <line> WITH progname. "ignoriert spaces
REPLACE '$TOP' WITH inclname INTO <line>.
REPLACE '$POOL' WITH pool INTO <line>.
REPLACE '$USER' WITH space INTO <line>.
REPLACE '$DATE' WITH space INTO <line>.
REPLACE '$O01' WITH oinclname INTO <line>.
REPLACE '$I01' WITH iinclname INTO <line>.
REPLACE '$F01' WITH finclname INTO <line>.
ENDLOOP.
This form is called by another form INSERT_PROGRAM in program SAPLSEDTATTR when creating a source so at the end those are the only variables available

Related

Custom fields not showing on table output

I'm having trouble figuring out why two custom fields are not showing up in transaction VA05 (its output to be specific).
Before reading below: I didn't make any changes to the program because I wasn't assigned to this task. One of my colleagues did this change.
I followed this tutorial, which explains how to expand the VA05 output table with custom fields.
I didn't actually followed this guide. I followed this tutorial only to understand what my colleague might have done to achieve what we need and what might be needed to fix the issue.
So, as the tutorial suggests, this is what should be done in short:
Go to SE11 and search for VBEP Database table and click display.
Click on Append Structure
Click on Create Append
Insert the name of the append name, in my case it's ZZVBEP_MECC
Insert two fields: ZZDELIVERYDATE and ZZREQDELIVERYDATE
Save and activate
If you go to VBEP table now, you'll see at the bottom the field .APPEND with the column Data Element set to ZZVBEP_MECC.
Now, following the tutorial, the include program V05TZZMO need to be changed, and here's ours:
***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
CASE ZP.
WHEN 'VBAK'.
WHEN 'VBAP'.
CHECK LVBAP-PSTYV NE 'ZRAC'.
CHECK LVBAP-PSTYV NE 'ZCAC'. "Escl.acconti
MOVE LVBAP-KDMAT TO LVBMTV-ZZKDMAT.
PERFORM OFFENE_AUFTRAGSMENGE.
SELECT SINGLE * FROM VBKD WHERE VBELN = LVBAP-VBELN.
IF SUBRC = 0.
MOVE VBKD-KDGRP TO LVBMTV-ZZKDGRP.
ENDIF.
WHEN 'VBEP'.
MOVE LVBEP-ZZDELIVERYDATE TO LVBMTV-ZZDELIVERYDATE.
MOVE LVBEP-ZZREQDELIVERYDATE TO LVBMTV-ZZREQDELIVERYDATE.
ENDCASE.
ENDFORM.
When I run VA05 however, these two custom fields are not there nor are in the Change Layout screen.
Is it possible that the code in V05TZZMO is not in the right place? Looking at the tutorial's code I saw that they put those statements in WHEN 'VBAK' instead of WHEN 'VBEP'.
Also, the ENHANCEMENT 1 ZZ_SD_VBAK_VA05 is not present in my code.
There might be something I missed. As I said above, I didn't make these changes so I cannot tell exactly what my colleague did.
Custom fileds also must be included in the structure VBMTVZ.
Regards
Finally solved.
Here's the procedure step-by-step we followed in order to fix the issue:
Create an Append Structure
Go to TCode SE11 and open database table VBMTVZ
Click on Append Structure...(It's in the program's toolbar) - or Goto > Append Structure
Create a new Append Structure(There's a button for it)
Enter the name of the structure(in our case was ZZVBMTVZ_MECC
A new structure is then created. Enter the needed components/fields
Save and activate the structure.
Note: To check if the structure is actually appended, go back and open table VBMTVZ again. At the end of the list of fields there must be one field called .APPEND with the type set to the name of the structure you created. After this field, there's also all your fields you created on that structure. See the image below for reference.
Change V05T program
Now you'll need to make some changes to the program linked to the TCode VA05.
To do this:
Go to TCode SE80.
Select Function Group and insert V05T as the name of the group.
Open the sub-folder called Includes and look for V05TZZMO
Open this include file in change mode.
The file should look like this:
***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
CASE ZP.
WHEN 'VBAK'.
* header
* MOVE LVBAK-XXXXX TO LVBMTV-ZZXXXXX.
WHEN 'VBAP'.
* item
* MOVE LVBAP-XXXXX TO LVBMTV-ZZXXXXX.
WHEN 'VBEP'.
* schedule line
* MOVE LVBEP-XXXXX TO LVBMTV-ZZXXXXX.
ENDCASE.
ENDFORM.
Add the following line of code to the WHEN 'VBEP'. code block.
MOVE LVBEP-name_of_your_field TO LVBMTV-name_of_your_field
You need to add that line for each field you appended.
In my case, the final result was the following:
***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
CASE ZP.
WHEN 'VBAK'.
* header
* MOVE LVBAK-XXXXX TO LVBMTV-ZZXXXXX.
WHEN 'VBAP'.
* item
* MOVE LVBAP-XXXXX TO LVBMTV-ZZXXXXX.
WHEN 'VBEP'.
* schedule line
* MOVE LVBEP-XXXXX TO LVBMTV-ZZXXXXX.
move LVBEP-zzdeliverydate to lvbmtv-zzdeliverydate.
move LVBEP-zzreqdeliverydate to lvbmtv-zzreqdeliverydate.
ENDCASE.
ENDFORM.
Save the file and activate the program.
At this point you should be able to see your fields in the output of TCode VA05.
Notes
In order to be able to change the include program V05TZZMO you need an Access Key. Without that you cannot change the program.
If the fields you appended aren't showing even after activating, try:
To logout and log back in or
reset the buffer with this TCode /$SYNC

ReplaceText processor

I have a CSV file with attribute name EpochWithMicroSec and value like 1512520846 and I want to append 000 at the end of value like this 1512520846000.
I am using following configuration please help to fix this issue.
TIA
My configuration is appending 000 at the last attribute of my CSV file. How to map it to attribute EpochWithMicroSec attribute?
As you are changing the existing field value then use
Replacement Value Strategy
Literal Value
Update Record Configs:
Add Dynamic property
/EpochWithMicroSec
${field.value:append('000')}
If you're only working on the attribute itself, you should use UpdateAttribute rather than ReplaceText (the latter works on the flow file contents, not attributes). In UpdateAttribute you can add a user-defined property "EpochWithMicroSec" with the same Expression you have in your ReplaceText: ${EpochWithMicroSec:append('000')}

Creating a feature class in ArcGIS 10

I am trying to create a feature class from another feature class via below:
arcpy.CreateFeatureclass_management(path, name, "POLYGON")
In ArcGIS, it is creating the fields Shape, Shape_Length, and Shape_Area. I added additional fields to the newly feature class.
cursor = arcpy.da.SearchCursor("old featureclass", ["Shape#", "*"]
insert = arcpy.da.InsertCursor("new featureclass", ["*"]
for i in cursor:
insert.insertRow(i)
I am getting an error:
Sequence size must match size of the row
This is because the newly feature class has added additional fields as I mentioned above. Then I tried
for i in cursor:
append newly array with (ShapeLength, and ShapeArea)
insert.insertRow(newlyarray)
It worked fine but the Shape_Area and Shape_Length is returning zero. I've also tried to calculate field area and it didn't work as well.
Can someone please help me with this issue? The geometry shape is a polygon but the shape area and shape length won't populate based of the pre-existing shape.
I think what you want to do is:
Get the fields list from the old shapefile,
Add the desired fields to the new file,
then iterate over each field (or just the ones you want to copy) of each row from the old file and copy the value into its corresponding field in the new file.
Then you can add your brand new new fields whenever you like and this copying function won't be affected if it refers to fields by name.
Another method would be to literally copy the old shapefile using the copy tool, then edit the copied file.

Replace url that contains a unique id

I am trying to write sql to replace sql fields anywhere a certain url occurs with a new url. The problem is part of the url contains a unique id with I need to replace too.
E.g. the field content contains the following:
<ul><li>Identity Verification</li>
<li>Personal Data</li>
<li>Professional Check</li></ul>
when updated I would like it to become:
<ul><li>Identity Verification</li>
<li>Personal Data</li>
<li>Professional Check</li></ul>
I need to replace all the first part of the url up to the document name with http://domain2/ but this needs to be done for each of the urls and they all contain unique strings. Is there anyway to do this using the replace function ?
ie.
Update Table
set content = replace(content, url,newurl)
where content like '%http://domain1/d/d/workspace/SpacesStore/%'

Domain Names to Webpage Titles in OpenRefine

I have a column in Excel of domain names (like stackoverflow.com) and would like to create a corresponding column with the title of the domains (like "Stack Overflow").
I uploaded the Excel file into OpenRefine. I believe the best way to do this would be to call the "Add column by fetching URLs on column" function. But I don't know what expression to use.
The way I do it is as follows:
(1) Have visitable URLs in the source column. I.e., http://stackoverflow.com instead of just the domain name.
(2) Apply "Add column by fetching URLs..." as you said. (If you're hitting pages on the same domain over and over, make sure you set a reasonable delay.)
(3) Using this first new column, create a second new column based on newCol1 by parsing the HTML that's returned:
value.parseHtml().select("title")[0].toString()
Notes:
(a) You need the toString() else you'll see blank values in the new column after you apply the function.
(b) You don't have to create a second new column; you could just apply a transform using the same formula as above.
(c) I've also tried using a split:
value.split("")[1].split("")[0]
I don't have my results handy at the moment, but I believe that also worked.