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

Screen Exit

aidaj_hilton
Participant
0 Likes
1,373

Can anyone help me with creating screen exits.

I have read SAP documentation and am still confused. According to documentation SAP provides function modules that can be used in PBO and PAI to send info to/from customer screen. These exits are only activated if PBO/PAI modules are created.

I'm not sure what code should go in these function exits and what should go in the PBO and PAI modules created for the screen. Reluctant to reference my actual problem because it seems to cloud the issue.

What I need - step 1 created project and activated

step 2 - created subscreen and added the necessary fields

step 3 (what goes into the PBO/PAI modules for this screen)

step 4 created the necessary includes for the function exits that send data to/from screen (what goes into these includes)

Note in debug mode the flow is:

  • call to function exit that imports values from the SAP screen (the value of the subscreen is not known)

  • PBO module of sub screen - value of fields on subscreen are known but not rest of the values on the values on the standard SAP screen

After changing the value in the subscreen:

  • PAI module of subscreen is called - new value of subscreen is available at this point

  • call to second function exit that has import and export parameters. The value of the SAP standard screen fields is known but not the subscreen.

How do you make the values of the subscreen known between the subscreen PBO/PAI modules and the function exits called that should be sending this info to/from the sub screen.

**********

Specifically I have added a couple of fields to a screen:

VIQMEL-INSPK

VIQMEL-QMNAM

The relevant Notification Header screen enhancement is QQMA0001

and I need to reference the function modules:

EXIT_SAPMIWO0_008 - Customer Exit: Transfer Notification Data to User Screen

EXIT_SAPMIWO0_009 - Customer Exit: Transfer Notification Data to User Screen

I have created a subscreen with the relevant fields. Athough I understand that the PBO module should reference the first function module and the PAI should reference the second I am still confused as to how to achieve this.

The result is that the I cannot save data in the new fields since the SAP standard program does not recognize the subscreen data and vice versa. I would appreciate assistance with this issue.

Thanks!

6 REPLIES 6
Read only

former_member186741
Active Contributor
0 Likes
956

Hi Jill,

at the risk of saying the obvious, in the PBO you move fields from your program to the screen... if your screen and abap variables have the same names I think you can code:

VIQMEL-INSPK = VIQMEL-INSPK.

VIQMEL-QMNAM = VIQMEL-QMNAM.

I think you can do the same in the PAI module to achieve the reverse of moving the fields input by the user to the abap variables. Your PAI may also have some validation logic in it though.

Hope this is helpful.

Read only

Former Member
0 Likes
956

Jill,

I am little confused about your problem. The fields you are trying to add on the subscreen are those fields which are already existing in QMEL table structure. These user exists are intended for when you add customer fields in table QMEL ( by adding fields in CI_QMEL include).

For your situation there are lot of other ways including only confiruation. Go to SPRO, PM, NOTIFICATION CREATION, NOTIFICATION TYPE, <b>SET FIELD SELECTION FOR NOTIFICATION</b> and unhide QNMAM and INSPK. You also see <b>'set screen template of notification type'</b>. These fields will start appearing in notification transaction.

If you are really adding new fields, write me back. I have done it recently.

Read only

0 Likes
956

Hello Sharad,

i have the same problem like Jill, but i added new fields by using the cutomizing include CI_QMEL.

I added the new fields in the subscreen by adressing them with VIQMEL* (includes CI_QMEL).

But the new fields are not saved.

For testing i added a normal QMEL-field on the exit screen. This field is saved.

Any idea what is missing?

Thx in advance.

Michael

Read only

Former Member
0 Likes
956

Hopefully, you already know that you must activate the user exits EXIT_SAPMIWO0_008 (transfer data from VIQMEL to customer subscreen) and EXIT_SAPMIWO0_009 (transfer data from subscreen back to SAP) through transaction CMOD.

Additionally, to tranfer data back from your custom subsceen to SAP, you MUST use the export structure E_VIQMEL provided in EXIT_SAPMIWO0_009, you can pass SAP fields as well as custom fields included via CI_QMEL. An Example follows :

if viqmel-qmart = 'DN'.

E_VIQMEL-WMSIGLVL = VIQMEL-WMSIGLVL.

E_VIQMEL-WMSLTYPE = VIQMEL-WMSLTYPE.

e_viqmel-priok = viqmel-priok.

e_viqmel-ltrmn = viqmel-ltrmn.

e_viqmel-zzleak_ps = viqmel-zzleak_ps.

e_viqmel-zzleak_rp = viqmel-zzleak_rp.

e_viqmel-zzleak_db = viqmel-zzleak_db.

e_viqmel-zzleak_ba = viqmel-zzleak_ba.

e_viqmel-zzleak_oc = viqmel-zzleak_oc.

e_viqmel-zzleak_cat = viqmel-zzleak_cat.

e_viqmel-zzleak_loc = viqmel-zzleak_loc.

e_viqmel-zzleak_est = viqmel-zzleak_est.

e_viqmel-zzleak_calc = viqmel-zzleak_calc.

endif.

Read only

0 Likes
956

Hi,

How to get the status of the notification number which u can see it in iw22.

rgds

p.kp

Read only

0 Likes
956

Hi,

thanks for help. But i fixed the problem myself. It was an error on my side, i didn't know that there was an active BAdI running at the end, that killed my data.

The whole time i was wondering, why the data were available in debugging when i left the exit dynpro, but then somewhat later they got lost.

So again a little experience richer ))

Thnx