Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

sap - 如何使ABAP代码在任何基于ABAP的系统中工作(How to make ABAP code works in any ABAP-based system)

I often share ABAP code via forums, github and so on, which is often intended to work on any ABAP-based system .

(我经常通过论坛,github等来共享ABAP代码,这些代码通常旨在在任何基于ABAP的系统上工作 。)

Unfortunately, it often happens that some of the objects I use (database tables, types and so on) only exist in the solution I am working with (for instance C/4HANA which works on an ABAP system).

(不幸的是,经常发生我使用的某些对象(数据库表,类型等)仅存在于我正在使用的解决方案中(例如在ABAP系统上工作的C / 4HANA)。)

It's important to understand that there are several solutions developed by SAP, which are independent from other solutions, but are to be installed on an ABAP system, which includes the ABAP language itself and closely-linked external objects like those in the ABAP dictionary.

(重要的是要了解,SAP开发了一些解决方案,这些解决方案与其他解决方案无关,但是要安装在ABAP系统上,该系统包括ABAP语言本身以及紧密链接的外部对象(如ABAP词典中的对象)。)

Such SAP solutions are SAP R/3, SAP CRM, SAP SRM, SAP SCM, SAP BW, S/4HANA, C/4HANA, BW/4HANA, SAP Solution Manager, etc.

(此类SAP解决方案是SAP R / 3,SAP CRM,SAP SRM,SAP SCM,SAP BW,S / 4HANA,C / 4HANA,BW / 4HANA,SAP解决方案管理器等。)

For instance, let's say I want to ask a question about the join in ABAP and I provide the following example (that I developed on a C/4HANA system, but the question doesn't concern C/4HANA):

(例如,假设我想问一个关于ABAP中联接的问题,并提供以下示例(我是在C / 4HANA系统上开发的,但该问题与C / 4HANA无关):)

REPORT.
DATA gt_partner TYPE TABLE OF crmd_order_index-partner_no.
SELECT DISTINCT a~partner_no
    INTO TABLE gt_partner
    FROM crmd_order_index AS a INNER JOIN crm_jest AS b
    ON a~header = b~objnr
    UP TO 10 ROWS.
cl_demo_output=>write( crmd_order_index ).

Many people have S/4HANA, not C/4HANA, so the code won't compile on their system because the database table crmd_order_index exists only in C/4HANA.

(许多人拥有S / 4HANA,而不是C / 4HANA,因此代码不会在他们的系统上编译,因为数据库表crmd_order_index仅存在于C / 4HANA中。)

Probably those people won't answer or they won't be able to verify their answer, so I think I could make an effort to improve the example and make it work on any ABAP system.

(那些人可能不会回答,或者他们将无法验证他们的回答,所以我认为我可以努力改进示例,使其在任何ABAP系统上都可以使用。)

This is of course a very simple example, but imagine that you have tens or hundreds of lines.

(这当然是一个非常简单的示例,但请想象您有几十行或几百行。)

I know that one solution is to install an ABAP Developer Edition on our own laptop, because it contains the minimal ABAP configuration, and test the ABAP code on it.

(我知道一个解决方案是在我们自己的笔记本电脑上安装一个ABAP Developer Edition ,因为它包含最小的ABAP配置,并在其上测试ABAP代码。)

But it's relatively complex and long to install, occupies a lot of disk space, just to check a "simple thing".

(但是它相对复杂且安装时间长,仅用于检查“简单的事情”就占用大量磁盘空间。)

Is there another way to check easily and quickly whether the ABAP code compiles in any ABAP-based system?

(还有另一种方法可以轻松快速地检查ABAP代码是否可以在任何基于ABAP的系统中编译吗?)

Or any other idea?

(还是其他想法?)

I would also like that this solution applies to code as big as abapGit for instance.

(我还希望这种解决方案适用于例如abapGit一样大的代码。)

For information:

(有关信息:)

  • One well-known ABAP tool which works in any ABAP-based system is abapGit .

    (在任何基于ABAP的系统中都可以使用的一种著名的ABAP工具是abapGit 。)

  • The question is not about the versions (for instance for checking that ABAP code made on an ABAP 7.52 system compiles on ABAP 7.0 systems) because I think it's a much more complex problem.

    (问题不在于版本(例如,用于检查在ABAP 7.52系统上生成的ABAP代码是否可以在ABAP 7.0系统上编译)的问题,因为我认为这是一个更为复杂的问题。)

  • In StackOverflow, an ABAP question whose code doesn't work on any ABAP system weakens the principle of Minimal, Reproducible Examples .

    (在StackOverflow中,ABAP问题的代码在任何ABAP系统上均不起作用,这削弱了“ 最小,可重现示例”的原理。)

  ask by Sandra Rossi translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...