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

Setting cursor on ztable field

former_member636500
Participant
0 Likes
873

Hi all,

By seeing the sample codes in the forum I got to add a routine - Event 01 - in the V_TVIMF that checks if the ZLIFNR field content exists in the LFA1 before saving the record.

Inside LOOP AT TOTAL, I set a error message 'Vendor doesn't exist' to avoid the record is written when ZLIFNR is invalid. The problem is the cursor skips to a new line after that. In addition, the other lines get locked.

After displaying the error message, I would like the cursor pointed to the field where the ZLIFNR is invalid by keeping it enabled in order to allow the user to correct the content.

Any help is welcome.

Regards,

Tiago.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
836

Use CHAIN -ENDCHAIN.

CHAIN.

FIELD <YOUR FIELD> MODULE <CHECK_FIELD>.

ENDCHAIN.

MODULE <CHECK_FIELD>.

GET CURSORE LINES <CURRENT_LINE_ON_TC>

-


ERROR Message.

ENDLOOP.

IN PBO.

SET THE CURSOR AT <CURRENT_LINE_ON_TC>

Any further clarifications, please revert.

Regards,

A.Singh

Hi all,

By seeing the sample codes in the forum I got to add a routine - Event 01 - in the V_TVIMF that checks if the ZLIFNR field content exists in the LFA1 before saving the record.

Inside LOOP AT TOTAL, I set a error message 'Vendor doesn't exist' to avoid the record is written when ZLIFNR is invalid. The problem is the cursor skips to a new line after that. In addition, the other lines get locked.

After displaying the error message, I would like the cursor pointed to the field where the ZLIFNR is invalid by keeping it enabled in order to allow the user to correct the content.

Any help is welcome.

Regards,

Tiago.

5 REPLIES 5
Read only

Former Member
0 Likes
837

Use CHAIN -ENDCHAIN.

CHAIN.

FIELD <YOUR FIELD> MODULE <CHECK_FIELD>.

ENDCHAIN.

MODULE <CHECK_FIELD>.

GET CURSORE LINES <CURRENT_LINE_ON_TC>

-


ERROR Message.

ENDLOOP.

IN PBO.

SET THE CURSOR AT <CURRENT_LINE_ON_TC>

Any further clarifications, please revert.

Regards,

A.Singh

Read only

Former Member
0 Likes
836

Dialog screen field validation

Code to demonstrate screen validation for dialog programs. The following code should be inserted into the PAI module

 Validate single field via module call
  FIELD sc_field-ebeln
   MODULE validate_screen_field     "validation code performed in module
  ON INPUT.


* Validate multiple fields via module call
  CHAIN.
    FIELD: sc_field-ebeln, sc_field-ebelp.
    MODULE validate_screen_field.   "validation code performed in module
  ENDCHAIN.


* Validate field via table selection
  FIELD sc_field-ebeln
    SELECT *
      FROM ekko
     WHERE ebeln = sc_field-ebeln
      INTO ekko
       WHENEVER NOT FOUND SEND ERRORMESSAGE 001
                         WITH ' Document Number ’
 ON INPUT.

reward points if it is usefull ...

Girish

Read only

Former Member
0 Likes
836

Hi,

Please try to use this statement after the message line:

"Set cursor position" to next line.

If u do not no the syntax take help of its documentation.

Pls reward points.

Regards,

Ameet

Read only

0 Likes
836

Hi all,

Thanks for your replies.

I'm trying to insert your suggestions in the code now. As soon as possible I'll provide you the points and the feedback about these modifications.

Thank you very much for the help until now.

Tiago.

Read only

0 Likes
836

Hi all,

I finally got to do what you suggested. Thank you very much.

Regards,

Tiago.