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 message with table value

Former Member
0 Likes
2,576

hello all,

i have to display a pop-up message while saving invoice documents in FB60, i m using the customer exit for the same.

but problem is that i have to display some values also in pop-up screen and there should be two pushbutton for user selection like 'OK' and 'CANCEL'. can anyone plz tell me which function module should i use? i tried POPUP_TO_CONFIRM, POPUP_TO_CONFIRM_WITH_MESSAGE, and POPUP_TO_CONFIRM_WITH_VALUE.

pop-up message must be like....

'atleast one document has been entered.' " this is text only

Vendor : 211111 - product distribution. "vendor & description from ITAB

Refrence : Test1 " Ref from ITAB

Do u want to continue to save?

OK -


CANCEL

Regards saurabh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,269

Hi,

try this code

call function 'POPUP_TO_CONFIRM'
        exporting
         titlebar                    = text-004
*       DIAGNOSE_OBJECT             = ' '
          text_question               = message
          text_button_1               = text-002
          icon_button_1               = 'X'
          text_button_2               = text-003
          icon_button_2               = 'X'
          default_button              = co_one
          display_cancel_button       = co_space
*       USERDEFINED_F1_HELP         = ' '
*       START_COLUMN                = 25
*       START_ROW                   = 6
*       POPUP_TYPE                  =
*       IV_QUICKINFO_BUTTON_1       = ' '
*       IV_QUICKINFO_BUTTON_2       = ' '
       importing
         answer                      = l_answer
*     TABLES
*       PARAMETER                   =
       exceptions
         text_not_found              = 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.

in the place of message you can dynamically populate the text required in a variable and use that variable.

hello all,

i have to display a pop-up message while saving invoice documents in FB60, i m using the customer exit for the same.

but problem is that i have to display some values also in pop-up screen and there should be two pushbutton for user selection like 'OK' and 'CANCEL'. can anyone plz tell me which function module should i use? i tried POPUP_TO_CONFIRM, POPUP_TO_CONFIRM_WITH_MESSAGE, and POPUP_TO_CONFIRM_WITH_VALUE.

pop-up message must be like....

'atleast one document has been entered.' " this is text only

Vendor : 211111 - product distribution. "vendor & description from ITAB

Refrence : Test1 " Ref from ITAB

Do u want to continue to save?

OK -


CANCEL

Regards saurabh

12 REPLIES 12
Read only

Former Member
0 Likes
2,269

Hi ,

This is a module pool program SAPMF05A.

You can create a new screen and make its layout , as per your requirement.

You can handel the OK code , as per your logic.

Call this screen in your exit.

Hope you understand it.

Read only

Former Member
0 Likes
2,270

Hi,

try this code

call function 'POPUP_TO_CONFIRM'
        exporting
         titlebar                    = text-004
*       DIAGNOSE_OBJECT             = ' '
          text_question               = message
          text_button_1               = text-002
          icon_button_1               = 'X'
          text_button_2               = text-003
          icon_button_2               = 'X'
          default_button              = co_one
          display_cancel_button       = co_space
*       USERDEFINED_F1_HELP         = ' '
*       START_COLUMN                = 25
*       START_ROW                   = 6
*       POPUP_TYPE                  =
*       IV_QUICKINFO_BUTTON_1       = ' '
*       IV_QUICKINFO_BUTTON_2       = ' '
       importing
         answer                      = l_answer
*     TABLES
*       PARAMETER                   =
       exceptions
         text_not_found              = 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.

in the place of message you can dynamically populate the text required in a variable and use that variable.

Read only

0 Likes
2,269

hi gopinath ,

thanx for reply, can u please tell me in details that how can i display all required data like text and table values in 'MESSAGE' ?

regards .

Read only

0 Likes
2,269

Hi,

Suppose you want to display

atleast one document has been entered.' " this is text only

Vendor : 211111 - product distribution. "vendor & description from ITAB

Refrence : Test1 " Ref from ITAB

constant: text1(100) type c value 'atleast one document has been entered'.
constant: text2(10) type c value 'Vendor:'.
constant: text3(10) type c value 'Reference:'.

data: message type string,
         l_answer type c.


"declare with the respective types of vendor, description and reference.
data: d_vendor,
         d_desc,
         d_ref.

clear: d_vendor, d_desc, d_ref.
Read table itab into wa_itab with key "use your condition here to select the required record from itab.
if sy-subrc = 0.
d_vendor = wa_itab-vendor.
d_desc = wa_itab-desc.
d_ref = wa_itab-ref.
endif.

concatenate text1 text2 d_vendor '-' d_desc text3 d_ref into message separated by space.

call function 'POPUP_TO_CONFIRM'
        exporting
         titlebar                    = 'Header'
          text_question               = message
          text_button_1               = 'OK'
          icon_button_1               = 'X'
          text_button_2               = 'CANCEL'
          icon_button_2               = 'X'
          default_button              = 1
          display_cancel_button       = 
       importing
         answer                      = l_answer
       exceptions
         text_not_found              = 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 l_answer = 1.
"logic if ok is pressed.
else if l_answer = 2.
"logic if cancel is pressed.
endif.

Edited by: Harini Gopinath on Dec 22, 2009 12:26 PM

Read only

0 Likes
2,269

Hi

Check this FM.

popup_get_values.

Read the documentation for this FM. Hope it helps.

Regards,

Raj

Read only

0 Likes
2,269

here is a sample code using fm POPUP_TO_CONFIRM


DATA: t_spar TYPE TABLE OF spar.
DATA: fs_spar LIKE LINE OF t_spar.
DATA: w_text TYPE string.
data: w_ans type c.
" data in t_spar can ne your itab data to be displayed
fs_spar-param = 'Vendor'.
fs_spar-value = 'Vendor'.
append fs_spar to t_spar.

fs_spar-param = 'kunnr'.
fs_spar-value = '1234'.
append fs_spar to t_spar.

CONCATENATE '&Vendor&' '--' '&kunnr&'
' Do You want to continue to save?' into w_text.
WRITE: 'CLICK SAVE'.

SET PF-STATUS 'STAT'. 

AT USER-COMMAND.
CASE SY-UCOMM.
  WHEN 'SAVE'.


CALL FUNCTION 'POPUP_TO_CONFIRM'
  EXPORTING
   TITLEBAR   = 'atleast one document has been entered'
*   DIAGNOSE_OBJECT             = ' '
    text_question = w_text
   TEXT_BUTTON_1               = 'OK'(001)
*   ICON_BUTTON_1               = ' '
   TEXT_BUTTON_2               = 'NO'(002)
*   ICON_BUTTON_2               = ' '
*   DEFAULT_BUTTON              = '1'
   DISPLAY_CANCEL_BUTTON       = 'X'
*   USERDEFINED_F1_HELP         = ' '
*   START_COLUMN                = 25
*   START_ROW                   = 6
*   POPUP_TYPE                  =
*   IV_QUICKINFO_BUTTON_1       = ' '
*   IV_QUICKINFO_BUTTON_2       = ' '
 IMPORTING
   ANSWER                      = w_ans
 TABLES
   PARAMETER                   = t_spar
 EXCEPTIONS
   TEXT_NOT_FOUND              = 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.

WHEN OTHERS.
  EXIT.
ENDCASE.

Regards,

Deeba

Read only

0 Likes
2,269

hi gopinath...very thanx for nice reply....it has been resolve my issue.

but can u plz tell me one more thing that :

if l_answer = 1.

"logic if ok is pressed. " here i want that user can continue to save---then what code should i write here else if l_answer = 2.

"logic if cancel is pressed. " here i want that user come back to FB60 screen---then what code should i write here endif.

also tell me that how can i increase the size of POP-UP box?

plz suggest.

regards.

Read only

0 Likes
2,269

Hi,

If l_answer = 1.

"database should be updated

UPDATE <db table> from wa_itab.

elseif l_answer = 2.

"no action should take place

skip.

endif.

hope this helps.

If your question is resolved, award points and mark the question as solved.

Thanks,

Harini

Read only

0 Likes
2,269

Dear gopinath,

i m writing this logic but it is still creating the document number in database, while i need that if l_answer = '2' then it must come back on basic screen of FB60.

if l_answer = '2'.

skip.

else.

endif.

kindly suggest.

regards.

Read only

0 Likes
2,269

Hi,

Please paste your code here

Read only

0 Likes
2,269

hi gopinath,

i passed the FB60 screen number and now it is working, so now only u check that what i write, is it fine or not?

and please let me know can i increase the size of POP-UP box because all contents are not coming as desired line and spaces?

please suggest.

*----


tables : bsip, lfa1.

*----


TYPES: BEGIN OF t_tab, " Structure

xblnr like bsip-xblnr,

belnr like bsip-belnr,

name1 like lfa1-name1,

end of t_tab.

*----


DATA: lt_itab TYPE TABLE OF t_tab with header line. "local internal table

*----


data : lwa type bseg. " Local work area

data : lwa1 type bkpf. " Local work area

*----


constants: text1(80) type c value 'Atleast one document has been entered with same vendor name and Reference Data.'.

constants: text2(10) type c value 'Vendor:'.

constants: text3(10) type c value 'Reference:'.

*----


data: message type string,

l_answer type c.

*----


read table DOC_ITEM_TAB index 1 into lwa.

*----


1

if sy-subrc = 0.

read table DOC_HEAD_TAB index 1 into lwa1.

*----


2

if sy-subrc = 0.

select single xblnr belnr from bsip into lt_itab where LIFNR = lwa-LIFNR

and XBLNR = lwa1-XBLNR

and SHKZG ne 'S'.

*----


3

if sy-subrc eq 0.

select single name1 from lfa1 into lt_itab-name1 where lifnr = lwa-lifnr.

concatenate text1 text2 lwa-LIFNR '-' lt_itab-name1 text3 lwa1-XBLNR into message separated by space.

call function 'POPUP_TO_CONFIRM'

exporting

titlebar = 'Duplicate Check'

text_question = message

text_button_1 = 'OK'

icon_button_1 = 'X'

text_button_2 = 'Cancel'

icon_button_2 = 'X'

  • default_button = 1

display_cancel_button = ' '

START_COLUMN = 25

START_ROW = 6

importing

answer = l_answer

exceptions

text_not_found = 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 l_answer = '2'.

leave to screen 1100.

else.

endif.

*----


else.

endif.

*----


3

else.

endif.

*----


2

else.

endif.

regards.

Read only

0 Likes
2,269

Hi Saurabh,

[Check this Thread|]

This is simple and Straight.

Cheerz

Ram