Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECTION-SCREEN problem

Former Member
0 Likes
555

Hi experts,

I want to do something like this in my selection screen.

Number of Records: (number of rows in a Z-table)

How to achieve it in Selection-screen, please advise.

Cheers,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
512

HI,

Lawrence Lee


SELECTION-SCREEN :  BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
      PARAMETERS :  field1 TYPE tab-field,
 SELECTION-SCREEN :  END OF BLOCK B1.

INITIALIZATION.
*      count the number of lines.

field1 = value.

start-of-selection.

When you run the program

Selection screen appears with the number of records in ztable.

4 REPLIES 4
Read only

guilherme_frisoni
Contributor
0 Likes
512

Hi,

you can get this information in AT SELECTION-SCREEN OUTPUT, like this:



SELECTION-SCREEN COMMENT COMM1.

AT SELECTION-SCREEN OUTPUT.
SELECT count(*) from table.

COMM1 = sy-dbcnt.

Regards,

Frisoni

Read only

0 Likes
512

Hi,

Thanks for the fast reply. But i just couldn`t get it work. Below is my codes, help me to take a look.


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: pv_file TYPE string.
PARAMETERS: upload as CHECKBOX.
PARAMETERS: pv_start TYPE i.
PARAMETERS: pv_end TYPE i.

SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN COMMENT 1(50) lv_rec.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-003   MODIF ID s1.
  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-004   MODIF ID s2.
  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-005   MODIF ID s3.
  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-006   MODIF ID s4.

  SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  %_pv_file_%_app_%-text  = 'File Name'.
  %_upload_%_app_%-text   = 'Upload file to Z-table'.
  %_pv_start_%_app_%-text = 'Start Record'.
  %_pv_end_%_app_%-text   = 'End Record'.

  SELECT count(*) from ZCTD_MIGCUST.
  lv_rec = sy-dbcnt.

Thanks

Read only

0 Likes
512

Hi,

try this way.


Report zXXXX.

data: p_com type string.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: pv_file TYPE string.
PARAMETERS: upload as CHECKBOX.
PARAMETERS: pv_start TYPE i.
PARAMETERS: pv_end TYPE i.

SELECTION-SCREEN SKIP 1.
selection-screen begin of line.
SELECTION-SCREEN COMMENT 1(50) lv_rec.
selection-screen end of line.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-003   MODIF ID s1.
  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-004   MODIF ID s2.
  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-005   MODIF ID s3.
  SELECTION-SCREEN SKIP 1.
  SELECTION-SCREEN COMMENT 1(50) text-006   MODIF ID s4.

  SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  %_pv_file_%_app_%-text  = 'File Name'.
  %_upload_%_app_%-text   = 'Upload file to Z-table'.
  %_pv_start_%_app_%-text = 'Start Record'.
  %_pv_end_%_app_%-text   = 'End Record'.

  SELECT count(*) from lfa1.
  p_com = sy-dbcnt.
  lv_rec = p_com.

It is the comment's description. Maybe its type is not compatible with sy-dbcnt.

If a user-defined name is entered, the runtime environment generates a global variable of the same name with type c and length 83.

Edited by: Yong Zhao on Jul 29, 2009 6:39 AM

Read only

Former Member
0 Likes
513

HI,

Lawrence Lee


SELECTION-SCREEN :  BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
      PARAMETERS :  field1 TYPE tab-field,
 SELECTION-SCREEN :  END OF BLOCK B1.

INITIALIZATION.
*      count the number of lines.

field1 = value.

start-of-selection.

When you run the program

Selection screen appears with the number of records in ztable.