Tuesday, July 6, 2010

LESSON 37 INTERACTIVE LIST TECHNIQUES

INTERACTIVE LIST TECHNIQUES:


When a user chooses a function from a list, it triggers that function's function code. This function code, in turn, triggers a corresponding event.

Some function codes are reserved for use by the system and therefore do not trigger an interactive event when the user chooses them (that is, the system does not return to the program). Instead these codes trigger a corresponding system function.

All function codes with the exception of "PICK" as well as all codes reserved for system use trigger the event AT USER-COMMAND. For more information, refer to the Program Interface unit.

The statement MODIFY LINE modifies the first line of the list. The values stored in the hide area for this line are placed in the corresponding fields, and are thus available in the program.

The statement MODIFY CURRENT LINE changes the last line to have been chosen by line selection or the READ LINE statement (even if it was in a different list level).

If you use the LINE FORMAT addition, the selected line is formatted according to the
specifications , , ...

The addition FIELD VALUE replaces the field contents of , , ... in the list line with the current values of , , ... (all values are converted to type C).
The contents of , , ... themselves are not replaced.

If a field from the line being modified is displayed more than once, that line will only be modified the first time it is displayed.

The LINE VALUE FROM addition allows you to replace the entire line being modified with the current contents of field .

The FIELD statement, allows you to find out the name of the field in which the cursor is positioned. The name of the variable from which the value comes is placed in the field . However, for the sort criterion, you only use the name of the field as it appears in the table definition. You therefore need to use an offset specification to find out the field name. The offset is the length of the structure name plus one character for the hyphen.

The name of the output field is provided in the field specified in the FIELD parameter. The output value is contained in the field specified in the VALUE parameter.

The operation sets the return code sy-subrc.

sy- subrc = 0: The cursor was positioned on a field.
sy- subrc = 4: The cursor was not positioned on a field.

Caution: Do not use the value from the VALUE parameter as a selection criterion in a SELECT statement. If it is not a character field, the system will convert its type, which could lead to undesired results. It is better to use the hide technique instead.

Before you find out the sort field, check that the user placed the cursor on a valid line. If this is not the case, you should display an appropriate message.

Decreasing the list level (changing the value of sy-lsind) should always be the last action before you display the list buffer. This system field determines the list level at which the new list is displayed. The hide area and list buffer of any higher list levels are automatically initialized.

You can use system field sy-lsind to determine the list level at which the list is displayed. In the example above, list level 2 where the list is sorted according to the number of unoccupied seats is being displayed. The statement sy-lsind = 1 causes the list to be displayed at list level 1, thus replacing the list sorted according to date, which would normally be displayed first.

You cannot assign a value to sy-lsind that is greater than the current value of the field assigned by the system. This means you cannot bypass list levels in ascending direction.

You should only change sy-lsind in the last statement before the list is displayed, since changing the value does not always lead to an immediate change of list level. The new list level is assigned to the list at the very end, after the entire list buffer has been displayed. If you are not acquainted with this behavior, you could program your lists incorrectly.

Message types have the following effects on list processing:

Type E messages discard the current detail lists and return to the list level previously displayed.

Type W messages are always displayed as error messages (type E).

While the basic list is being created, type W and type E messages always lead to program termination (corresponds to type A).

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites