Need sample code in webdynpro for java

Hi all
actually i have one webdynpro form which is having multiple input elements. for example name,address,phoneno,price quantity and amount. and there is update button for that form.
when i click the update button the multiplication of quantity and price value will be updated by in one input field which is part of the another webdynpro form is part of the same view.
i want to update the input field in another form only when i change the value of either price or quantity otherwise the value of inputfield in another form should be same.
now how do we retrieve the event of either price or quantity inputfield which only changes rather than changes of name or adreess.
only when i modify the value of price or quantity in form and updated button then only the multiplication will be reflected in inputfield of another form.i dont want to reflect that inputfield of another form when i changes of other inputfields except price or quantity.
please provide the sample code on the same...especially how to retrieve the event of that price or quantity in a form..
Regards
Suresh babu

Hi Suresh,
please post your issue to the Web Dynpro forum.
Greetings,
Carsten

Similar Messages

  • Retrieve already deployed webdynpro for java source code from portal server

    HI ,
       We have webdynpro for java apllication already deployed on the J2EE server.  We found the ear file related to this application.  But I am not able to make any changes to the ear file in NWDS as it cannot be directly imported into NWDS.  We do not have NWDI for software logistics and the resource who built the WDJ application has left the company.  Is there any way that I can retrieve the complete source code of the application from the portal.  I need to make some changes to Webdynpro component and its view.  I have worked with basis team to retrieve the ear file from portal server.  But I could not make any progress just with the ear file.  Thank you for your help in advance
    Regards,
    KMM.

    You are probably breaking some license agreement by de-compiling the content of the 'war' files. Why not ask the people who provided the 'war' file if you could have the source and build system.

  • Need documents on webdynpro for java?

    hi,
    i am working on java,i want to move to webdynpro for java.i need documents on webdynpro for java.

    Hi Ram Sai,
    welcome to Web dynpro Java .... obviously you will be having a great future in this.....
    for material.... its been asked many times in the SDN just search. you will get hundreds of books....
    just like below.... these are very few... you will get many more in sdn.... just go and search
    The following links will give you introduction to Web Dynpro,Getting Started with Web Dynpro & WebDynpro Benefits
    /thread/358673 [original link is broken]
    /thread/353819 [original link is broken]
    Tutorials and PDFs
    Also see:
    WEB DYNPRO?
    what is webdynpro?
    What is Webdynpro?
    What is Web Dynpro?
    Webdynpro Sample Applications and Tutorials
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    SAP WebAs Samples And tutorials
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/7d646a6c-0501-0010-b480-bf47b8673143
    Basic Webdynpro tutorials....
    http://help.sap.com/saphelp_erp2005/helpdata/en/15/0d4f21c17c8044af4868130e9fea07/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/1fc0bdb1cdd34f9a11d5321eba5ebc/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/d08342a7d30d53e10000000a155106/frameset.htm
    http://searchsap.techtarget.com/searchSAP/downloads/SAPPRESS.pdf
    Go through the following documents for step by step procedure for developing an application in wdjava.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a361a890-0201-0010-c0bc-8f16de527cde
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/efe7a790-0201-0010-7894-cfd79d02bb7e
    the following document will give you some idea of webdynpro concepts
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a815cf90-0201-0010-8481-da495d68294c
    The following document gives some introduction in nwds
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f637ae90-0201-0010-ccab-81f3ec35f85e
    the following document will give you some idea of WAS concepts
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e1515a37-0301-0010-b2bb-99780cb4cafa
    Check the following thread u can get lot of materials,
    WeB Dynpro Documents
    All Web Dynpro Articles
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/7082f9fc-070d-2a10-88a2-a82b12cea93c?startindex=221
    Refer these linkshttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web%20dynpro%20tutorial%20and%20sample%20applications.faq
    Why WebDynpro ?
    Why WebDynpro ?
    Why  webdynpro and not BSP or JSP?
    What kind of applications are being developed with Web Dynpro?
    http://www.sappro.com/downloads/OptionComparison.pdf
    Developing Java Applications using Web Dynpro Configuration Scenario
    http://www50.sap.com/businessmaps/8F5B533C4CD24A59B11DE1E9BDD13CF1.htm
    Integrating Web Dynpro and SAP NetWeaver Portal Part 1: Creating Web Dynpro-Based Portal Content
    http://www.octavia.de/fileadmin/content_bilder/Hauptnavigation/SAP_NetWeaver/WebDynpro/Tutorial_1.pdf
    The Structural Concepts of Web Dynpro Components
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a048387a-0901-0010-13ac-87f9eb649381
    Web Dynpro:Context Mapping & Model Binding
    http://wendtstud1.hpi.uni-potsdam.de/sysmod-seminar/SS2005/presentations/14-Web_Dynpro_dataflow.pdf
    Web Dynpro:Getting Involved
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c193252d-0701-0010-f5ae-f10e09a6c87f
    Refer the following links also
    1.Tutorials & Samples for Web Dynpro Java
    2.https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60e5add3-8349-2a10-9594-bcb7d1b4bd2d
    3.http://help.sap.com/saphelp_nw04/helpdata/en/80/c12041aa7df323e10000000a155106/frameset.htm
    4.https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d599690-0201-0010-12bb-b9ea3ea32d22
    5.http://help.sap.com/saphelp_nw70/helpdata/EN/dd/0e2a41b108f523e10000000a155106/frameset.htm
    6.What is Web Dynpro? What is the use?
    7.Everything you wanted to know about Web Dynpro but were afraid to ask, including...
    Elearning Webdynpro For Java
    https://www.sdn.sap.com/irj/sdn/ui-elearning
    Articles On Webdynpro For Java
    https://www.sdn.sap.com/irj/sdn/nw-ui?rid=/webcontent/uuid/4005b711-9f9b-2a10-ebae-a1c7ab7ed39d
    Blogs On Webdynpro For Java
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/weblogs/topic/43
    Wiki's On Webdynpro For Java
    https://www.sdn.sap.com/irj/sdn/wiki?path=/x/iau
    Documentation On Webdynpro
    https://www.sdn.sap.com/irj/sdn/nw-wdjava
    The following links will give you introduction to Web Dynpro:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/webcontent/uuid/8921447c-0501-0010-07b4-83bd39ffc7be
    WebDynpro Benefits
    The following link will give you basics of how to build applications in Web Dynpro:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/efe7a790-0201-0010-7894-cfd79d02bb7e
    Following link is the comprehensive link for numerous tutorials on Web Dynpro from SDN itself:
    Tutorials & Samples for Web Dynpro Java
    Following are some threads where you can get links to practice examples on Web Dynpro:
    /thread/358673 [original link is broken]
    /thread/353819 [original link is broken]
    Tutorials and PDFs
    Also see:
    WEB DYNPRO?
    what is webdynpro?
    With Regards,
    RooP KumaR.

  • How to start to work on MDM JAVA API by using webdynpro for java

    Hi all
    I have basic idea on MDM business package thru portal by using standard iViews.
    now i am planning to work on MDM JAVA APIs by using Webdynpro for Java as UI.
    1) can you please share the required documents on the same. how to start working on this by using MDM JAVA APIs in webdynpro for java
    2) what are the JARs files are required and how to integrate those jar files into webdynpro for java application.
    3)  is there any SDN help on MDM JAVA API with webdynpro for java? . can you please send the link on the same.
    4) can you please help by providing sample code on how to use JAVA APIs for retrieving,deleting,inserting and Updating the data in the database.
    if anybody helps on the same then it is the great help to me.
    points are always rewardable...
    Regards
    Suresh babu

    Hi Suresh,
    You can have the MDM JAVA API javadocs from the link
    http://help.sap.com/javadocs/MDM/SP06P2/index.html
    There you can see a package named com.sap.mdm.examples.The classes in it contains some examples using which you can start understanding the code.
    You need to have MDM JAR files for it. And these JAR files to be used at build time can be added to the project thru :-
    Right click on project-> properties->Java Build Path - > Add external JARs
    At run time you can add them the reference in
    Right click on project-> properties->web dynpro references->library reference.
    Thanks
    Namrata

  • Problem in connecting to database from webdynpro for java

    Hi
    I have a problem in connecting to database from webdynpro application
    I am using oracle 10 express edition as database and was able to connect to database from a java application.But  was unable to connect from a webdynpro for java.
    <b>I guess webdynpro for java uses open sql instead of vendor sql(I looked in the visual admin ,DB is using open sql) so unable to connect to database.Am i right.?</b>
    Do i need to make any settings in the visual admin to make it work?
    How to solve this problem.Please give me pointers
    Thanks
    Bala

    Hi,
    For connecting to Oracle, either you can use the normal JDBC connectivty code directly which is given below :
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("your query");
    In case you want to fetch data through ejbs, these are the steps to be followed :
    1) Open the J2EE perspective
    2) Create an EJB Module project
    3) Right click on ejbModule, create a new EJB (select your EJB type)
    4) While creating the ejb itself, you can add business methods by clicking ‘Next’ in the UI. Another option is after creating the ejb, write the method in the bean, then select the method from ejb-jar.xml -> <bean name> ->method. Right click and select ‘propogate to local & remote’.
    5) Double click on ejb-j2ee-engine.xml. select your bean and specify a Jndi name for eg: “MyJndi”.
    6) Right click on the EJB project and add ‘classes12.zip’ file (provided by Oracle) to it’s build path. (under libraries tab). Also check the same file under ‘Order & Export’.
    7) Create an Enterprise Application project.
    8) Right click on the EJB module project and select add to EAR project, then select the created EAR project.
    9) Right click on the EJB project, select ‘Build EJB Archive’
    10) Right click on the EAR project, select ‘Build Application Archive’
    11) Open the WebDynpro perspective, open a new project, right click on the project ->properties. Do the following configurations :-
    • Java Build path - select the EJB project from ‘projects’ , check the selected project under ‘Order & Export’
    • Project references – select the EAR project
    • WebDynpro references – select ‘sharing references’ tab, click add & make an entry as : <vendor>/<EAR project name without .ear extension>
    You can find the vendor name under ‘application-j2ee-engine.xml’ file of the EAR project. By default it is ‘sap.com’. So if my EAR project’s name is ABC, my entry would look like ‘sap.com/ABC’
    12) Now the configurations are over and the EJB can be invoked by writing the client code inside the webdynpro component. Like:
    InitialContext context = new InitialContext();
    Object obj = context.lookup("MyJndi");
    MyEJBHome home = MyEJBHome)PortableRemoteObject.narrow(obj,MyEJBHome.class);
    MyEJB mybean = home.create();
    int a = 0;
    a= mybean.add(10,15);
    wdContext.currentContextElement().setSum(a);
    where ‘MyEJB’ is my EJB name and ‘MyJndi’ is my JNDI name
    To connect to Oracle , you can write the usual Java code (given below) as a business methos of the ejb (similar to add() method in the example). And access it like mybean.<businessMethodName>().
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("your query");
    Extracted from Re: Webdynpro and Oracle
    http://help.sap.com/saphelp_webas630/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm
    May be of use to understand the VA Conf /people/varadharajan.krishnasamy/blog/2007/02/27/configuring-jdbc-connector-service-to-perform-database-lookups
    Regards
    Ayyapparaj

  • Reading/Writing .xlsx files using Webdynpro for Java

    Dear All
    I have a requirement to read/write excel files in .xlsx format. I am good in doing it with .xls format using jxl.jar. The jxl.jar doesn't support .xlsx format. Kindly help me in understanding how do I need to proceed on reading/writing .xlsx files using Webdynpro for Java.
    Thanks and Regards
    Ramamoorthy D

    i am using jdk 1.6.22 and IBM WebSphere
    when i use poi-3.6-20091214.jar and poi-ooxml-3.6-20091214.jar  to read .xlsx file. but i am getting following errors
    The project was not built since its classpath is incomplete. Cannot find the class
    file for java.lang.Iterable. Fix the classpath then try rebuilding this project.
    This compilation unit indirectly references the missing type java.lang.Iterable
    (typically some required class file is referencing a type outside the classpath)
    how can i resolve it
    here is the code that i have used
    public class HomeAction extends DispatchAction {
         public ActionForward addpage(
                             ActionMapping mapping,
                             ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response)
                             throws Exception {     
                             String name = "C:/Documents and Settings/bharath/Desktop/Book1.xlsx";
               FileInputStream fis = null;
               try {
                   Object workbook = null;
                    fis = new FileInputStream(name);
                    XSSFWorkbook wb = new XSSFWorkbook(fis);
                    XSSFSheet sheet = (XSSFSheet) wb.getSheetAt(0);
                    Iterator rows = sheet.rowIterator();
                    int number=sheet.getLastRowNum();
                    System.out.println(" number of rows"+ number);
                    while (rows.hasNext())
                        XSSFRow row = ((XSSFRow) rows.next());
                        Iterator cells = row.cellIterator();
                        while(cells.hasNext())
                    XSSFCell cell = (XSSFCell) cells.next();
                    String Value=cell.getStringCellValue();
                    System.out.println(Value);
               } catch (IOException e) {
                    e.printStackTrace();
               } finally {
                    if (fis != null) {
                         fis.close();
                return mapping.findForward("returnjsp");

  • Books and Documentation on Webdynpro for Java

    Hi,
       I'am planning to start developing Webdynpro for Java applicatios.I know only Core java and iam not familiar with J2EE.I need some help on this.Any books on webdynpro for java basics and any documentation avail and prerequisite befor going to strat developing Webdynpro for JAVA
      Can anybody please give me suggestions on this.
    With Regadrs
    Praveen

    What is Webdynpro?
    What is Web Dynpro?
    Webdynpro Sample Applications and Tutorialshttps://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    SAP WebAs Samples And tutorials
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/7d646a6c-0501-0010-b480-bf47b8673143 [original link is broken]
    Basis Webdynpro tutorials....
    http://help.sap.com/saphelp_erp2005/helpdata/en/15/0d4f21c17c8044af4868130e9fea07/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/1fc0bdb1cdd34f9a11d5321eba5ebc/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/d08342a7d30d53e10000000a155106/frameset.htm
    Web Dynpro Sample Applications and Tutorials:https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d [original link is broken]
    http://searchsap.techtarget.com/searchSAP/downloads/SAPPRESS.pdf
    Check the following thread u can get lot of materials,
    WeB Dynpro Documents
    Refer these linkshttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web%20dynpro%20tutorial%20and%20sample%20applications.faq
    Why WebDynpro ?Why WebDynpro ?
    Why  webdynpro and not BSP or JSP?
    Why webdynpro and not BSP or JSP?BSP to WEB Dynpro
    BSP to WEB Dynpro
    Benifits of using Webdynpro Benifits of using
    Webdynpro
    Java vs. ABAP WEbDynpro Java vs.
    WebDynpro ABAP
    regarding Java related webdynpro
    Regarding Java related Web Dynpro vs. Struts - a few questions
    Web Dynpro vs. Struts - a few What kind of applications are being developed with Web Dynpro?
    What kind of applications are being developed with Web Dynpro?
    http://www.sappro.com/downloads/OptionComparison.pdf
    Hop this will helpful for u..
    Urs GS

  • Dynamic destinations for adaptive web service in webdynpro for java

    Hi,
    Please advice me on how to create dynamic destination for adaptive web service model in webdynpro for java.
    Regards,
    Patana

    Hi,
    If this is the case, then use the HTTP destination for this.
    What you need to do is:
    1. Create one HTTP destination in visual administrator at services-> Destinations. Provide HTTP url of the your web service and the security options.
    2. Specify this HTTP destination in the code before executing web service model.
    Write following code for that:
    wdContext.current<node name>Element().modelobject()._setHTTPDestination(<Specify HTTP destination name>);
    Then execute your web service model.
    Now, whenever you want to change the server on which your web service is running, make change in the HTTP Destination in visual administrator.
    Refer this link,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7
    Regards,
    Sunaina Reddy T

  • Accessing portal roles in webdynpro for java

    Hi,
    Please let me know how to access portal roles in webdynpro for java.
    Rgds,
    Patana

    Hi ,
    Please use this API to access the portal roles:
    IRoleFactory fact=UMFactory.getRoleFactory();
    Also see this code to get more information of role using code:
    IRoleFactory rolef=UMFactory.getRoleFactory();
    IRoleSearchFilter searchfilterrole= rolef.getRoleSearchFilter();
    ISearchResult searchResult = rolef.searchRoles(searchfilterrole);
    while(searchResult.hasNext())
    String unq=(String) searchResult.next();
    IRole role1=rolef.getRole(unq);
    String roleName = role1.getDisplayName();
    String roleID = role1.getUniqueID();
    // Once you get the informationof role you can use it in your application as per your requirement.
    Also please note that:
    You should add "com.sap.security.api.jar" to your project`s java build path for getting the Portal Security API's.
    I hope this solves the problem. Please revert back incase you need any further informationon this.
    Thanks and Regards,
    Pravesh

  • Webdynpro for Java Edit and Save.

    Dear all,
    ter cal
    iam working on webdynpro for java i want simple code for EDIT and SAVE  after calling a rfc in for using NWDS webdynpro for java.
    1)HOW TO SAVE AND EDIT THE FRONT WEBDYNPRO FOR JAVA APPLICATION
    2)AFTER SAVING AND THE DATA THAT SHOULD BE SAVED IN PA30 ARE PA20 AND IN PARTICULAR TABLE ALSO.
    PLEASE GIVE ME GOOD TIPS.

    Hi Kishore,
    Creating/Updating entries in tables through Bapis (RFC calls) work in the same way as it is done for other Bapis like those for returning values or even structures. All you have to do is
    1. Import the model, create a model node in your context and bind it to the Input structure of the model under used models.
    2.Create an istance of the Model input structure, like
         Z_Test1_Input input = new Z_Test1_Input();
    3. Set attibutes directly under the input structure
         input.setAttr1("XYZ");
    4. Set attributes under any other structure under Input Structure by first creating the instance of the sub-structure
        Z_SubStruct1 subStrc1 = new Z_SubStruct1();
        subStrc1.setSubAttr1("ABC");
    5. Add all available instances of sub-structures to the instance of input structure
        input.set<SubStruct1>(suStrc1);
    6. Add all available instances of tables under Input Structure after setting attributes within using
    for (int iCount = 0; iCount < wdContext.nodeVn_ContactInfo().size(); iCount++) {
          Z_Table1 zTable1 = new Z_Table1();
          IPublic<YourComponent>.IVn_Table1Element tab1Ele = wdContext.nodeVn_Table1().getVn_Table1ElementAt(iCount);
          zTable1.set<TableAttr>(tab1Ele .getVa_Attr1());
          input.add<Table1>(zTable1);
    7. Bind the instance of input structure to the model node.
       wdContext.nodeMn_TestModel().bind(input);
    8. Execute the model object and then invalidate the output structure under model node (Put this code in try catch block)
       wdContext.currentMn_TestModelElement().modelObject().execute();
       wdContext.nodeMn_TestModel().nodeOutput().invalidate();
    9. Retrieve values from the attributes, tables and structures under the Output Node of the Model Node (Mn_TestModel) as usual
    and store wherever in context as required. In case of output tables, you need to use FOR loop to iterate through the tables and access elements within using index (using wdContext.node<YourRequiredNode>().get<YourRequiredNode>ElementAt(int index)).
    Hope it is helpful.

  • Suggestion for a good book for webdynpro for java

    Hi, I am new to this technology,and i know a little bit basics,but i want to learn in depth regarding Webdynpro For Java and my backend is SAP R/3
             can anyone suggest me  a good book for webdynpro for java

    Hi padma,
    Check this link.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#9">Web Dynpro Sample Applications and Tutorials</a>
    Re: Guides for new entrant to Webdynpro
    Regards,
    Mithu

  • Need sample code with RV_INVOICE_CREATE used

    Hi everybody!
    I need sample code with RV_INVOICE_CREATE or similar FMs used.
    The thing is that I do not know how to populate parametres of this and other invoicing FMs....
    For example, there are some tables to be passed to RV_INVOICE_CREATE
         TABLES
              XKOMFK     = XKOMFK
              XKOMV       = XKOMV
              XTHEAD      = XTHEAD
              XVBFS        = XVBFS
              XVBPA        = XVBPA
              XVBRK        = XVBRK
              XVBRP        = XVBRP
              XVBSS        = XVBSS
    How to populate them? I mean how to fill them with needed values?
    Useful answers will be awarded.
    Kind regards, M.

    RV_INVOICE_CREATE is the function module to create invoice based on delivery .
    when you pass delivery number ,it will create invoice ,see the invoice number in vf02,vf03 transaction. and also see the data vbrk,vbrp tables
    I have done this development and i have cancelled invoice,reverse goods issue,updated the delivery and again i am createing invoice..see the below progrm to get better understanding.
    REPORT ZWM_OVERWEIGHT_FIX  no standard page heading
                               message-id zwm.
    ======================================================================
    Program Name : ZWM_OVERWEIGHT_FIX                                    *
    Description  : Tool to fix Overweight in delivery line item,         *
                   Used All Function module to cancel invoice ,          *
                   Reverse the goods issue  ,Update Delivery qty,Create  *
                   invoice                                               *
    Author       : Seshu                                                 *
    Date         : 05/08/2007                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    --|||--
    05/08/07| Seshu    | DEVK921979 | Initial                            *
    D A T A - D E C L A R A T I O N     *******************
    Tables
    Tables : vbak,
             vbap,
             vbfa,
             likp,
             lips,
             vbrk,
             vbrp.
    Internal Tables
    data : i_lips like lips occurs 0 with header line,
           i_vbap like vbap occurs 0 with header line.
    Variables
    data : v_deliv like vbfa-vbelv,
           v_invoic like vbfa-vbelv.
    Data Declaration Part for Post Goods Issue
    DATA: l_vbeln LIKE likp-vbeln,
          l_vbkok LIKE vbkok,
          i_prot LIKE prott OCCURS 0 WITH HEADER LINE,
          ef_error_any_0 TYPE c,
          ef_error_in_item_deletion_0 TYPE c,
          ef_error_in_pod_update_0 TYPE c,
          ef_error_in_interface_0 TYPE c,
          ef_error_in_goods_issue_0 TYPE c,
          ef_error_in_final_check_0 TYPE c,
          d_return   LIKE bapireturn1.
    Internal tables for BAPI Function Module
    data : i_cret like BAPIRETURN1 occurs 0 with header line,
           i_csucess like BAPIVBRKSUCcESS occurs 0 with header line,
           i_ret2 like bapiret2 ,
           flag type c,
           i_mesg like mesg occurs 0 with header line.
    Data Declaration for Invoice Creation
    DATA: VBSK_I     LIKE  VBSK.
    data: d_success  type  c.
    DATA: XKOMFK LIKE      KOMFK   OCCURS 0 WITH HEADER LINE,
          XKOMV  LIKE      KOMV    OCCURS 0 WITH HEADER LINE,
          XTHEAD LIKE      THEADVB OCCURS 0 WITH HEADER LINE,
          XVBFS  LIKE      VBFS    OCCURS 0 WITH HEADER LINE,
          XVBPA  LIKE      VBPAVB  OCCURS 0 WITH HEADER LINE,
          XVBRK  LIKE      VBRKVB  OCCURS 0 WITH HEADER LINE,
          XVBRP  LIKE      VBRPVB  OCCURS 0 WITH HEADER LINE,
          XVBSS  LIKE      VBSS    OCCURS 0 WITH HEADER LINE,
          XKOMFKGN LIKE    KOMFKGN OCCURS 0 WITH HEADER LINE.
    S E L E C T I O N  -  S C R E E N   ******************
    Selection-screen
    Selection-screen : begin of block blk with frame title text-001.
    parameters : p_vbeln like vbak-vbeln obligatory.
    selection-screen : end of block blk.
    A T -  S E L E C T I O N  - S C R E E N ***************
    Validation on Sales order
    at selection-screen on p_vbeln.
    Check the data on VBAK Table
      select single vbeln from vbak into vbak-vbeln
                                where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message e006 with p_vbeln.
      endif.
    S T A R T  - O F - S E L E C T I O N *******************
    Start-of-selection.
      break sreddy.
    Get the Invoice Number corresponding Sales Order Number
      perform get_invoice.
    Step 1.
    Cancel the Invoice  - Transaction VF11
      perform cancel_invoice.
    Reverse the goods issue
      perform reverse_goodsissue.
    Get the Order and Delivery Items
      perform get_sales_deliv.
    Delivery Change
      perform Delivery_change.
    Create Invoice document
      perform invoice_create.
    E N D  -  O F -  S E L E C T I O N  *******************
    end-of-selection.
    if flag = 'X'.
    message i012 with p_vbeln.
    endif.
    *&      Form  get_invoice
          Get Invoice Number
    FORM get_invoice.
    Clear Variables
      clear : v_deliv,
              v_invoic,
              flag.
    Get the Delivery Number First
      select single vbeln from vbfa into v_deliv
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'J'.
      if sy-subrc ne 0.
        message i004 with p_vbeln.
        stop.
      endif.
    Get the Invoice Number
      select single vbeln from vbfa into v_invoic
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'M'.
      if sy-subrc ne 0.
        message i003 with p_vbeln.
        stop.
      endif.
    ENDFORM.                    " get_invoice
    *&      Form  cancel_invoice
          Cancel the Invoice
    FORM cancel_invoice.
      clear : i_ret2,
              i_cret,
              i_csucess.
      refresh : i_cret,
                i_csucess.
      CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
        EXPORTING
          BILLINGDOCUMENT       = v_invoic
      TESTRUN               =
      NO_COMMIT             =
      BILLINGDATE           =
        TABLES
          RETURN                = i_cret
          SUCCESS               = i_csucess
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                WAIT   = space
           IMPORTING
                RETURN = i_ret2.
    read table i_cret with key type = 'E'.
      if sy-subrc ne 0.
        message i005 with v_invoic.
        stop.
      endif.
    ENDFORM.                    " cancel_invoice
    *&      Form  reverse_goodsissue
          Reverse the goods Issue
    FORM reverse_goodsissue.
    Local Variable
      data : lv_vbtyp like likp-vbtyp.
      clear : i_mesg,
              lv_vbtyp.
      refresh : i_mesg.
      select single vbtyp from likp into lv_vbtyp
                               where vbeln = v_deliv.
      CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
        EXPORTING
          I_VBELN                         = v_deliv
          I_BUDAT                         = sy-datum
        I_COUNT                         =
        I_MBLNR                         =
        I_TCODE                         =
          I_VBTYP                         = lv_vbtyp
        TABLES
          T_MESG                          = i_mesg
       EXCEPTIONS
         ERROR_REVERSE_GOODS_ISSUE       = 1
         OTHERS                          = 2
      if sy-subrc ne 0.
        message i007 with v_deliv.
      endif.
    ENDFORM.                    " reverse_goodsissue
    *&      Form  get_sales_deliv
          Get the Sales order and Deliv Items
    FORM get_sales_deliv.
    Local Variables
      data : lv_kwmeng like vbap-kwmeng.
      clear : i_lips,
              i_vbap.
      refresh : i_lips,
                i_vbap.
    Select the data from LIPS
      select * from lips into table i_lips
                         where vbeln = v_deliv.
      if sy-subrc ne 0.
        message i008 with v_deliv.
        stop.
      endif.
      sort i_lips by vbeln posnr.
      Get the Sales order Item Data.
      select * from vbap into table i_vbap
                              where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message i006 with p_vbeln.
        stop.
      endif.
      sort i_vbap by vbeln posnr.
    Compare delivery Item and Order Items
      loop at i_lips.
        clear lv_kwmeng.
        read table i_vbap with key posnr = i_lips-posnr.
        if sy-subrc eq 0.
          lv_kwmeng = i_vbap-kwmeng * 2.
          if lv_kwmeng >= i_lips-lfimg.
            i_lips-lfimg = i_vbap-kwmeng.
            modify i_lips.
          endif.
        endif.
      endloop.
    ENDFORM.                    " get_sales_deliv
    *&      Form  Delivery_change
          Delivery Update
    FORM Delivery_change.
      Clear : i_prot.
      refresh : i_prot.
    Delivery Update
      CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
           EXPORTING
                do_commit                = 'X'
           TABLES
                t_delivery_items         = i_lips
                prot                     = i_prot
           EXCEPTIONS
                conversion_overflow      = 1
                essential_data_missing   = 2
                error                    = 3
                nothing_to_update        = 4
                lock_after_update_failed = 5
                error_in_delivery_update = 6
                OTHERS                   = 7.
      COMMIT WORK.
      IF sy-subrc <> 0.
        MESSAGE i009 with v_deliv.
      endif.
    Post Goods Issue
      CLEAR:    d_return,
                i_prot,
                l_vbeln,
                l_vbkok.
      REFRESH i_prot.
      CLEAR:  ef_error_in_item_deletion_0    ,
              ef_error_in_pod_update_0       ,
              ef_error_in_interface_0        ,
              ef_error_in_goods_issue_0      ,
              ef_error_in_final_check_0      .
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    SET UPDATE TASK LOCAL.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
           EXPORTING
                vbkok_wa                    = l_vbkok
                synchron                    = 'X'
                no_messages_update          = ' '
                update_picking              = 'X'
                commit                      = 'X'
                delivery                    = l_vbeln
                nicht_sperren               = 'X'
                if_error_messages_send_0    = space
           IMPORTING
                ef_error_any_0              = ef_error_any_0
                ef_error_in_item_deletion_0 = ef_error_in_item_deletion_0
                ef_error_in_pod_update_0    = ef_error_in_pod_update_0
                ef_error_in_interface_0     = ef_error_in_interface_0
                ef_error_in_goods_issue_0   = ef_error_in_goods_issue_0
                ef_error_in_final_check_0   = ef_error_in_final_check_0
           TABLES
                prot                        = i_prot
           EXCEPTIONS
                error_message               = 1
                OTHERS                      = 2.
      if sy-subrc ne 0.
        message i010 with v_deliv.
      else.
        COMMIT WORK .
      endif.
    ENDFORM.                    " Delivery_change
    *&      Form  invoice_create
          Invoice Creation
    FORM invoice_create.
      refresh: XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS.
      clear  : XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS,
               VBSK_I.
      VBSK_I-SMART = 'F'.
      XKOMFK-VBELN =  v_deliv.
      XKOMFK-VBTYP = 'J'.
      APPEND XKOMFK.
      CALL FUNCTION 'RV_INVOICE_CREATE'
           EXPORTING
                VBSK_I       = VBSK_I
                WITH_POSTING = 'C'
           TABLES
                XKOMFK       = XKOMFK
                XKOMV        = XKOMV
                XTHEAD       = XTHEAD
                XVBFS        = XVBFS
                XVBPA        = XVBPA
                XVBRK        = XVBRK
                XVBRP        = XVBRP
                XVBSS        = XVBSS.
      if sy-subrc eq 0.
        COMMIT WORK.
       flag = 'X'.
      else.
      message i011 with p_vbeln.
      endif.
    ENDFORM.                    " invoice_create
    Reward Points if it is helpful
    Thanks
    Seshu

  • Flex with webdynpro for java using Flex Island

    Hi Friends,
    I am on Netweaver/SAP Enterprise Portal 7.0 SPstack12, I am developing UI for BI reports using VC, I am interested in developing UI using flex and want to integrate those apps with EP, I came to know flux Island supports flux with webdynpro java,  basically I am a webdynpro for java developer, I want to develop flux applications with webdynpro for java in NWDS. And i want to know how to use Flex Island with webdynpro for java. So could u please post some useful links.
    Thank in advance
    Regards
    samba

    Hi
    If you want to try out using ADOBE Flash Islands with WDJ, you would need to download SAP CE 7.1 EhP1 trial version, if not done so already.
    The following link may help you in building the WDJ component with Flash Islands..
    The specified item was not found.
    If you donot want to develop the Flex project you can download the .swf file provided by the SAP mentors:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10989ef6-968c-2b10-50a9-eb34a5267163
    Thanks.
    Chitrali

  • Creating a multi level views in webdynpro for java

    Hi,
    My requirement is i need to create a webdynpro application with 3 screens .
    first screen will be a search screen for example with first and last names fields .so when i give search criteria it will display the search results in the second screen below the first screen(search screen) and some of the fields in the result screen wil have a hyperlink so when i click on that it will display the details of that row in the details view below that results view
    in simple terms
    search screen
    results screen
    detail screen
    please let me know the way to develop this kind of application in webdynpro for java
    points will be rewarded for the helpful answer.

    Hi Bala,
                Here you have two options.
    <b>I. Display all views at one time:</b>
    Open  Navigation Modeler,
    Create  a <b>ViewSet</b> with properties column 1, rows 3.
    1. In the tool selection list, select Embed View.
    2. In the layout area of the Navigation Modeler, click on the cell of the view set in which the view is to be embedded.
    3.In the wizard, choose Embed New View and, in the next window, enter a name for the view.
    4.Use the package that you entered for the component definition or select another package by choosing Browse.
    5.Choose Finish.
    Create 3 views with names search screen,results screen and detail screen.
    Use plugs to navigate.
    <b>II. Display one view at a time:</b>
    Create a main View. Insert <b>ViewContainerUIElement</b>
    Open  Navigation Modeler.
    1. In the layout area of the Navigation Modeler, click on the cell of the <u>ViewContainerUIElement</u>.
    2.In the wizard, choose Embed New View and, in the next window, enter a name for the view.
    3.Use the package that you entered for the component definition or select another package by choosing Browse.
    4.Choose Finish.
    Create 3 views with names search screen,results screen and detail screen.
    Use plugs to navigate.
    You can use <b>visibility</b> property also as another option to show/hide the views in both of these.
    regards,
    Siva

  • How to use BAPI in webdynpro for java application

    Hi all,
    Please help in getting started with calling a BAPI in a webdynpro for java application. I have got only the content needed to call a BAPI in a webdynpro for abap application but not in java. Kindly provide me some documents if possible.
    Thanks in advance

    Hi ,
    U have Created One Bapi u want to work with web Dyn pro for java Application Right .
    U need the Following
    1) NWDS (Netweaver Devloper Studio )
    2) jdk1.4 or Above installed in your system .
    After Installation of NWDS .
    1) Just Take J2EE Enginee Details
      a) Go to Window -> preferences  -> J2ee Enginee - > give ur port number , Host name Details . and click finsh .
    Go To Web Dyn Pro Perspective Click onj2EE engine .
    Click On Refresh U will see Green Colour button .
    Now ur Ready to import Ur BAPI .
    1) Go to File -> New -> Project - > Web Dyn pro Project -.
    Give Name , pkg Name Click On Finish .
    2) Expand ur project hirarchy -> go TO Application -> Right Click -> Create Application - > Give Application name and Pkg name -> Click on Finish .
    3) Now ur View And Controller Are Created by Default .
    4) Go to Model-> Right Click on it-> Create Model -> Give Model Name & Pkg name Should diff from Application pkg the Click On Next
    a) Here u have to Two JCo Destination Name Like Model Data And Meta data & R/3 System Details like System Number , Host name  Etc -> then Click on next .
    b) Here u will text filed where u want to search for ur Required BAPI . Type ur BAPI Name Click on Search . Ur bapi will be displyed In Down . click on Next .
    c) Now Ur model is Importedint into NWDS .Map ur model data To Controller and Controller Element to View Elements .
    After ur Model .
    Go to -> Project Name -> Right Click -> go to -> Deploy New Archive .
    after wards u have to go Apllication -> Right click -> deploy and Run .
    ur output will be displyed thru Browser .
    Thats it
    Regards ,
    venkat

Maybe you are looking for

  • C#/SharePoint -View State related issue while exporting data to excel

    We have web application based on SharePoint. We have a list view to display data based on Search Criteria. We have total of around 16000 data. When we try to export all data to excel it gives an error. The cause of the issue is: View State is used to

  • Need experience on FORM Template for custom system development

    Hi, I need to use FORM BUILDER+Application Server to do development for a custom system(No relation to EBS). There are many screens need to development, and I want to make these screen look like in the same style, I need to a TMPLATE.fmb to guide dev

  • Zoom while video recording (bug) - Video flickers back and forth on playback

    Using iphone 5s iOS 7.0.2 If i zoom slowly during video recording, when playback the video, during the period i zoomed in or out, it just flickers back and forth (in and out). which ruins all the video.

  • 50 Hz interferen​ce with DSP

    I have a very sophisticated DSP package developed in LV that analyzes biomedical signals at 256 sps. In the US the code works perfectly but in Europe, with some laptops, the code does not function correctly and 50 Hz "noise" is present. There are a f

  • Seeking a keynote wiz to help me with animated presentations

    I am seeking to hire a keynote wiz to help me put together some basic presentations and even some animated ones - for promotional videos I am doing for a personal development product. i would be ready to get started immediately. does anybody know of