SAP ABAP - Sample Program On Creating A Screen With Two TABSTRIPS For A Report Program.

This sample program creates a screen with two tabstrips. One tab TAB1 accepts two numbers, where as the other tab TAB2 displays the sum of two numbers accepted on TAB1.

SAMPLE PROGRAM:

REPORT ztest_screen_tabstrip.

DATA: number1 TYPE i,
number2 TYPE i,
n1 TYPE i,
n2 TYPE i,
ok_code TYPE sy-ucomm,
result TYPE i.

CONTROLS tabstrip TYPE TABSTRIP.

CALL SCREEN 100.
CALL SCREEN 110.
CALL SCREEN 130.

*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
ENDMODULE. " STATUS_0100 OUTPUT

*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE ok_code.

WHEN 'TAB1'.
tabstrip-activetab = 'TAB1'.

WHEN 'TAB2'.
tabstrip-activetab = 'TAB2'.

WHEN 'BACK'.
LEAVE PROGRAM.

WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'CANCEL'.
LEAVE PROGRAM.

ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT

*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0130 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0130 INPUT.
result = number1 + number2.
ENDMODULE. " USER_COMMAND_0130 INPUT

*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0110 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0110 INPUT.
n1 = number1.
n2 = number2.
ENDMODULE. " USER_COMMAND_0110 INPUT


SCREEN LOOKS LIKE:


On clicking TAB2.



MORE PROGRAMS ON REPORT PROGRAMMING:

- Demonstrate Tabstrips & Subscreens In Selection Screen.

- Setting Default Values In Selection Screen.

- Programming On Buttons In A Screen.

- On Using HOTSPOT Keyword In A Report Program.

- Type Conversion ( Char To Curr Type).

- Type Conversion ( Curr To Char Type).

- ...Back To Index On Report Programming.




Your suggestions and comments are welcome in this section.

Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.