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

Dynpro

Former Member
0 Likes
2,247

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

22 REPLIES 22
Read only

Former Member
0 Likes
2,197

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.

Read only

Former Member
0 Likes
2,197

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

Read only

0 Likes
2,197

define all the fields in CHAIN ENDCHAIN

CHAIN.

FIELDS:FLD1,

FLD2,

FLD3,

....

ENDCHAIN.

Read only

0 Likes
2,197

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.

Read only

0 Likes
2,197

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.

Read only

0 Likes
2,197

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.

Read only

0 Likes
2,197

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

Read only

0 Likes
2,197

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

Read only

Former Member
0 Likes
2,197

Hello,

Can any one help to how to code for what Neil suggested.

regards

Kesi

Read only

Former Member
0 Likes
2,197

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

Read only

0 Likes
2,197

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

Read only

0 Likes
2,197

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

Read only

0 Likes
2,197

The user has to fix the error and press enter. Then the button that was pressed will take effect.

Rob

Read only

Former Member
0 Likes
2,197

Any help!! please

Read only

Former Member
0 Likes
2,197

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

Read only

0 Likes
2,197

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

Read only

Former Member
0 Likes
2,197

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

Read only

0 Likes
2,197

That looks ok - why don't you just try it? (Make sure the flag is globally defined.)

Rob

Read only

Former Member
0 Likes
2,197

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

Read only

0 Likes
2,197

show us EXACTLY your flow logic for the two screens and the abap code in any pai and pbo modules.

Read only

Former Member
0 Likes
2,197

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

Read only

0 Likes
2,197

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.