Dialog (103) - Table Control

<< Click to Display Table of Contents >>

Navigation:  All About ABAP Technique > English > ABAP Dialog Programming > Basic Knowledge >

Dialog (103) - Table Control

Objective

Creating Dialog

Result

Source Code

Flow Logic

Include "YPRACTICE_DIALOG_103_HEADER"

Transaction Code

SE38 - ABAP Editor

Support

Video , Video (Tips)

 

Creating Dialog

1.Open SE38

2.Copy Program "YPRACTICE_DIALOG_101" to "YPRACTICE_DIALOG_103"

3.Select All Object

abp0018

4.Change Program "YPRACTICE_DIALOG_103"

5.Open Goto > Attributes, and change Title with "103 - Table Control"

6.Modified Report Declaration

Before

REPORT  ypractice_dialog_101                    .

 

After

REPORT  ypractice_dialog_103                    .

 

7.Modified ""

Before

*----------------------------------------------------------------------*

*GLOBAL VARIABLE DECRALATION

*----------------------------------------------------------------------*

 

DATA : ok_code LIKE sy-ucomm,

       save_ok LIKE sy-ucomm.

 

DATA : gv_message1(100),

       gv_message2(100).

 

*----------------------------------------------------------------------*

 

After

*----------------------------------------------------------------------*

*GLOBAL VARIABLE DECRALATION

*----------------------------------------------------------------------*

TYPES: BEGIN OF ty_header,

         matkl LIKE mara-matkl,  " Material Group

         matnr LIKE mara-matnr,  " Material Number

         maktx LIKE makt-maktx,  " Material Description

         bismt LIKE mara-bismt,  " Old material number

         meins LIKE mara-meins,  " Base Unit of Measure

         mseht LIKE t006a-mseht, " Unit of Measurement Text

         Cek,

       END OF ty_header.

 

* Or You can using this code bellow

*TYPES: BEGIN OF ty_header.

*         INCLUDE STRUCTURE yta_header_101.

*TYPES:   cek,

*       END OF ty_header.

 

* Deklarasi Internal Table

DATA: gi_header TYPE STANDARD TABLE OF ty_header WITH HEADER LINE,

      gi_makt  LIKE STANDARD TABLE OF makt WITH HEADER LINE,

      gi_t006a LIKE STANDARD TABLE OF t006a WITH HEADER LINE.

      

DATA: gv_matkl LIKE mara-matkl.

 

DATA : ok_code LIKE sy-ucomm,

       save_ok LIKE sy-ucomm.

 

DATA : gv_message1(100),

       gv_message2(100).

 

*----------------------------------------------------------------------*

 

8.Click "abap_tutorial0019" and click "abap_tutorial0031"

9.Select "REPS", "CUAD" and "DYNP"

abp0033

10.Click "abap_tutorial0025" to activate the program

11.Click "ar0015"

12.Double click "abp0008" to open screen 2000

13.Click "ar0018" to start design layout (Screen Painter)

14.Click "abp0019" and then click to screen

15.Set Label (Text Field) Name with "GV_LABEL1" and Text with "Material Group." like this bellow

abp0034

 

16.Click "abp0021" and then click to screen

17.Set TextBox (Input/Output Field) name with "GV_MATKL" with length "10" like this bellow

abp0035

 

18.Double Click "abp0041" and set Search help with "H_T023"

abp0040

 

19.After that the TextBox changed to "abp0042"

20.Click "abp0023" and then click to screen

21.Set Button (PushButton) name with "GV_BUTTON" like this bellow

abp0036

 

22.Double click "abp0037" and set Function Code with "DISPLAY"

abp0038

 

23.After that the button color changed to gray like this "abp0039"

24.Click "abap_tutorial0019" to save the screen

25.Click "abp0043" and drag it at screen painter

26.After than Table Control Wizard will be run

abp0044

 

27.Click "abp0045" Followed this steps bellow

Display Steps

 

Wizard Result

 

28.Click "abap_tutorial0019" to save the screen and then close the screen painter

29.Back to source code

30.Modified module "USER_COMMAND_2000 input"

Before

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_2000  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

module USER_COMMAND_2000 input.

  save_ok = ok_code.

  CLEAR ok_code.

 

  CASE save_ok.

    WHEN 'BACK'.

      LEAVE TO SCREEN 0.

    WHEN OTHERS.

 

  ENDCASE.

 

  CLEAR ok_code.

endmodule.                 " USER_COMMAND_2000  INPUT

 

After

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_2000  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE user_command_2000 INPUT.

  save_ok = ok_code.

  CLEAR ok_code.

 

  CASE save_ok.

    WHEN 'BACK'.

      LEAVE TO SCREEN 0.

    WHEN 'DISPLAY'.

      CALL FUNCTION 'YFM_RFC_PRACTICE_101'

       EXPORTING

         gv_matkl         = gv_matkl

*         GV_MATNR         =

         gv_max_row       = 0

       TABLES

         gi_header        = gi_header

                .

    WHEN OTHERS.

 

  ENDCASE.

 

  CLEAR ok_code.

ENDMODULE.                 " USER_COMMAND_2000  INPUT

 

31.Click "abap_tutorial0019" and click "abap_tutorial0031"

32.Select "REPS", "REPS" and "DYNP"

abp0054

33.Click "abap_tutorial0025" to activate the program

34.Test and Run program

35.Create T-Code "YPD103"

36.Finished

 

Result

Screen 2000

abp0055

 

After button "Display" clicked

abp0056

 

Flow Logic