Application Development 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: 

POPUP TO GET VALUE

Former Member
0 Kudos

Hi, I need to show a popup that lets write a value.

I've tried POPUP_GET_VALUES function, but I need to write the text to show, not the description of the field. With POPUP_GET_VALUES I inform a field from a table and when the popup appears, it shows the description of the field. I need a popup where I can write the description and retrieve the data entered.

For example, I'd like to show a popup with the question: What's your name? and a textbox where the user can write the answer, does it exist?

Thanks!

Carles

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Hi,

Check the table SVAL have a field FIELDTEXT here you can pass the description you want

aRs

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate

Can the question be the title of the popup?




data: ivals  type table of sval.
data: xvals  type sval.

xvals-tabname   = 'USR01'.
xvals-fieldname = 'BNAME'.
append xvals to ivals.

call function 'POPUP_GET_VALUES'
     exporting
          popup_title     = 'What is your name?'
     tables
          fields          = ivals
     exceptions
          error_in_fields = 1
          others          = 2.

read table ivals into xvals with key fieldname = 'BNAME'.
if sy-subrc  = 0.
  write:/ xvals-value.
endif.

Regards,

Rich Heilman

former_member194669
Active Contributor
0 Kudos

Hi,

Check the table SVAL have a field FIELDTEXT here you can pass the description you want

aRs

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Or, how about this, although it is not very elegant.




data: value type spop-varvalue1.


call function 'POPUP_TO_FETCH_ONE_VALUE'
  exporting
    textline1            = 'What is your name?'
*   TEXTLINE2            = 'Can you tell me please?'
*   TEXTLINE3            = ' '
    title                = 'Question'
    valuelength          = '30'
  importing
*   ANSWER               =
    value1               = value
 exceptions
   titel_too_long       = 1
   others               = 2.

Regards,

Rich Heilman

Former Member
0 Kudos

Thanks, but no, it can't be the title. And I also need to show more text, like:

Hi, my name is ....

What's your name? [textbox]

Thanks