Old New ABAP Editor | SAP Blogs

Source: https://blogs.sap.com/2017/08/01/old-new-abap-editor/#
Capture Date: 16.09.2018 22:52:10

If you develop now UI for SAP, you use Web IDE. If you are doing backend and ABAP, you use ADT (ABAP in Eclipse). But sometimes you still need to come back to SAP GUI and ABAP Workbench and use the “New” ABAP Editor.

For that rare cases when you are doing ABAP in old fashion way 😉 I have some suggestions, which maybe someone not aware of, and that may help be more productive. In this blog, I will try to explain most useful functions added in ABAP Editor (from my point of view) and will try to collect links to other useful resources related to ABAP Editor for SAP GUI.

Do not expect too much in the beginning, but the list will grow up on demand.

I am long time not responsible for the ABAP Editor in Workbench so I cannot add or fix something. And I am not ABAP Workbench expert in general – I can only give details about that white area where you type your code. But for that white area, I can explain how it was designed and if the thing you want is in or is theoretically possible.

Quick start

It was designed, that when one starts “New” ABAP editor in the ABAP workbench for the first time, he gets an introduction page, explaining new features of the editor. But I never saw this working :).

The page is located aside to ABAP Editor user settings in:

“%APPDATA%SAPSAP GUIABAP Editorqstart.htm” Copy => Win + R => Paste => Enter

And here is most valuable part of the page:
quick_start.gif

Block / Column Selection

  • Alt + Shift + Left/Right/Up/Down

The ABAP editor allows you not only use standard (called “stream” selection) but also allow to select a rectangular block of text, which does not start from the beginning of the line:

block-selection.gif

You can select text block using the keyboard commands (Alt + Shift + Arrows) or with a mouse, keeping left Alt key during selection:

block-selection-mouse.gif

After selection, you can apply many of the editing functions in block mode:

  • Delete, Insert, Multi Edit
  • Copy/paste from Clipboard
  • Case conversion
  • Indent etc.

Multi Editing

multi-editing.gif

Null Width Selection

The degenerated version of the block selection is Null Width selection (not visualized 🙂 ), which you can use for indenting of text blocks.

null-width-selection.gif

Clipboard Ring or Multi Clipboard or Clipboard History

  • Ctrl + Shift + V

If you want to see all text pieces you have copied during your editing session, just press Ctrl + Shift + V, instead of normal Ctrl + V. Then you get a history of the clipboard items (up to 12, in chronological sequence) where you can select and paste any of the items (it also overwrites current Windows clipboard content).

clipboard-ring.gif

Case Modification

  • Ctrl + L -> lower case
  • Ctrl + U -> UPPER CASE
  • Ctrl + K -> sWAP cASE
  • Ctrl + J -> Capitalize Text
  • Ctrl + T -> Like in sentence

You can easily modify text case, without using a pretty print function. It works with stream and with block selection.

case-correction.gif

Lines move

  • Ctrl + Alt + Up/Down

The feature is useful when you need a block of lines, but do not want to overwrite keyboard content. You can move selected block of lines up or down. If no selection is done, the current line is moved.

lines-move.gif

Line duplicate

  • Ctrl + D

Sometimes it is much faster to duplicate the current line and adjust content than typing it once more.

line-duplicate-1.gif

Word/Line Selection

The ABAP editor supports different kinds of word/line selection:

  • Ctrl + Left/Right to select till word borders
  • Ctrl + Left Mouse Click on a word
  • Left Mouse Click on number margin to select lines

selection.gif

Incremental Search

  • Ctrl + I, Ctrl + Shift + I

In many cases when you want to do a simple text search you can achieve it without calling Find dialog and losing your editing context. Just start Incremental Search mode by pressing Ctrl + I and start typing.

incremental-search.gif

  • Press Ctrl + I to search for next occurrence
  • Ctrl + Shift + I for search of the previous occurrence
  • Backspace to correct your input
  • Esc to exit incremental search mode
  • See editor status bar for current search query

Code Hints

Code Hints were designed as proactive, not intrusive alternative for standard code completing list called by Ctrl + Space. It shall be very prudent to resources, but same time giving the user a way to speed up typing.

Code Hints may suggest syntactical construction, variables and code templates (somewhen before it was also auto correction suggestions in). The editor collects all fitting suggestions, rank them by type, usage count, input method and shows you the best hit. Code Templates are always won against keywords and variables, keywords (syntactical constructions) win against keywords.

Suggest Non-Keywords from the Text

The mentioned option is OFF by default (for some reason), but it brings a lot of value. “Non-Keywords from the Text” means in ABAP scope – your variables. So, if you enable the feature, you get your variables suggested by code hints (code completion list will show them independently of the flag) and this may save some typing effort especially if you are using “self-explaining”, meaningful variable names ;). Especially the flag would be useful, if you are forced to work on systems below SAP_BASIS 7.02, where full blown code completion is not enabled, and this flag and code hints the only “completion” you may get :).

suggest_not_keywords.png

Code Hint Color

When you using Code Hints, you see that it sometimes has light, standard background:

code_hint_ab4_single.png

And sometimes it has inverted, dark background:

code_hint_ab4_multi.png

Have you ever asked yourself: what does this crap mean? 😉

The secret meaning of the Code Hint background color:

ADT (ABAP in Eclipse) has also emulated implementation of Code Hints in some way, but the “secret knowledge” was lost, and the only inverted color is left 🙂 :

code_hint_eclipse.png

Why my code highlighted differently when I paste it in an email?

You may wonder, why when you copy/paste your code from the editor into email (or any other editor supporting HTML formatting) syntax highlighting of the ABAP code looks different from the one you had in ABAP editor.

ABAP Editor:
syntax_highlighting_editor.png

MS Outlook:
syntax_highlighting_outlook.png

The reason here – different highlighters that used for rendering of text in both cases. The one in ABAP editor, it is a highly sophisticated one, which works in respect of ABAP grammar available on ABAP system you work (and require fully qualified input), and the second one, is rudimental highlighter, which works based on keywords and can highlight even invalid code, but is not in sync to actual ABAP grammar. On the example above we see that keyword based parser has not highlighted OCCURRENCE, REGEX RESULTS (while in time the editor was written, these keywords were not yet known J ) but has highlighted the VALUE in the second sentence, that has been marked as an error by ABAP parser.

You would not be able to get code pasted into an email, always looking as one in ABAP editor, but you can extend syntax scheme of the keyword based parser, by simply adding missing keywords into abap_spec.xml file in ABAP Editor settings directory to get missing keywords highlighted:

“%APPDATA%SAPSAP GUIABAP Editor” -> abap_spec.xml

Add this:

… <TextType id="52" name="Keywords" ...> <Keywords> … <Keyword text="regex"/> <Keyword text="occurrence"/> <Keyword text="results"/> … </Keywords> </TextType> …

And get them also highlighted:

syntax_highlighting_outlook_corrected.png

Display list of assigned ABAP Editor keyboard shortcuts

The easiest way to get an overview of currently assigned keyboard shortcuts in your instance of the ABAP editor is a preview of the keyboard mapping scheme file in Internet Explorer (not in Chrome, you need a browser supporting XSLT transformations).

Paste the following path in your Windows Explorer:

%APPDATA%SAPSAP GUIABAP Editorkeymap.xml

If you are lucky and your default browser is still IE, you will get something like this:

keymap.png

The list is searchable and contains all assigned keyboard shortcuts and command IDs and descriptions for all installed keyboard mapping schemes.
If the command is not on the list, it means, there is no shortcut assigned to it.

Most of you know that it is possible to change the color of syntax elements shown in ABAP Editor. Using that “Settings” button in the status bar. But most of you a bit lazy to change that consistently and create new color scheme (Dark one for example) in a way that you can use and share with others.

But there are guys who did it. Check this GitHub repository if you want to get alternative color schemes for ABAP editor.

https://github.com/lucattelli/ab4-themes

abap_editor_dark_small.pngabap_editor_nostalgia_small.png

abap_editor_tb_dark_small.png

And if you have your own one – share it with the community!

Probably everyone used the ABAP Editor has also used Code Templates, speeding up typing of routine code. And definitely, there were some cases when you would like to have a new code template for some code block and have not found it among the standard SAP pre-installed ones (for example METHOD/ENDMETHOD.).

Here you can find an extended set of code templates for ABAP Editor which may help.

Feel free to suggest new code templates or request update of existing.

Let us make a world of ABAP Programming better

Display DDL Source Codes in SAP GUI using ABAP Program

Source: http://www.kodyaz.com/sap-abap/display-d…views-in-sapgui.aspx
Capture Date: 15.04.2018 23:39:00

To display DDL source codes of SAP CDS objects like CDS Views in SAP GUI ABAP developer can run DEMO_SHOW_DDL_SOURCE program.
CDS objects like CDS views or CDS table functions are created and maintained in ADT Tools like SAP HANA Studio with SQL Console.
When you are in SAP GUI and want to see source codes of a CDS view, you can use ABAP program DEMO_SHOW_DDL_SOURCE .

CDS View created using SQL DDL Document

Here is BSIS CDS View in SAP HANA system which I use SE11 transaction to display DDL SQL View.

Note that there is DDL Source section which has the value “BSIS_DDL”. When I double click it, I get only a small part of the SQL DDL source codes of the CDS view.

ABAP programmers should realize the warning:
Data Definitions can only be edited using ADT in Eclipse
Message no. DDIC_ADT_DDLS005

So if you have SAP HANA Studio ADT Tool installed, using the Eclipse IDE it is possible to display the SQL data definition language source codes of the CDS view.

Fortunately, there is an ABAP report to display source codes of SQL DDL views.

DEMO_SHOW_DDL_SOURCE to Show DDL Source Codes of CDS Views

SAP provided ABAP program DEMO_SHOW_DDL_SOURCE to display DDL source codes of CDS views or other CDS objects easily in SAP GUI environment without using SAP HANA Studio.

Launch SE38 ABAP transaction to execute DEMO_SHOW_DDL_SOURCE report

Run the program with F8

Enter the DDL source name (name of the SQL DDL document) and press Enter button. Please check on SE11 for DDL Source attribute. Do not use the DDL SQL View name instead of DDL Source name.

Although the format of the SQL codes is confusing the developers, all of the SQL DDL codes of a CDS view can be displayed with DEMO_SHOW_DDL_SOURCE ABAP program without the requirement of an installed SAP HANA Studio.

Create DEMO_SHOW_DDL_SOURCE ABAP Program

If DEMO_SHOW_DDL_SOURCE ABAP report does not exist on your SAP system, you can try to create it by using following ABAP codes.

REPORT Z_KODYAZ_DDLSOURCE.
" copy of DEMO_SHOW_DDL_SOURCE ABAP report

CLASS demo DEFINITION.


PUBLIC SECTION.
CLASS-METHODS main.
ENDCLASS.
CLASS demo IMPLEMENTATION.


METHOD main.
DATA name TYPE string.
cl_demo_input=>request( EXPORTING text = 'DDL Source' CHANGING field = name ).
TRY.
cl_dd_ddl_handler_factory=>create( )->read(
EXPORTING
name = CONV ddlname( to_upper( name ) )
IMPORTING
ddddlsrcv_wa = DATA(ddlsrcv_wa) ).
CATCH cx_dd_ddl_read INTO DATA(exc).
cl_demo_output=>display( exc->get_text( ) ).
ENDTRY.
IF ddlsrcv_wa-source IS INITIAL.
cl_demo_output=>display( |Nothing found| ).
RETURN.
ENDIF.
cl_demo_output=>display( replace( val = ddlsrcv_wa-source sub = |\n| with = '' occ = 0 ) ).


ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.


demo=>main( ).

I could get a better formatted SQL DDL source view of the CDS view I created at CDS View tutorial using “Z_Ddlsqlview” in the DDL Source input parameter as follows

Smartform Version Comparison | SAP Blogs

Source: https://blogs.sap.com/2016/04/08/smartfo…-version-comparison/
Capture Date: 25.03.2018 23:46:09

There has long been a requirement, where we need to compare 2 Smartform versions.

In SAP there is no feature for this, there are no past versions maintained and also certainly no remote comparison.

This makes comparison and version management of smartforms a tedious task.

I was faced with such a task too. There were multiple complex smartforms and due to multiple activities and phases of my project working simultaneously, it was very difficult to trace what went wrong and definitely made it a lot of effort to maintain and revert changes in case of any issues.

Thus began my journey down the lane on how to overcome this problem.

My initial research “Google” shed no fruitful results. All I got was it is not possible in SAP to compare the smartforms and we will need to download the XML files and save locally in order to do version management.

And in case we need to compare, we will need to upload and create a temporary version and then compare each window and element.

Well, to me it did not make a lot of sense. Since it would be way easier to create new in a lot of cases and yes, I believe that is what must have been done in most cases.

So I started with my own utility program for Smartform Version Comparison.

I noticed that always on Download and XML file is generated and this remains more or less of a similar structure.

There are tags which we can traverse and identify to compare the smartforms.

And also the entire data in the smartform is present in the XML.

So, why not automate this and voila now I have a working program to compare smartforms.

I have uploaded the source code of the same on Github at https://github.com/sajid-a/SmartformVersionCompare

This is currently a working version with a known bug that it can only compare smartforms upto a certain size. The reason is that currently we are not able to process the complete string provided by the XML in the file. Other than that this can be used to compare smartforms.

The process for comparison is as follows:

1. Download and Maintain the XMLs of the smartform before making any change. This will act as your repository of version management. Alternatively an SVN can be used for this purpose

files.PNG

2. Execute the program and provide the two XML files that you want to compare.

upload.PNG

3. On execution, the changes in the two versions will be displayed.

3.PNG

4.PNG

The program is currently in the Alpha Phase and hence any suggestions or improvements are welcome.

Also all are welcome to collaborate on the source code and help in the development of a comprehensive tool.

The features to be added in the current program are as follows:

1. Only Code Comparison

2. Remote System Comparison

3. Automatic Version Management and Comparison

4. Auto generation of XML by just entering the Smartform Name

5. Bug fixes

Hope this post proves useful to all who are in need for a way to compare smartforms.

Old New ABAP Editor | SAP Blogs

Source: https://blogs.sap.com/2017/08/01/old-new-abap-editor/
Capture Date: 11.03.2018 19:39:41

If you develop now UI for SAP, you use Web IDE. If you are doing backend and ABAP, you use ADT (ABAP in Eclipse). But sometimes you still need to come back to SAP GUI and ABAP Workbench and use the “New” ABAP Editor.

😉

For that rare cases when you are doing ABAP in old fashion way  I have some suggestions, which maybe someone not aware of, and that may help be more productive. In this blog, I will try to explain most useful functions added in ABAP Editor (from my point of view) and will try to collect links to other useful resources related to ABAP Editor for SAP GUI.

Do not expect too much in the beginning, but the list will grow up on demand.

I am long time not responsible for the ABAP Editor in Workbench so I cannot add or fix something. And I am not ABAP Workbench expert in general – I can only give details about that white area where you type your code. But for that white area, I can explain how it was designed and if the thing you want is in or is theoretically possible.

Quick start

It was designed, that when one starts “New” ABAP editor in the ABAP workbench for the first time, he gets an introduction page, explaining new features of the editor. But I never saw this working :).

The page is located aside to ABAP Editor user settings in:

“%APPDATA%SAPSAP GUIABAP Editorqstart.htm” Copy => Win + R => Paste => Enter

And here is most valuable part of the page:
quick_start.gif

Block / Column Selection

  • Alt + Shift + Left/Right/Up/Down

The ABAP editor allows you not only use standard (called “stream” selection) but also allow to select a rectangular block of text, which does not start from the beginning of the line:

block-selection.gif

You can select text block using the keyboard commands (Alt + Shift + Arrows) or with a mouse, keeping left Alt key during selection:

block-selection-mouse.gif

After selection, you can apply many of the editing functions in block mode:

  • Delete, Insert, Multi Edit
  • Copy/paste from Clipboard
  • Case conversion
  • Indent etc.

Multi Editing

multi-editing.gif

Null Width Selection

The degenerated version of the block selection is Null Width selection (not visualized 🙂 ), which you can use for indenting of text blocks.

null-width-selection.gif

Clipboard Ring or Multi Clipboard or Clipboard History

  • Ctrl + Shift + V

If you want to see all text pieces you have copied during your editing session, just press Ctrl + Shift + V, instead of normal Ctrl + V. Then you get a history of the clipboard items (up to 12, in chronological sequence) where you can select and paste any of the items (it also overwrites current Windows clipboard content).

clipboard-ring.gif

Case Modification

  • Ctrl + L -> lower case
  • Ctrl + U -> UPPER CASE
  • Ctrl + K -> sWAP cASE
  • Ctrl + J -> Capitalize Text
  • Ctrl + T -> Like in sentence

You can easily modify text case, without using a pretty print function. It works with stream and with block selection.

case-correction.gif

Lines move

  • Ctrl + Alt + Up/Down

The feature is useful when you need a block of lines, but do not want to overwrite keyboard content. You can move selected block of lines up or down. If no selection is done, the current line is moved.

lines-move.gif

Line duplicate

  • Ctrl + D

Sometimes it is much faster to duplicate the current line and adjust content than typing it once more.

line-duplicate-1.gif

Word/Line Selection

The ABAP editor supports different kinds of word/line selection:

  • Ctrl + Left/Right to select till word borders
  • Ctrl + Left Mouse Click on a word
  • Left Mouse Click on number margin to select lines

selection.gif

Incremental Search

  • Ctrl + I, Ctrl + Shift + I

In many cases when you want to do a simple text search you can achieve it without calling Find dialog and losing your editing context. Just start Incremental Search mode by pressing Ctrl + I and start typing.

incremental-search.gif

  • Press Ctrl + I to search for next occurrence
  • Ctrl + Shift + I for search of the previous occurrence
  • Backspace to correct your input
  • Esc to exit incremental search mode
  • See editor status bar for current search query

Code Hints

Code Hints were designed as proactive, not intrusive alternative for standard code completing list called by Ctrl + Space. It shall be very prudent to resources, but same time giving the user a way to speed up typing.

Code Hints may suggest syntactical construction, variables and code templates (somewhen before it was also auto correction suggestions in). The editor collects all fitting suggestions, rank them by type, usage count, input method and shows you the best hit. Code Templates are always won against keywords and variables, keywords (syntactical constructions) win against keywords.

Suggest Non-Keywords from the Text

The mentioned option is OFF by default (for some reason), but it brings a lot of value. “Non-Keywords from the Text” means in ABAP scope – your variables. So, if you enable the feature, you get your variables suggested by code hints (code completion list will show them independently of the flag) and this may save some typing effort especially if you are using “self-explaining”, meaningful variable names ;). Especially the flag would be useful, if you are forced to work on systems below SAP_BASIS 7.02, where full blown code completion is not enabled, and this flag and code hints the only “completion” you may get :).

suggest_not_keywords.png

Code Hint Color

When you using Code Hints, you see that it sometimes has light, standard background:

code_hint_ab4_single.png

And sometimes it has inverted, dark background:

code_hint_ab4_multi.png

Have you ever asked yourself: what does this crap mean? 😉

The secret meaning of the Code Hint background color:

ADT (ABAP in Eclipse) has also emulated implementation of Code Hints in some way, but the “secret knowledge” was lost, and the only inverted color is left 🙂 :

code_hint_eclipse.png

Why my code highlighted differently when I paste it in an email?

You may wonder, why when you copy/paste your code from the editor into email (or any other editor supporting HTML formatting) syntax highlighting of the ABAP code looks different from the one you had in ABAP editor.

ABAP Editor:
syntax_highlighting_editor.png

MS Outlook:
syntax_highlighting_outlook.png

The reason here – different highlighters that used for rendering of text in both cases. The one in ABAP editor, it is a highly sophisticated one, which works in respect of ABAP grammar available on ABAP system you work (and require fully qualified input), and the second one, is rudimental highlighter, which works based on keywords and can highlight even invalid code, but is not in sync to actual ABAP grammar. On the example above we see that keyword based parser has not highlighted OCCURRENCE, REGEX RESULTS (while in time the editor was written, these keywords were not yet known J ) but has highlighted the VALUE in the second sentence, that has been marked as an error by ABAP parser.

You would not be able to get code pasted into an email, always looking as one in ABAP editor, but you can extend syntax scheme of the keyword based parser, by simply adding missing keywords into abap_spec.xml file in ABAP Editor settings directory to get missing keywords highlighted:

“%APPDATA%SAPSAP GUIABAP Editor” -> abap_spec.xml

Add this:

… <TextType id="52" name="Keywords" ...> <Keywords> … <Keyword text="regex"/> <Keyword text="occurrence"/> <Keyword text="results"/> … </Keywords> </TextType> …

And get them also highlighted:

syntax_highlighting_outlook_corrected.png

Display list of assigned ABAP Editor keyboard shortcuts

The easiest way to get an overview of currently assigned keyboard shortcuts in your instance of the ABAP editor is a preview of the keyboard mapping scheme file in Internet Explorer (not in Chrome, you need a browser supporting XSLT transformations).

Paste the following path in your Windows Explorer:

%APPDATA%SAPSAP GUIABAP Editorkeymap.xml

If you are lucky and your default browser is still IE, you will get something like this:

keymap.png

The list is searchable and contains all assigned keyboard shortcuts and command IDs and descriptions for all installed keyboard mapping schemes.
If the command is not on the list, it means, there is no shortcut assigned to it.

Most of you know that it is possible to change the color of syntax elements shown in ABAP Editor. Using that “Settings” button in the status bar. But most of you a bit lazy to change that consistently and create new color scheme (Dark one for example) in a way that you can use and share with others.

But there are guys who did it. Check this GitHub repository if you want to get alternative color schemes for ABAP editor.

https://github.com/lucattelli/ab4-themes

abap_editor_dark_small.pngabap_editor_nostalgia_small.png

abap_editor_tb_dark_small.png

And if you have your own one – share it with the community!

Probably everyone used the ABAP Editor has also used Code Templates, speeding up typing of routine code. And definitely, there were some cases when you would like to have a new code template for some code block and have not found it among the standard SAP pre-installed ones (for example METHOD/ENDMETHOD.).

Here you can find an extended set of code templates for ABAP Editor which may help.

Feel free to suggest new code templates or request update of existing.

Let us make a world of ABAP Programming better 🙂

IDoc Basics For Functional Consultants | SAP Blogs

Source: https://blogs.sap.com/2012/12/31/idoc-ba…ctional-consultants/
Capture Date: 11.03.2018 19:40:11

Today IDocs are used in most SAP applications for transfer of message(information) from SAP system to other systems and vice versa. Though lot of documentation is available on IDocs it is difficult for a functional consultant to understand such documents due to their technical nature. While a functional consultant is not expected to know the IDoc concepts in its entirety, an effort has been made to capture the minimum necessary information that one needs to be aware of in order to handle project/support issues on IDocs.

IDoc is an SAP object that carries data of a business transaction from one system to another in the form of electronic message. IDoc is an acronym for Intermediate Document. The purpose of an IDoc is to transfer data or information from SAP to other systems and vice versa. The transfer from SAP to non-SAP system is done via EDI (Electronic Data Interchange) subsystems whereas for transfer between two SAP systems, ALE is used.

IDoc can be triggered in SAP system or in EDI subsystem. This depends on the direction in which IDoc is sent and is called as Inbound IDoc and Outbound IDoc accordingly. In case of outbound flow, IDoc is triggered in SAP through document message control which is then sent to EDI subsystem. EDI converts the data from IDoc into XML or equivalent format and then sends the data to partner system through Internet.

For inbound flow, EDI converts partner data and IDoc is created in SAP. After successful processing of this IDoc, Application Document is posted in SAP.

/wp-content/uploads/2012/12/1_170630.png

“EDI is electronic exchange of business document between the computer systems of business partners, using a standard format over a communication network”. EDI stands for Electronic Data Interchange.

For transmission of information electronically, two widely used standards are ANSI ASC X12 and EDIFACT. ANSI ASC X12 is a committee formed by representatives of major organizations, government bodies and EDI software companies which defines standards and guidelines for information interchange over EDI. UN/EDIFACT stands for United Nations EDI for Administration, commerce and Transport and was formed in 1985 using ANSI X12 and UNTDI (United Nations Trade Data interchange) as base standards. ANSI X12 describes business document as transactions and each transaction is represented by three digit number e.g. 850 – Purchase Order, 855 – Purchase Order Acknowledgement. EDIFACT describes business document as messages, represented by standard names e.g. ORDERS for purchase order.

IDOC (BASIC) TYPE

IDoc Types are based on the EDI standards and mostly on EDIFACT standards.

Basic Types (or IDoc Type) defines the structure of an IDoc. Each basic type describes standard IDoc segments, format of data fields and their size. Basic Type also defines number of segments and fields in an IDoc. All the fields that are necessary for transmission of message for a particular business transaction are mapped in different segments. It also defines the structure and relationship of IDoc segments along with mandatory and optional segments.

/wp-content/uploads/2012/12/2_170568.png

IDOC EXTENSION

Basic type contains all the standard fields that are necessary for carrying out a business transaction. However, if any additional values are to be sent to the partner then we can make use of the IDoc Extension feature. IDoc extension is extension of basic type and contains additional custom IDoc segments and fields that are not available in standard basic type.

IDOC SEGMENTS

IDoc segments contain the actual data that is sent to or received from a partner. These segments contain the actual values that are sent as part of IDoc transmission.

/wp-content/uploads/2012/12/3_170569.png

PARENT AND CHILD SEGMENTS

IDoc segment is termed as Parent segment if it contains its own segments. The dependent segments are called as child segments.

/wp-content/uploads/2012/12/4_170570.png

INBOUND/OUTBOUND IDOCS

IDocs sent outside the system are termed as Outbound IDocs and the ones that are received into the system, are called as Inbound IDocs.

/wp-content/uploads/2012/12/5_170571.png

IDOC DIRECTION

This signifies the direction is which information is sent and is similar to terminology used in mails. If information is sent outside the system then the direction is outbox when it is received into the system then direction is inbox. In SAP Outbox direction is represent by “1” i.e. outbox and Inbox direction is represented by “2”.

/wp-content/uploads/2012/12/6_170572.png

PARTNER

Partner is the Business Partner with which the exchange of information is to take place using IDoc. It can be a vendor or customer or any other system. Depending on the direction of information in which the information is sent it plays a role of either a “sending partner” or a “receiving partner”.

/wp-content/uploads/2012/12/7_170573.png

PARTNER TYPE

Partner type/role is used to identify partners within the sap systems. Partner type is KU for customer, LI for vendor and LS for Logical System.

/wp-content/uploads/2012/12/8_170574.png

MESSAGE TYPE

IDoc processing involves transmission or receipt of document in the form of a message, each of which represents a document in SAP. These documents can be Order, Shipment Confirmation, Advance Shipping Notification, Goods Receipt, or Invoice. Message type is associated with Basic IDoc Type (Basic Type) and defines the kind of data or document that is exchanged with the partner.

PROCESS CODE

The process code contains the details of the Function Module that are used for IDoc processing. Message Type can be linked to the Process code.

PORT

IDoc Port contains the information about the way data is sent between the source or target system. The type of port defines the information contained within the port. For port type “Internet” Port will contain IP address of the target system. For port type “file”, directory or file name information is maintained. “tRFC” port contains information about the RFC destination of the target system. For IDoc transmission using ALE “tRFC” ports are used.

PARTNER PROFILE (WE20)

Partner profile must be maintained for all the business partners to whom we want to send or receive the IDocs. The TCODE for maintaining the partner profile is WE20.

/wp-content/uploads/2012/12/9_170575.png

Double clicking on the Partner will show the following screen:

/wp-content/uploads/2012/12/20_170565.png

Partner profile contains parameters for Inbound and Outbound processing of IDocs. For each message type we can maintain, inbound/outbound options, message control, post processing options and contact information within Inbound and outbound parameters.

OUTBOUND OPTIONS (OUTBOUND PARAMETERS)

This involves sender/receiver port, Output mode and relation to IDoc type i.e. Basic Type and extension.

/wp-content/uploads/2012/12/21_170566.png

MESSAGE CONTROL (OUTBOUND PARAMETERS)

This contains application for which IDoc will be created e.g. EF for Purchase order, the message type of the application that will trigger the IDoc and Process Code that will convert SAP document to an IDoc. For example, if PO is to be sent to the Vendor AXXXXZ, then in the outbound option of the partner AXXXXZ we need to maintain the message type ZXX1 and link it to the Process Code ME10. So when message type ZXX1 is triggered in the PO then an IDoc will be created for the partner vendor AXXXXZ.

Process Code is linked to the Function Module in SAP that converts application data into an IDoc. Standard function modules are provided by SAP for this conversion however these can also be customized as per business needs.

/wp-content/uploads/2012/12/22_170603.png

Change Message Indicator indicates whether the IDoc is sentas a notification of change. For example, Purchase Order change messages are sent to vendor using EDI standard message type 860.

/wp-content/uploads/2012/12/24_170604.png

Separate message type should be triggered in the purchase order for PO change. Additional line with change message type must be added in the Message control tab with change message indicator on.

/wp-content/uploads/2012/12/10_170579.png

INBOUND OPTIONS (INBOUND PARAMETERS)

For inbound options process code is maintained in the Inbound screen only. IDoc processing can be triggered by background program and triggered immediately.

/wp-content/uploads/2012/12/11_170580.png

POST PROCESSING (INBOUND/OUTBOUND PARAMETERS)

In the post processing option we can maintain the workflow details of the users or positions to which an error notification will be sent if an IDoc processing fails.

/wp-content/uploads/2012/12/25_170605.png

TELEPHONY (INBOUND/OUTBOUND PARAMETERS)

We can also maintain the contact details in the telephony option.

/wp-content/uploads/2012/12/12_170581.png

EDI STANDARD (OUTBOUND PARAMETERS)

EDI standard screen contains the details of the Standard EDI terminology used for the IDoc transmission.

/wp-content/uploads/2012/12/26_170606.jpg

For example, Message Type 850 is an EDI standard for Purchase Order IDoc and is linked to IDoc Message Type Orders.

STRUCTURE

IDoc structure is divided into Control Record, Data Records and Status records.

/wp-content/uploads/2012/12/27_170607.png

These records are stored in the transparent tables in SAP. These are EDIDC, EDID4 and EDIDS.

CONTROL RECORD (EDIDC)

It contains information such as IDoc number, direction, IDoc Status, Basic Type, Message Type, Partner (Sender/Receiver), date and time of creation/update, Interchange File or ISA number,etc.

/wp-content/uploads/2012/12/28_170608.png

/wp-content/uploads/2012/12/29_170609.png

DATA RECORD (EDID4)

It contains the details of the IDoc segments.

/wp-content/uploads/2012/12/30_170610.png

IDoc segment has fields that contain the data necessary for posting the documents.

/wp-content/uploads/2012/12/31_170611.png

/wp-content/uploads/2012/12/32_170615.png

STATUS RECORDS (EDIDS)

IDoc Status defines the processing status of the IDoc. IDoc statuses are used to track the IDoc and its various processing states. Status Numbers represents IDoc status. Current status of the IDoc is present in Control record.

/wp-content/uploads/2012/12/33_170616.png

Initial Status numbers are 64 for inbound and 03 for outbound. Successful status is 53 for inbound and 16 for outbound IDocs.

TRIGGERING AN OUTBOUND IDOC

Outbound IDocs can be triggered from the output message types of Purchase Orders, deliveries, Material Documents, invoices, etc. The following figure shows that once the output ZXX1 of PO XXXXXXX1 is processed an IDoc “000000XXXXXXXXX1” is added/created.

/wp-content/uploads/2012/12/34_170617.png

The relationship between the IDoc and the application document can be found in two ways:

1. Relationship tab of IDoc

/wp-content/uploads/2012/12/35_170618.png

/wp-content/uploads/2012/12/36_170619.png

2. Relationship tab of Application Document, e.g. PO, SO, Material Document, etc.

/wp-content/uploads/2012/12/37_170620.png

The initial status of this IDoc will be 30, which after successful processing will convert into status 16.

/wp-content/uploads/2012/12/38_170621.png

A successful outbound IDoc will pass through all the above statuses in reverse order (01-03-18-06-12-16). Each status represents an IDoc validation step. If an IDoc passes all the validations it would reach status 16. These different validation steps for outbound IDocs are explained below:

01: IDoc generation successful

30: IDoc is ready to be processed by IDoc Processing job

03: IDoc data is passed to the Port

18: IDoc successfully triggered EDI subsystem

06: IDoc data translated to EDI format

12: IDoc is dispatched successfully to the partner

16: Partner has received the IDoc successfully

IDoc can possibly fail at any of the above steps during validation.

RECEIVING AN INBOUND IDOC

The initial status of an inbound IDoc is 64 and successful status is 53.

Different validation steps for inbound IDocs are explained below:

50: IDoc received successfully in the system

64: IDoc is ready to be processed by IDoc processing job

53: Application document created and saved successfully. The document number can be found by expanding the status node 53

/wp-content/uploads/2012/12/39_170622.png

/wp-content/uploads/2012/12/40_170623.png

An inbound IDoc goes through all the above statuses in reverse order (50-64-53).

AUTOMATIC/IMMEDIATE PROCESSING

In this case, IDoc are processed immediately as they generated or added in the system. The check “Transfer IDoc immediately” is selected in Outbound Options and “Trigger Immediately” is selected in Inbound Option. These checks are generally used when the real time information exchange is necessary between two systems.

/wp-content/uploads/2012/12/41_170624.png

/wp-content/uploads/2012/12/13_170582.png

MANUAL PROCESSING

IDocs can also be manually processed using the TCODE BD87 in SAP.

PROCESSING VIA BACKGROUND JOB

IDoc processing by background is the most preferred way of processing the IDocs. Following Programs are used from processing the IDocs using background job:

RBDAPP01 – Inbound IDocs

RSEOUT00 – Outbound IDocs

REPROCESSING IDOCS

On the basis of IDoc statuses different programs can be used for reprocessing of failed IDocs. These are given below:

pastedimage_18_171678.png

If an IDoc contains error in the data then such IDocs can be edited using TCode WE02 or WE05. When an IDoc is edited the original IDoc information(backup) is saved in a New IDoc under status 70 (for inbound) / 33 (for outbound). These IDoc stays in the system for reference only and cannot be processed. The status of the edited IDoc becomes 69 (inbound) and 32 (outbound). These IDocs can then be processed using BD87 transaction or batch jobs.

Debugging of IDocs can be done using by copying the IDocs using TCode WE19. WE19 is a test tool for Idocs processing. WE19 copies the existing idoc and creates a new IDoc which can then be modified as per testing needs. The newly generated IDoc can also be processed using BD87.

Report RC1_IDOC_SET_STATUS can be used to change the status of IDoc. Status changes are generally needed to move an IDoc to status 68 – no further processing

/wp-content/uploads/2012/12/14_170583.png

TCODE WE02/WE05: GENERAL SEARCH

IDocs can be displayed in system via TCODE WE02 and WE05. If IDoc number is not known then search can be made on the basis of IDoc Date, Direction, BASIC TYPE, MESSAGE TYPE, and PARTNER NUMBER. Partner number can be found in the Output Messages of the documents.

/wp-content/uploads/2012/12/15_170588.png

/wp-content/uploads/2012/12/42_170625.png

IDoc search can also be made on the basis of ISA or Transfer file Reference.

/wp-content/uploads/2012/12/16_170584.png

TCODE WE09: SEARCHING DATA IN IDOC SEGMENTS

If we are looking for specific information within the IDocs Segments then this can be found using TCODE WE09. This is useful if you are searching for a particular information in similar kind of IDoc within IDoc segments. For example, if you want to search a particular Purchase Order number e.g. 100000001 in multiple IDocs which lies in Segment E1EDK01 of an IDoc under field BELNR. Then the search can be executed in the following manner.

/wp-content/uploads/2012/12/43_170626.png

/wp-content/uploads/2012/12/17_170589.png

Though, the IDoc failure may not be related to any of the above mentioned reasons, the best way to find the IDoc error is to compare the existing IDoc with the good example. Good example IDoc can be easily searched with any of the IDoc search methods as described above.

IDoc documentation can be found using TCODE WE60 and can be helpful to obtain information of the IDoc Type or its particular segment. It also provides information such as mandatory and optional segments, minimum and maximum number of segments, etc.

/wp-content/uploads/2012/12/44_170628.jpg

The following list gives the Basic Type and Message Type combination for common idocs

pastedimage_79_171676.png

As IDocs grow older they are archived and deleted from the database. Archived IDocs can be viewed using TCODE SARI in Achieve Explorer using archiving object as IDoc. Following are the few programs that are used for archiving and deletion of IDocs from database.

pastedimage_90_171677.png

SAP Fiori 2.0 – Bildirim Merkezi

Source: https://www.linkedin.com/pulse/sap-fiori…erkezi-mehmet-canca/
Capture Date: 11.03.2018 19:40:50

Kullanıcı Deneyimi (User Experience) ve Dijital Dönüşüm (Digital Transformation) kavramlarının ortaya çıkmasıyla birlikte, kullanıcıların kendi görevlerini takip ettiği uygulamalardan ilgili kişileri ihtiyaç anında bilgilendiren teknolojilere geçiş sürecindeyiz.

SAP, uygulamalara erişmek için Grafiksel Kullanıcı Arayüzü (Graphical User Interface) yerine SAP Fiori ürününü geliştirmiş ve müşterilerinin kullanımına sunmuştur. İlerleyen dönemlerde anlık bildirimler (Push Notifications) başlığı altında inceleyeceğimiz bir eklenti ile kullanıcıyı ihtiyaç anında bilgilendirme işlevini sağlamıştır. Bu yazımızda, sistemde anlık bildirim özelliğinin nasıl kullanılabileceğini ve aktifleştirilmesi için gerekli ön adımları inceleyeceğiz. S/4HANA 1610 kullanmayı düşünen müşteriler için en büyük veri kaynağı SAP Business Workflow yapısı olacaktır. Kurgulanmış iş akışı onay adımlarının Fiori Launchpad’e yönlendirilmesi ve anlık bildirimler olarak görüntülenmesi öncelikli taleplerden biri olarak karşımıza çıkmaktadır.

Bildirim Merkezi için Terimler:

  • Notification Center: Fiori Launchpad üzerinde bildirimlerim görüntülendiği alandır.
  • Notification Hub: Bunu Gateway sunucunuz olarak düşünebilirsiniz. Farklı kaynaklardan gelen bildirimlerin toplandığı birimdir. Eğer embedded senaryo kullanıyorsanız bu S/4HANA ile Gateway sunucunuzun aynı olduğu anlamına gelir.
  • Notification Provider: Bildirim üreten kaynaktır. Örnek vermek gerekirse; S/4HANA’nın kurulu olduğu sunucu (iş akışı onay adımlarının üretildiği yer) veya herhangi bir etkileşim kaynağı olarak düşünülebilir.

Bildirim Merkezi için Sistem Gereksinimleri:

  • Fiori 2.0 versiyonu gerekmektedir. Bu, teknik olarak Fiori Frontend Server 3.0 sahibi olmak demektir ki; S/4HANA 1610 olmadan ilgili bileşen kullanılamamaktadır. Uygun sistem mimarileri için bağlantı incelenebilir. Ayrıca, Fiori 2.0 S/4HANA Cloud 1608 itibariyle kullanılabilmektedir.
  • Gateway sunucusunu lokal bir kurulum olarak kullanıyorsak; SAP NetWeaver 7.51 versiyonu gerekiyor.

Bildirim Merkezinin Aktivasyonu

Bu bölümde yapılacak işlemler Gateway sunucusu üzerinde yapılmalıdır. Aktivasyon için 2 temel adım bulunmaktadır.

  • Bildirim oData servisinin aktivasyonu
  • Web Socket kanalının ayarlanması

Bildirim kanallarıyla ilgili SAP Help dokümantasyonuna buraya tıklayarak ulaşabilirsiniz.

Uyarlamaların yapılması için gerekli bütün adımlara SPRO > SAP NetWeaver > Notification Channel Hub üzerinden ulaşılabilir.

Bildirim oData Servisinin Aktifleştirilmesi

oData servis aktivasyonu için /IWFND/V4_ADMIN işlem kodu kullanılabilir. Normal oData versiyon 2 servislerini aktifleştirirken kullandığımız işlem kodu olan /IWFND/MAINT_SERVICE bu servis için kullanılamıyor; çünkü bildirim servisi oData versiyon 4 altyapısına sahiptir.

İşlem koduna giriş yaptıktan sonra /IWNGW/NOTIFICATION isimli servis grubunu aktifleştirmemiz gerekiyor. İşlemler gerçekleştirildikten sonra ekran görüntümüz aşağıdaki gibi olmalıdır. Aktivasyon sırasında System Alias bilgisi olarak LOCAL seçilmesine dikkat edilmelidir.

ABAP Push Channel Aktivasyonu

Bildirimlerin Fiori Launchpad üzerine iletilmesi için bir ABAP Push Channel kullanılmaktadır. Bunlar Web Service, RFC gibi teknolojiler olabilir.

Web üzerinden yapılacak bildirimler için kullanılacak servisin aktivasyonu gerekmektedir.

SICF işlem kodu kullanılarak notification_push_apc servisinin aktifleştirilmesi gerekmektedir (/default_host/sap/bc/apc/iwngw/notification_push_apc).

Ayrıca, SPRO içerisinde yer alan Activate and Maintain Push Channels adımında aşağıdaki girişi yapmamız gerekiyor:

Yapılacak konfigürasyon değişikliklerinden sonra Gateway sisteminde aşağıdaki işlem kodları çalıştırılarak Notification Hub cachelerinin temizlenmesi gerekmektedir. Bu işlemi SPRO içerisinde yer alan Clean Up MetaData and Data Cache adımından veya /IWNGW/H_CLEAR_CACHE işlem kodunu kullanarak gerçekleştirebiliriz. Bu işlem sistem tarafından da belirli aralıklarla otomatik olarak gerçekleştirilmektedir. SJOBREPO işlem kodundan /IWFND/NOTIFICATION_CLEANUP isimli arka plan işinin aktif olup olmadığı kontrol edilebilir.

Uyarlamalar tamamlandıktan sonra /N/IWNGW/BEP_DEMO işlem kodunu kullanarak bildirim merkezi kontrol edilebilir.

NOT: Yukarıdaki ekran alıntısının sağ üst köşesinde bulunan Bildirim Merkezi ikonu kullanıcılara özel bir rol tanımlaması yapılmadan görüntülenmemektedir. Bu amaçla Gateway sisteminde rol tanımlaması yaparak içerisine /UI2/CONFIG_NOTIFICATIONkataloğunun eklenmesi gerekmektedir.

SAP Workflow Onay Adımlarının Bildirim Merkezine Yönlendirilmesi

Bu bölümde anlatılacak bütün adımlar S/4HANA Core sunucusu üzerinde yapılmalıdır.

SAP Workflow bildirim sağlayıcısının aktifleştirilmesi

Öncelikle, S/4HANA Core sisteminin besleyeceği Notification Hub(Gateway) sistemini System Alias bilgisini kullanarak tanımlamamız gerekiyor. Buradaki temel amaç; Fiori Lauchpad üzerinde bir bildirim işlemdiğinde hangi sistemin çağırılacağına karar verilmesidir. Bu işlemi gerçekleştirmek amacıyla SPRO içerisinden Notification Channel Provider Enablement > Configuration > Connection Settings > Enter the Backend System Alias yolu kullanılır.

Yapmış olduğumuz işlemi özetlemek gerekirse; S/4HANA Core sisteminde oluşan bir bildirimin hangi sisteme gideceği ve işlendiği durumda hangi sistemi çağıracağını belirlemiş olduk.

NOT: Embedded senaryo kullanıyorsak, yani S/4HANA ve Gateway sistemlerimiz aynı sunucu üzerinde çalışıyorsa, burada LOCAL girişi yapılması gerekmektedir.

Girişi yapıp raporu yürüttüğümüzde sistem tarafından aşağıdaki mesaj görüntülenir:

Bildirim Sağlayıcısının Aktivasyonu

SWF_PUSH_NOTIF1 işlem kodunu kullanarak SAP Business Workflow sisteminin bir bildirim sağlayıcısı olarak aktif olup olmadığını görüntüleyebilirsiniz. Aşağıdaki şekilde olduğu gibi statü yeşil olarak görüntülenmelidir. Bu adımda iş akışı ve onay adımının bildirim olarak gönderileceğine de karar veriyoruz.

Aktivasyon işlemini tamamladıktan sonra bildirim sağlayıcı için aşağıdaki uyarlama girişini yapmamız gerekiyor. SPRO içerisinde yer alan Register Notification Providers uyarlaması kontrol edilmelidir:

İlk satırda görünen giriş mevcut değil ise; aşağıdaki bilgileri ve yukarıdaki ekran görüntüsü üzerinde kırmızı ile işaretlenmiş fonksiyon tuşlarını kullanarak eklememiz gerekiyor.

Tanımlama sırasında herhangi bir açıklama metni girebilirsiniz. Önemli bilgiler aşağıdaki gibidir:

  • Notification Provider ID SAP_BUSINESS_WORKFLOW
  • Provider Class CL_SWF_PUSH_NOTIF_PROVIDER

Arka plan işinin aktif olup olmadığının kontrol edilmesi

Bütün bildirimler arka planda otomatik olarak tetiklenen işler tarafından Gateway sistemine iletilmektedir. Burada kullanılan teknoloji bgRFC yani Background Remote Function Call olarak ifade edilmektedir. SJOBREPO işlem kodunu kullanarak SAP_WORKFLOW_PUSH_NOTIFICATION iş tanımının aktif olup olmadığı kontrol edilmedir.

İş Akış Bildirimlerinin Test Edilmesi

Kolay bir yöntem olarak Sistem Doğruluma iş akışı kullanılabilir. WS30100051 numaralı iş akışının 4 numaralı adımını kullanarak bildirim gönderimi test edilebilir. İş akışı WS30100051, sistemde iş akışı uyarlamalarının eksiksiz bir şekilde yapılıp yapılmadığını kontrol etmektedir. SWU3 işlem kodunda yer alan System Verification tuşu kullanılarak kolayca test edilebilir.

Yetkilendirme

S/4HANA sisteminde bildirimleri Gateway sistemine gönderen kullanıcıda (Arka planda otomatik olarak tetiklenen işi yürüten kullanıcı) ve Fiori kullanıcılarına tanımlanması gereken bazı yetkiler bulunmaktadır. Kullanıcılarla ilgili yetkilendirme dokümantasyonuna buraya tıklayarak ulaşabilirsiniz.

Kaynaklar

https://blogs.sap.com/2017/02/13/leading-s4hana-ux-notification-center-part-1-activation/

https://blogs.sap.com/2017/02/14/leading-s4hana-ux-notification-center-part-2-providing-notifications/

https://blogs.sap.com/2017/02/08/leading-s4hana-ux-fiori-my-inbox-part-1-activation/

https://blogs.sap.com/2017/02/08/leading-s4hana-ux-fiori-my-inbox-part-2-task-specific-options/

https://help.sap.com/viewer/a7b390faab1140c087b8926571e942b7/7.51.1/en-US/8a56c34ef855453b9768e0bb9ffac739.html

https://wiki.scn.sap.com/wiki/display/Fiori/SAP+Fiori+for+S4HANA

What should an ABAPer continue to learn as an application developer | SAP Blogs

Source: https://blogs.sap.com/2017/01/19/what-sh…plication-developer/
Capture Date: 11.03.2018 19:41:33

There is an excellent blog written by Marco Hernandez <<And now for something completely different>> which tells how an ABAP can avoid to be obsolete. The following five points are listed in the blog which I completely agree:

  • Object-oriented programming in general.
  • Test-Driven development and ABAP Unit.
  • Business Object Processing Framework (BOPF).
  • Floorplan Manager and other UI technologies (SAP UI5 perhaps).
  • ABAP for SAP HANA.

Outlook.jpg

Figure: a small gift got in SAP D-KOM 2017 in Shanghai,China

As another ABAP veteran who has been programming using ABAP in SAP for ten years, I have some additional points. I saw the term “SAP’s latest technology” within the communication of that blog, no doubt it could be quite good for an ABAPer to keep learning them, and IMHO it could be even better if an ABAPer has some basic awareness of the latest technique trends in open source community. Perhaps it is difficult for a traditional ABAPer to touch some of these trends in their daily work, however I do think that by knowing them, it can help you to become a better programmer, not just a better ABAPer.
Some of them come into my mind which are related to ABAPers’ life:

1-AM83LP9sGGjIul3c5hIsWg.png

In stackoverflow, there are already lots of discussion on it. See this one:

Per my experience, by mastering a kind of functional programming language, it gives you as a programmer a completely different way of problem-thinking-and resolving direction. You can never get such feelings when you use imperative and object oriented languages. After that you can look back into your current ABAP coding for example which will perform really time-consuming calculation on big internal table? Have you ever thought of the possibility that such big internal table could be splited into small pieces and handled in parallel just as a functional programming language does?

I personally would always like to compare BOPF with Spring. I

know it is unfair, since BOPF has only been developed by several scrum teams in

Waldorf, and for Spring, on the other hand, it is open source project and never stops evolution with the amazing work of contributors

under the hood. Just see the star number of Spring project in

GitHub

.

In my opinion, BOPF has successfully achieved some cool features of Spring to some degree, for
example inversion of control and dependency injection. While BOPF fulfills them via countless
configuration tables ( I prefer to call TDD in ABAP as Table-Driven-Development ), Spring uses annotation as another elegant approach.

You can of course learn OO Design pattern via the toy program written in books, however actually most frequently used patterns already spread heavily in Spring source code, by studying those codes you can know how the patterns are applied to resolve real requirement by Spring gurus.

By knowing how Spring works under the hood, it helps you to understand BOPF more thoroughly in turn. When you are familiar with the mechanism of

those framework enough, you are now able to write some mini-framework in your application code, which helps you to avoid code duplication, break tight dependency among components, and make your future maintenance and

continuous development task easier

in that Open-Close-Principle is achieved.

For some other features like

AOP

, it could not be purely supported in ABAP from language perspective due to the fact that unfortunately ABAP Virtual Machine cannot support dynamic proxy as JVM does.

Nevertheless we still have

Pre/Post exit

which can be leveraged to simulate AOP, from which customer can still benefit a lot, to build their own extensions. Meanwhile, there is another blog talking about AOP in ABAP:

I had been using CRM WebClient UI in the past to build UI, and I know it is not possible to build state-of-the-art responsive UI using this technology, and I have very limited knowledge on floor-plan manager so I am not sure whether it has the same problem. As far as I observe, UI5 plays a more and more important in SAP UX strategy, at least in my location, almost all customer facing UI are built by UI5. If you are an excellent ABAPer, you can develop high quality backend service which could be consumed by UI5 via OData, that’s fine. However if you would not like to limit yourself as just a backend developer, but instead, you wanna become a Full-Stack developer, then it is a must that you should learn Javascript. Three years ago ( in 2014 ) I once wrote a blog

A list of Javascript interesting features compared with ABAP

to compare ABAP with Javascript when I step into UI5 world. There are some

new syntactical sugar

over JavaScript’s existing prototype-based inheritance introduced in ECMAScript 2015. Check the following JavaScript source code:

clipboard1-10.png

I cannot help asking at the first sight of it: is this JavaScript at all?

MongoDB is classified as a NoSQL database in

Wikipedia

.

Its source code could be found from github repository.
While HANA knowledge is quite important for an ABAPer, have you ever wondered that why NoSQL database will come out although there are many powerful relational database in the world?Again Google with keyword “why nosql”:

clipboard2-8.pngI will keep updating this list once new topic comes to my mind which is really related to ABAP. I believe you will tower over normal ABAPers once you get familiar with those stuffs.

How time flies! One year has passed again. Here is another point which I think should be added to ABAPer’s TO-LEARN list.

.jpg

ABAP veterans might get confused that what could they do in current cloud world. Good news is, they are never abandoned by SAP at all.

clipboard1-17.png

I have written a series of blogs which compare the language feature among ABAP, JavaScript and Java. You can find a list of them below:

Functional Programming – Try Reduce in JavaScript and in ABAP | SAP Blogs

Source: https://blogs.sap.com/2017/02/27/functio…ascript-and-in-abap/
Capture Date: 11.03.2018 19:42:51

 

In my previous blog Functional programming – Simulate Curry in ABAP I simulate a very important concept “Curry” in functional programming world using ABAP.

In that blog I use the curry idea in the example below:
output:
jerry-java
In this blog, as blog title, I will show another approach by leveraging built-in function reduce in JavaScript Array and Reduce keyword in ABAP to fulfill the same requirement.
First see official documentation for Array.reduce here.
Follow the idea of functional programming, I first declare three dedicated functions which are responsible for a specific task in line 6 ~ 8.
Then in line 10, I construct a new composite function which will finally executes the three small functions driven by reduce.
Output:
jerry-java-scala

Reduce in ABAP

Now let’s see how we can achieve the same function in ABAP.
If we use the traditional imperative programming paradigm, the code is written as:
DATA: lv_input TYPE string value 'Jerry Java Scala',
      lv_result TYPE string.

SPLIT lv_input AT space INTO TABLE DATA(lt_temp).
LOOP AT lt_temp ASSIGNING FIELD-SYMBOL(<temp>).
   lv_result = lv_result && |{ <temp>  case = lower }| .
   IF sy-tabix <> lines( lt_temp ).
      lv_result = lv_result && '-'.
   ENDIF.
ENDLOOP.

WRITE: / lv_result.
Output:
jerry-java-scala
Now let’s try with Reduce. Here is the ABAP documentation for keyword REDUCE.
See how ABAP code can be re-written using REDUCE:
This version looks quite clear and more human-readable compared with the first imperative one:
1. in line 11~13 there are three command instance created and inserted into a command queue held by variable lo_queue.
2. command queue ZCL_COMMAND_QUEUE internally execute the commands one by one using REDUCE as the execution engine.
The rough design of ABAP solution using REDUCE is listed below:
1. I have declare an interface ZIF_COMMAND which has one method DO to perform concrete command, one method GET_RESULT to return command execution result and method SET_TASK to specify command input.
2. ZCL_COMMAND_QUEUE has internally maintained a command queue. The enqueue operation is provided by public method INSERT.
Another public method EXECUTE is defined to fire the command queue execution.
Inside this method, ABAP keyword is used. The last command in the queue will be returned and its interface method get_result is called to return the final calculation request to consumer call.
Hope this small example can help you understand the reduce usage in functional programming world and how to use command design pattern to resolve some real problem.
The complete source code could be found here.
I have written a series of blogs which compare the language feature among ABAP, JavaScript and Java. You can find a list of them below:

Creating Offline Application based on SAP Web IDE CRUD Master-Detail Template using Hybrid App Toolkit | SAP Blogs

Source: https://blogs.sap.com/2017/06/12/creatin…-hybrid-app-toolkit/
Capture Date: 11.03.2018 15:08:33

Introduction

In this blog, I am going to walk through the steps of creating an offline application based on CRUD Master-Detail template from SAP Web IDE using Hybrid App Toolkit

To follow the steps mentioned in this blog post, the following prerequisites needs to be met

Services.png

  • You need to install Hybrid App Toolkit local add-on in your local environment.The installation and setup instructions for Hybrid App Toolkit local add-on can be found here
  • To create a CRUD master-detail application, we need a backend destination setup in SAP Cloud Platform. For this blog, we use SAP Gateway ES4 Demo System OData Service. If you have not previously signed-up for SAP Gateway Demo System, you can sign-up here

Setting up backend destination

  1. Access Cloud Platform cockpit using https://account.hanatrial.ondemand.com/cockpit
  2. On the left-hand side, select Connectivity tab, then Destinations tab.
  3. Click on the New Destination link to open new destination configuration form.
  4. Enter all fields as shown in below tables

For Additional Properties fields click New Property and fill-up

Destination-1.png

5. Click Save.

Enable Hybrid App Toolkit Plugin in SAP Web IDE

Before creating the project using the SAP Web IDE Project template, we need to enable the “Hybrid App Toolkit” plugin, so that Hybrid Mobile features will be available in the SAP Web IDE.

  1. Open SAP Web IDE using the url https://webide-<your_trial_account>.dispatcher.hanatrial.ondemand.com Replace the string “<your_trial_account>” with your HCP Trial Landscape account
  2. After entering SAP Web IDE, select Tools > Preferences or click on the Preference icon directly on the left bar

tools.png

Or

pref.png

3. Select Plugins. Find and check Hybrid App Toolkit to enable the plugin.

plugin.png

4. Click Save.

5.Click Refresh to reload SAP Web IDE

Create new project based on CRUD Master-Detail template

Now you will create a new application using the SAP Web IDE Project template wizard.

  1. In the SAP Web IDE select the Workspace root and open the context menu by right-clicking.
  2. Choose New > Project from Template to open the new project creation wizard.

proj1.png

3. On Template Selection page, select SAP Fiori Application category and click on the CRUD Master-Detail Application to mark it as the template to be used for your new project

proj2.png

4. Click Next.

5. On the first page of the wizard, enter the Project Name as OfflineApp, Title as Products, and Namespace as com.sap.offlineapp

proj3.png

6. Click Next

7. On the Data Connection page click on Service Catalog as service source.

8. From the drop down box select the ES4 Gateway System entry.

proj4.png

9. Type “BASIC” in the Search input field to filter

10. Select GWSAMPLE_BASIC service.

proj5.png

11. Click Next.

12. On Template Customization page, fill up the Data Binding – Object section as below

Check the box for “Display only required fields when creating a new identity”

proj6.png

13. Scroll down to the Data Binding – Line Item section,fill up the section as below.

Capture-22-2.png

14. Click Next.

15. Click Finish to create the new application.

proj8.png

16. Run the newly generated web application

proj9.png

17. Congratulations! You developed your CRUD Master-Detail application and you see it already running in preview mode.

proj10.png

Configure Offline Settings to the project

  1. Go to Workspace, select OfflineApp/webapp/manifest.json and open it code editor.

off1.png

2. Switch to code editor view

off2.png

3. Add the following code snippet at the end of the file

"sap.mobile": { "_version": "1.1.0", "definingRequests": { "ProductSet": { "dataSource": "mainService", "path": "/ProductSet?$expand=ToSalesOrderLineItems" } } } 

4. Save and close the file

Add code to Synchronize data

In this step, we will add a button to the Master view and a javascript code to the button press event to synchronize data to and from back end to offline store on the device

  1. Go to Workspace, select OfflineApp/webapp/view/Master.view.xml
  2. Right click on Master.view.xml, choose Open With/Layout Editor
  3. Now we can view the file in Layout Editor. Drag the Button and drop to bottom panel of our app.

butt1.png

4. Select the button on the bottom panel that we just added. On the right-hand side canvas, we will see a Properties/Button setting panel. Delete values in Text and Width properties, add sap-icon://refresh to Icon property.

5. Now your bottom panel should look like this

butt2.png

6. On the right-hand side canvas, select Events setting. and Press, New Function

butt3.png

7. Enter onSyncData, click OK

butt4.png

8. Go to Workspace, open OfflineApp/webapp/controller/Master.controller.js file.

9. Replace empty onSyncData function with the following code

, onSyncData: function() { if (sap.hybrid && sap.hybrid.isApplicationOnline()) { this.getView().setBusy(true); sap.hybrid.synAppOfflineStore(jQuery.proxy(this._syncSuccess, this), jQuery.proxy(this._syncFailed, this)); } else { this._oODataModel.refresh(); } }, _syncSuccess: function() { sap.m.MessageToast.show("Data Synchronization succeeded", { duration: 3000 }); this.getView().setBusy(false); this._oODataModel.refresh(); }, _syncFailed: function() { sap.m.MessageToast.show("Data Synchronization failed", { duration: 3000 }); this.getView().setBusy(false); this._oODataModel.refresh(); } 

10. Save and Close both view and controller files

Create an application on SAP Cloud Platform mobile services

  1. Go to your CPms Administration page (https://hcpmsadmin-<your_trial_account>.dispatcher.hanatrial.ondemand.com). Replace the string “<your_trial_account>” with your HCP Trial Landscape account
  2. Select Mobile Applications, then Native/Hybrid. Click new button

cp1.png

3. In the New Application pop up dialog, fill up with the following values

cp2.png

4. Click Save button. This saves the application and go to Edit Application page

5. In editing application page. Select Connectivity

cp3.png

6. Click on new destination Icon to create new destination

cp4.png

7. In Create Destination popup dialog, choose Mobile Destination for Type, and com.sap.offlineapp for Destination Name

cp5.png

8. Click Next

9. Fill-up the values as below

10. Click Next

11. Choose Basic Authentication for SSO Mechanism

cp6.png

12. Click Next.

13. Fill in the User Name and Password for the backend account (SAP Gateway ES4 Demo System OData Service account).

14. Click Next and click Finish.

15. Go back to Edit Application page, and choose Security

cp7.png

16. Change Security Configuration to None, and then click Save

cp8.png

Configure Hybrid App Toolkit Local Add-on Settings

  1. Right click on OfflineApp, select Project Settings
  2. Choose Hybrid App Toolkit/ Hybrid App Configuration (Local Add-on)

h1.png

3. For Application section, enter the information as shown below. And for Build Options choose Release Mode. For Platforms, select Android

h2.png

4. For Plugins section, under Cordova tab, check Network Connection; under Kapsel tab, check Logon Manager, Logger and Offline OData

h3.png

h4.png

5. Click Save button

Now we are ready to deploy the app to mobile devices through Hybrid app toolkit

Deploy the app to mobile devices

In this step we are going to deploy the app to selected mobile device and run the application in offline mode

  1. Right-click on OfflineApp project and choose the menu option Run à Run On and choose your desired device/emulator
  2. Wait for the HAT local add-on to created Cordova Project, Build the application in desired platform, Install the App on device and launch the application on device
  3. On start-up, application will load the Logon Screen as below

r1.png

4. Enter your backend Username and Password and tap OK on Logon screen. If Logon is successful, you will see the Passcode screen.

5. Tap Disable Passcode button to load the application. It will show the loading screen as below. This is an indication that our application is an offline application

r3-1.png

6. After creating offline store, the application screen should be like below

r4.png

Testing the offline functionality of the app

To verify whether our app’s offline functions are working correctly, we can try the following steps

  1. Tap on HT-1000 row in master screen. This will navigate to detail screen.
  2. Click the Edit button on the detail page of item HT-1000.

r1-1.png

3. Change the Currency Code from EUR to SGD.

r2.jpg

4. Click Save button.

5. Now on the phone screen, we can see that the currency code of HT-1000 has been changed.

r2.png

6. Switch to WebIDE, and click run, to run our web app. We can see that the currency code of HT-1000 remains at EUR. This is because the changes we make on mobile app is only stored on local store and not yet updated in backend service.

7. Switch to the mobile app, and click the Synchronization button, wait for the synchronization completed successfully.

8. Switch to the web app that we are running, and refresh the page. We can see that after synchronization, the currency code is finally updated to SGD.

r3-2.png

Integrating SAP Screen Personas into the SAP Cloud Platform Portal | SAP Blogs

Source: https://blogs.sap.com/2017/07/03/integra…ud-platform-portal/#
Capture Date: 11.03.2018 15:08:06

There are numerous specific reasons for adding a link to an SAP Screen Personas flavor. In general, though, it’s done in order to streamline the user experience for your employees, customers, and partners who already access information, applications, and services in your organization via the SAP Cloud Platform Portal.

In fact, this is a common scenario for organizations who use the on-premise SAP NetWeaver Portal and who want to benefit from the simplification and other features that SAP Screen Personas brings to their screens (as one customer has done).

Obtain the URL to the flavor that will be added to the portal site.

Example:

http://<hostname>:<port>/sap/bc/personas?sap-client=<client>&sap-language=EN&sap-sec_session_created=X&~transaction=VA01&sap-personas-flavor=005056BB59E71DD213CD5BCB4D6450C6

Launch the Portal service from the SAP Cloud Platform Cockpit.

  1. In the Services tab, scroll down to the bottom to the “Portal” tile.Screen-Shot-2017-07-02-at-4.18.34-PM.png
  2. Click on Go to Service.Screen-Shot-2017-07-02-at-4.36.23-PM.png

Add the flavor URL to the SAP Cloud Platform Portal menu

  1. Click on “Site Directory”.Screen-Shot-2017-07-02-at-5.50.15-PM.png
  2. Hover over the tile of the site to which the flavor is to be added. Then click the “Edit” button.Screen-Shot-2017-07-02-at-6.12.34-PM.png
  3. Click on the menu editor button.Screen-Shot-2017-07-02-at-6.17.19-PM.png
  4. Hover over the first menu item in the list and the click the add button (the plus icon). Next, choose either option. (For this guide, I will choose sub-item.)Screen-Shot-2017-07-02-at-6.34.06-PM.png
  5. Enter the following information as below and then click the “Add” button:Screen-Shot-2017-07-02-at-7.16.49-PM.png
  6. Click the “Save” button.Screen-Shot-2017-07-02-at-7.24.52-PM.png
  7. Click the publish button.Screen-Shot-2017-07-02-at-7.24.52-PM-1.png
  8. Click the “Publish and Open” button.Screen-Shot-2017-07-02-at-7.34.50-PM.png

Test the Menu Item

  1. Once the portal has loaded, hover over the menu item under which the sub-item was placed and then click the menu item for the flavor.Screen-Shot-2017-07-02-at-7.29.30-PM.png
  2. Violà!Screen-Shot-2017-07-02-at-7.39.01-PM.png