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

get cursor on subscreen

0 Likes
3,195

Hi All,

I have a question re subscreen processing. 

I have a variable 'PICK' in GUI status of mainscreen(0100) to trap for double click or F2.

I do a GET CURSOR and process the value for the main screen correctly. 

This same idea does not seem to work (i.e. The get cursor part does not give me the field value and fieldname ) from the subscreen. 

Any Ideas how to get this for the subscreen? 

Note that the attributes field, responds to double click is checked for both main and subscreen.

(Code below)

Thanks Tony 

MODULE user_command_0100 INPUT. 

DATA: lv_field TYPE fieldname,

          lv_value(10) TYPE c.

CASE gv_ok_code.

WHEN: 'BACK' OR 'EXIT' OR 'CANC'.

     SET SCREEN 0. 

WHEN 'PICK'.

GET CURSOR FIELD lv_field VALUE lv_value.

     CASE lv_field.  *

     *These fields are on the mainscreen and the get cursor work OK

          WHEN: 'GV_KUNNR1' OR 'GV_KUNNR2'.

               SET PARAMETER ID 'BUK' FIELD gv_bukrs.

               SET PARAMETER ID 'KUN' FIELD lv_value.

               CALL TRANSACTION 'X' AND SKIP FIRST SCREEN. 

     *These fields are on the subscreen and the get cursor DOES NOT work OK

          WHEN: 'GV_KUNNR1_LSTNR' OR 'GV_KUNNR2_LSTNR'.

               SET PARAMETER ID 'BUK' FIELD gv_bukrs.

               SET PARAMETER ID '/APFSS/LSTNR' FIELD lv_value.

               CALL TRANSACTION 'Y' AND SKIP FIRST SCREEN.

    ENDCASE. 

ENDCASE. 

ENDMODULE.                 " USER_COMMAND_0100 

7 REPLIES 7
Read only

SharathYaralkattimath
Contributor
0 Likes
2,277

Hi Tony,

Use GET CURSOR in the PAI of the subscreen & assign it to a global variable.

Then in the PAI i.e. USER_COMMAND_0100 module you can read the variable.

Thanks,

Sharath

Read only

0 Likes
2,277

Also dont hesitate to check sy-subrc, here if cursor is not in current screen, you got a sy-subrc = 4 after this statement...

Regards,

Raymond

Read only

0 Likes
2,277

Thanks for your prompt replies guys, but neither solution has worked, perhaps because I have tabs on my subscreens, see below. Get back to me if you have any other good ideas or need further info.

Thanks

Tony

Read only

0 Likes
2,277

Answer to 1

I hope you did not declare the function code associated to double-click as an exit function code, and that the module which manage the function code is not executed before the call subscreen


process after input.

  module pai1 at exit-command.

  call subscreen sub1.

  call subscreen sub2.

  module pai2.

Same logic (without user command management) in embedded subscreens.

Answer to 2 has already been provided by

Regards,

Raymond

Read only

Former Member
0 Likes
2,277

the FIELD must be globally defined...and not local.

Can you check that the field defined is in the top include or in a global include of your module.


Read only

0 Likes
2,277

Thanks for all your replies, but I had all your suggested points covered. In the end I just attached a button adjacent to the field with an sy-ucomm assigned to it, and checked for that in the PAI of main screen. Best Regards Tony

Read only

0 Likes
2,277

Please close this thread & mark it as answered.