‎2006 Jul 03 7:13 PM
Hi -
My client would like to add a print button to screen 9999 of SAPMP56T to print a custom Smart Form.
I have added the button to the screen, and added code to call the smart form when the button is pressed.
However, when I run the transaction and click on the user data button, I get the following error message:
A: Screen SAPMP56T 9999 must be an Include screen (screen error).
What am I doing wrong here?
Thanks in advance.
‎2006 Jul 03 7:39 PM
Do you have SET PF-STATUS or LEAVE SCREEN in the screen modules of 9999?, they should not be there.
Regards
Sridhar
‎2006 Jul 03 7:19 PM
Hi
That screen is a subscreen so you should manage the ok_code only in the main screen.
Max
‎2006 Jul 03 7:24 PM
Really? MODULE D9999_OK-CODE isn't the place to check the ok-code that a button sets?
‎2006 Jul 03 7:34 PM
Hi
I don't know the code of that program very well.
Anyway you can insert a pushbutton in a subscreen but it'd be better manage all in PAI of main screen, but if the std programm just manages ok_code in PAI of that subscreen, you do it too.
In this case check when the error is triggered by debug because it seem you're trying to use the 9999 as main screen: perhaps have you changed the attribute of the screen? See the screen type.
I've the same error when i try to call a main screen in a subarea.
Max
‎2006 Jul 03 7:47 PM
The error is triggered as soon as it hits
CALL SUBSCREEN USERDATA INCLUDING 'SAPMP56T'
'9999'.
Hmm. It appears that the screen type is a modal dialog box. Let me see if changing that fixes it.
‎2006 Jul 03 7:39 PM
Do you have SET PF-STATUS or LEAVE SCREEN in the screen modules of 9999?, they should not be there.
Regards
Sridhar
‎2006 Jul 03 7:43 PM
No, none of that. Here is all the code we put in there:
case sa-code.
when 'PICK'.
daten_input = 'X'.
get cursor field cursor_field
line cursor_line.
*{ INSERT 1
*for Print Expense Report
when 'PRNT'.
include zte_exp_print_report.
*} INSERT
endcase.ZTE_EXP_PRINT_REPORT is just a program that calls the smart form.
Message was edited by: Bryan Cain
‎2006 Jul 03 7:48 PM
Hi
ZTE_EXP_PRINT_REPORT is a program? It should be an INCLUDE.
But exactly when does error occur? As soon as you press the button or when it runs ZTE_EXP_PRINT_REPORT?
Max
‎2006 Jul 03 7:59 PM
It is an include.
The error happens as soon as you press the button.
The screen is currently defined as a modal dialog, however, when I try to change it to a subscreen, I'm getting this error:
Delete the name OK-CODE of the OK_CODE field first.
‎2006 Jul 04 8:29 AM
Hi Bryan
I think the type screen is wrong: it has to be a subscreen and not modal dialog.
So:
- Delete OK_CODE from elements list
- Set flag "SUBSCREEN"
The function code of your pushbutton insert in the 9999 will be stored in OK_CODE of main dynpro.
Remember the subscreen is a screen can't "survival" alone, but it need main screen. So some elemants of subscreen are given from the main.
P.s.: in my system that screen is defined as subscreen.
Max.
‎2006 Jul 06 7:08 PM
Hi Max -
I can't delete the OK-CODE from the screen, even when I remove all custom fields from it. OK-CODE is greyed out.
I'm still getting the same error message when I try to change the attributes to type subscreen.
‎2006 Jul 06 7:18 PM
Screen painter won't let u delete the line with element type OK. Set attriburts back to modal diaog box, clear OK-CODE from name field, set the attribures to Sub screen.
Regards
Sridhar
‎2006 Jul 06 7:55 PM
Changing to modal dialog box still won't let me delete the OK code line.
I opened an OSS note - in the meantime, any other ideas?
‎2006 Jul 08 3:33 PM
SAP is not being very helpful, not surprisingly. They pointed me to some documentation that didn't answer my question at all.
Does it make sense for me to be getting the subscreen error before I've even made any changes to the page? In other words, the user data screen is activated, but we have changed nothing, and when you press the user data button, we get this error:
A: Screen SAPMP56T 9999 must be an Include screen (screen error).
Should it be doing that before I've changed anything? That seems strange to me.
‎2007 Oct 26 4:16 PM
Brian,
I am having the same problem with screen 9999 and the call to it as a subscreen from screen 3999. Did you ever get this fixed and if so what did you do?