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

pop up before selection screen

Former Member
0 Likes
2,300

hi all,

i need to give a pop up screen before the selection screen which will take the value for the number of records to be displayed. how to do this ?

thanks,

Amit

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,738

You could do something like this.



report zrich_0001.

data: value1 type spop-varvalue1.
data: answer type c.

parameters: p_check type c.

load-of-program.

check sy-ucomm = space.

  call function 'POPUP_TO_GET_ONE_VALUE'
    exporting
      textline1            = 'Number of Records:'
*   TEXTLINE2            = ' '
*   TEXTLINE3            = ' '
      titel                = 'Number of Records'
      valuelength          = '5'
   importing
      answer               = answer
      value1               = value1.

start-of-selection.

But I really don't understand your requirement. Why not ask for this value on the selection screen itself?

Regards,

Rich Heilman

hi all,

i need to give a pop up screen before the selection screen which will take the value for the number of records to be displayed. how to do this ?

thanks,

Amit

12 REPLIES 12
Read only

Former Member
0 Likes
1,738

Hi,

Create 1st program :

Report Zfirst.

Use POp up FM.

If <Condition >

Submit <Zsecond> via selection-screen.

endif.

Report Zsecond.

Here give selection screen commands.

Best regards,

Prashant

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,739

You could do something like this.



report zrich_0001.

data: value1 type spop-varvalue1.
data: answer type c.

parameters: p_check type c.

load-of-program.

check sy-ucomm = space.

  call function 'POPUP_TO_GET_ONE_VALUE'
    exporting
      textline1            = 'Number of Records:'
*   TEXTLINE2            = ' '
*   TEXTLINE3            = ' '
      titel                = 'Number of Records'
      valuelength          = '5'
   importing
      answer               = answer
      value1               = value1.

start-of-selection.

But I really don't understand your requirement. Why not ask for this value on the selection screen itself?

Regards,

Rich Heilman

Read only

0 Likes
1,738

thanks rich.

can we 1)change the format of the popup

2)make the field mandatory

Read only

0 Likes
1,738

Not with that function module, but you can with another.

Regards,

Rich Heilman

Read only

0 Likes
1,738

thanks rich

but what do you mean by 'with another'

Read only

0 Likes
1,738

You can make the field required like this with this function module.



report zrich_0001.

data: value1 type spop-varvalue1.
data: answer type c.

data: ival type table of sval with header line.

parameters: p_check type c.

load-of-program.

  ival-tabname   = 'SYST'.
  ival-fieldname   = 'SROWS'.
<b>  ival-field_obl   = 'X'.        " Required Field</b>
  append ival.


  call function 'POPUP_GET_VALUES'
    exporting
*   NO_VALUE_CHECK        = ' '
      popup_title           = 'Number of Records:'
*   START_COLUMN          = '5'
*   START_ROW             = '5'
* IMPORTING
*   RETURNCODE            =
    tables
      fields                = ival.




start-of-selection.

  write:/ value1.

Regards,

Rich Heilman

Read only

0 Likes
1,738

It appears that there may be a limitation to this function module, as the field must be of character type. So you will need to find a table-field combination which will give you a character field with a description like "lines" or "rows" or whatever you want.



report zrich_0001.

data: ival type table of sval with header line.

parameters: p_check type c.

load-of-program.

<b>  ival-tabname   = 'MARA'.
  ival-fieldname   = 'MAGRV'.</b>
  ival-field_obl   = 'X'.        " Required Field
  append ival.

  call function 'POPUP_GET_VALUES'
       exporting
            popup_title = 'Number of Records:'
       tables
            fields      = ival.

start-of-selection.

  read table ival index 1.

  write:/ ival-value.

Regards,

Rich Heilman

Read only

0 Likes
1,738

For example, this structure field seems to be a good fit.



report zrich_0001.

data: ival type table of sval with header line.

parameters: p_check type c.

load-of-program.

<b>  ival-tabname   = 'YBAPIPQMPR'.
  ival-fieldname   = '2NMAXR'.</b>
  ival-field_obl   = 'X'.        " Required Field
  append ival.

  call function 'POPUP_GET_VALUES'
       exporting
            popup_title = 'Number of Records:'
       tables
            fields      = ival.

start-of-selection.

  read table ival index 1.

  write:/ ival-value.

Please be sure to award points for helpful answers and mark your post as solved when solved completely. Thanks

Regards,

Rich Heilman

Read only

0 Likes
1,738

Thanks Rich for all the inputs .

whenever i find time i will help others on SDN . You are my inspiration .

Thanks again

Read only

Former Member
0 Likes
1,738

Hi,

Do this in the initlalize event..For the popup use 'REUSE_ALV_POPUP_TO_SELECT'..

Thanks,

Naren

Read only

Former Member
0 Likes
1,738

U can call in the INITIALIZATION event.

But I think the better option will be, to display the pop-up after the user enters the value in the selection screen.

Or U can make a parameter like p_rec type i. And user has to enter the number of records to be displayed.

Regards,

Prakash.

Read only

Former Member
0 Likes
1,738

Hi,

Try this..

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.

PARAMETERS: NUMBER TYPE NUM6 OBLIGATORY.

SELECTION-SCREEN END OF SCREEN 500.

LOAD-OF-PROGRAM.

CALL SELECTION-SCREEN 500 STARTING AT 10 10.

Thanks,

Naren

Message was edited by: Narendran Muthukumaran