Application Development 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: 

How to go to a transaction on double click of a customer subscreen field

Former Member
0 Kudos
1,223

Hello,

I have created a customer subscreen to be included in a Quality notification. The field that I have added is a Purchase Order number.

I want to code the double click event for this field, such that when I double click the PO number it navigates to the Display PO transaction.

As it is a subsreen, I cannot use the user command 'PICK'.

I tried capturing the sy-ucomm and entering the following commands:

IF sy-ucomm = 'AZOB'.

SET PARAMETER ID 'BES' FIELD viqmel-zzponumber.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.

However, this gives a problem because there is already a Purchasing Doc field in the notification and it navigates to the wrong PO.

Can anyone give me alternate suggestions to navigate to the customer PO field?

Thanks,

Rugmani

8 REPLIES 8

Former Member
0 Kudos
363

Try like this


IF sy-ucomm = '&IC1'.
SET PARAMETER ID 'BES' FIELD viqmel-zzponumber.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.

Former Member
0 Kudos
363

Are you saying that the PO in viqmel-zzponumber is the wrong number?

Rob

0 Kudos
363

Hello,

The quality notification standard SAP screen already has a PO number (VIQMEL-EBELN) and it has the double click event associated with it.

Now I have added another PO field (referring to a return PO number) using VIQMEL-ZZPONUMBER. I need to be able to navigate to the return PO on double clicking on the VIQMEL-ZZPONUMBER screen field.

Please advise.

Thanks,

Rugmani

0 Kudos
363

If there is a PID associated with the other field, you could:

Save it

clear it

call your transaction

refresh the pid

Rob

0 Kudos
363

How can I clear the PID?

0 Kudos
363

Set it to a space.

Rob

0 Kudos
363

It works for VIQMEL-ZZPONUMBER. However, when I double click on the screen field VIQMEL-EBELN it first goes to display PO with return PO number VIQMEL-ZZPONUMBER and then when I click 'back' it goes to the original PO VIQMEL-EBELN.

This is because both have the same sy-ucomm.

Below mentioned is my code in the PAI of the user subscreen:

DATA: lv_ponumber LIKE viqmel-zzponumber.

CLEAR lv_ponumber.

IF sy-ucomm = 'AZOB'.

SET PARAMETER ID 'BES' FIELD viqmel-zzponumber.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

SET PARAMETER ID 'BES' FIELD lv_ponumber.

ENDIF.

How can I avoid this?

Thanks,

Rugmani

Former Member
0 Kudos
363

Solved the problem.

Code:

DATA: cursorfield(20),

g_cursor LIKE viqmel-ebeln,

lv_length TYPE i,

lv_ponumber LIKE viqmel-zzponumber.

GET CURSOR FIELD cursorfield VALUE g_cursor.

IF g_cursor IS NOT INITIAL.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = g_cursor

IMPORTING

output = lv_ponumber.

ENDIF.

IF sy-ucomm = 'AZOB' AND lv_ponumber = viqmel-zzponumber.

SET PARAMETER ID 'BES' FIELD viqmel-zzponumber.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.