Skip to Content

SET CURSOR ON PARTICULAR INPUT/OUTPUT FIELD OF THE DIALOG SCREEN

Hello ABAPers,

I have gone through many threads but did not find the solution. My requirement is that I am taking screen elements from table on the screen and I am performing validations on each field of the screen. Now, what I want now is that after failing of validation cursor focus should come on a particular field of the dialog screen where validation is failed.

I am using like this

SET CURSOR FIELD 'ZDB_TUSER-USER_EMPNAME'.


but still not getting cursor on this field.

Please help me..


points will be rewarded..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 10:13 AM

    Hi,

    May this sample code help you out,

    REPORT xyz

    DATA: field1(14) TYPE c, field2(14) TYPE c, field3(14) TYPE c,
    name(10) TYPE c.

    SELECTION-SCREEN BEGIN OF BLOCK bloc WITH FRAME.
    PARAMETERS: def RADIOBUTTON GROUP rad,
    txt RADIOBUTTON GROUP rad,
    f1 RADIOBUTTON GROUP rad,
    f2 RADIOBUTTON GROUP rad,
    f3 RADIOBUTTON GROUP rad.
    SELECTION-SCREEN END OF BLOCK bloc.

    PARAMETERS pos TYPE i.

    IF txt = 'X'.
    name = 'TEXT'.
    ELSEIF f1 = 'X'.
    name = 'FIELD1'.
    ELSEIF f2 = 'X'.
    name = 'FIELD2'.
    ELSEIF f3 = 'X'.
    name = 'FIELD3'.
    ENDIF.

    CALL SCREEN 100.

    MODULE cursor OUTPUT.
    IF def NE 'X'.
    SET CURSOR FIELD name OFFSET pos.
    ENDIF.
    SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.

    MODULE back INPUT.
    LEAVE SCREEN.
    ENDMODULE.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2014 at 10:10 AM

    Hi.

    Are you using set cursor field command at PBO?

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2014 at 10:20 AM

    Hi

    Please dont use words like points will be rewarded...We are not here for points.

    Coming to your question are you throwing some error mesage if yes when are you calling set cursor after message or before?

    Nabheet

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 10:44 AM

    Hi,


    In PBO, use statement SET CURSOR FIELD to control where the cursor will be .... also, create some flag to tell you what field to choose in every interaction.


    Regards,

    Thiru.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2014 at 03:44 AM

    Hi Dhammadeep,


    The reason you are not getting is because your SET CURSOR statement should be followed by an

    error message.

    Try like this:


    SET CURSOR FIELD <field_name>

    MESSAGE e000 WITH text-001.


    Regards,

    Ashish Kumar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2014 at 05:00 AM

    Hello,

    Thank you all. I solve it. Set cursor statement should be in PBO. I have maintain flag for each validation and checking in PBO for setting cursor

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2014 at 08:35 AM

    Did you try to validate in PAI using the FIELD statement ?

    It should work. Read the f1 help.

    Something like below:


    FIELD: ls-matnr MODULE validate.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.