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

FM to take input from User

Former Member
0 Likes
1,706

Hi All,

I have to capture the rejection reason using a pop up / dialog box.

Length can be max 255 chars.

If anybody knows if std FM is available for this purpose ?

I have tried FM: POPUP_TO_GET_ONE_VALUE.

However in this I am able to put commnets upto 30 chars only.

How do I achieve if I want to enter upto 255 chars?

Regds,

Akshay

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
874

Hi Akshay,

the standard FMs SAP offers are not many not really good.

Try:


SELECTION-SCREEN BEGIN OF SCREEN 777 AS WINDOW.
  PARAMETERS:
    p_string                                TYPE string.
SELECTION-SCREEN END OF SCREEN 777.

  CALL SELECTION-SCREEN 777
                      STARTING AT 10 5
                      ENDING   AT 100 6.

I crashed my SAPGUI entering strings with length exceeding 1000 characters

Regards,

Clemens

Hi All,

I have to capture the rejection reason using a pop up / dialog box.

Length can be max 255 chars.

If anybody knows if std FM is available for this purpose ?

I have tried FM: POPUP_TO_GET_ONE_VALUE.

However in this I am able to put commnets upto 30 chars only.

How do I achieve if I want to enter upto 255 chars?

Regds,

Akshay

2 REPLIES 2
Read only

Clemenss
Active Contributor
0 Likes
875

Hi Akshay,

the standard FMs SAP offers are not many not really good.

Try:


SELECTION-SCREEN BEGIN OF SCREEN 777 AS WINDOW.
  PARAMETERS:
    p_string                                TYPE string.
SELECTION-SCREEN END OF SCREEN 777.

  CALL SELECTION-SCREEN 777
                      STARTING AT 10 5
                      ENDING   AT 100 6.

I crashed my SAPGUI entering strings with length exceeding 1000 characters

Regards,

Clemens

Read only

uwe_schieferstein
Active Contributor
0 Likes
874

Hello Akshay

Have a look at the following sample report which is quite close to your solution.

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_POPUP_GET_VALUE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_popup_get_value.


DATA:
  gd_rc        TYPE syst-subrc,
  gs_sval      TYPE sval,
  gt_sval      TYPE STANDARD TABLE OF sval.



START-OF-SELECTION.

  gd_rc = 0.


" Choose any table/structure field having a CHAR255 data element
  CLEAR: gs_sval.
  gs_sval-tabname    = 'BAPISDXTH'.
  gs_sval-fieldname  = 'FLDCHAR'.  " data element = CHAR255
  gs_sval-fieldtext  = 'Reason'.
  gs_sval-novaluehlp = 'X'.
  APPEND gs_sval TO gt_sval.


  CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
      no_value_check        = 'X'
      popup_title           = 'Reason of Rejection'
*     START_COLUMN          = '5'
*     START_ROW             = '5'
    IMPORTING
      returncode            = gd_rc
    TABLES
      fields                = gt_sval
    EXCEPTIONS
      error_in_fields       = 1
      OTHERS                = 2.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  check ( gd_rc = 0 ).

  read table gt_sval into gs_sval index 1.
  write: / 'Reason =', gs_sval-value.


END-OF-SELECTION.

Regards

Uwe