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: 

FM ------> POPUP_GET_VALUES_USER_BUTTONS

Former Member
0 Kudos
1,119

I am using the following FM, in this i am having two buttons i.e., 'Set Date' & the default button 'cancel'.

the 'Set Date' button is not working. i.e., when i click on the button it popup dialog box does not disappear, it stays there itself.

please specify where i had done the mistake. so that i can rectify it to get the event invoked.

Ur replies will be appreciated.

CALL FUNCTION 'POPUP_GET_VALUES_USER_BUTTONS'

EXPORTING

  • F1_FORMNAME = ' '

  • F1_PROGRAMNAME = ' '

  • F4_FORMNAME = ' '

  • F4_PROGRAMNAME = ' '

FORMNAME = 'DELIMIT_PROXY'

PROGRAMNAME = 'ZVR_SALES_PROXY_MAINT'

POPUP_TITLE = text-012

OK_PUSHBUTTONTEXT = text-011

ICON_OK_PUSH = text-011

  • QUICKINFO_OK_PUSH = ' '

  • FIRST_PUSHBUTTON = text-011

  • ICON_BUTTON_1 = text-011

  • QUICKINFO_BUTTON_1 = ' '

  • SECOND_PUSHBUTTON = 'Cancel'

  • ICON_BUTTON_2 = 'Cancel'

  • QUICKINFO_BUTTON_2 = ' '

  • START_COLUMN = '5'

  • START_ROW = '5'

  • NO_CHECK_FOR_FIXED_VALUES = ' '

IMPORTING

RETURNCODE = answer

TABLES

FIELDS = delim

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.

IF SY-SUBRC EQ 0.

PERFORM delimit_proxy TABLES delim

USING text-012 text-011

CHANGING answer.

CASE answer.

WHEN '1'.

IF w_date LT sy-datum AND NOT w_date IS INITIAL.

READ TABLE delim INDEX 1.

it_proxy-endda = delim-value.

MODIFY it_proxy FROM it_proxy INDEX sy-tabix

TRANSPORTING endda.

ELSE.

MESSAGE i000(zq) WITH text-013 sy-datum.

CONTINUE.

ENDIF.

WHEN '2'.

EXIT.

WHEN OTHERS.

ENDCASE.

ELSE.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

FORM delimit_proxy TABLES p_delim STRUCTURE sval

USING "p_progname

p_title1

p_title2

CHANGING p_answer.

IF p_answer NE 'A'.

p_answer = '1'.

ELSE.

p_answer = '2'.

ENDIF.

ENDFORM.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
363

Change this line of code.



  if p_answer ne 'A'.
<b>    p_answer = space.</b>
  else.
    p_answer = '2'.
  endif.


Regards,

Rich Heilman

5 REPLIES 5

Former Member
0 Kudos
363

Hi Ateeq,

Just check whether your first condition is satisfied in the case '1'.

Former Member
0 Kudos
363

pls debug and see what is the value u r getting into the field 'answer'when u click set Date.

and write the code accordingly

Former Member
0 Kudos
363

It has documentation. Have you checked it?

It suggests looking at program RSSPO450 for an example.

Rob

Message was edited by: Rob Burbank

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
364

Change this line of code.



  if p_answer ne 'A'.
<b>    p_answer = space.</b>
  else.
    p_answer = '2'.
  endif.


Regards,

Rich Heilman

0 Kudos
363

This code work pretty good for me.


report zrich_0002.

data: delim type table of sval with header line.
data: answer(1) type c.

delim-tabname = 'VBAK'.
delim-fieldname = 'ERDAT'.
append delim.

call function 'POPUP_GET_VALUES_USER_BUTTONS'
exporting
* F1_FORMNAME = ' '
* F1_PROGRAMNAME = ' '
* F4_FORMNAME = ' '
* F4_PROGRAMNAME = ' '
formname = 'DELIMIT_PROXY'
programname = 'ZRICH_0002'
popup_title = text-012
ok_pushbuttontext = text-011
icon_ok_push = text-011
* QUICKINFO_OK_PUSH = ' '
* FIRST_PUSHBUTTON = text-011
* ICON_BUTTON_1 = text-011
* QUICKINFO_BUTTON_1 = ' '
* SECOND_PUSHBUTTON = 'Cancel'
* ICON_BUTTON_2 = 'Cancel'
* QUICKINFO_BUTTON_2 = ' '
* START_COLUMN = '5'
* START_ROW = '5'
* NO_CHECK_FOR_FIXED_VALUES = ' '
importing
returncode = answer
tables
fields = delim
exceptions
error_in_fields = 1
others = 2
.

case answer.
  when space.
*      if w_date lt sy-datum and not w_date is initial.
*        read table delim index 1.
*        it_proxy-endda = delim-value.
*        modify it_proxy from it_proxy index sy-tabix
*        transporting endda.
*      else.
*        message i000(zq) with text-013 sy-datum.
*        continue.
*      endif.
  when 'A'.
    exit.
  when others.
endcase.



*---------------------------------------------------------------------*
*       FORM delimit_proxy                                            *
*---------------------------------------------------------------------*
form delimit_proxy tables p_delim structure sval
               using p_code1 p_code2
               changing p_answer.


  if p_answer ne 'A'.
    p_answer = space.
  endif.

endform.

Regards,

Rich Heilman