Sample code in PBO and PAI

Hi all,
i created a new field in the customer master (xd03) screen with a button. if i click that button, it will display the next screen with the new field. now i need to write the code in PBO and PAI events in that screen to get the data from table and to change the already exiting data.
can any body provide me the sample code wht to write in the PBO and PAI eventts.?
thanks in advance.
kp

Hi,
I think you find the answer but i still answered your question.
You can use the function module 'DYNP_VALUES_READ' to read value you want and use the function module ' HELP_VALUES_GET_WITH_TABLE' to get the values from kna1 table.
Good luck.

Similar Messages

  • Why do we need to code  loop statement in both PBO and PAI in Table control

    Hi friends,
    i have 2 questions-
    Q1-why do we need to code a loop and endloop statement in both PBO and PAI in Table control,sometimes even empty as well?
    Q2-what r d dynpro keywords?

    Hi,
    It is required to pass information from internal table to table control so we loop it in PBO and to get the updated information back, we loop in PAI and update internal table content.
    To get more knowledge on Table controls check these threads -
    table control
    Table Control
    Hope this helps.
    ashish

  • Screen enhancement in ME51N - control is not passing to PBO and PAI of exit

    HI ,
    I am doing screen Exit for the Tcode : Me51N / Me52N.
    I have to add 3 Text fields in item level, i am using Enhancement:MEREQ001(in CMOD).
    Initially i added those 3 fields in Structure CI_EBANDB.
    Then i designed Screen in Screen Exit:SAPLMEGUI Screen Num:111.
    Here in the PBO and PAI Module
    MODULE STATUS_0111 , MODULE USER_COMMAND_0111.
    the control is not going , i tried with break-point inside these modules.
    But while executing ME51N , debugger is not working.
    Code i wrote in both PAI and PBO
    MODULE STATUS_0111 and MODULE USER_COMMAND_0111.
    loop AT SCREEN.
           screen-output = '1'.
           screen-input = '0'.
           MODIFY SCREEN.
    endloop.
    I need to display the three screen in Display format not in editable format.
    Thanks and Regards,
    Prakash K

    Hi
    You need to write the code in PBO of that screen based on TRANSACTION TYPE.
    there is a method call 'get_transaction_state' from this you will get the transaction type (H -  create , 'V'-  change  'B' -display) at run time.
    If run time transaction type = B
      LOOP AT screen.
          IF screen-name eq c_name . "field names
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    endif.

  • Module Programming  PBO and PAI flow.

    Hi,
    I am new to module programming,
    My req are -  I have 4 input fields and button in my first screen(1000)
    After user enters these values then I have to validate this values in the database and then
    I need to update 1 field value in the database. After updating I need to display the results in second screen (2000).
    Can any one please let me know what is the process in PBO and PAI modules.
    How to write code .
    1.     where to validate field values
    2.     where to write code for updating database.
    3.     where to write code for displaying success/failure message in second screen(2000)
    4.     where to write declarations.
    Thanks a lot for ur time .
    I highly appreciate ur help.
    Venkat.

    Hello
    Check this out:
                                INCLUDES                                 *
    INCLUDE ZIMMFORM001_TOP.
    INCLUDE ZIMMFORM001_PBO.
    INCLUDE ZIMMFORM001_PAI.
    Main Process
    START-OF-SELECTION.
    CALL SCREEN 100. -> double click
    END-OF-SELECTION.
    Uncomment the following:
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.   -> double click
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.  -> double click
    *&  Include           ZIMMFORM001_TOP
    Global Definitions                                   *
    "Your definitions
    *&  Include           ZIMMFORM005_PBO
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'MEN'.  -> double click -> CREATE SCREEN STATUS 'EXE' AND 'BACK'
      SET TITLEBAR 'ZTIT'.  -> double click
    INITIATE WHATEVER YOU NEED
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&  Include           ZIMMFORM001_PAI
    *&      Module  USER_COMMAND_0100  INPUT
          text
    INSIDE THE CASE YOU CAN VALIDATE.WHEN 'EXE' IS SELECTED FOR EXAMPLE.
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXE'.
          PERFORM validate_form.
          PERFORM save_form_to_db.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Hope this helps, dont forget to reward
    GABRIEL
    Message was edited by:
            Gabriel Fernando Pulido V.

  • Screen exit for co11n and problems in writting the PBO and PAI Logic ?

    Hi People,
    I am developing a screen exit for transaction co11n. I have found the exit ( CONFPP07 ) ... I created a project and have
    assigned this exit and activated the project. I have created a field named SHIFT  on clicking this field i have to give three
    possible values (a,b,c  ) and i have to store these values in some table .......... now my problem is in which include i
    have to write PBO and PAI logic ... should i have to write pbo logic in the include provided in the exit
    EXIT_SAPLCORU_S_100 and PAI in EXIT_SAPLCORU_S_101.......or .........Can any tel me what should i have to do to
    meet the requirements... and in which structure i have to add this field so that it gets stored in some table.
    Thanks in Advance.

    Hi,
    Use the includes in the program SAPLXCOF given in CONFPP07 Exit.
    You may use include zxcofzzz ( for Subprograms and Modules )
    by creating it upon double click.
    Regards,
    Wajid Hussain P.

  • Looking for sample code using "first_tab" and "next_tab"

    Looking for sample code using "first_tab" and "next_tab". How is it used with ItemID within a dialog box? I've read the reference books - don't understand it.

    Hi Ray,
    There are several ways to do this, and in the example I created, I actually did not end up using shift registers. I've attached some example code that basically multiplies the period by the duty cycle percentage to achieve the number of milliseconds to be high and low.
    You would just need to insert your DIO code in each frame of the sequence structure.
    Hope that helps. Kind regards,
    -Sam F, DAQ Marketing Manager
    Learn about measuring temperature
    Learn how to take voltage measurements
    Learn how to measure current
    Attachments:
    70_PWM_Example.vi ‏23 KB

  • Transaction code to learn for sample codes about trees and containers

    trnasaction code to learn for sample codes about trees and containers

    hi check this....,
    REPORT  Ztree_TEST_PGM.
    Type-pools : fibs,stree.
    data : t_node type snodetext.
    data : node_tab like t_node occurs 0 with header line.
    clear : node_tab, node_tab[].
    node_tab-type = 'T'.
    node_tab-name = 'Earth'.
    node_tab-tlevel = '01'.
    node_tab-nlength = '5'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Europe'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Germany'.
    node_tab-tlevel = '03'.
    node_tab-nlength = '7'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Berlin'.
    node_tab-tlevel = '04'.
    node_tab-nlength = '6'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Asia'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '4'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'India'.
    node_tab-tlevel = '03-'.
    node_tab-nlength = '5'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Bombay'.
    node_tab-tlevel = '04-'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
      TABLES
        NODETAB                  = node_tab .
      DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
      DATA: wa_type TYPE stree_ctl_type_mapping.
      CLEAR: type_mapping[].
        wa_type-type = 'A'.
        wa_type-icon = '@BL@'.
        APPEND wa_type TO type_mapping.
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
       USE_CONTROL                     = 'L'.
    A list of other function modules that can also be used to construct tree reports:
    SEUT,                            Hierarchy framework
    RS_TREE_ADD_NODE                 Insert nodes
    RS_TREE_AUTOMATIC_REFRESH
    RS_TREE_COMPRESS                 Hide subtree(s)
    RS_TREE_CONSTRUCT                Construct new hierarchy or insert subtree
    RS_TREE_CONTROL_PREPARE
    RS_TREE_CREATE                   Create hierarchy
    RS_TREE_DELETE_NODE              Delete node with associated sub-tree
    RS_TREE_EXPAND                   Expand subtree
    RS_TREE_GET_CURRENT_LAYOUT       Get layout information for displayed hierarchy
    RS_TREE_GET_CURRENT_NODE         Get node at which cursor is positioned
    RS_TREE_GET_CURRENT_ROOT         Get current root node
    RS_TREE_GET_CURRENT_TREE         Get structure information for displayed hierarchy
    RS_TREE_GET_INPUT                Get entires from input fields
    RS_TREE_GET_MARKED_NODES         Get selected nodes
    RS_TREE_GET_MODIFICATION_LOG     Get change log for hierarchy
    RS_TREE_GET_NODE                 Get nodes for specified ID
    RS_TREE_GET_NODE_BY_NAME         Get node for specified node name
    RS_TREE_GET_PREDECESSOR          Get preceding node
    RS_TREE_GET_SEARCHSTRING         Get last search strinng
    RS_TREE_LIST                     Simulate hierarchy or subtree display
    RS_TREE_LIST_DISPLAY             Display hierarchy
    RS_TREE_LIST_DISPLAY             Display hierarchy
    RS_TREE_MODIFY_NODE
    RS_TREE_MOVE                     Reassign node with subtree
    RS_TREE_POP                      Get hierarchy from the stack and restore
    RS_TREE_PUSH                     Place hierarchy on the stack
    RS_TREE_RESET_LOCK               Deselect node
    RS_TREE_SET_CURRENT_LAYOUT       Set layout with marked cursor position
    RS_TREE_SET_CURRENT_TREE         Set other hierarchy
    RS_TREE_SET_LOCK                 Select node
    RS_TREE_SET_NODE                 Change Nodes
    RS_TREE_SET_SCROLL_POS           Position node at the beginning of the page
    RS_TREE_SLEEP
    RS_TREE_SORT_CHILDREN
    regards,
    venkat.

  • Where can i get more sample code of javacard and OCF

    i'm a newbie..can anybody tell me where can i get
    more sample code of OCF and javacard..especially OCF's sample code..because the OCF's programmer's guide is too simple..
    thx a lot

    Hi,
    will U pl. clear which sample code you are having? Anyway you can check with www.alphaworks.ibm.com.
    Rgs,
    Anupam

  • Process PBO and PAI when Enter key is pressed

    Hello everyone,
    I am making a program where there is a I/O Box component. When the user enters data in this field and hits the 'ENTER' key I want to process the PBO and the PAI of that screen.
    The problem is what should i assign in the ok_code for this?
    Please advise.
    Thanks in advance,
    Karan

    >
    Karan Kappal wrote:
    > Hello everyone,
    > I am making a program where there is a I/O Box component. When the user enters data in this field and hits the 'ENTER' key I want to process the PBO and the PAI of that screen.
    > The problem is what should i assign in the ok_code for this?
    >
    > Please advise.
    >
    > Thanks in advance,
    > Karan
    You want to Go when user Press enter.
    In PBO we will set the status,
    SET PF-STATUS 'STATUS'. " double click on it or Go to SE41
    here activate the Function code for the ENTER button.
    in the FUnction keys you can see in the Beginning First Function (Green Tick mark) Give the Function code say ENTER , and give all necessary details and Activate .
    Now Test your application.
    When your enter the data and press enter, First it Goes to PAI
    here you do what ever required based on the action code...
    in PAI
    case ok_code.
    when 'ENTER'.
    "your code here...
    endcase.
    and once it is done, Control backs to PBO ..

  • Additional field in infotype 0009 issue ( PBO and PAI )

    Hi Guru,
    I need your help please.
    I have a additional field in IT0009 and when I want created a new infotype 0009, I fill all field but after ENTER or SAVE all field are save in the layout but not the additional field.
    To save the additional field in the layout, I must fill it again and after the ENTER or SAVE the field is save in the layout.
    I have checked in the debbugger, when I create a new infotype 0009 it goes to the PBO but after ENTER or SAVE it doesn't go to the PAI so I must do it again ( fill the additional field and ENTER or SAVE ) and then it goes to the PAI.
    Thus I would like to know how I can make so that after the ENTER or SAVE the screen goes in PAI before the PBO and at the first time.
    Thanks very much in advance.
    Regards.

    Hi Srini Vas, hi Pedro Guarita and thanks for your reply,
    After more investigation, the probleme come from a check over country bank.
    In fact, the screen of the infotype 0009 must be adpated following the country bank but to do this, the standard module pool (mp000900) check if the country bank have changed.
    call method cl_hrpad00_iban=>process_iban_pai
          changing
            cs_bankdata = ls_bank_data_current
          exceptions
            error_iban  = 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.
        call method cl_hrpad00_iban=>get_bank_data_old
          importing
            bank_data_old = ls_bank_data_old.
        if ls_bank_data_current-banks <> ls_bank_data_old-banks. "MELN1357200
    bank country changed -> leave screen needs to be done
          leave_screen = 'X'.
        endif.
    But when you create a new infotype 0009, the ls_bank_data_old-banks is always initial. So when module pool compared the ls_bank_data_old-banks with the ls_bank_data_current-banks, those are always different.
    In conclusion, when you create a new infotype 0009 it is always mandatory to push ENTER before to fill any additional field because at each first time that the standard module pool go in the PAI, it make a leave screen.
    Thanks in advance for all yours reply.

  • Can u please send me a sample code to upload and download a file using java

    Hi,
    Please can u send me a sample code to upload a file and to download the same file from a remote server using a java servlets. The file should be read byte by byte.
    Message was edited by:
    user461713

    Hi, Thank u.
    Sorry, I forgot to attach a code. Here it is.
    Actually i need to upload a file to a remote server and download it from a server to my machine. I'm trying it using servlets and using tomcat5.0 as a servlet container. Here i'm sening a code used to upload a file. Let me know whether it works. Only few lines are here.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.lang.Object;
    import java.util.*;
    import java.lang.String;
    import com.oreilly.servlet.MultipartRequest;
    public class FileUpload extends HttpServlet{
         public void doPost(HttpServletRequest req, HttpServletResponse res)throws
         ServletException, IOException{
         MultipartRequest multi=new MultipartRequest(req);     
         String file="file1";
         byte[] b=file.getBytes();
         InputStream in=null;
         BufferedInputStream bis=null;
         FileWriter fw=null;
    try{
         in=multi.getInputStream("file1");
    bis=new BufferedInputStream(in);
         File output=new File("/fileuploadtest");
         fw=new FileWriter(output);
              int i;
              i=bis.read();
              while (i != -1) {
    fw.write(i);
    i = bis.read();
         catch(IOException e){
              System.out.println("Exception=" +e);
    finally{
         try{
              if(in!=null)
              in.close();
              if(bis!=null)               
              bis.close();
              if(fw!=null)
              fw.close();
         catch(Exception e){
              System.out.println(e);
    This code is giving error as: cannot resolve symbol: class MultipartRequest
    Why is this happening?
    Pls let me know whether this code works or no and also i have written form.html.
    Can u pls tel me whether there are ways in which i can write a code to upload a file using servlets without using third party packages. Pls help.
    Also how should be the servlet mapping for this code.?
    Regards
    Message was edited by:
    user461713

  • Cocode check at PBO and PAI

    Hi
    I  should not allow Cocode AD01 records to update and Display when user has authorization for CoCode AD01.
    i know in Event its possible, but we need to do it in PBO PAI of Screen.
    PBO
    *First statement
    Module Authorictycheck.
    Include LZXXXO01
    module Authoritycheck
      LOOP AT EXTRACT.
        AUTHORITY-CHECK OBJECT 'ZCHECK_BUK'
                            ID 'BUKRS' FIELD ZTTL01-BUKRS.
        IF sy-subrc <> 0.
    *delete the record from EXTRACT table.
    Append Extract.
        ENDIF.
      ENDLOOP.
    endmodule
    Does the above PBO code will work for display nonauthorized company code?
    In PAI, No idea where to write and which table should i have to loop. Pls advice.
    Regards
    Prince

    Hi
    When the user tries to change the record in SM30, Authorization check
    for the BUKRS has to be done and display error if no authority.
    In PAI, under LOOP at Extract, i have added AUTHORITY_BUKRS module
    and made below code. but the Authority check occurs when i click the edit button in SM30 screen.
    but requirement is error should trigger only after change occurred for record.
    Can you pls suggest how to handle this problem?
    LOOP AT EXTRACT.
       MODULE LISTE_INIT_WORKAREA.
       CHAIN.
        FIELD ZXXXX-COCODE .
        FIELD ZXXXX-MATKL .
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
       ENDCHAIN.
       FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
       CHAIN.
        FIELD ZXXXX-COCODE .
        MODULE AUTH_CHECK_UPDATE.       <-Added Module
        MODULE LISTE_UPDATE_LISTE.
       ENDCHAIN.
    MODULE AUTH_CHECK_UPDATE INPUT.
    Authority-check OBJECT 'Z_XXX_BUK'
                  ID 'BUKRS' FIELD ZTAUTH-COCODE.
    If sy-subrc <> 0.
    MESSAGE E105(ZSCM01).
    ENDIF.
    ENDMODULE.
           Regards
    prince
    Edited by: princeck on Sep 16, 2011 3:33 PM
    Edited by: princeck on Sep 16, 2011 3:42 PM

  • Sample code to download and open an Asset

    For anyone who wants to download an asset from the web and load it into your Adobe application, this is how I did it:
    // .js
    var TMP_FOLDER="/tmp/com.mb.extension/";
    var doOpen = function(uri) {
              var xhr = new XMLHttpRequest();
              xhr.open("GET", uri, true);
              xhr.responseType = "blob";
              xhr.onload = function(event) {
                        var blob = this.response;
                        var data;
                        blobToBase64(blob, function(result) {
                                  data = result;
                                  var file = TMP_FOLDER+name;
                                  window.cep.fs.writeFile(file, data, cep.encoding.Base64);
                                  doOpenFile(file);
              xhr.send();
    function doOpenFile(file) {
              var ppid = "ILST";
              var extScript = "$._ext_"+ppid+".open('"+file+"')";
              evalScript(extScript);
    var base64ToBlob = function(base64, callback) {
      var binary = atob(base64);
      var len = binary.length;
      var buffer = new ArrayBuffer(len);
      var view = new Uint8Array(buffer);
      for (var i = 0; i < len; i++) {
           view[i] = binary.charCodeAt(i);
      callback(new Blob([view]));
    // .jsx
    $._ext_ILST={
        open : function(path) {
            openDocument(path);
    var openDocument = function(path) {
        return app.open(File(path));

    I don't know why, but when I use this code. The file was downloaded right, but Illustrator doesn't open the file.
    When doOpenFile is fired the args are correct, because I have debug it in console. But I think the problem is with the JSX file, sure I'm doing something wrong.
    Anybody could guide me about it?
    I'm newbie trying to script Adobe Extensions.

  • Where I could find the sample code for Pan and Zoom?

    hello all:
    I saw a demo for showing how to implement Pan and Zoom in java. If I remember correctly it should be included in JAI, however I cannot find it in JAI sample demos any more.
    THe only samples it included are
    * JAIDemo
    * JAIExampleApp/SampleDescriptor
    * JAIFileBrowser
    * JAIWarpDemo
    * JAIImageReader
    * FormatDemo
    Does anyone know where I could find that demo back?
    Thank you
    -Daniel

    Hi,
    I think this document will help you to develop your own modules.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e?quicklink=index&overridelayout=true
    later version pi71
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa?quicklink=index&overridelayout=true
    regards,
    francis

  • Sample code to sign and verify

    Hi,
    Those of you who might be following my threads will know that signing and verifying data is proving to be a big problem
    on my Java Card. I use JC 2.1.1
    Could anyone please post a simple code snippet that signs AND verifies data. Please post code that actually works on your card and is thus tested and proven.
    Thank you all very much for all your support and help.

    Hi,
    probably not the right forum for this type of questions. However, have a look here, maybe it helps: https://blogs.oracle.com/shay/entry/to_adf_or_oaf_or
    Frank

Maybe you are looking for

  • Ralink RA3290 does not work on Oracle Linux

    I have just bought a new HP Pavilion G6-2213so which seems to have a ralink rt3290 wifi chipset (Just so you know I'm not very experienced with linux when it comes to install new drivers etc) I have installed: Red Hat Enterprise Linux Server release

  • Will Quicktime support PPAPI? Does it already?

    Quicktime is blocked in Chrome, IE Explorer, and Firefox, but not yet in Safari. Can I count on this being true in the future? Let me explain my problem: I'm developing a website that will show literally hundreds of video clips of American Sign Langu

  • Issue in New Asset Accounting

    Hi Experts, We have activated the new Asset accounting Datasource (0FI_AA_20) delivered as a part of EHP4 reporting financials. Now ee have replicated the datasource in BW and the model is activated. The model contains 2 cubes: 1 Basic(C20) and 1 Vir

  • Open PDF Link in new window?

    I want to create a Word document with hyperlinks to a variety of PDF files. I then want to create a PDF file from the Word document with hyperlinks intact. Here's the problem. The PDF file made from the Word document has its embedded links opening in

  • Is there a way to filter iPhoto photos by what's been uploaded to Flickr?

    I want to know which photos in my iPhoto library have NOT been uploaded to Flickr.  Is there a way to do this?