In this article we will examine an exceptionally basic point, Why Underscore “_” is Converted into Space at Runtime in ABAP? Lets talk about the situation once. Here I am thinking about standard t-codes and screens viz SE11, SE38 and so forth to show the standard way of behaving in ABAP or would it be advisable for us to say the exclusion which is there in ABAP?
Which Standard conduct I’m discussing? We should dig somewhat more. Here we are discussing ‘‘ . This extraordinary person is changed over into space at runtime. How about we see it direct. Got to t-code SE11. In the event that you enter (highlight) in any of the determination input, it will get changed over into space. Allow me to take a stab at putting _(underscore) in SE11 determination information and see the way of behaving by clicking enter. Why Underscore “_” is Converted into Space at Runtime in ABAP?
As it is obvious from above model, _(underscore) will vanish in the wake of clicking enter. We should consider another model. We have some standard table. For instance VBAP. Lets see what is the conduct in the determination screen for table information.
Assuming we input _ (highlight) in any of the table fields and hit the return key, it disappears.
Presently the inquiry emerges why this way of behaving in ABAP? What could be the explanation that _ (highlight) and ! (interjection) are getting changed over into space at runtime. Allow us to attempt to comprehend the way of behaving with not many datatypes. We have made the accompanying basic report for better clarification.
In this report , I have made boundaries to get input from client. I have utilized char1, char2, string, sstring, text40 to see the way of behaving. Enter _ (highlight) as contribution to every one of the boundaries.
Can you guess the Output?
From this plainly just string information type upholds the ““(underscore). My speculation which may be totally off-base is that since strings are dynamic information articles and string can hold variable length, it shows . String datatype has no maximum cutoff. sstring datatype additionally has variable length however there is furthest breaking point.
On the off chance that anybody of you have a superior clarification, kindly put in the remarks segments. We will refresh our post appropriately.
Presently, assuming the message comprises of a few words, they are combined consequently by highlights, which are supplanted by spaces at runtime. This could be one reason . Yet, string hold esteem progressively and there is no reset on the field at runtime.
How can we store underscore in database table with char1 (if we need only one character)?
We have no particular genuine business case. Lets expect for reasons unknown we need to save _ in one of the fields of the table. Could might we at any point accomplish it? Is it truly conceivable to accomplish it? Might we at any point store highlight as single person in data set?
Answer is indeed, we can do that. We can do it with the assistance of TMG (Table Upkeep Generator).
Follow the below steps
1. Create a database table using SE11. I created the database table with fields as follows:
2. Make Table Upkeep generator from utilities> Table Support Generator (TMG) as follows:
3. After making of TMG, double tap on outline screen number, following screens will open:
4. Presently click on format (featured above), following screen will open. Double tap on field and select “Without Reset” and “Without Layout”. With the assistance of these you can add highlight in DB table. Click save and initiate button.
5. Now you will be able to save _ (underscore) in table as follows:
This was one stunt which I as of late scholarly. Not certain, the number of you will require in genuine activities. Be that as it may, this was an exceptionally one of a kind and different opportunity for growth. Along these lines considered imparting to you. Do allow me to have at least some idea how you feel about this basic idea.
YOU MAY BE INTERESTED IN
SAP OData v4: Unleash the Power of Efficient Data Access