[PAI] Refresh a screen field within PAI

Hi,
During the PAI process, I would like to refresh the content of a screen field (so that it is calculated automatically from the value of another field).
Indeed, the user would greatly benefit from this field condidering the checks performed during the PAI.
I tried the FM 'DYNP_VALUES_UPDATE' but without success...
Has someone another idea ?
Thanks in advance.
Best regards,
Guillaume

Hi,
Thanks for your insights !
I have 2 fields on the screen : <b>my_source_field</b> and <b>my_pourcent</b>.
Here is the code :
PROCESS AFTER INPUT.
  MODULE exit AT EXIT-COMMAND.
  CHAIN.
    FIELD my_source_field MODULE calculate_%.
  ENDCHAIN.
  CHAIN.
    ... lot of checks here, where the user requires the value of a % mininum
  ENDCHAIN.
and in the calculate_% subroutine :
  IF my_source_field <> 0.
    CLEAR my_pourcent.
    my_pourcent = ( k_%_mini * 100 ) / my_source_field.
*   Updating screen immediately
    CLEAR   : wt_update.
    REFRESH : wt_update.
    wt_update-fieldname    = 'MY_SOURCE_FIELD'.
    wt_update-fieldvalue   = my_source_field.
    APPEND wt_update.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname                     = sy-cprog
        dynumb                     = sy-dynnr
      tables
        dynpfields                 = wt_update
      EXCEPTIONS
        INVALID_ABAPWORKAREA       = 1
        INVALID_DYNPROFIELD        = 2
        INVALID_DYNPRONAME         = 3
        INVALID_DYNPRONUMMER       = 4
        INVALID_REQUEST            = 5
        NO_FIELDDESCRIPTION        = 6
        UNDEFIND_ERROR             = 7
        OTHERS                     = 8.
    IF sy-subrc <> 0.
    ENDIF.
  ENDIF.
Any idea ?
Best regards,
Guillaume
Message was edited by: Guillaume Garcia

Similar Messages

  • How to access screen field in pai event

    Hi All,
    I have created a custom screen it has the field say matnr selected from the dictionay.NOw  how will I should access this field in PAI event module?
    Thanks in advance
    Mahesh

    just declare the same variable in your abap editor as per your layout field name.
    suppose in your layout input field name is matnr just declare
    data : matnr like mara-matnr.
    in pai module if you are using matnr it will give you the screen data.
    like
    module pai input.
    if matnr ne '1000'.
    message 'Error matnr is not 1000' type 'E'.
    endif.
    endmodule.
    reagards
    shiba dutta

  • PAI Screen Fields

    Dear Guys
    I have created few screen Fields which save the data in table when some one click Save Button. Note down that these are screen fields not dictionary fields.
    The problem is that when user press enter all fields gets cleared from screen. I have also tried to make those fields dictionary fields but the problem is still there whenever user press enter all value gets clear from the screen.
    User dont want that value gets clear untill or less he will press save button.
    Pls explain.
    Thnx

    Hi
    Probably you're clearing those fields in PBO, you should consider when the user press enter the PBO is processed again.
    Max

  • Module Pool - Refresh Screen Fields Progmatically

    Hello All!
    I have a slightly frustrating problem. I have built a Module Pool application to display shipments and their underlying deliveries (various information from each).
    I have structured the application as follows
    An object to store the Data. This object has an internal table of Shipments and an internal table of Deliveries. The tables are related by TKNUM. When the application needs to display a shipment, it requests the shipment's information and the underlying deliveries information from the object. The object is structured to move through the shipments with methods like "GetFirstHeader", "GetPrevHeader", "GetNextHeader", "GetLastHeader". These return the data for the application to use.
    The Deliveries are displayed in a CL_SALV_TABLE, the Shipment information is displayed in textbox type fields above the table.
    The form for display has buttons to trigger the "Move" methods of the data object. This currently will retrieve the new data from the object, modify the fields and the alv grid and then go back through PBO (I'm assuming because a button was pressed). This works well. It will bring in the new data and refresh the screen everything is fine.
    I also have a button to print the currently displayed Shipment and Deliveries. This Print is handled through a SmartForm.
    The area that is giving me troubles is my other button. Since the Application can store a range of shipments at once, I have a "Print All" button. This button moves to the first shipment in the data object,
    calls the Print Form, then moves through the rest of the data object calling the Print Form for each Shipment Displayed. This happens from one button push. The problem I am running into is that the screen does not refresh when the data changes during this movement through the data objects. I believe this is due to the PBO module not being triggered yet. My question is, is there a way to refresh the screen progmatically?
    I have tried SET USER-COMMAND to move through the data, instead of calling the "GetFirstHeader" and "GetNextHeader" method directly, but that has some unpredictable behavior (works in debug, not in regular execution). I have also tried a LEAVE SCREEN statement, as that would trigger the PBO, since the Next Screen is set to the same screen number, but that kills execution of that block of code at the LEAVE SCREEN STATEMENT.
    I am including my code from my PAI module that runs this processing, hopefully that will help.
    << unformatable code removed >>
    Moderator message - Please go through your code and post only what is relevant to your question.
    Edited by: Rob Burbank on Apr 28, 2009 1:44 PM

    MODULE USER_COMMAND_9999 INPUT .
      CASE OK_CODE .
        WHEN 'NEXT' .
          PERFORM Next .
          PERFORM GetGridData .
          PERFORM RefreshALV .
        WHEN 'PREV' .
          PERFORM Prev .
          PERFORM GetGridData .
          PERFORM RefreshALV .
        WHEN 'EXIT' .
          SET SCREEN 0 .
        WHEN 'PRNT' .
          PERFORM Print .
        WHEN 'PRNA' .
          PERFORM PrintAll .
        WHEN 'BACK' .
          PERFORM HideInitials .
          SET SCREEN '1000' .
        WHEN 'CANC' .
          SET SCREEN '1000' .
        WHEN 'FRST' .
          PERFORM First .
          PERFORM GetGridData .
          PERFORM RefreshALV .
        WHEN 'LAST' .
          PERFORM Last .
          PERFORM GetGridData .
          PERFORM RefreshALV .
        WHEN 'CFAX' .
          PERFORM Show6000 .
      ENDCASE .
    ENDMODULE .
    FORM PrintAll .
      DATA sPromptB TYPE STRING .
      DATA sPromptM TYPE STRING .
      DATA sPromptE TYPE STRING .
      DATA sPromptF TYPE STRING .
      DATA cAnswer  TYPE C LENGTH 1 .
      IF NOT oLTend->isEmpty( ) = 1 .
        sPromptB = text-995 .
        sPromptM = ITOTSHIPNUM .
        sPromptE = text-994 .
        CONCATENATE sPromptB sPromptM sPromptE INTO sPromptF SEPARATED BY SPACE .
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            TITLEBAR                    = 'Print All?'
            TEXT_QUESTION               = sPromptF
            DISPLAY_CANCEL_BUTTON       = ' '
          IMPORTING
            ANSWER                      = cAnswer
          EXCEPTIONS
            TEXT_NOT_FOUND              = 1
            OTHERS                      = 2 .
        IF SY-SUBRC <> 0 .
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 .
        ENDIF .
        IF cAnswer = '1' .
          PERFORM First .
          PERFORM GetGridData .
          PERFORM RefreshALV .
          " >>> Need Screen Refreshed right here
          PERFORM Print .
          DO .
            PERFORM Next .
            PERFORM GetGridData .
            PERFORM RefreshALV .
            " >>> Need Screen Refreshed right here
            PERFORM Print .
            IF oLTend->GetIndex( ) = oLTend->GetCount( ) .
              EXIT .
            ENDIF .
          ENDDO .
        ENDIF .
      ENDIF .
    ENDFORM .
    That is the general flow. Hope that helps, if more info is needed, let me know.

  • Make invisible a field in PAI

    Hi guys,
    my problem is, that i need to make invisible some fields after the user clicks on one button, i know how to make invisible a field, but is not working because i put my code in the PAI event, any ideas? (is in the same dynpro)
    tks in advance
    Message was edited by:
            javier  santana

    Hi ,
    THINK THIS WAY,
    IF YOU ARE IN PAI OF SCREEN 101 AND YOU HAVE A BACK BUTTON THAT TAKES YOU TO SCREEN TO 100 AND IN 100 YOU WANT THE FIELDS TO DISABLE.
    THEN YOU CAN WRITE THE CODE IN PAI OF 100 OR PAI OF 101
    YOU ARE IN PAI OF 101 THAT'S MEANT FOR SCEEN 101 AND  IF YOU WRITE CODE IN HERE ITS FO SCREEN AND IF YOU WRITE THE SAME CODE IN PAI OF 100 THEN ALSO IT DOESN'T WORK BECOZ WHEN YOU PRESS ITS DIRECTLY GOES TO PBO OF SCREEN 100
    Thats the reason fo writing the code in PBO
    LET ME KNOW IF YOU NEED ANYTHING ELSE
    THANKS
    VENKI

  • Table control in PAI of a screen.

    Hi all..
    Here i am having a scenario where in i have to display header details and item details(in table control) in a screen. At first, screen should not display any contents but after choosing a value for key field of the header table from provided search help, it should populate my table in the screen depending upon the chosen key field value. How to handle this in PAI of the screen.
           please provide me some sample code.
    regards,
    Jalendhar

    Hi Jalendar,
                 When you a value in the header table and pressing any button or enter it immediately takes to the PAI. In the PAL module populate the internal table.
    the cursor then goes to the PBO to show the screen. So here in PBO write like this
    LOOP AT <internal table> CURSOR <scroll-var>
    [WITH CONTROL <table-control> ]
    [FROM <line1> ] [TO <line2> ].
    ...<actions>...
    ENDLOOP.
    The above syntax is to display the data on the screen for table control.
    Br,
    Laxmi.

  • PAI in custom screen.

    Hi All,
    I have a custom screen and the plant will be entered in one of the field available in the screen.
    IN PAI, i have written the validation for the entered part. If the user enters wrond plant, the PAI code will display an error message. Now, if the user changes the Plant value in the screen, the screen field is not saving the latest value of the PLant.
    Again the PAI will validate the plant entered for the tirst time only..
    How to resolve this issue..?????
    Regards
    Pavan

    Hi,
    Cleare the plant field after displaying the error message.
    IF sy-subre NE 0
    MESSAGE 'Invalid Plant' TYPE 'E'.
    CLEARE plant.
    ENDIF.
    Thanks,
    Sri.

  • Calling the PAI of a screen dynamically

    Hi Experts,
    I have two screens say 9000 and 9001. If the user enters a certain command in screen 9000 I am supposed to call screen 9001 for some secondary information. After the user enters the info in screen 9001 i am supposed to return back to the calling portion of screen 9000. If instead of coming back to the calling portion I want to trigger the PAI of screen 9000 from PAI of screen 9001 after the user enters the info how to do it. Please note that I am not using any OOPs ALV. So I do not have a container class in place. Both the screens are normal screens.
    Thanks and regards
    Srinibas

    Hi,
    When creating Gui title use placeholders(&1, &2 etc) in it.
    *For example : * Change PO &1 by &2
    And while setting title bar use WITH addition as;
    lv_po = '40000023'.
    lv_user = 'SAPABAP'.
    SET TITLEBAR 'TIT1' WITH lv_po lv_user
    Now in the title bar it will display as;
    Change PO 40000023 by SAPABAP
    Regards
    Karthik D

  • Create Input Field within ALV Toolbar

    Hi,
    I've created an ALV table using the CL_SALV_TABLE class. I'm now trying to include an input field within the ALV toolbar. I would also require this field to do an F4 to obtain its values. Can anyone help me?
    Thanks and regards,
    Adeline.

    Hi Adeline,
    as Rich explained: Not inside ALV toolbar. If you do not use full screen display but have a screen container for this, you may define a subscreen area on top of ALV container. Use CALL SUBSCREEN <area> INCLUDING <prog> <dynp> syntax to process the subscreen. Define PROCESS ON VALUE-REQUEST for F4. In PAI (PROCESS AFTER INPUT) you can modify the table displayed in the grid and do a new display.
    Regards,
    Clemens

  • Populating the screen field when the cursor moves to that field

    hi every one,
    I want to populate the screen field(MODULE POOL) When the cursor moves to that field.
    So can any one help me out with this.
    EXAMPLE..
    I want to populate 'S10_TOT_PRICE' (Total Price). When the fields like 'S10_PIECES' (Number of Pieces) will be entered. I want to populate 'S10_TOT_PRICE'  without pressing any button on the screen nor when enter is hit. When the field 'S10_PIECES''  will be entered with some value and the cursor moves to 'S10_TOT_PRICE' . The Total Price field should be populated. Please help me out with this.
    THANKS & REGARDS.
    Mahanta.
    POINTS WILL BE REWARDED.

    Sorry but look at this SAP documentation <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/54/0608162d0711d295520000e8353423/frameset.htm">User Actions on Screens</a>
    Extract :
    <i>User Actions on Screens
    There are various ways in which users can interact with screens.
    Filling Input Fields
    Users can enter values in any input field on the screen, or change the value using the mouse, in the case of radio buttons and checkboxes. The contents are placed in the corresponding screen field. Filling an input field does not normally trigger the PAI event. Exceptions to this are Checkboxes and Radio Buttons with Function Codes and input fields with Drop Down Boxes.</i>
    So, i fear that you cannot "take hand" when user fill a numerical field to perform calculations and update the screen.
    Regards

  • Holding the value in screen-field

    Dear All,
    I m facing the problem ,while i m putting the value in screen-field and then pressing enter,
    value in that screen-field is becoming null automatically.
    wht shld i do for holding the value even after PAI.
    Thanks in advance.

    Hi,
    You should define a corresponding variable for that screen field in your program.
    data: my_input_field type ... "same name and type as the one used in screen for field
    so when you enter data to that field and press ENTER, the data will be transported to that variable and in PAI you have its value there.
    Regards
    Marcin

  • How to Read the Screen Fields after a Transaction ?

    Hi all,
    I am working on the Transaction 'O4K_LICENSE'. After the transaction is run, it generates an Internal License number which is displayed on the screen. I tried using 'GET PARAMETER', but as the CALL TRANSACTION is called within a loop, the SAP Global memory is not getting refreshed and iam getting the same value for every loop for the Internal License Number.
    Is there any function Module other than DYNP_VALUES_READ to get the screen field values? I tried using the above function module, but in vain and it is not getting any values.
    Warm Regards,
    Vijay.

    Well .... let me explain this very clearly.
    The table OIHL has a composite primary key which is the combination of "External License Number" and "Internal License Number". The latter is generated after running the O4K_LICENSE transaction.
    Moreover, iam attaching every record with a record generated in the program. Now, the same User(ERNAM) can create records having the same External License Number.
    For example:
    If i created a record yesterday with an external License Number 123, then say an internal lic no of 3 is assigned to it.
    If i Create another record today with the same external lic no of 123, and an internal no of say 20 is attached to it, then i donot have any criterion to select the one which i have created today, as it fetches both the records.
    To add to the worst, there is no timestamp field also.
    Message was edited by: Vijay Sai

  • RF Monitor -  add screen field

    Hi.
    Is it possible to add a field in the report and how? or is there any user-exit?
    Thx.

    If your client/employer allows CORE-MODS then go ahead and make the changes just as you'd change any screen field. If not, I suggest you look at GUIXT. This comes standard as part of 4.6 and up ...
    I suggest that you add this field (and necessary PBO/PAI logic) in custom tab and use GUIXT to display this field in whichever tab/screen you choose to.
    You can go to GUIXT.com and check out sample code on how to do this. Its very simple, you should be able to go through the tutorial and do it yourself.
    Raj

  • SCREEN field values

    Dear Sir,
            Can any body pls tell me how to pass screen field values generically in dialogue programming...the screen field values like input,output, group...
    Can we use the table 'SCREEN' in dialogue programming..?? & how???
    Regards,
    Rushikesh

    Hi Rushikesh,
    What exactly is your requirement....?
    You can use the table SCREEN for modifying the screen element attributes at runtime...
    Suppose for example , when I click on a button, I want a button to be displayed...It can be done , but only in the PBO event....
    Initially , go to the screen attributes and make it invisible...
    Now in the program, you can do like this
    1) Declare a global variable (say flag initialized to zero).
    2) In PBO event
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'FIELD1' and FLAG = 1.
    screen-invisible = 0.
    modify screen.
    endif.
    endloop.
    3) In PAI event.
    case sy-ucomm.
    when 'CLICK'.
    flag = 1.
    endcase.
    This is one example , you can have any number of situations.
    Regards,
    SP.

  • Screen field value under POV event

    Hi All,
    I have one issue...please suggest me solution for this.
    In module-pool program i have one screen(1000) which has one field(hrname_1000).
    Under this event:
    PROCESS ON VALUE-REQUEST.
    FIELD hrname_1000 MODULE hrname_1000.
    under this module hename_1000 i have used F4IF_INT_TABLE_VALUE_REQUEST to put a search help for field hrname_1000.
    after that i am trying to retrive HR related stuff's based on the field on module-pool i.e i am using hrname_1000 in the where condition.
    but problem is that im not getting value for hrname_1000 which im giving in the module-pool screen.
    thats y my select query is not working.
    Where as im getting values for the hrname_1000 under PBO & PAI.
    It will look like below.
    PROCESS ON VALUE-REQUEST.
    FIELD hrname_1000 MODULE hrname_1000.
    (under the above module)
    SELECT DISTINCT ename plans FROM pa0001 INTO CORRESPONDING FIELDS OF TABLE itab WHERE stell = '50001026'.
    LOOP AT itab INTO wa WHERE ename = hrname_1000.
    ENDLOOP.
    Please suggest
    Thanks & regards
    Ansumesh

    Hi,
    I guess you don't get back value from function F4IF_INT_TABLE_VALUE_REQUEST to your global data object hrname_1000, althought it is returned from search help back to screen field.
    See this thread. I explained there [how values are returned from screen field to a variable|https://www.sdn.sap.com/irj/scn/profile?userid=3509696]
    You may also try with FM DYNP_VALUES_READ for reading dynpro fields values in POV.
    Regards
    Marcin

Maybe you are looking for

  • *FIXED* No sound and 'No Audio Device' in Control Panel. *FIX

    I?m having a problem with my sound. Basically all I get is a system sound, which means no sounds from itunes but the error prompt sounds still play. I?m tempted to say that this is a detection issue because of several things: -First, when looking in

  • I own a Macbook Pro 2008 and Airdrop doesn't work? Final Cut Pro X Flop!

    Aidrop: Why does Apple offer such features and then they don't work? Apple is on a mad way i think? Final Cut Pro X: ...also with Final cut Pro!!!! support please! Apple stands for a minority of creative People. There Machines stands for creativity a

  • No phoneline,No broadband and the activation date ...

    I recently switched from Sky to BT as I was having an issue with my broadband and phoneline that Sky were far from helpful about. Sky took 5 weeks to fix a fault on the phoneline after many promises and many times an engineer didnt turn up when promi

  • Windows 8.1 - Settings & Apps refuse to open?!

    Hello, In order for me to solve another error with my computer - Driver Stopped responding and has recovered - I have been given the method of reinstalling Windows 8 (Refresh without losing files). However in order for me to do this I need to access

  • Nothing Adobe will load (Error 148:8)

    Hello, Any Adobe program I have will not load.  I have CS4.  I get a: "This product has has (yes, two "has'es") encountered a problem which requires that you restart ytour computer before it can be launched."  I have done this and still it will not l