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

Trip User Data - add button?

bryan_cain
Contributor
0 Likes
1,680

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.

1 ACCEPTED SOLUTION
Read only

sridhar_k1
Active Contributor
0 Likes
1,637

Do you have SET PF-STATUS or LEAVE SCREEN in the screen modules of 9999?, they should not be there.

Regards

Sridhar

14 REPLIES 14
Read only

Former Member
0 Likes
1,637

Hi

That screen is a subscreen so you should manage the ok_code only in the main screen.

Max

Read only

0 Likes
1,637

Really? MODULE D9999_OK-CODE isn't the place to check the ok-code that a button sets?

Read only

0 Likes
1,637

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

Read only

0 Likes
1,637

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.

Read only

sridhar_k1
Active Contributor
0 Likes
1,638

Do you have SET PF-STATUS or LEAVE SCREEN in the screen modules of 9999?, they should not be there.

Regards

Sridhar

Read only

0 Likes
1,637

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

Read only

0 Likes
1,637

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

Read only

0 Likes
1,637

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.

Read only

0 Likes
1,637

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.

Read only

0 Likes
1,637

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.

Read only

0 Likes
1,637

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

Read only

0 Likes
1,637

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?

Read only

0 Likes
1,637

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.

Read only

Former Member
0 Likes
1,637

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?