“set cursor…” has no effect

Tags:
SAP ABAP
I'm writing a list with input fields which are then validated. If an error is found, I want the cursor to be put on the invalid field but no matter how I write the "set cursor" command, the cursor always goes to the first input field. Can anybody suggest what's wrong?

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can use :
SET CURSOR FIELD fieldname LINE linenumber.
Also, please note that if you have your standard report heading on, the output starts on line 3.

Following is an example code:
REPORT zexample .

DATA: imara LIKE mara OCCURS 0 WITH HEADER LINE.

AT LINE-SELECTION.
SET CURSOR FIELD ‘IMARA-MATNR’ LINE 6.

START-OF-SELECTION.
SELECT * FROM mara INTO TABLE imara
UP TO 10 ROWS.

END-OF-SELECTION.
LOOP AT imara.
WRITE / imara-matnr INPUT.
ENDLOOP.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BrigitteMcDonald
    Thanks ITManiac, but the users are entering data in a whole screen full of lines and validation only occurs on ENTER, PGDN or PGUP, so the code goes like this: AT USER-COMMAND. DO. READ LINE w_linno. if . SET CURSOR LINE OFFSET . MESSAGE e000 WITH .... endif. . etc. It makes no difference if I hardcode a number in or use a variable. I know the variable for is not wrong because to get around my problem, I am coding SCROLL LIST TO FIRST PAGE LINE and it puts the right line to the top of the screen. Any ideas? Brigitte
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following