2005 Dec 14 4:42 PM
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.
2005 Dec 14 5:00 PM
2005 Dec 14 4:50 PM
Hi Ateeq,
Just check whether your first condition is satisfied in the case '1'.
2005 Dec 14 4:51 PM
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
2005 Dec 14 4:52 PM
It has documentation. Have you checked it?
It suggests looking at program RSSPO450 for an example.
Rob
Message was edited by: Rob Burbank
2005 Dec 14 5:00 PM
2005 Dec 14 5:03 PM
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