Archive for the ‘How to’ Category

How to use if Statement in SAP

Wednesday, July 2nd, 2008

The if statement in ABAP/4 has relational operators for equality and inequality and special relational operators for string comparisons and for bit masks.

Syntax for the if Statement
The following is the syntax for the if statement.

if [not] exp [ and [not] exp ] [ or [not] exp ].

[elseif exp.
---]
[else.
---]
endif.

where:
* exp is a logical expression that evaluates to a true or false condition.
* — represents any number of lines of code. Even zero lines are allowed.

The following points apply:
* Every if must have a matching endif.
* else and elseif are optional.
* Parentheses can be used. Each parentheses must be separated by a space. For example, if ( f1 = f2 ) or ( f1 = f3 ) is correct, and if (f1 = f2) or (f1 = f3) is incorrect.
* Variables can be compared with blanks or zeros using the addition is initial. For example, if f1 is initial will be true if f1 is type c and is blank. If f1 is any other data type, the statement is true if f1 contains zeros.
* To accomplish negation, not must precede the logical expression. For example, if not f1 is initial is correct. if f1 is not initial is incorrect.
* Variables can be compared with nulls using the addition is null. For example, if f1 is null.

Comparing two values that do not have the same data type will result in an internal automatic type adjustment of one or both of the values. One type will take precedence and will dictate what type of conversion is performed. The order of precedence is: (more…)

Popularity: 6% [?]

How to Search the Descriptions of a Structure or Table

Monday, June 30th, 2008

Step by step how to search the descriptions of a structure or table:

  1. Begin at the Dictionary: Table/Structure: Display Fields screen.
  2. Choose the menu path Table->Print. The Print Table Manual screen is displayed. Here you specify which details you want to see.
  3. Tickmark all fields and press the Continue button. The Print: screen is displayed.
  4. If the Output Device field is blank, position your cursor in the field, press the down arrow, and choose any output device. (It doesn’t matter which device you choose; it won’t be used.)
  5. Press the Print Preview button at the bottom of the screen. The Print Preview for xxxx Page 00001 of nnnnn screen is displayed.
  6. Choose the menu path Goto->List Display. The Print Preview for xxxx screen is displayed.
  7. Type %sc in the Command field on the Standard toolbar.
  8. Press the Enter key. The Find screen is displayed.
  9. In the Search For field, type a character string to be found. If you are searching for the current logon language, you might type language. Wildcard characters are not permitted. (more…)

Popularity: 8% [?]