Set cursor Field

hey guys,
MODULE PAI_CHECK.
MODIFY MYTAB FROM LTAB INDEX ZTABDISP-CURRENTLINE transporting KUNRR STATUS.
SET CURSOR FIELD 'LTAB-KUNNR'
MESSAGE E005.
END MODULE.
does not allow me to put cursor at KUNNR field, instead
it stands in first column itself..
what could be the reason here..
ambichan

Try setting the cursor field in the PBO.
If this is to point the user at the error which is occuring, then it should happend automatically if you are coding it correctly.
This statement should actually be in its own module.
MODIFY MYTAB FROM LTAB INDEX ZTABDISP-CURRENTLINE transporting KUNRR STATUS.
The checks should be in their own modules.
MODULE CHECK_KUNNR.
IF ltab-kunnr is initial.
message E005.
endif.
ENDMODULE.
In your flow logic, in the PAI,  you should be coding your checks like this.
  LOOP AT LTAB.
      MODULE YOUR_MODIFY_STATEMENT.
      FIELD LTAB-KUNNR MODULE CHECK_KUNNR.
  ENDLOOP.
Regards,
Rich Heilman

Similar Messages

  • Error message and set cursor field in subscreen

    hey ,
    i have a program with main screen 500 and many subscreens 501,502 and so own .
    when i  want to validate wrong input in a field and set message type 'E' in the PAI of the subscreen the program
    raise the message and exit from the program .
    if i try to put the message in the PBO of the subscreen it dosn't exit but after the message the program dosn't flow to
    command SET CURSOR FIELD that i wrote after the message .
    how can i solve this ?
    is there somthing that i'm missing in the basic code flow of the program ?
    ( screen 500 PBO - PAI ->  SUBSCREEN 50x PBO - PAI )
    best regards
    ASA

    hello and thanks for the answer
    let me  clarify my problem :
    i want to issue a message ( type e or i ) only if some fields are null and the user pressed on SAVE .
    when i'm in the tab-strip and writing error message in :
    PAI :
    chain.
    field XXX
    field YYY
    module issue_warning_message on chain-request.
    endchain.
    in  module issue_warning_message :  if XXX is initial --> message type E --> set cursor field XXX.
    here i get the message and cursor is set.
    when i try to post the message in without chain or any events :
    module user_command_tab502 .
    the message is issued and it exit the program if the type is e and if type message is I the cursor is not set .
    please advice
    ASA

  • Reg: set cursor field problem.

    hello guyz,
        In module pool programmming, I need to vaildate entries made by the user in the PAI block. Once the entry is valid, I need to move the cursor to the next input field.
         Is it possible to set the cursor field in the PAI block. Could you please help me out in this issue because as for as I know the set cursor field works only in PBO.
    thanks,
    karthikeyan

    No dont create another screen..
    For validation you might be using chain .. endchain..
    let us say i have a material field and quantity field... i want to validate materil and set the cursor in quantity field.
    chain
    field : material module validate_material
    endchain.
    module validate_material.
    select single * from mara where matnr = material
    if sy-subrc eq 0.
    set cursor field quantity.
    endif.
    endmodule.

  • How to SET CURSOR FIELD my_field in my_REPORT_PROG.?

    Hi Experts,
    If the user do not enter a value in one field( NOT mandatory field) on the selection screen of my_report_prog. I wanna,
    1- To throw message - am getting by throwing as STATUS message
    2 - wanna keep CURSOR on that particlar field in order to input the value by the user - am using SET CURSOR FILED my_filed----
    > but NOT working????????
    So, pls. let me know that How to get it done?
    thanq

    hi,
    try the following code.you will get the cursor in the same field if you use status message or information message.
    selection-screen:begin of block b with frame title text-001.
    parameters:a type i.
    selection-screen:end of block b.
    at selection-screen.
    if a <> 3.
    message s000(0) with 'hi this is chaitu'.
    endif.
    after showing the message the cursor is at a.
    please rewards points if useful.

  • Staying on screen at set cursor field

    I am trying to catch a user's input on a field and return the user to that field to enter  new value. In PAI I catch the invalid entry in a method with a message, and after the message I want to stop processing and return the user to the unaltered screen at the field that needs to be changed. All commands I try either exit the method and continue PAI processing, or return to a refreshed screen with the status set in its PBO.
    Any help will be appreciated
    << Moderator message - Please do not promise rewards>>
    Edited by: Rob Burbank on Nov 14, 2011 4:15 PM

    All you need to do is in Flow Logic part.. write a Field statement for your required field( which needs checking ) and a module for it.. Eg.. if your field is w_matnr.. in Flow Logic write:
    FIELD W_MATNR module chk_matnr on request.
    now double click on chk_matnr . A new module will be created and write your code for checking in this module.. And if it is an error, display the message using type "E'.It will stop at that field

  • How to set cursor in perticular field Table Maintence generator?

    Hi
    All
    I have created a table with 2 fields  Start_date and End_date. Now my requirement is i have to validate the both date field as Start_Date must be LESS than or EQUAL to End_Date. In table maintenance maintenance generator i have created a event VALIDATE_DATE in event 21. Its validating perfectly. The issue is after the ERROR message the Cursor is going to the key field. I want to set the cursor at End_Date field.
    I used
    data:ly_pos type i.
    IF NOT start_date LE end_date.
        SET CURSOR FIELD 'TABLE_NAME-END_DATE' LINE sy-linno OFFSET lv_pos.
        MESSAGE exxx(MsgClass).
    ENDIF.
    Its working for the FIRST time i am entering the new data. Next time the cursor going to the KEY field.  I have been asked not to write code in SE80. Anyhow i have to set the cursor in table maintenance maintenance generator event.
    Can anybody help?

    Hi Sourav,
    Please follow the below method:
    Go to Maintainance Screen (where you want the cursor setting). Goto Status - > Remember the screen name -> Double click on Program name.. Open Object list and expant Screen Tree -> double click on the same screen Number -> Go to its first tab attributs -> Change Mode -> Do F4 on Cursor Position field -> Choose the field where you want the cursor.
    But this way will always set the cursor at the HardCoded Field Name.
    Thanks,
    Preyansh

  • Set cursor on error field in selection screen

    Hi ALL,
    How to place the cursor on a particular selection screen field?I am doing validation if validation fails for a particular field the program should give error mesg and the cursor should place on the error field only but it's going to the Ist field on the selection can somebody tell me how do this? I tried with set cursor field <fieldname) but not working I am doing validations on at-selection screen.
    Thanks&Regard
    mahesh

    Hi chandrasekhar find my code below
    this code i am writing under  at selection-screen.
    *&      Form  Z_VALIDATE_TVKOV
    FORM z_validate_tvkov .
      DATA: i_vtweg LIKE vbak-vtweg.
      IF NOT s_vtweg-low IS INITIAL.
        SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
                     WHERE vtweg = s_vtweg-low.
        IF sy-subrc <> 0.
        set cursor FIELD 'S_VTWEG-LOW'.
        MESSAGE e000(z_sd) WITH text-052.
        ENDIF.
       ENDIF.
      IF NOT s_vtweg-high IS INITIAL.
        SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
                            WHERE vtweg = s_vtweg-high.
        IF sy-subrc <> 0.
          MESSAGE e000(z_sd) WITH text-052.
        ENDIF.
      ENDIF.
    ENDFORM.                    " Z_VALIDATE_TVKOV

  • Activate Tab page and set cursor on field!

    Hi All,
    I have a requirement to mimic SAP standard functionality like whenever a mandatory field is not enetered in a transaction, the control activates particular tab page and set the cursor on mandatory field.
    My requirement is as below.
    There is a main screen 1 with many tab pages.
    But when I click on save button, the control goes to different screen. When a partular field is not enetered, then I should put my control to a particular tab page and cursor on that initial field.
    Please help me to get this done. Al I think is SET SCREEN but not sure how I can eneable the control to a particular tab page and cursor on a field from the different screen.
    Many thanks.
    -Pratyusha
    Edited by: pratyushasdn on Jun 24, 2010 2:07 PM

    Hi chandrasekhar find my code below
    this code i am writing under  at selection-screen.
    *&      Form  Z_VALIDATE_TVKOV
    FORM z_validate_tvkov .
      DATA: i_vtweg LIKE vbak-vtweg.
      IF NOT s_vtweg-low IS INITIAL.
        SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
                     WHERE vtweg = s_vtweg-low.
        IF sy-subrc <> 0.
        set cursor FIELD 'S_VTWEG-LOW'.
        MESSAGE e000(z_sd) WITH text-052.
        ENDIF.
       ENDIF.
      IF NOT s_vtweg-high IS INITIAL.
        SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
                            WHERE vtweg = s_vtweg-high.
        IF sy-subrc <> 0.
          MESSAGE e000(z_sd) WITH text-052.
        ENDIF.
      ENDIF.
    ENDFORM.                    " Z_VALIDATE_TVKOV

  • Set cursor in table control field

    I have developed module using table control have done validation for one field on Enter key press.In change mode if user changes value in table control field and presses Enter key then system is showing Error message on status bar and table control gets gray out.
    if user again hits Enter key then this error message clears and Table control is in Edit mode.
    Here I wan that Cursor should go to same filed from which error message occurred.
    I have written Get Cursor In PAI event and Set Cursor in PBO after Loop at table control. I tried Set cursor within Lop at Table control in PBO.
    But cursor is not coming on that field of table control.
    I have written set cursor as below:
    Set Cursor Field itab-fieldname Line lineno Offset offsetval.
    Here itab is internal table assigned to table control.
    Please let me know why cursor is not setting on particular field on table control.

    Hi Ganesh,
       A simpler way would be to include the fields of the table in a chain-endchain block.
    in PAI section.
    PROCESS AFTER INPUT.
      loop at IT_FINAL.
        chain.
          field WA_FINAL-JOBCARD.
          field WA_FINAL-MATIDTAG.
          field WA_FINAL-VORNR.
          field WA_FINAL-ARBPL.
          field WA_FINAL-ZZPULLCONTNRQTY.
          field WA_FINAL-NOOFTAGS.
          field WA_FINAL-ROUTE_TO.
       module validate.
        endchain.
      endloop.
    you can issue your error messages in the module validate.
    REgards,
    Ravi

  • How to set cursor in table control?

    I have a table control (Screen 300) to display invoice number and amount. For some checks we have around 200 invoices to be displayed.  When user enters the invoice number in invoice text box and click on OK, it should highlight the invoice number and amount row or set the cursor position.
    I have another problem.
    Screen 300 is being called from Screen 200. When the user clicks on OK in 300, 300 is getting closed. Acutally it should be displayed with Cusor position or highlighted row.
    I appreaciate your help ... Thanks

    I believe that you can use the SET CURSOR statement to do the first part of your requirement.  Something like this should work:
    SET CURSOR FIELD w_field LINE w_line.
    Here's the info from SAP help:
    Effect
    : The cursor is positioned on the screen element whose name is contained in upper case in field. The data object field must be character-type and flat. The screen layout or a table control is scrolled in the display so that the screen element on which the cursor is positioned is visible. If the specified screen element is not found, the statement is ignored.
    If the specified screen element is part of a table control or a step loop, the line of the table control or group of the step loop in which the cursor is positioned on the specified screen element must be specified using the addition LINE. For the data object line, the type i is expected. If there is no line or group for the value of line, or the addition LINE is not specified, the statement is ignored. The statement is also ignored if the addition LINE is specified and the screen element is not part of a table control or step loop.
    I hope this helps.
    - April King

  • Set-Cursor In TableControl Help Help Help

    Hello Friends
    Please HelpOut for Sure
    i had an table control which is filled by internal Table itab_emp
    i m applying condition on that internal table
    its giving error message
    i want that cursor should be placed to that position that gives errormessage
    i m sending u code
    Just tell me changes
    LOOP AT ITAB_EMP WHERE MARK = 'X' .
        IF SY-SUBRC = 0.
          ITAB_TEST[] = ITAB_EMP[].
          DELETE ADJACENT DUPLICATES FROM ITAB_TEST.
          LOOP AT ITAB_TEST.
            CLEAR SUM .
            LOOP AT ITAB_EMP WHERE PERID = ITAB_TEST-PERID.
              SUM = SUM + ITAB_EMP-OTIME.
            IF SUM > '100000'.
              MESSAGE E018.
            <b>ELSEIF ITAB_EMP-OTIME > '010000'.
              MESSAGE E017.
            SET CURSOR FIELD ITAB_EMP-OTIME .</b>        ELSE.
              MOVE-CORRESPONDING ITAB_EMP TO ITAB_OTAPP .
              ITAB_OTAPP-OBJID = 1.
              ITAB_OTAPP-INACT = 'X'.
              ITAB_OTAPP-TODTE = ZHR_PR_M_OTAPP-TODTE.
              ITAB_OTAPP-FRDTE = ZHR_PR_M_OTAPP-FRDTE.
              ITAB_OTAPP-IMMHD = ZHR_PR_M_OTAPP-IMMHD.
              ITAB_OTAPP-CRETM = SY-UZEIT.
              ITAB_OTAPP-CREON = SY-DATUM.
              ITAB_OTAPP-CREBY = SY-UNAME.
              APPEND ITAB_OTAPP.
            ENDIF.
          ENDLOOP.
    ENDLOOP.
          endif.
    endloop.
        LOOP AT ITAB_OTAPP INTO WA_ITAB_OTAPP.
          MODIFY ZHR_PR_M_OTAPP FROM WA_ITAB_OTAPP.
        ENDLOOP.
    BOLD lines are the condition checking
    if check all the lines and then if any of the line gives error it reflects now i want to place cursor on that field which is giving error
    sy-tabix will work
    BUT HOW?????
    Hope this time any of the genius gotmy problem
    With Best Regards
    Ruby

    Some of the logic is a bit confusing (would be easier to read if you used the "Code" button in the SDN message editor)... for example:
    LOOP AT ITAB_EMP WHERE MARK = 'X' .
      IF SY-SUBRC = 0.
    ... the "IF SY-SUBRC" won't be reached unless there is at least one row where "mark = 'X'.''...
    Anyhow, where is this code implemented currently?... the usual approach to validating a table control is to have a module called inside the "loop at table control" in the PAI of the screen flow... then the contents of each row on the screen will get passed into your logic a row at a time automatically and the "set cursor field" + "message e999(zz)" type code should work as it will refer to the current row being checked.
    Jonathan

  • Set cursor command

    Hi experts,
    I want to position the cursor in a screen field.
    I gave SET CURSOR FIELD GS_ASSEMBLY-SERNR  in PAI.
    But still the cursor is not in required position.
    Pls help me to do this.
    Thanks.

    Hi  Murugan ....
    in the  screen example  100- > in  <b>Attribute's  tab</b>  ( first tab )   there is  Other Attriubutes  block which is   3rd   selection screen in the  screen..
    <b>Exactly  below the  <b>Next Screen</b>  field  that is the <b>Cursor  position</b> .
    <b>for  setting the cursor on the screen</b>
    <b>there  do the F4</b>   it will show the  <b>list of the fields  which are all declared in the screen by you  ..</b>
    <b>just select the  field</b>   .....   inwhich field  you want to set the cursor  .</b>then <b>activate</b> it  ... execute  and see ...
    the  cursor will be there  on the cursor selected  field .
    reward points if it is usefull   ...
    Girish

  • Set cursor on screen

    hi,
    i want to set cursor on screen field. i used SET CURSOR FIELD field_name command on PBO ,but it is not working. if any body has solution then please reply me....
    Thanks
    Regards
    Rakesh

    Hi
    Check Rich Heilman's reply for code sample in the thread:-
    Re: Cursor setting in Screen fields
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • Set cursor on table control not working

    Hi,
      I have a screen with delivery number field on top with Get Data Button next to it. Once I click on Get Data, I want to get all the handling units and show them in a table control below and show the first line of that table control selected by default.
      I m able to get the data but the cursor always goes back to the delivery number field.
    I have the following code in PBO
    Status & title for the screen
      MODULE status_0100.
    And in the module, the last lines are as follows
      if sy-ucomm = 'GET'.
        s_vepo-sel = c_x.
        set cursor field 'TABLE1' line 1. "TABLE1 is name of the table control in screen
                                                      "painter
      endif.
    I debugged and saw that the line " set cursor field 'TABLE1' line 1." is indeed the last line which gets executed but still the cursor goes back to delivery number field and table row doesnt get selected.
    Thanks for reading.

    Try maintaining the "Cursor position" in the screen layout in Attributes tab with the field name that you want the default cursor position to be present.
    Regards,
    Shri Hari.

  • Hi friends i have doubt on set cursor.

    i am using dialog programming. here in the first text field i am auto generating the number, so user should only suppose to enter the values for other repective fields only.but in execution the cursor is positioning at the first field. it should start from the second and so on.
    i tried using SET CURSOR FIELD F2. but tbe result is same. please provide me guidence on this.

    Hi,
    In the PBO of the dialog module,write the following code :
    SET CURSOR FIELD `FIELD2`.
    Remember the FIELD2 is the name assigned to the textbox of the screen.
    Best regards,
    Prashant
    PS : Please reward all helpful answers

Maybe you are looking for

  • Creation of SC or POs based on the Company Code restriction

    Dear All, I am abaper and I am new to SRM. Ours is SRM 4.0 using Extended Classic Scenario we got one requirement that one company ex: SE04 should be blocked for further ordering of SC and POs. i.e. when creating any SC or PO they dont want to use 'S

  • Multiprovider query selection screen

    HI, I have a query built on multiprovider. Multiprovider has two underlying infocubes. At selection screen user wants to input only one field , say field 'A'. Field 'A' exists in one infocube only . when I restrict query on selection screen with  fie

  • Creating a Query Filter with the MDX editor

    I want to create a non mandatory predefined condition in the universe where only the last 31 days are returned. I would like to do this in the MDX editor in universe (released in XI 3.1) and not in the BEx query. There isn't much in the MDX editor th

  • Fact Table and the InfoCube

    Hi All, When I search for Inventory quantity in an InfoCube, it is giving me all zero values. I had verified and found correct values in the Fact Table for that InfoCube. The Update Rules applied is a direct InfoObject to InfoObject mapping(Source Ke

  • Plain nodemanager throws BEA-090476 Invalid/unknown SSL header -

    I have a default installation of weblogic. I do not want to use SSL for communication to nodemanager. I turned the ssl listen port off on the managed server, and then i set SecureListener to false in my nodemanager.properties. Here is my nodemanager.