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

set cursor not working

Former Member
0 Likes
880

Hi All,

After the user has entered an invalid input,the system should give an error msg and the cursor should automatically set in the invalid field entered.My code is as given below.Plz let me know what is wrong?

PROCESS BEFORE OUTPUT.

MODULE status_0100.

  • module select_category.

*

PROCESS AFTER INPUT.

CHAIN.

FIELD : t001w-werks,

likp-vstel,

t001l-lgort,

tvlkt-lfart.

MODULE check_input.

ENDCHAIN.

MODULE cancel AT EXIT-COMMAND.

MODULE user_command_0100.

&----


*& Module Check_input INPUT

&----


  • text

----


module Check_input input.

*Plant

SELECT SINGLE werks FROM t001w INTO g_plant WHERE werks EQ t001w-werks

.

IF sy-subrc NE 0.

MESSAGE s208(00) WITH text-012.

  • CALL SCREEN 100.

ENDIF.

  • Shipping point

SELECT SINGLE vstel FROM tvst

INTO g_shippoint

WHERE vstel EQ likp-vstel.

IF sy-subrc NE 0.

MESSAGE s208(00) WITH text-015.

CALL SCREEN 100.

SET CURSOR FIELD likp-vstel.

ENDIF.

*Storage Location

SELECT SINGLE lgort FROM t001l

INTO g_loc

WHERE lgort EQ t001l-lgort.

IF sy-subrc NE 0.

MESSAGE s208(00) WITH text-014.

CALL SCREEN 100.

ENDIF.

*Delivery type

SELECT SINGLE lfart FROM tvlkt

INTO g_deltype

WHERE lfart EQ tvlkt-lfart.

IF sy-subrc NE 0.

MESSAGE s208(00) WITH text-013.

CALL SCREEN 100.

ENDIF.

endmodule. " Check_input INPUT

1 ACCEPTED SOLUTION
Read only

Former Member
702

Hi Rakesh,

Comment out "CALL SCREEN 100" before "SET CURSOR".

And, specify field name in quotes like this -

<b>SET CURSOR FIELD 'LIKP-VSTEL'</b>

Regards,

Manish Joshi

    • I hope you know how to award points

4 REPLIES 4
Read only

Former Member
703

Hi Rakesh,

Comment out "CALL SCREEN 100" before "SET CURSOR".

And, specify field name in quotes like this -

<b>SET CURSOR FIELD 'LIKP-VSTEL'</b>

Regards,

Manish Joshi

    • I hope you know how to award points

Read only

0 Likes
702

Hi Manish,

I have changed the code as below.The cursor is coming now but it comes in the first filed always not to the filed where the error has actually occured.

&----


*& Module Check_input INPUT

&----


  • text

----


module Check_input input.

*Plant

SELECT SINGLE werks FROM t001w INTO g_plant WHERE werks EQ t001w-werks

.

IF sy-subrc NE 0.

MESSAGE e208(00) WITH text-012.

SET CURSOR FIELD t001w-werks.

ENDIF.

  • Shipping point

SELECT SINGLE vstel FROM tvst

INTO g_shippoint

WHERE vstel EQ likp-vstel.

IF sy-subrc NE 0.

MESSAGE e208(00) WITH text-015.

SET CURSOR FIELD likp-vstel.

ENDIF.

*Storage Location

SELECT SINGLE lgort FROM t001l

INTO g_loc

WHERE lgort EQ t001l-lgort.

IF sy-subrc NE 0.

MESSAGE e208(00) WITH text-014.

SET CURSOR FIELD t001l-lgort.

ENDIF.

*Delivery type

SELECT SINGLE lfart FROM tvlkt

INTO g_deltype

WHERE lfart EQ tvlkt-lfart.

IF sy-subrc NE 0.

MESSAGE e208(00) WITH text-013.

SET CURSOR FIELD tvlkt-lfart.

ENDIF.

endmodule. " Check_input INPUT

Read only

0 Likes
702

Hi Rakesh,

1. Wherever you are using SET CURSOR make sure that field name is in <b>quotes</b> like this -

<b>

SET CURSOR FIELD 'T001W-WERKS'

</b>

2. Secondly control doesn't fall to next statement when you show error message. Write this way wherever applicable -

<b>


SET CURSOR FIELD 'T001W-WERKS'.
MESSAGE e208(00) WITH text-012.

</b>

Regards,

Manish Joshi

Message was edited by:

Manish Joshi

Read only

Former Member
0 Likes
702

hi rakesh,

Try this..


IF sy-subrc NE 0.
SET CURSOR FIELD likp-vstel.
MESSAGE s208(00) WITH text-015.
CALL SCREEN 100.
ENDIF.

Message was edited by:

Chandrasekhar Jagarlamudi