Questions tagged [abap]

ABAP is the programming language of SAP softwares R/3, S/4HANA, CRM and many others.

ABAP is a SAP proprietary language that is used to write both the fundamental SAP R/3 system itself and the standardized business applications that run on top of this system and more recent systems like CRM and S/4HANA. It can be used for customer extensions of the system or entirely new software applications as well. The online language reference is available at no cost from the SAP Help Portal. Another great community - almost as rewarding as StackOverflow - is the SAP Community Network.

ABAP programs can be developed in ABAP Development Tools (ADT), a set of plugins for Eclipse, or using the tools in the ABAP Workbench on SAP GUI. ABAP programs use Open SQL statements to query the underlying Database Management System (DBMS). ABAP can be used to write executable programs, such as reports, and non-executable programs, such as function modules and classes. The ABAP Objects feature allows for object oriented programming in ABAP.

Useful links


Related tags

3276 questions
7
votes
2 answers

RTTI: Get length of a character column

My function module receives a table name and a column name at runtime. I would like to get the length of the column: How many characters are allowed in the transparent table? I used my favorite search engine and found RTTS. But the examples in the…
guettli
  • 25,042
  • 81
  • 346
  • 663
7
votes
5 answers

What does it mean to say that C was compiled in C?

I've seen stuff like this written... C was written in C, or ABAP was written in ABAP.. I've even seen one guy saying that this is one of the criteria to sort languages into true programming languages. I'd like someone to explain to me what this…
Felipe
  • 11,557
  • 7
  • 56
  • 103
7
votes
1 answer

Create dynamic ABAP internal table

On selection screen, the user needs to insert a table name, and I need to get first 3 fields from that table and display them in an ALV for the output. What I understand from reading tutorials is that I need to call method…
usesser
  • 191
  • 3
  • 21
7
votes
3 answers

Syntax for creating internal table from existing database table?

I'm new to ABAP. Started learning about internal tables. I was reading on the ways to create internal tables. I came across the following syntax to create an internal table from an existing database table: data: it_mara type table of mara. I'm…
The-Droidster
  • 635
  • 7
  • 13
7
votes
3 answers

Table comprehensions: get subset from internal table into another one

As stated in the topic, I want to have a conditioned subset of an internal table inside another internal table. Let us first look, what it may look like the old fashioned way. DATA: lt_hugeresult TYPE tty_mytype, lt_reducedresult TYPE…
icbytes
  • 1,831
  • 1
  • 17
  • 27
7
votes
4 answers

Unit testing and SAP software

I am looking for some tutorials and guides for unit testing on SAP platform. So far, I have found some mention of ABAP Unit and of Ruby programming language being implemented on SAP software, making it much more interesting option for unit testing…
Dan
  • 11,077
  • 20
  • 84
  • 119
7
votes
2 answers

Can't catch TYPE_NOT_FOUND exception

I am calling the cl_abap_typedescr=>describe_by_name method. It could possibly throw a TYPE_NOT_FOUND exception. I am coming form c# and in c# it would be quite easy to catch such an error. But in ABAP i am not able to catch the exception. It…
Florian
  • 5,918
  • 3
  • 47
  • 86
7
votes
6 answers

Increment an integer

Sometimes ABAP drives me crazy with really simple tasks such as incrementing an integer within a loop... Here's my try: METHOD test. DATA lv_id TYPE integer. lv_id = 1. LOOP AT x ASSIGNING . lv_id = lv_id+1. …
Ben
  • 245
  • 2
  • 6
  • 9
7
votes
4 answers

get one field from itab with read table TRANSPORTING

I trying to get one field from interal table like this: READ TABLE tbl_peps TRANSPORTING ususap INTO lv_responsable WITH KEY usr03 = wa_tbl_prps-usr03. This sentence is wrong, it gives me an error tbl_peps and lv_responsable are…
funkeeiads
  • 327
  • 2
  • 6
  • 20
7
votes
2 answers

Cleanest way to flip a Boolean

Are there any existing methods or function modules that flip boolean values efficiently? I've come up with a simple implementation should I have to define my own utility method, but I'm wondering if this is the most efficient approach: IF iv_bool =…
Lilienthal
  • 4,327
  • 13
  • 52
  • 88
7
votes
1 answer

Do exceptions propagate automatically?

I'm relatively new to ABAP development and have more experience in Java and similar languages. In Java, any exception that is thrown and not caught is automatically propagated up the call chain so that you can decide how to handle it at the highest…
Lilienthal
  • 4,327
  • 13
  • 52
  • 88
7
votes
3 answers

Is it possible to create an Enumeration (enum) in ABAP?

Is it possible to create an Enumeration (enum) in ABAP such as in Java ? As far as I know, we can define a domain with fixed values, but they are only used for screens.
Eduardo Copat
  • 4,941
  • 5
  • 23
  • 40
7
votes
4 answers

Count itab rows that meet some condition?

I get a internal table from a Function Module call that returns ~ 100 rows. About 40% of the rows are not relevant to me because I only need the entries with PAR1 = "XYZ". On SQL tables (transparent tables), I can use a select count(*) from tab…
Jasper
  • 660
  • 1
  • 7
  • 19
7
votes
1 answer

Generate DDIC structure from XSD?

I have a number of XSDs that are part of the enterprise definitions for several services at the client. I would like to be able to take a single XSD and generate a DDIC structure from it (without the use of PI!) Seeing as you can generate proxies…
mydoghasworms
  • 18,233
  • 11
  • 61
  • 95
7
votes
4 answers

ABAP Unit Test Classes - Good References

I'm looking for good reference material regarding the use of ABAP Unit Test Classes. I'm interested in any of the following: Documentation on the functionality Best Practises "How To Guides" Blogs/Books on people's experience in using test-driven…
Esti
  • 3,677
  • 8
  • 35
  • 57