‎2006 Jan 11 10:31 PM
Hello Everyone,
I am working with 2 screens, the second screen is a pop-up called by pressing a button on first(orders screen extended using user exits). Before calling 2nd screen, it goes through some validations and are done in the user exits.
1)
If i press the button on 1st screen, without selecting the item line, it raises a error as required
2) if button is pressed along with item line and is not valid it again raises the error as required
The problem is, after the error, the screen freezs and i am un able to de- select the line and select the other to process.
How to solve this issue.
Regards
Kesi
‎2006 Jan 11 10:42 PM
u can use CHAIN ENDCHAIN commands
go to ur particular source code on screen
PROCESS AFTER INPUT.
CHAIN.
FIELDS : here write ur checkbox fieldname
ENDCHAIN.
‎2006 Jan 11 10:53 PM
Hello,
What about the item lines, i cant de-selct the error
line and select the other, as the screen freezs. And if i just press the button with out selcting the line item, it gives the error as required but again the screen freezes and does not allow me to selct the item line for processing. everytime i need to start the transaction again.
REgards
Kesi
‎2006 Jan 11 10:55 PM
define all the fields in CHAIN ENDCHAIN
CHAIN.
FIELDS:FLD1,
FLD2,
FLD3,
....
ENDCHAIN.
‎2006 Jan 11 11:19 PM
when you issue an 'error' message sap only enables for input the fields asociated with the module being processed (i.e. those in the chain).
If you want the logic to be able to issue a message based on some fields but allow entry to other fields you'll have to use a 'success' message and also set a flag to indicate that an error has occurred. You can then check your flag at the end of pai and force the pbo to repeat rather than moving on as if real 'success' has occurred. The 'success' message come out on the next screen displayed but without freezing anything.
‎2006 Jan 12 12:08 AM
Hello Neil,
Yes, i declared them as success messages but unable to understand how to set the flag and disaplay the messages.
IF you can give me a bit of code as to how to do that it will be of great help.
regards
Kesi.
‎2006 Jan 12 12:49 AM
Try something like this:
in your pai flow:
LOOP.
MODULE check_stuff.
ENDLOOP.
module error_check.
..............
in your abap
form check_stuff.
only check if the current line has been selected
CHECK ??????
clear the flag
CLEAR w_illegal.
if wrong..
IF blah blah blah.
*.. set flag that error has occurred
w_illegal = 'X'.
show message on next screen
MESSAGE s778 WITH
'Cannot do that sort of thing!'.
& &
ENDIF.
endform.
form error_check.
IF ERRORS STAY HERE (AS LONG AS SCREEN HAS ITSELF AS NEXT)
CHECK w_illegal IS INITIAL.
IF NO ERRORS MOVE ON TO 'NEXT SCREEN'
SET SCREEN ???.
LEAVE SCREEN.
EXIT.
endform.
>>>>>>>>>>>>>>>
If this doesn't make sense show us your flow logic and I'll try to adjust it to your code.
‎2006 Jan 12 1:20 AM
Hello I have screen(6000) with some buttons to extend the standard sapmv45a screen. The button name is ztag on screen 6000.
case sy-comm.
when 'ztag'
perform tag-tag.
************
form tag-tag.
read ivbap with key posnr = ivbap-posnr.
if ivbap-selkz ne 'x'.
message s301(z1).,<----error message
endif.
read xvbap with key posnr=xvbap-posnr.
if xvbap-matkl ne ztab-matkl and
ztab-matkl = ' '.
message s302(z1).<---error message.
-.......
say if we select more than one item line (say lv_count >0)then
message s303(z1).<---error message.
.
.
.
.
if all the above validations are ok then
call screen 6001 ( a pop up screen).
regards
Kesi
‎2006 Jan 12 1:28 AM
Hi
form tag-tag.
read ivbap with key posnr = ivbap-posnr.
if ivbap-selkz ne 'x'.
message s301(z1).<----error message
EXIT. <========================================
endif.
read xvbap with key posnr=xvbap-posnr.
if xvbap-matkl ne ztab-matkl and
ztab-matkl = ' '.
message s302(z1).<---error message.
EXIT. <========================================
-.......
say if we select more than one item line (say lv_count >0)then
message s303(z1).<---error message.
EXIT. <========================================
CALL SCREEN 6001.
So after calling message do an EXIT statament, in this way the system'll leave the form without to do the rest of code.
Put the call of popup at the end of the routine: the system can run that statament only if all controlls are ok.
Max
‎2006 Jan 12 12:48 AM
Hello,
Can any one help to how to code for what Neil suggested.
regards
Kesi
‎2006 Jan 12 1:45 AM
Hello Max,
what will be the screen status after the EXIT after the error message.
For example if user selects 2 item line, which results in error, the screen which will be presented to the user after the exit, should show the the both item lines as slected with an error at the bottom. In this way the user can de select one of the selected lines.
Regards
Kesi
‎2006 Jan 12 2:10 AM
Hi
The user'll see the same situation, if you want to do that, you have to manage it into your user exit.
If you want to deselect the items, it's easy because you need only to clear the field SELKZ of internal table IVBAP, but I don't believe it'll easy ton place the item (where the error occurs) to top.
You should update the field TOP_LINE of table control:
read ivbap with key posnr = ivbap-posnr.
if ivbap-selkz ne 'x'.
message s301(z1).,<----error message
Get index of record:
READ TABLE XVBAP WITH KEY POSNR = IVBAP-POSNR
TRANSPORTING NO FIELDS.
TCTRL_U_ERF_AUFTRAG-TOP_LINE = SY-TABIX.
EXIT.
endif.
TCTRL_U_ERF_AUFTRAG is the table control, i don't know if it'll work: try!
Max
‎2006 Jan 18 10:07 PM
Hello every one,
After the error encounter ( now this has be declared as errors instead of success messages), the calling screen (say 1) freezes. Now want the it to be active so tht the user can select another function.
(screen 1 is sapmv45a and screen to is a pop-up/modal screen).
regards
Kesi
‎2006 Jan 18 11:03 PM
The user has to fix the error and press enter. Then the button that was pressed will take effect.
Rob
‎2006 Jan 18 10:50 PM
‎2006 Jan 18 11:09 PM
Hello,
Here is the scenario. If user selects a item line which dosn't contain data according to the requirement, it throws an error. Initially the error message as success message s502(z1)...but as success message processes, it calls the pop up screen which is displayed. But when it encounters the message, it must able to display message at the bottem, still as success but must not call the second screen.
How we achevie that.
Regards
kesi
‎2006 Jan 18 11:16 PM
When you raise the message, set a flag. Then, when you process the ok-code to see if you still want to go to that screen or not.
Rob
‎2006 Jan 18 11:26 PM
How we set up the flag.
flag(1) type c.
statement1
if sy-subrc ne 0.
flag = 'x'.
message s501(z1).
endif.
statement2
if sy-subrc ne 0.
flag = 'x'.
message s501(z1).
endif.
*
*
*
if flag = ' '.
call screen 2.
endif.
Is this how we do it. If not please let me know.
Regards
Kesi
‎2006 Jan 18 11:30 PM
That looks ok - why don't you just try it? (Make sure the flag is globally defined.)
Rob
‎2006 Jan 18 11:50 PM
Hello,
As the message is on stnadard sap screen sampv45a (sales order). The screen still freezes.
I have the validations on user exit for the SO screen.
stmt1
If sy-subrc <> 0.
message1
endif.
stmt2
If sy-subrc <> 0.
message2
endif.
stmt3
If sy-subrc <> 0.
message3
endif.
call screen 2.
Now it triggers the error but freezes the screen if message type is 'E'. it displays the message and calls screen 2 if mssg type is 'S'.
Help!
regards
Kesi
‎2006 Jan 19 2:09 AM
show us EXACTLY your flow logic for the two screens and the abap code in any pai and pbo modules.
‎2006 Jan 19 6:49 AM
here is the code for the screen 1. and the validations are carried out here..if any error, message is displayed but calls the 2 nd screen...which shouldnt happen...it should only deisplay the error with out freezing the screen.
&----
*& Form zz_call_monitor
&----
text
----
--> p1 text
<-- p2 text
----
FORM zz_call_monitor.
TABLES: zpv_potsize.
variables.
DATA: flg(1) TYPE c,
lv_count TYPE i,
lv_matkl(9) TYPE c, "material group.
zzcusttype(10) TYPE c,
lv_team LIKE zpv_potsize-team_number,
v_posnr LIKE xvbap-posnr,
lv_callcounting LIKE zpv_data-transition_flag,
lv_perno LIKE zpv_data-pernr.
Work area
DATA: wa_team LIKE zpv_potsize.
DATA: wa_vbap LIKE xvbap.
check for single line selection
LOOP AT ivbap WHERE selkz = 'X'.
lv_count = lv_count + 1.
ENDLOOP.
IF lv_count > 1.
MESSAGE s520(z1).
ENDIF.
check for item line selection
READ TABLE ivbap WITH KEY selkz = 'X'.
IF sy-subrc <> 0.
MESSAGE e902(v1). "item line not selected.
MESSAGE s522(z1).
ENDIF.
check for material group.
LOOP AT ivbap WHERE selkz = 'X'.
READ TABLE xvbap WITH KEY posnr = ivbap-posnr.
IF sy-subrc = 0.
SELECT SINGLE matkl FROM zpv_matkl INTO lv_matkl
WHERE matkl = xvbap-matkl.
IF sy-subrc <> 0.
MESSAGE s521(z1).
ENDIF.
ENDIF.
ENDLOOP.
Check for sales channel selection.
READ TABLE xvbkd WITH KEY posnr = ivbap-posnr.
IF sy-subrc = 0.
IF xvbkd-bsark <> 'ZF' AND xvbkd-bsark <> 'ZT'.
MESSAGE s521(z1).
ENDIF.
ENDIF.
call pop-up screen after all above screens are validated.
CALL SCREEN 9010.
ENDFORM. " zz_call_monitor
‎2006 Jan 19 10:07 PM
one obvious thing is that after your s message flow will continue (e messages stop processing, s messages don't) and therefore the call to screen 9010 will ALWAYS occur.
But, please post the FLOW LOGIC not just the abap...and show the abap code for all pai and pbo modules.