Meaning of (052) at the end of text literal? - abap

Really just a curious question.
Here are a few examples of the same concern that I have since they are being exported to the FM "REUSE_ALV_GRID_DISPLAY" for parameter "it_fieldcat".
ls_fieldcat-seltext_l = 'Material number'(052).
ls_fieldcat-seltext_m = 'Material'(053).
ls_fieldcat-seltext_s = 'Mat.'(054).
I tried removing the numbers on the right and executed the program but I didn't see any differences and I also tried to see what happens inside debug mode but it only fills the field with the string value, am I missing something or is there something that I wasn't able to notice?
I've been tasked to create a copy of a program which originally joins multiple tables and filters them according to the Parameters from the SELECTION-SCREEN and then shows the results in an ALV Grid Report, but for the use case of the copy it should instead populate a table in ECC that we will then be replicating to BW side. I have successfully copied and modified it accordingly but I can't seem to understand what the numbers beside the strings are doing.
Can someone please explain what their use is, would be very grateful to see a few examples.
Thanks!

The number in the brackets is a text symbol defined as a part of the text elements of the program. Using the syntax 'Literal'(idf) replaces these literals in the program if the symbol is in the currently loaded text pool.

Related

LabVIEW Inserting/overwriting text into existing string

I was wondering if folks have found a reliable way to inject text into an existing string. Some context, I'm writing data to a string indicator formatted like a table, and I wanted to inject values into so they maintain a specific format, spacing-wise. Writing to a table would definitely be easier, however I am porting a legacy program and wanted to provide familiarity to the end user.
Essentially, I want to do the equivalent of typing into a .txt file with the INSERT function enabled, where it just overwrites the content already in the string. Example below (dashes added to show spacing) of how it is currently looking when I inject the values with hard coded spacing:
Time---value---avg. value---result
60------10---------20---------PASS
120------11---------20---------PASS
180------9---------15---------FAIL
I'd prefer it to look more lined up, like below:
Time---value---avg. value---result
60------10---------20---------PASS
120-----11---------20---------PASS
180-----9--------- 15---------FAIL
Writing my application using LabVIEW 2019
Edit: Header will obviously not change, only each subsequent line where the values can result in entries not looking lined up
What about "Replace Substring" function (https://zone.ni.com/reference/en-XX/help/371361R-01/glang/replace_substring/)? Doesn't it meet your requirements?
The diagram below outputs 01234999990123PASS890123456789. The values of the integer and the word PASS are added replacing characters in the existing string, exactly like overstrike would do.

Different parameter count in FORM and PERFORM

I am trying to add a formal parameter in the FORM and PERFORM in an existing code, as I will be need it the extra parameter in a new function that I have to call. The idea is that when executing the new code it keeps showing the error: Different parameter count in FORM and PERFORM (routine: CM_SHOW_CRC, number of formal parameters: 2, number of actual parameters: 3).
The code that I have for the form part is as follows:
FORM cm_show_crc
USING
civ_matnr TYPE matnr
civ_charg TYPE charg_d
civ_werks TYPE werks_d. "The parameter that I added
And the perform code is:
PERFORM cm_show_crc
USING
pis_sdow_alv-matnr
pis_sdow_alv-charg
pis_sdow_alv-werks. "The parameter that I added
The table pis_sdow_alv is type of a structure that also includes the variable WERK(Component type WERKS_D)
Before adding the new parameter WERK the code was working fine.
May anyone know what the problem in this part of the code may be?
There was also another similar question in: Different number of parameters in FORM and PERFORM, however I am not using the syntax CHANGING in my code, as it was also not used prior.
Please do tell me if you need additional information.
Thank you all in advance!
This problem can occur when FORM and PERFORM are in different includes and you only activate one but not the other.
When you activate an include, then it is checked against the active version of all other repository objects it depends on. Not the saved version. This can lead to an annoying catch-22 situation. You can not activate A because it does not match the previous version of B, and you can not activate B because it does not match the previous version of A.
The solution to this conundrum is to activate both objects together. When you activate something in SE80 and you have multiple inactive objects, you get a window where you can select multiple objects to activate together:
In Eclipse, you get a similar list by clicking on the "activate multiple" button:

Getting the values of an /AIF/ERR variant

I did try using the RS_VARIANT_CONTENTS and RS_VARIANT_VALUES_TECH_DATA, it did show the values of the variant except the values of the name space, interface and interface version in which I also need to retrieve. I also searched the VARI* and TVARC tables but I didn't found it there.
I think it has something to do with the program name and screen number. Do you have any ideas or other way that I can retrieve all those values, whether using FM or select?
Thank you.
Some of the parameters in the transaction /AIF/ERR, the ones you are talking about, vary dynamically based on the value chosen in the Application screen field. They are handled by another AIF program, and they are not saved in the program variant, but in the table /AIF/T_ERR_VARS.
You may call the function module /AIF/ERR_VAR_LOAD to load the missing parameters.
Its usage is shown in the subroutine GET_VAR of the program /AIF/ERROR_HANDLING_TRANS (which is the program behind the transaction /AIF/ERR).

ListObjects.Add.QueryTable Source Array String

I will provide some context before I ask my question.
I am attempting to query an SQL Server and create a table within Excel from the data. Because I am not familiar with how to accomplish this in VBA I recorded by using Data -> Get External Data -> From Other Sources -> Microsoft Query. In the dialog box that appears, I chose a .DSN file provided to me by someone else. I then used the Microsoft Query interface to structure the query and import the data onto a worksheet.
The code in the recorded macro looked something like this. I will use generic terms instead of the actual code.
With Sheet2.ListObjects.Add(SourceType:= 0, Source:=Array _
(Array("ODBC;DRIVER=SQL Server;SERVER=ServerName;UID=userid;Trusted_Connection=Yes;APP=Microsoft Windows Operating System;WSID=SomeString"), _
Array("A;DATABASE=DatabaseName")), Destination:=Range ("Sheet2!$A$1")).QueryTable
I know this is not formatted ideally, which is part of my question below.
https://msdn.microsoft.com/en-us/library/bb211863(v=office.12).aspx
From the above article, I know that SourceType:= 0 is an xlSrcExternal, or an external data source. This makes sense to me.
My confusion begins to arise when I get to the Source component of the Add method. From the provided article, "When SourceType = xlSrcExternal, an array of String values specifying a connection to the source, containing the following elements:
•0 - URL to SharePoint site
•1 - ListName
•2 - ViewGUID
So to begin with, what exactly is meant by "an array of String values", as the code from the recorded macro does not appear to correspond to what I thought was an array. I know that normally an array is declared something like this Array("string1", "string2", etc.). Or is the array recorded simply an array of one value? In other words Array("string1"). Does anyone know the purpose of passing an "array of string values" as opposed to just passing a string?
Also does anyone know the nuances of why the recorded macro has this particular formatting/syntax? In other words, why does it appear to have this syntax Array(Array("string1"),_ (new line) Array("string2"))? Why not just Array ("string1")? Does it have something to do with the second line being too long?
I have several more questions related to this topic, but this seemed like a good place to start..
Thank you all for any help given.

Dynamically declaring parameters from table

Is it possible to dynamically create parameters from table entries?
For example like this:
SELECTION-SCREEN BEGIN OF BLOCK example WITH TITLE text-01
LOOP AT example_internal_table INTO example_workarea
IF example_workarea-field = criteria.
PARAMETERS: (example_workareafield) AS CHECKBOX.
ENDIF.
ENDLOOP.
SELECTION-SCREEN END OF BLOCK example.
The code snippet above throws the error that example-workarea-field is not a constant. Does this mean it isn't possible to dynamically declare parameters or am I just doing it wrong? Thanks
Correct. PARAMETERS statements compile into selection screens at compile time, not at runtime. Therefore you cannot do what you want in the way you have proposed.
However, it is possible to have some form of dynamic screens.
Look at the answers to this question: For the I/O fields in a normal ABAP screen, can i get them to behave like a SELECT-OPTIONS?
This gives you two starting points: The use of subscreens, which you can call dynamically, or the use of FREE_SELECTIONS_INIT as examples.
Depending on how crazy you are about this, you can also investigate:
http://help.sap.com/abapdocu_702/en/abenabap_language_dynamic.htm
You could load the DYNPRO and dynamically change the screen, activate and then run a report that calls the changed screen.
This is of course a different approach from using PARAMETERS and should only be used for pet projects, not real production code as these statements are for internal use. I believe this is the approach that SE16 uses when it generates a selection screen for a table.