2016 Jan 18 4:45 AM
Hi gurus,
My client want a pop-up screen while user click on save. My t code is f-48. While pop-up appears user must ans should choose one option from pop-up(Radio buttons). If the user doesn't choose any option you need to raise a message 'please choose one option from pop-up'. I done all things my enhancement name is F180A001. But while i display message like this Message ''please choose one option from pop-up'' type 'E'. This error message gives a pop-up with 'exit' while i am clicking forcibly t code come out. For this i give message type 'i' and use leave screen.
My code is
TYPE-POOLS : WCTP1.
DATA I_SEL TYPE WCTP1_RADIO_TYPE.
CALL FUNCTION 'WCFW_POPUP_RADIO'
EXPORTING
I_TITLE = 'BUTTONS'
I_TXT1 = 'TEXT1'
I_TXT2 = 'TEXT2'
I_TXT3 = 'TEXT3'
I_TXT4 = 'TEXT4'
I_TXT5 = 'TEXT5'
I_TXT6 = 'TEXT6'
I_CHOICE = '1'
IMPORTING
E_CHOICE = I_SEL
* EXCEPTIONS
* ERROR = 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-UCOMM = 'CANC'.
CLEAR : DOC_HEAD_TAB ,DOC_ITEM_TAB ,RELATION_TAB.
MESSAGE 'PLEASE CHOOSE ANY MATERIAL ON POP-UP' TYPE 'E'.
ENDIF.
below screen is the error.
2016 Jan 18 5:01 AM
2016 Jan 18 5:01 AM
2016 Jan 18 5:15 AM
Ya works fine Gautham Thanks a lot. But can you please give me clarity why error message display like this in exits. Till now i never face this situation.
2016 Jan 20 3:14 PM
Hi Srinivas,
messages behave differently depending on the context.
Details are described in the online (F1) documentation for keyword MESSAGE under 'Behavior of Messages'.
In the current case the 'E' message has ben converted into an 'A' message.
Regards,
Johannes
2016 Jan 18 6:19 AM
Hello Srinivas,
For this you can use,
Message 'Please choose one option from pop-up' type 'E' display like 'I'.
2016 Jan 18 6:27 AM
No i already used but it behaves same like what i post in image..
2016 Jan 18 6:41 AM
If you don't want this message in pop-up,you can treat this message as Error msg display like Succes message.
Message ' ' type 'E' display like 'S'.
2016 Jan 18 6:45 AM
2016 Jan 18 7:31 AM
2016 Jan 18 7:42 AM
2016 Jan 19 3:04 PM
As Suresh tried to write, dont' execute a true error message, try something like
DO.
CALL FUNCTION 'WCFW_POPUP_RADIO'
EXPORTING
i_title = 'BUTTONS'
i_txt1 = 'TEXT1'
i_txt2 = 'TEXT2'
i_txt3 = 'TEXT3'
i_txt4 = 'TEXT4'
i_txt5 = 'TEXT5'
i_txt6 = 'TEXT6'
i_choice = '1'
IMPORTING
e_choice = i_sel
EXCEPTIONS
error = 1
OTHERS = 2.
IF i_sel EQ 'C'.
MESSAGE 'You didn''t select any option - Same player shoot again' TYPE 'S' DISPLAY LIKE 'E'.
ELSE.
EXIT.
ENDIF.
ENDDO.
Or build your own pop-up.
Regards,
Raymond
2016 Jan 20 3:52 AM
Hi
if i write above logic the transaction continue. But in my scenario transaction must stop at save level( dont update in DB).
2016 Jan 20 4:25 AM
Hello
You shall find then correct exit/badi where the method/function module gives you an option to validate. If you will throw error in this exit it will stop everything with only option to exit the tcode.
Nabheet
2016 Jan 20 3:20 PM
2016 Jan 22 6:13 AM
Hi Raymond Giuseppi could you please give few more brief details for your explanation.
2016 Jan 22 12:36 PM
Raymond, It does work as you mentioned, but interestingly the message doesn't show up giving an illusion that the click never happened. When you click the tick button it just proceeds. This behavior is only observed in exit 001 for me but in exit 002 things seem to work just fine. Can't seem to find a logical explanation for that at the moment.
2016 Jan 22 12:45 PM
2016 Jan 22 1:21 PM
But i put a BREAK-POINT Statement in both EXIT_SAPLF048_001 , EXIT_SAPLF048_002 but only EXIT_SAPLF048_001 triggered. Thats why i done my work with EXIT_SAPLF048_001. But i didnt understand how your system triggered EXIT_SAPLF048_002 .
2016 Jan 22 1:50 PM
Did you try putting a break point in function module COBL_CUSTOMER_EXIT_PAI and try?
2016 Jan 20 5:00 AM
I choose best Exit among the Sap provide. . Its strange for me.
2016 Jan 20 5:11 AM
Hello Srinivas
You shall try for FI validation where you can raise error message or search for BTE.
Thanks
Nabheet
2016 Jan 21 4:31 PM
You will not be able to achieve that in the customer exit 'EXIT_SAPLF048_001' as this exit is called from a function module from which will convert any error message raised within it to an abend message which results in termination of the transaction. (F1 help on MESSAGE will not help in this case as the behavior of the error message is programmatically changed to deviate from the standard behavior, so don't go by the SAP keyword help documentation in this case).
Instead you can use the below code in the exit 'EXIT_SAPLF048_002' to achieve the functionality you want. (BU is the function code for Post). Assuming that you don't have to pass anything back in the other exit.
IF sy-ucomm EQ 'BU'
DO.
CALL FUNCTION 'WCFW_POPUP_RADIO'
EXPORTING
i_title = 'BUTTONS'
i_txt1 = 'TEXT1'
i_txt2 = 'TEXT2'
i_txt3 = 'TEXT3'
i_txt4 = 'TEXT4'
i_txt5 = 'TEXT5'
i_txt6 = 'TEXT6'
i_choice = '1'
IMPORTING
e_choice = i_sel
EXCEPTIONS
error = 1
OTHERS = 2.
IF i_sel EQ 'C'.
MESSAGE 'You didn''t select any option - Same player shoot again' TYPE 'S' DISPLAY LIKE 'E'.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
2016 Jan 22 6:10 AM
hi Coder X EXIT_SAPLF048_002 is not triggered. Thats why i choose EXIT_SAPLF048_001.
2016 Jan 22 6:41 AM
Hi Srinivas,
can Try Following as suggested by coder X
But in place of 'S' Use 'I' it will give a pop up message and if u press on ok button your process will continue .
IF i_sel EQ 'C'.
MESSAGE 'You didn''t select any option - Same player shoot again' TYPE 'I' DISPLAY LIKE 'E'.
ELSE.
Best Regards.
2016 Jan 22 12:32 PM
I checked in the system and EXIT_SAPLF048_002 gets called before EXIT_SAPLF048_001. You can set a break point in the function module COBL_CUSTOMER_EXIT_PAI and check if the control stops there. If it does, just debug a little further and you will notice 002 being called.
See attached screenshot
2016 Jan 25 4:11 AM
Hi Coder X,
Sorry for late replay. Ya i observe 002 is called in COBL_CUSTOMER_EXIT_PAI but the problem is flg_ci_exists = 'Y' in COBL_CUSTOMER_EXIT_PAI here i am unable to check 002 fm. See attachment.
2016 Jan 25 5:28 PM
Definitely not the best solution, but the exit will be called if you just add a dummy field to the customer include CI_COBL found in the structure BAPICOBL_CI. (May be you can just add ZZDUMMY of type CHAR01). You can use this as a last option if you really don't have any other Exit or BADI.
Alternatively, consider using an implicit enhancement in the subroutine where they handle the user commands or perform before save checks. This is definitely a better solution than the above. (Hint: Include:MF05AI10_PAI_ANFANG, Form:PAI_PAI_ANFANG)