Dynamic Dynpro Creation using RPY_DYNPRO_INSERT

Hi there,
Did anyone of you already worked with this function and could provide me some information about the following points?
1. How do I have to fill the CONTAINERS and FIELDS_TO_CONTAINERS tables to let the Dynpro show me e.g. a text field with the text "Hello World"? (The Dynpro header works fine and I also get the Dynpro shown, but without any fields, also the Flow Logic works fine) Which fields of the appropriate structures do I have to fill in which way?
2. Due to my task I need to generate the Screen at runtime and every time it is called I need a new one. Is there a possibility to delete these Screens dynamically again? So the program does not create thousands of Screens over time.
Thank you in advance for your help.
Kind Regards,
Sebastian

Hi there,
Did anyone of you already worked with this function and could provide me some information about the following points?
1. How do I have to fill the CONTAINERS and FIELDS_TO_CONTAINERS tables to let the Dynpro show me e.g. a text field with the text "Hello World"? (The Dynpro header works fine and I also get the Dynpro shown, but without any fields, also the Flow Logic works fine) Which fields of the appropriate structures do I have to fill in which way?
2. Due to my task I need to generate the Screen at runtime and every time it is called I need a new one. Is there a possibility to delete these Screens dynamically again? So the program does not create thousands of Screens over time.
Thank you in advance for your help.
Kind Regards,
Sebastian

Similar Messages

  • Dynamic header creation using SQL

    Hi Gurus,
    I need your help again. I have a query which uses a date parameter to populate a report. The report pulls out data from the user entered date to minus eleven months. The report counts totals calls registered each month. I have the query working fine but I need help in populating the header.
    For ex - suppose I run the query on todays date (18-Jan-2012)
    The report header will be -
    Jan Feb Mar Apr ....Dec
    But I want the header to be populated in the following format -
    Jan 2012 Feb 2011 Mar 2011 Apr 2011....Dec 2011
    And for ex if I run the report for a future date say (21-May-2012)
    The header will be in the following format -
    Jan 2012....May 2012 Jun 2011 Jul 2011 .......Dec 2011.
    Please let me know if I can populate the header using SQL. Any help is greatly appreciated.

    Hi Tenacious,
    You wrote:
    I want the header to be populated in the dynamic format with the year value concanated to the Month column.My script does that; you can look one more time at the output in my first post, and also in my second post.
    And if you want another example, when we replace 18-Jan-2012 by 21-May-2012, we have the following:
    SQL> select to_char(col,'Monyyyy') col_date
      2  from
      3  (select
      4         add_months(to_date('21-May-2012','dd-Mon-yyyy'),
      5                      -level + 1) col
      6  from dual
      7  connect by level <= extract(month from to_date('21-May-2012','dd-Mon-yyyy')
      8  union
      9  select
    10         add_months(to_date('21-May-2012','dd-Mon-yyyy')
    11                    , level - 12 )
    12  from dual
    13  connect by level <= 12 - extract(month from to_date('21-May-2012','dd-Mon-y
    yyy')))
    14  order by extract(year from col) desc, extract(month from col);
    COL_DAT
    Jan2012
    Feb2012
    Mar2012
    Apr2012
    May2012
    Jun2011
    Jul2011
    Aug2011
    Sep2011
    Oct2011
    Nov2011
    COL_DAT
    Dec2011
    12 rows selected.
    SQL>

  • Dynamic Table Creation using RTTS - Question on Issue

    I am using the RTTS services to dynamically create a table.  However, when I attempt to use the get_components method it does not return all the components for all tables that I am working with.
    Cases and End Results
    1) Created structure in data dictionary – get_components works.
    2) Pass PA0001, P0001 or T001P to get_components and I do not receive the correct results.  It only returns a small subset of these objects.  The components table has all the entries; however, the get_components method only returns about 4 rows.
    Can you explain this and point me to the correct logic sequence? I would like the logic to work with all tables.
    Code excerpt below:
    The logic for the get components works for case 1, but not case 2. When I pass into this method a "Z" custom table or structure name for parameter “structure_name” and the get_components() method executes and returns the correct results. However, when I pass in any of the objects listed above in case 2, the get_components method does not return the correct number of entries. When I check typ_struct which is populated right before the get_components line, I see the correct number of components in the components table. 
    method pb_add_column_headings .
      constants: c_generic_struct type c length 19 value 'ZXX_COLUMN_HEADINGS'.
      data: cnt_lines      type sytabix,
            rf_data        type ref to data,
            typ_field      type ref to cl_abap_datadescr,
            typ_struct     type ref to cl_abap_structdescr,
            typ_table      type ref to cl_abap_tabledescr.
      data: wa_col_headings type ddobjname.
      data: rf_tbl_creation_exception type ref to 
                                      cx_sy_table_creation,
            rf_struct_creation_exception type ref to
                                      cx_sy_struct_creation.
      data: t_comp_tab type
                       cl_abap_structdescr=>component_table,
            t_comp_tab_new      like t_comp_tab,
            t_comp_tab_imported like t_comp_tab.
      field-symbols: <fs_comp> like line of t_comp_tab,
                     <fs_col_headings_tbl> type any table.
    **Get components of generic structure
      wa_col_headings = c_generic_struct.
      typ_struct ?= cl_abap_typedescr=>describe_by_name(
                                       wa_col_headings ).
      T_COMP_TAB = typ_struct->get_components( ).
    **Determine how many components in imported structure.
      typ_struct ?= cl_abap_typedescr=>describe_by_name(
                                        structure_name ).
      t_comp_tab_imported = typ_struct->get_components( ).
      cnt_lines = lines( t_comp_tab_imported[] ).

    Hi Garton,
    1. GET_COMPONENT_LIST
       Use this FM.
       It gives all fieldnames.
    2. Use this code (just copy paste)
    REPORT abc.
    DATA : cmp LIKE TABLE OF rstrucinfo WITH HEADER LINE.
    DATA : pa0001 LIKE TABLE OF pa0001 WITH HEADER LINE.
    CALL FUNCTION 'GET_COMPONENT_LIST'
      EXPORTING
        program    = sy-repid
        fieldname  = 'PA0001'
      TABLES
        components = cmp.
    LOOP AT cmp.
      WRITE :/ cmp-compname.
    ENDLOOP.
    regards,
    amit m.

  • DYNAMIC TABLE CREATION USING JSP

    I WANT TO CREATE A DATABASE TABLE IN AN INTERACTIVE WAY ie MY QUESTION IS: HOW TO CREATE A TABLE USING JSP WITH TWO ARRAYS(FIRST ARRAY CONTAINS FIELD(COLUMN) NAMES AND THE SECOND ARRAY CONTAINS ITS CORRESPONDING DATATYPE)BOTH ARRAYS ARE OF VARYING SIZE.IF THE USER ENTERS SUPPOSE '6' AS THE INPUT TO FORM A TABLE OF 6 FIELDS SO, THE QUERY SHOULD BE DYNAMICALLY FORME USING THE ARRAY NAME FOR FIELD AND THE ARRANAME FOR ITS CORRESPONDING DATATYPE.HAVE ANY IDEA ON THIS PLEASE LET ME KNOW.
    THANKS

    u need to know quite a few java technologies to make archieve your dream.
    JDBC, dynamic array and JSP.
    after reading tutorial regarding to these 3 materials, you should be able to get your job done.

  • Dynamic table creation using JDBC

    hi all, i am working in JDBC and using prepared statements.the problem i have is i need to create and read from tables,dynamically and i should also create tables with keys dynamically,i.e the user gives the table name and i should create it using JDBC.the user does not enter the full query he just types the table name.i am using oracle as backend.i have tried prepared statements to retrieve datas from tables whose names r given dynamically like
    "select * from ?"
    and then using
    setString(1,the variable which holds the table name);
    but this doesnt seem to work.it says invalid table name.how can i do this.i shd also create tables the same way like
    "create table ? ..."
    is there a way out of this problem or is there any other type of statement that i can use.please give a detailed example.thanks in advance.

    Usually when I work with Oracle DBA's they get real excited when I suggest that the application could create the tables dynamically. Because this means that there is absolutely no chance that there is a coherent implemetation of table allocation.
    Seemed like a good point to me.

  • Dynamic Tree Creation using JSP, Struts framework

    I urgently require tips/information/code snippet for creating a Dynamic Tree structure.
    Tree is the hierarchical folder structure that we see in windows operating system.
    Dynamic tree in the sense that all nodes shall be populated from database & a radio button shall be present at each node that can be selected & submitted to form.
    Tree should be done using JSP (& if required Javascript).
    I am using Struts framework .
    [email protected]

    u need to know quite a few java technologies to make archieve your dream.
    JDBC, dynamic array and JSP.
    after reading tutorial regarding to these 3 materials, you should be able to get your job done.

  • Dynamic app creation using MXML?

    I'm working on creating a small quiz application which will
    be driven by pre-formatted external XML. I have designed various
    custom question canvases for each of the question types (MCQ, short
    answer, match-pairs etc.) and I'm wondering if there is some way to
    implement the main application using MXML instead of ActionScript?
    I've managed to hard-code the order of the questions, knowing
    which canvases are needed in which order, but I need to be able to
    detect the question type from the XML (that bit I can manage) and
    then add the appropriate question canvas component in order in my
    tabNavigator.
    Essentially, I'm trying to replicate the function of a
    switch:case clause in MXML. Does anyone know if this is possible?
    I've started trying to implement it in ActionScript, but I'm a bit
    of a newbie to AS3, and I keep getting errors I don't understand,
    like "Access of undefined property" where I'm referring to an
    object I've just declared and instantiated in the previous line of
    code. E.g (anywhere I use mainPanel):
    <mx:Script>
    <![CDATA[
    import mx.controls.Text;
    import mx.containers.Canvas;
    import mx.containers.Panel;
    var mainPanel:Panel = new Panel();
    Root.addChild(mainPanel);
    mainPanel.layout = "absolute";
    mainPanel.setStyle("left", 10);
    mainPanel.setStyle("top", 10);
    mainPanel.setStyle("right", 10);
    mainPanel.setStyle("bottom", 10);
    var testPage:Canvas = new Canvas();
    var numQuestions:int = quizQns.childNodes.length;
    var qTypes:Array = new Array(numQuestions);
    var textLine:Array = new Array(numQuestions);
    ]]>
    </mx:Script>

    You can declare and initialize variables outside functions in
    your script block, but for most else you need to do it in a
    function. I would continue learning AS3 as it will give you real
    flexibility and power.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.controls.Text;
    import mx.containers.Canvas;
    import mx.containers.Panel;
    private var mainPanel:Panel;
    private var testPage:Canvas = new Canvas();
    private var numQuestions:int = 10;
    // private var numQuestions:int = quizQns.childNodes.length;
    private var qTypes:Array = new Array(numQuestions);
    private var textLine:Array = new Array(numQuestions);
    public function init():void {
    mainPanel = new Panel();
    addChild(mainPanel);
    mainPanel.layout = "absolute";
    mainPanel.setStyle("left", 10);
    mainPanel.setStyle("top", 10);
    mainPanel.setStyle("right", 10);
    mainPanel.setStyle("bottom", 10);
    ]]>
    </mx:Script>
    </mx:Application>

  • Dynamic Load Plan creation using scripting

    Hello All,
                   We have a requirement to create load plans dynamically i.e using script groovy. Idea is that we will store interface scenarios in a table and then script will read these scenarios an create dynamic load plans. Now following are my question.
                   1) Is it possible to create load plans through script ? (different blogs on net claims that you can do anything or everything whatever ODI studio can do)
                    2) Any pointer what API to use for this task ? I am very new to scripting and have zero idea about how to go about it . if possible please suggest sample script to create load plans (I can see some sample to create interface,folder etc on net.)
    Thanks in advance for your reply.
    Thanks & Regards

    ODI SDK apis allows dynamic creation of Loadplans. Oracle Fusion Middleware Java API Reference for Oracle Data Integrator
    Studio too uses these APIs for LP related operations so you should be able to do using these whatever studio allows.
    You can find SDK samples at Oracle Data Integration Sample Code

  • Simple WebService Creation using JDeveloper 11.1 Technology Preview 2

    Hi,
    I like the way JDeveloper simplifies the web service creation using the wizards and allows to test the web services from the IDE itself.
    I have the following issues when I tried the step-by-step tutorial (http://www.oracle.com/technology/obe/obe11jdev/11/ws/ws.html) to build a web service. I greatly appreciate if some one can help me with these issues. This tutorial basically provides how to create a simple hello world kind of web service using JDev. Some of the steps are failing in my case.
    Failure 1) Unable to find the WSDL document
    When I invoke the "Test Web Service" menu item HTTP Analyzer is unable to locate the dynamically generated WSDL. I did try with and with-out proxy settings both the cases it failed. However I can see the WSDL if I go to the given WSDL URL in my web browser. I suspect I am missing some thing in Jdeveloper configuration. So I had to manually save the WSDL from the browser to go to further steps.
    Failure 2) Failure in the Response message
    When I invoke the request message I am getting the following error in the response:
    "The selected message is not a SOAP message". However, if I use the browser to test the web service, it is working fine.
    I greatly appreciate if you can provide me some insight into why JDeveloper is failing in these cases.
    Thanks
    Sunil

    It started working after I restarted the JDeveloper with no proxy settings. Seems to be after changing proxy settings JDev need to be restarted to take the preference changes to be effective in this case.
    Another interesting aspect that I noticed was, when HTTP analyzer is running it dynamically sets the proxy in the preferences settings as localhost with the HTTP analyzer port.
    But anyway now I am able to run and test this webservice within the JDev itself.
    Regards
    Sunil

  • Dynamic Table Creation & Fill Up

    Hello,
    Can anyone please guide where I can find examples for dynamic table creation (programmaticaly), with dynamic number of columns and rows, used to place inside text components (or whatever) to fill them with data.
    All programmatic.
    Using JSF, ADF BC
    JDeveloper 10.1.3.1
    Thanks
    Message was edited by:
    RJundi

    Hi,
    Meybe this article helps: http://technology.amis.nl/blog/?p=2306
    Kuba

  • Does Seeburger's SFTP adapter support dynamic filename creation

    Hi all,
    Does the SFTP adapter support dynamic filename creation.
    If yes, then do we have to use UDF's and are there any specific settings that have to be done in the SFTP communication channel.
    Please provide a blog which helps in the configuration process of the above case.
    thanks,
    younus

    Dynamic Creation of File using counter in Seeburger Variable:
    1. Configuration Needed in the Communication Channel:
    The process of dynamic creation of files can be done we have to select the following checkbox in the receiver channel:
    Dynamic Attribute in receiver Channel:
    Import the following modules:
    Localejbs/Seeburger/solution/sftp
    Localejbs/Seeburger/AttribMapper
    Localejbs/ModuleProcessorExitBean
    Enter  the desired file naming convention:
    Use the Parameter GetCounter("ID") to the place where the counter is expected to come.
    2. Configuration Needed in the SeeBurger Workbench:
    If the J2EE server is listening on a port different from 50000 (which is the standard for the SAP client 000), the port number must be configured:
    Login into the seeburger workbench using the URL
    http://<localhost>:<port number>/seeburger/index.html
    Select Property Store.
    Create or edit the following property:
    Parameter
    Value
    Namespace
    http://seeburger.com/xi/SeeFunctions
    Key
    provider.servlet.server
    Value
    http://localhost:50000/ (where the port number 50000 must be set
    accordingly to the J2EE server configuration).
    Note: The configured value (server URL) has to end with a slash (/). Otherwise,
    SeeFunctions will not work correctly.
    If we need to start the counter from any specific value , it can be configured in the SeeBurger workbench, this value can be maintained in Mapping Variables :

  • Dynamic Datasource creation

    I am trying to create datasources dynamically. Using an example from a previous
    post,
    mbeanHome = lookupMBeanHome();
    JDBCDataSourceMBean dsMBean = (JDBCDataSourceMBean)mbeanHome.createAdminMBean(poolName,"JDBCDataSource",
    mbeanHome.getDomainName());
    dsMBean.setJNDIName(poolName);
    dsMBean.setPoolName(poolName);
    dsMBean.addTarget(tserverMBean);
    dsMBean.setPersistenceEnabled(false);
    How can I retrieve the proper TargetMBean reference to send to the addTarget method.
    Does anyone know where I can find an entire class example of dynamically creating
    datasources, or something similar.
    Thanks in advance,
    Fahd

    Hi Fahd,
    Here is a sample I posted here some time ago
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.Iterator;
    import java.util.Set;
    import javax.naming.Context;
    import javax.sql.DataSource;
    import weblogic.jndi.Environment;
    import weblogic.management.configuration.JDBCDataSourceMBean;
    import weblogic.management.configuration.ServerMBean;
    import weblogic.management.MBeanHome;
    * This class demonstrates dymamic creation,
    * using and deletion of DataSource via
    * Weblogic management API.
    public class DynamicDataSource {
    private Context ctx = null;
    private JDBCDataSourceMBean dsMBean = null;
    private MBeanHome mbeanHome = null;
    private ServerMBean serverMBean = null;
    // DataSource attributes
    private String cpName = "yourPoolName";
    private String dsJNDIName = "dynamic-data-source";
    private String dsName = "dynamic-data-source";
    // Security credentials
    private String password = "admPasword";
    private String serverName = "yourServer";
    private String url = "t3://localhost:7701";
    private String userName = "system";
    * Creates and starts up a DataSource using
    * management API.
    public void createDataSource() throws SQLException {
    System.out.println("Creating DataSource...");
    try {
    // Get context
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(userName);
    env.setSecurityCredentials(password);
    ctx = env.getInitialContext();
    // Lookup for MBean home
    mbeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    serverMBean = (ServerMBean)mbeanHome.getAdminMBean(serverName,
    "Server");
    // Delete if DataSource MBean already exists in active domain
    Set dsMBeanSet = mbeanHome.getMBeansByType("JDBCDataSource",
    mbeanHome.getDomainName());
    Iterator iter = dsMBeanSet.iterator();
    while(iter.hasNext()) {
    JDBCDataSourceMBean dsmb = (JDBCDataSourceMBean) iter.next();
    if (dsmb.getJNDIName().equals(dsJNDIName)) {
    dsMBean = dsmb;
    deleteDataSource();
    break;
    // Create DataSource MBean
    dsMBean = (JDBCDataSourceMBean)mbeanHome.createAdminMBean(
    dsName, "JDBCDataSource",
    mbeanHome.getDomainName());
    // Set DataSource attributes
    dsMBean.setJNDIName(dsJNDIName);
    dsMBean.setPoolName(cpName);
    // Startup datasource
    dsMBean.addTarget(serverMBean);
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    * Symply gets and closes a connection from dynamic
    * DataSource. Will throw a SQLException if datasource
    * does not exists.
    public void createConnection() throws SQLException {
    System.out.println("Getting Connection...");
    try {
    DataSource ds = (DataSource)ctx.lookup (dsName);
    Connection conn = ds.getConnection();
    conn.close();
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    * Shuts down and deletes DataSource from configuratrion
    * using management API.
    public void deleteDataSource() throws SQLException {
    System.out.println("Deleting DataSource...");
    try {
    // Remove dynamically created datasource from the server
    dsMBean.removeTarget(serverMBean);
    // Remove dynamically created datasource from the configuration
    mbeanHome.deleteMBean(dsMBean);
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    public static void main(String args[]) {
    DynamicDataSource dds = new DynamicDataSource();
    try {
    dds.createDataSource();
    dds.createConnection();
    dds.deleteDataSource();
    } catch (SQLException ex) {
    ex.printStackTrace();
    "Fahd" <[email protected]> wrote in message
    news:[email protected]...
    >
    I am trying to create datasources dynamically. Using an example from aprevious
    post,
    mbeanHome = lookupMBeanHome();
    JDBCDataSourceMBean dsMBean =(JDBCDataSourceMBean)mbeanHome.createAdminMBean(poolName,"JDBCDataSource",
    mbeanHome.getDomainName());
    dsMBean.setJNDIName(poolName);
    dsMBean.setPoolName(poolName);
    dsMBean.addTarget(tserverMBean);
    dsMBean.setPersistenceEnabled(false);
    How can I retrieve the proper TargetMBean reference to send to theaddTarget method.
    >
    >
    Does anyone know where I can find an entire class example of dynamicallycreating
    datasources, or something similar.
    Thanks in advance,
    Fahd

  • Does UCM support dynamic page creation on contributor mode.?

    Hi All,
    Does UCM support dynamic page creation on contributor mode.
    We want to create new pages and link it into the existing pages
    is that possible?
    Thanks
    ~Hari

    You can create new secondary pages in contributor mode - you would normally do this via a dynamic list fragment though technically you could also achieve it by switching region content and creating new data files. You can then use the linz wizard to link between pages.
    If you are talking about creating new primary pages and sections in your site then you would need to use something like Site Studio Manager fragment.
    Tim

  • Error in : Purchase order Creation using BAPI_PO_CREATE1

    Hell  guys,
    I am trying to create a PO using a BAPI - BAPI_PO_CREATE1
    I want the new PO to have all the characteristics of an existing PO. whose PO # is  stored in wa_order_split_create-docnr and for the new PO, i want the quantity from wa_order_split_create-qty_acptd and the delivery data to be wa_order_split_create-dly_date. But this process and code below gives a short dump in the std FM - MEPO_DOC_ITEM_GET . It raises an exception of failure. I am trying to create many new PO's in the loop below. If there is just one row, sometimes, it creates the PO even with the exception failure ( which is pretty weird).
    Am i making any mistake while filling the header or item or schedule lines for the BAPI_PO_CREATE1 ? Any tips or clues why I am getting a dump ?
    DATA: i_insert,
            i_create_order,
            i_cycle     TYPE cycle,
            i_qty_acpt  TYPE dzmeng,
            i_dly_date  TYPE vbak-vdatu,
            i_item      TYPE roijnomiio .
      DATA: i_order TYPE symsgv,
            i_return TYPE swd_return .
      DATA: i_vbak      TYPE vbak,
            i_vbap      TYPE vbap,
            i_ekko      TYPE ekko,
            i_ekpo      TYPE ekpo,
            i_bsoh      TYPE bapisdhd1,
            i_bsohx     TYPE bapisdhd1x,
            i_bpoh      TYPE bapimepoheader,
            i_bpohx     TYPE bapimepoheaderx,
            i_vbeln     TYPE vbeln_va,
            i_posnr     TYPE posnr_va,
            i_contr     TYPE vbeln_va,
            i_conit     TYPE posnr_va,
            i_ebeln     TYPE ebeln,
            i_ebelp     TYPE ebelp,
            i_pargr     TYPE pargr,
            i_thead     TYPE thead,
            i_line      TYPE tline,
            i_note      TYPE txw_note,
            i_new_vbeln TYPE vbeln_va,
            i_new_ebeln TYPE ebeln,
            i_wa_bsoi   TYPE bapisditm,
            i_wa_bsoix  TYPE bapisditmx,
            i_wa_bsop   TYPE bapiparnr,
            i_wa_bsos   TYPE bapischdl,
            i_wa_bsosx  TYPE bapischdlx,
            i_wa_vbpa   TYPE vbpa,
            i_wa_vbkd   TYPE vbkd,
            i_wa_bpoi   TYPE bapimepoitem,
            i_wa_bpoix  TYPE bapimepoitemx,
            i_wa_bpos   TYPE bapimeposchedule,
            i_wa_bposx  TYPE bapimeposchedulx,
            i_wa_bpop   TYPE bapiekkop,
            i_wa_ekpa   TYPE ekpa,
            i_message   TYPE char72,
            i_bapiretn  TYPE bapiret2,
            i_bapiret2  TYPE TABLE OF bapiret2 INITIAL SIZE 1,
            i_vbpa      TYPE TABLE OF vbpa INITIAL SIZE 1,
            i_vbkd      TYPE TABLE OF vbkd INITIAL SIZE 1,
            i_ekpa      TYPE TABLE OF ekpa INITIAL SIZE 1,
            i_bsoi      TYPE TABLE OF bapisditm INITIAL SIZE 1,
            i_bsoix     TYPE TABLE OF bapisditmx INITIAL SIZE 1,
            i_bsos      TYPE TABLE OF bapischdl INITIAL SIZE 1,
            i_bsosx     TYPE TABLE OF bapischdlx INITIAL SIZE 1,
            i_bsop      TYPE TABLE OF bapiparnr INITIAL SIZE 1,
            i_bpoi      TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
            i_bpoix     TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
            i_bpos      TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
            i_bposx     TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
            i_bpop      TYPE TABLE OF bapiekkop INITIAL SIZE 1,
            i_text_tab  TYPE TABLE OF tline INITIAL SIZE 1,
            i_line_tab  TYPE TABLE OF tline INITIAL SIZE 1,
            i_txw_note  TYPE TABLE OF txw_note INITIAL SIZE 1,
            i_oij_el_doc_mot TYPE oij_el_doc_mot .
      CONSTANTS: c_char_c VALUE 'C',
                 c_char_e VALUE 'E',
                 c_char_p VALUE 'P',
                 c_char_g VALUE 'G',
                 c_char_i VALUE 'I',
                 c_char_s VALUE 'S',
                 c_char_x VALUE 'X',
                 c_zsw(3) VALUE 'ZSW',
                 c_nomit_stat(4) VALUE 'ZDNY' .
      DATA : lv_nomtk_split        TYPE oij_nomtk.
      DATA : i_order_split_create  TYPE TABLE OF zsws_order_split.
      DATA : wa_order_split_create TYPE zsws_order_split.
      LOOP AT i_order_split_create INTO wa_order_split_create.
        IF NOT i_create_order IS INITIAL .
          CLEAR: i_create_order .
              MOVE: wa_order_split_create-docnr  TO i_ebeln,
                    wa_order_split_create-docitm TO i_ebelp .
              CALL FUNCTION 'ME_EKKO_SINGLE_READ'
                   EXPORTING
                        pi_ebeln         = i_ebeln
                   IMPORTING
                        po_ekko          = i_ekko
                   EXCEPTIONS
                        no_records_found = 1
                        OTHERS           = 2.
              IF sy-subrc <> 0 .
              ENDIF .
    * Fill PO Header
              i_bpoh-comp_code   = i_ekko-bukrs .
              i_bpoh-doc_type    = i_ekko-bsart .
              i_bpoh-vendor      = i_ekko-lifnr .
              i_bpoh-langu       = i_ekko-spras .
              i_bpoh-pmnttrms    = i_ekko-zterm .
              i_bpoh-purch_org   = i_ekko-ekorg .
              i_bpoh-pur_group   = i_ekko-ekgrp .
              i_bpoh-currency    = i_ekko-waers .
              i_bpoh-agreement   = i_ekko-konnr .
              i_bpoh-incoterms1  = i_ekko-inco1 .
              i_bpoh-incoterms2  = i_ekko-inco2 .
    * Fill PO update indicator 'X'
              i_bpohx-comp_code  = c_char_x .
              i_bpohx-doc_type   = c_char_x .
              i_bpohx-vendor     = c_char_x .
              i_bpohx-langu      = c_char_x .
              i_bpohx-pmnttrms   = c_char_x .
              i_bpohx-purch_org  = c_char_x .
              i_bpohx-pur_group  = c_char_x .
              i_bpohx-currency   = c_char_x .
              i_bpohx-agreement  = c_char_x .
              i_bpohx-incoterms1 = c_char_x .
              i_bpohx-incoterms2 = c_char_x .
              CALL FUNCTION 'ME_EKPO_SINGLE_READ'
                   EXPORTING
                        pi_ebeln         = i_ebeln
                        pi_ebelp         = i_ebelp
                   IMPORTING
                        po_ekpo          = i_ekpo
                   EXCEPTIONS
                        no_records_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 .
    * Fill PO Item
              i_wa_bpoi-po_item    = i_ekpo-ebelp .
              i_wa_bpoi-material   = i_ekpo-matnr .
              i_wa_bpoi-plant      = i_ekpo-werks .
              i_wa_bpoi-stge_loc   = i_ekpo-lgort .
              i_wa_bpoi-quantity   = wa_order_split_create-qty_acptd .
              i_wa_bpoi-po_unit    = i_ekpo-meins .
              i_wa_bpoi-tax_code   = i_ekpo-mwskz .
              i_wa_bpoi-val_type   = i_ekpo-bwtar .
              i_wa_bpoi-item_cat   = i_ekpo-pstyp .
              i_wa_bpoi-acctasscat = i_ekpo-knttp .
              i_wa_bpoi-agreement  = i_ekpo-konnr .
              i_wa_bpoi-agmt_item  = i_ekpo-ktpnr .
              APPEND i_wa_bpoi TO i_bpoi .
    * Fill PO Item update indicator 'X'
              i_wa_bpoix-po_item    = i_ekpo-ebelp .
              i_wa_bpoix-po_itemx   = c_char_x .
              i_wa_bpoix-material   = c_char_x .
              i_wa_bpoix-plant      = c_char_x .
              i_wa_bpoix-stge_loc   = c_char_x .
              i_wa_bpoix-quantity   = c_char_x .
              i_wa_bpoix-po_unit    = c_char_x .
              i_wa_bpoix-tax_code   = c_char_x .
              i_wa_bpoix-val_type   = c_char_x .
              i_wa_bpoix-item_cat   = c_char_x .
              i_wa_bpoix-acctasscat = c_char_x .
              i_wa_bpoix-agreement  = c_char_x .
              i_wa_bpoix-agmt_item  = c_char_x .
              APPEND i_wa_bpoix TO i_bpoix .
    * Fill PO Item Schedule
              i_wa_bpos-po_item       = i_ekpo-ebelp .
              i_wa_bpos-sched_line    = '0001' .
              i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
              i_wa_bpos-quantity      = wa_order_split_create-qty_acptd .
              APPEND i_wa_bpos TO i_bpos .
    * Fill PO Item schedule update indicator 'X'
              i_wa_bposx-po_item       = i_ekpo-ebelp .
              i_wa_bposx-sched_line    = '0001' .
              i_wa_bposx-delivery_date = c_char_x .
              i_wa_bposx-quantity      = c_char_x .
              APPEND i_wa_bposx TO i_bposx .
              CLEAR: i_pargr .
              SELECT SINGLE pargr
                INTO i_pargr
                FROM t161
               WHERE bstyp = i_ekko-bstyp
                 AND bsart = i_ekko-bsart .
              CLEAR i_ekpa[].
              CALL FUNCTION 'MM_READ_PARTNERS'
                   EXPORTING
                        application = c_char_p
                        ebeln       = i_ebeln
                        bstyp       = i_ekko-bstyp
                        pargr       = i_pargr
                   TABLES
                        x_ekpa      = i_ekpa[].
              LOOP AT i_ekpa INTO i_wa_ekpa .
                i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
                i_wa_bpop-langu = sy-langu .
                IF NOT i_wa_ekpa-lifn2 IS INITIAL .
                  i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
                ELSE .
                  i_wa_bpop-buspartno = i_wa_ekpa-parnr .
                ENDIF .
                APPEND i_wa_bpop TO i_bpop .
                CLEAR: i_wa_ekpa, i_wa_bpop .
              ENDLOOP .
              CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
              CALL FUNCTION 'BAPI_PO_CREATE1'
                   EXPORTING
                        poheader         = i_bpoh
                        poheaderx        = i_bpohx
                   IMPORTING
                        exppurchaseorder = i_new_ebeln
                   TABLES
                        return           = i_bapiret2
                        poitem           = i_bpoi[]
                        poitemx          = i_bpoix[]
                        poschedule       = i_bpos[]
                        poschedulex      = i_bposx[].
              i_order = i_new_ebeln .
              SHIFT i_order LEFT DELETING LEADING '0' .
              i_return-errortype = c_char_i .
              i_return-workarea  = c_zsw .
              i_return-message   = '064' .
              i_return-variable1 = i_order .
            loop at i_bapiret2 into i_bapiretn where type ca 'EAX' .
            append i_bapiretn to t_bapi_return .
          endloop .
          if t_bapi_return[] is initial .
             i_create_order = c_char_x .
               CALL FUNCTION 'SWD_POPUP_MESSAGE_SEND'
                   EXPORTING
                        act_return = i_return. "Popup with new PO no.
          ENDCASE .                                     " Docind
        ENDIF .
      ENDLOOP.

    Hi Shareen,
    I think in the following parts of the code,
              CALL FUNCTION 'MM_READ_PARTNERS'
                   EXPORTING
                        application = c_char_p
                        ebeln       = i_ebeln
                        bstyp       = i_ekko-bstyp
                        pargr       = i_pargr
                   TABLES
                        x_ekpa      = i_ekpa[].
    Error in : Purchase order Creation using BAPI_PO_CREATE1
    Posted: Mar 20, 2006 7:39 PM      Reply      E-mail this post 
    Hell guys,
    I am trying to create a PO using a BAPI - BAPI_PO_CREATE1
    I want the new PO to have all the characteristics of an existing PO. whose PO # is stored in wa_order_split_create-docnr and for the new PO, i want the quantity from wa_order_split_create-qty_acptd and the delivery data to be wa_order_split_create-dly_date. But this process and code below gives a short dump in the std FM - MEPO_DOC_ITEM_GET . It raises an exception of failure. I am trying to create many new PO's in the loop below. If there is just one row, sometimes, it creates the PO even with the exception failure ( which is pretty weird).
    Am i making any mistake while filling the header or item or schedule lines for the BAPI_PO_CREATE1 ? Any tips or clues why I am getting a dump ?
    DATA: i_insert,
            i_create_order,
            i_cycle     TYPE cycle,
            i_qty_acpt  TYPE dzmeng,
            i_dly_date  TYPE vbak-vdatu,
            i_item      TYPE roijnomiio .
      DATA: i_order TYPE symsgv,
            i_return TYPE swd_return .
      DATA: i_vbak      TYPE vbak,
            i_vbap      TYPE vbap,
            i_ekko      TYPE ekko,
            i_ekpo      TYPE ekpo,
            i_bsoh      TYPE bapisdhd1,
            i_bsohx     TYPE bapisdhd1x,
            i_bpoh      TYPE bapimepoheader,
            i_bpohx     TYPE bapimepoheaderx,
            i_vbeln     TYPE vbeln_va,
            i_posnr     TYPE posnr_va,
            i_contr     TYPE vbeln_va,
            i_conit     TYPE posnr_va,
            i_ebeln     TYPE ebeln,
            i_ebelp     TYPE ebelp,
            i_pargr     TYPE pargr,
            i_thead     TYPE thead,
            i_line      TYPE tline,
            i_note      TYPE txw_note,
            i_new_vbeln TYPE vbeln_va,
            i_new_ebeln TYPE ebeln,
            i_wa_bsoi   TYPE bapisditm,
            i_wa_bsoix  TYPE bapisditmx,
            i_wa_bsop   TYPE bapiparnr,
            i_wa_bsos   TYPE bapischdl,
            i_wa_bsosx  TYPE bapischdlx,
            i_wa_vbpa   TYPE vbpa,
            i_wa_vbkd   TYPE vbkd,
            i_wa_bpoi   TYPE bapimepoitem,
            i_wa_bpoix  TYPE bapimepoitemx,
            i_wa_bpos   TYPE bapimeposchedule,
            i_wa_bposx  TYPE bapimeposchedulx,
            i_wa_bpop   TYPE bapiekkop,
            i_wa_ekpa   TYPE ekpa,
            i_message   TYPE char72,
            i_bapiretn  TYPE bapiret2,
            i_bapiret2  TYPE TABLE OF bapiret2 INITIAL SIZE 1,
            i_vbpa      TYPE TABLE OF vbpa INITIAL SIZE 1,
            i_vbkd      TYPE TABLE OF vbkd INITIAL SIZE 1,
            i_ekpa      TYPE TABLE OF ekpa INITIAL SIZE 1,
            i_bsoi      TYPE TABLE OF bapisditm INITIAL SIZE 1,
            i_bsoix     TYPE TABLE OF bapisditmx INITIAL SIZE 1,
            i_bsos      TYPE TABLE OF bapischdl INITIAL SIZE 1,
            i_bsosx     TYPE TABLE OF bapischdlx INITIAL SIZE 1,
            i_bsop      TYPE TABLE OF bapiparnr INITIAL SIZE 1,
            i_bpoi      TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
            i_bpoix     TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
            i_bpos      TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
            i_bposx     TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
            i_bpop      TYPE TABLE OF bapiekkop INITIAL SIZE 1,
            i_text_tab  TYPE TABLE OF tline INITIAL SIZE 1,
            i_line_tab  TYPE TABLE OF tline INITIAL SIZE 1,
            i_txw_note  TYPE TABLE OF txw_note INITIAL SIZE 1,
            i_oij_el_doc_mot TYPE oij_el_doc_mot .
      CONSTANTS: c_char_c VALUE 'C',
                 c_char_e VALUE 'E',
                 c_char_p VALUE 'P',
                 c_char_g VALUE 'G',
                 c_char_i VALUE 'I',
                 c_char_s VALUE 'S',
                 c_char_x VALUE 'X',
                 c_zsw(3) VALUE 'ZSW',
                 c_nomit_stat(4) VALUE 'ZDNY' .
      DATA : lv_nomtk_split        TYPE oij_nomtk.
      DATA : i_order_split_create  TYPE TABLE OF zsws_order_split.
      DATA : wa_order_split_create TYPE zsws_order_split.
      LOOP AT i_order_split_create INTO wa_order_split_create.
        IF NOT i_create_order IS INITIAL .
          CLEAR: i_create_order .
              MOVE: wa_order_split_create-docnr  TO i_ebeln,
                    wa_order_split_create-docitm TO i_ebelp .
              CALL FUNCTION 'ME_EKKO_SINGLE_READ'
                   EXPORTING
                        pi_ebeln         = i_ebeln
                   IMPORTING
                        po_ekko          = i_ekko
                   EXCEPTIONS
                        no_records_found = 1
                        OTHERS           = 2.
              IF sy-subrc <> 0 .
              ENDIF .
    Fill PO Header
              i_bpoh-comp_code   = i_ekko-bukrs .
              i_bpoh-doc_type    = i_ekko-bsart .
              i_bpoh-vendor      = i_ekko-lifnr .
              i_bpoh-langu       = i_ekko-spras .
              i_bpoh-pmnttrms    = i_ekko-zterm .
              i_bpoh-purch_org   = i_ekko-ekorg .
              i_bpoh-pur_group   = i_ekko-ekgrp .
              i_bpoh-currency    = i_ekko-waers .
              i_bpoh-agreement   = i_ekko-konnr .
              i_bpoh-incoterms1  = i_ekko-inco1 .
              i_bpoh-incoterms2  = i_ekko-inco2 .
    Fill PO update indicator 'X'
              i_bpohx-comp_code  = c_char_x .
              i_bpohx-doc_type   = c_char_x .
              i_bpohx-vendor     = c_char_x .
              i_bpohx-langu      = c_char_x .
              i_bpohx-pmnttrms   = c_char_x .
              i_bpohx-purch_org  = c_char_x .
              i_bpohx-pur_group  = c_char_x .
              i_bpohx-currency   = c_char_x .
              i_bpohx-agreement  = c_char_x .
              i_bpohx-incoterms1 = c_char_x .
              i_bpohx-incoterms2 = c_char_x .
              CALL FUNCTION 'ME_EKPO_SINGLE_READ'
                   EXPORTING
                        pi_ebeln         = i_ebeln
                        pi_ebelp         = i_ebelp
                   IMPORTING
                        po_ekpo          = i_ekpo
                   EXCEPTIONS
                        no_records_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 .
    Fill PO Item
              i_wa_bpoi-po_item    = i_ekpo-ebelp .
              i_wa_bpoi-material   = i_ekpo-matnr .
              i_wa_bpoi-plant      = i_ekpo-werks .
              i_wa_bpoi-stge_loc   = i_ekpo-lgort .
              i_wa_bpoi-quantity   = wa_order_split_create-qty_acptd .
              i_wa_bpoi-po_unit    = i_ekpo-meins .
              i_wa_bpoi-tax_code   = i_ekpo-mwskz .
              i_wa_bpoi-val_type   = i_ekpo-bwtar .
              i_wa_bpoi-item_cat   = i_ekpo-pstyp .
              i_wa_bpoi-acctasscat = i_ekpo-knttp .
              i_wa_bpoi-agreement  = i_ekpo-konnr .
              i_wa_bpoi-agmt_item  = i_ekpo-ktpnr .
              APPEND i_wa_bpoi TO i_bpoi .
    Fill PO Item update indicator 'X'
              i_wa_bpoix-po_item    = i_ekpo-ebelp .
              i_wa_bpoix-po_itemx   = c_char_x .
              i_wa_bpoix-material   = c_char_x .
              i_wa_bpoix-plant      = c_char_x .
              i_wa_bpoix-stge_loc   = c_char_x .
              i_wa_bpoix-quantity   = c_char_x .
              i_wa_bpoix-po_unit    = c_char_x .
              i_wa_bpoix-tax_code   = c_char_x .
              i_wa_bpoix-val_type   = c_char_x .
              i_wa_bpoix-item_cat   = c_char_x .
              i_wa_bpoix-acctasscat = c_char_x .
              i_wa_bpoix-agreement  = c_char_x .
              i_wa_bpoix-agmt_item  = c_char_x .
              APPEND i_wa_bpoix TO i_bpoix .
    Fill PO Item Schedule
              i_wa_bpos-po_item       = i_ekpo-ebelp .
              i_wa_bpos-sched_line    = '0001' .
              i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
              i_wa_bpos-quantity      = wa_order_split_create-qty_acptd .
              APPEND i_wa_bpos TO i_bpos .
    Fill PO Item schedule update indicator 'X'
              i_wa_bposx-po_item       = i_ekpo-ebelp .
              i_wa_bposx-sched_line    = '0001' .
              i_wa_bposx-delivery_date = c_char_x .
              i_wa_bposx-quantity      = c_char_x .
              APPEND i_wa_bposx TO i_bposx .
              CLEAR: i_pargr .
              SELECT SINGLE pargr
                INTO i_pargr
                FROM t161
               WHERE bstyp = i_ekko-bstyp
                 AND bsart = i_ekko-bsart .
              CLEAR i_ekpa[].
              CALL FUNCTION 'MM_READ_PARTNERS'
                   EXPORTING
                        application = c_char_p
                        ebeln       = i_ebeln
                        bstyp       = i_ekko-bstyp
                        pargr       = i_pargr
                   TABLES
                        x_ekpa      = <b>i_ekpa[].</b>
              LOOP AT i_ekpa INTO i_wa_ekpa .
                i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
                i_wa_bpop-langu = sy-langu .
                IF NOT i_wa_ekpa-lifn2 IS INITIAL .
                  i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
                ELSE .
                  i_wa_bpop-buspartno = i_wa_ekpa-parnr .
                ENDIF .
                APPEND i_wa_bpop TO i_bpop .
                CLEAR: i_wa_ekpa, i_wa_bpop .
              ENDLOOP .
              CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
              CALL FUNCTION 'BAPI_PO_CREATE1'
                   EXPORTING
                        poheader         = i_bpoh
                        poheaderx        = i_bpohx
                   IMPORTING
                        exppurchaseorder = i_new_ebeln
                   TABLES
                        return           = i_bapiret2
                    <b>    poitem           = i_bpoi[]
                        poitemx          = i_bpoix[]
                        poschedule       = i_bpos[]
                        poschedulex      = i_bposx[].</b>
    it should be only i_bpoi, i_bpoix, i_bpos, i_bposx but not  i_bpoi[], i_bpoix[], i_bpos[], i_bposx[].
    CHange the code as follows:
    DATA: i_insert,
            i_create_order,
            i_cycle     TYPE cycle,
            i_qty_acpt  TYPE dzmeng,
            i_dly_date  TYPE vbak-vdatu,
            i_item      TYPE roijnomiio .
      DATA: i_order TYPE symsgv,
            i_return TYPE swd_return .
      DATA: i_vbak      TYPE vbak,
            i_vbap      TYPE vbap,
            i_ekko      TYPE ekko,
            i_ekpo      TYPE ekpo,
            i_bsoh      TYPE bapisdhd1,
            i_bsohx     TYPE bapisdhd1x,
            i_bpoh      TYPE bapimepoheader,
            i_bpohx     TYPE bapimepoheaderx,
            i_vbeln     TYPE vbeln_va,
            i_posnr     TYPE posnr_va,
            i_contr     TYPE vbeln_va,
            i_conit     TYPE posnr_va,
            i_ebeln     TYPE ebeln,
            i_ebelp     TYPE ebelp,
            i_pargr     TYPE pargr,
            i_thead     TYPE thead,
            i_line      TYPE tline,
            i_note      TYPE txw_note,
            i_new_vbeln TYPE vbeln_va,
            i_new_ebeln TYPE ebeln,
            i_wa_bsoi   TYPE bapisditm,
            i_wa_bsoix  TYPE bapisditmx,
            i_wa_bsop   TYPE bapiparnr,
            i_wa_bsos   TYPE bapischdl,
            i_wa_bsosx  TYPE bapischdlx,
            i_wa_vbpa   TYPE vbpa,
            i_wa_vbkd   TYPE vbkd,
            i_wa_bpoi   TYPE bapimepoitem,
            i_wa_bpoix  TYPE bapimepoitemx,
            i_wa_bpos   TYPE bapimeposchedule,
            i_wa_bposx  TYPE bapimeposchedulx,
            i_wa_bpop   TYPE bapiekkop,
            i_wa_ekpa   TYPE ekpa,
            i_message   TYPE char72,
            i_bapiretn  TYPE bapiret2,
            i_bapiret2  TYPE TABLE OF bapiret2 INITIAL SIZE 1,
            i_vbpa      TYPE TABLE OF vbpa INITIAL SIZE 1,
            i_vbkd      TYPE TABLE OF vbkd INITIAL SIZE 1,
            i_ekpa      TYPE TABLE OF ekpa INITIAL SIZE 1,
            i_bsoi      TYPE TABLE OF bapisditm INITIAL SIZE 1,
            i_bsoix     TYPE TABLE OF bapisditmx INITIAL SIZE 1,
            i_bsos      TYPE TABLE OF bapischdl INITIAL SIZE 1,
            i_bsosx     TYPE TABLE OF bapischdlx INITIAL SIZE 1,
            i_bsop      TYPE TABLE OF bapiparnr INITIAL SIZE 1,
            i_bpoi      TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
            i_bpoix     TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
            i_bpos      TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
            i_bposx     TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
            i_bpop      TYPE TABLE OF bapiekkop INITIAL SIZE 1,
            i_text_tab  TYPE TABLE OF tline INITIAL SIZE 1,
            i_line_tab  TYPE TABLE OF tline INITIAL SIZE 1,
            i_txw_note  TYPE TABLE OF txw_note INITIAL SIZE 1,
            i_oij_el_doc_mot TYPE oij_el_doc_mot .
      CONSTANTS: c_char_c VALUE 'C',
                 c_char_e VALUE 'E',
                 c_char_p VALUE 'P',
                 c_char_g VALUE 'G',
                 c_char_i VALUE 'I',
                 c_char_s VALUE 'S',
                 c_char_x VALUE 'X',
                 c_zsw(3) VALUE 'ZSW',
                 c_nomit_stat(4) VALUE 'ZDNY' .
      DATA : lv_nomtk_split        TYPE oij_nomtk.
      DATA : i_order_split_create  TYPE TABLE OF zsws_order_split.
      DATA : wa_order_split_create TYPE zsws_order_split.
      LOOP AT i_order_split_create INTO wa_order_split_create.
        IF NOT i_create_order IS INITIAL .
          CLEAR: i_create_order .
              MOVE: wa_order_split_create-docnr  TO i_ebeln,
                    wa_order_split_create-docitm TO i_ebelp .
              CALL FUNCTION 'ME_EKKO_SINGLE_READ'
                   EXPORTING
                        pi_ebeln         = i_ebeln
                   IMPORTING
                        po_ekko          = i_ekko
                   EXCEPTIONS
                        no_records_found = 1
                        OTHERS           = 2.
              IF sy-subrc <> 0 .
              ENDIF .
    Fill PO Header
              i_bpoh-comp_code   = i_ekko-bukrs .
              i_bpoh-doc_type    = i_ekko-bsart .
              i_bpoh-vendor      = i_ekko-lifnr .
              i_bpoh-langu       = i_ekko-spras .
              i_bpoh-pmnttrms    = i_ekko-zterm .
              i_bpoh-purch_org   = i_ekko-ekorg .
              i_bpoh-pur_group   = i_ekko-ekgrp .
              i_bpoh-currency    = i_ekko-waers .
              i_bpoh-agreement   = i_ekko-konnr .
              i_bpoh-incoterms1  = i_ekko-inco1 .
              i_bpoh-incoterms2  = i_ekko-inco2 .
    Fill PO update indicator 'X'
              i_bpohx-comp_code  = c_char_x .
              i_bpohx-doc_type   = c_char_x .
              i_bpohx-vendor     = c_char_x .
              i_bpohx-langu      = c_char_x .
              i_bpohx-pmnttrms   = c_char_x .
              i_bpohx-purch_org  = c_char_x .
              i_bpohx-pur_group  = c_char_x .
              i_bpohx-currency   = c_char_x .
              i_bpohx-agreement  = c_char_x .
              i_bpohx-incoterms1 = c_char_x .
              i_bpohx-incoterms2 = c_char_x .
              CALL FUNCTION 'ME_EKPO_SINGLE_READ'
                   EXPORTING
                        pi_ebeln         = i_ebeln
                        pi_ebelp         = i_ebelp
                   IMPORTING
                        po_ekpo          = i_ekpo
                   EXCEPTIONS
                        no_records_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 .
    Fill PO Item
              i_wa_bpoi-po_item    = i_ekpo-ebelp .
              i_wa_bpoi-material   = i_ekpo-matnr .
              i_wa_bpoi-plant      = i_ekpo-werks .
              i_wa_bpoi-stge_loc   = i_ekpo-lgort .
              i_wa_bpoi-quantity   = wa_order_split_create-qty_acptd .
              i_wa_bpoi-po_unit    = i_ekpo-meins .
              i_wa_bpoi-tax_code   = i_ekpo-mwskz .
              i_wa_bpoi-val_type   = i_ekpo-bwtar .
              i_wa_bpoi-item_cat   = i_ekpo-pstyp .
              i_wa_bpoi-acctasscat = i_ekpo-knttp .
              i_wa_bpoi-agreement  = i_ekpo-konnr .
              i_wa_bpoi-agmt_item  = i_ekpo-ktpnr .
              APPEND i_wa_bpoi TO i_bpoi .
    Fill PO Item update indicator 'X'
              i_wa_bpoix-po_item    = i_ekpo-ebelp .
              i_wa_bpoix-po_itemx   = c_char_x .
              i_wa_bpoix-material   = c_char_x .
              i_wa_bpoix-plant      = c_char_x .
              i_wa_bpoix-stge_loc   = c_char_x .
              i_wa_bpoix-quantity   = c_char_x .
              i_wa_bpoix-po_unit    = c_char_x .
              i_wa_bpoix-tax_code   = c_char_x .
              i_wa_bpoix-val_type   = c_char_x .
              i_wa_bpoix-item_cat   = c_char_x .
              i_wa_bpoix-acctasscat = c_char_x .
              i_wa_bpoix-agreement  = c_char_x .
              i_wa_bpoix-agmt_item  = c_char_x .
              APPEND i_wa_bpoix TO i_bpoix .
    Fill PO Item Schedule
              i_wa_bpos-po_item       = i_ekpo-ebelp .
              i_wa_bpos-sched_line    = '0001' .
              i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
              i_wa_bpos-quantity      = wa_order_split_create-qty_acptd .
              APPEND i_wa_bpos TO i_bpos .
    Fill PO Item schedule update indicator 'X'
              i_wa_bposx-po_item       = i_ekpo-ebelp .
              i_wa_bposx-sched_line    = '0001' .
              i_wa_bposx-delivery_date = c_char_x .
              i_wa_bposx-quantity      = c_char_x .
              APPEND i_wa_bposx TO i_bposx .
              CLEAR: i_pargr .
              SELECT SINGLE pargr
                INTO i_pargr
                FROM t161
               WHERE bstyp = i_ekko-bstyp
                 AND bsart = i_ekko-bsart .
              CLEAR i_ekpa[].
              CALL FUNCTION 'MM_READ_PARTNERS'
                   EXPORTING
                        application = c_char_p
                        ebeln       = i_ebeln
                        bstyp       = i_ekko-bstyp
                        pargr       = i_pargr
                   TABLES
                        x_ekpa      = i_ekpa.
              LOOP AT i_ekpa INTO i_wa_ekpa .
                i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
                i_wa_bpop-langu = sy-langu .
                IF NOT i_wa_ekpa-lifn2 IS INITIAL .
                  i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
                ELSE .
                  i_wa_bpop-buspartno = i_wa_ekpa-parnr .
                ENDIF .
                APPEND i_wa_bpop TO i_bpop .
                CLEAR: i_wa_ekpa, i_wa_bpop .
              ENDLOOP .
              CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
              CALL FUNCTION 'BAPI_PO_CREATE1'
                   EXPORTING
                        poheader         = i_bpoh
                        poheaderx        = i_bpohx
                   IMPORTING
                        exppurchaseorder = i_new_ebeln
                   TABLES
                        return           = i_bapiret2
                        poitem           = i_bpoi
                        poitemx          = i_bpoix
                        poschedule       = i_bpos
                        poschedulex      = i_bposx.
              i_order = i_new_ebeln .
              SHIFT i_order LEFT DELETING LEADING '0' .
              i_return-errortype = c_char_i .
              i_return-workarea  = c_zsw .
              i_return-message   = '064' .
              i_return-variable1 = i_order .
            loop at i_bapiret2 into i_bapiretn where type ca 'EAX' .
            append i_bapiretn to t_bapi_return .
          endloop .
          if t_bapi_return[] is initial .
             i_create_order = c_char_x .
               CALL FUNCTION 'SWD_POPUP_MESSAGE_SEND'
                   EXPORTING
                        act_return = i_return. "Popup with new PO no.
          ENDCASE .                                     " Docind
        ENDIF .
      ENDLOOP.

  • Execute Dynamic SQL statement using procedure builder

    i want to execute a dynamic SQL statment using procedure builder not using forms
    because my statement depending on a variable table name
    i know that i can do that from forms using
    FORMS_DDL('SQL_STAT');
    but i wanna to use the procedure builder
    which function i should use and how?
    please explain in example if you don't mind.
    thanks

    Hi,
    You can very well use DBMS_SQL Package supplied by Oracle for doing this.
    Search for DBMS_SQL in OTN. You will get all info regarding this.
    Regards.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by itslul:
    i want to execute a dynamic SQL statment using procedure builder not using forms
    because my statement depending on a variable table name
    i know that i can do that from forms using
    FORMS_DDL('SQL_STAT');
    but i wanna to use the procedure builder
    which function i should use and how?
    please explain in example if you don't mind.
    thanks<HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • No data in cube

    Hi, I create a mapping for cube, debugging shows that everything works well, and the loading data process also works, but at last there's no data in the cube. Could some one tell me what can be the problem? Thanks very much. And also, does warehouse

  • I'm able to connect via wifi but not via ethernet

    I have a iMac, Mac OS X v10.7.5, and recently had a problem connecting to internet.  I can connect via wifi, but when I try connecting via ethernet it's not working.  When I go to the preferences > network, it shows "green" / connected for ethernet b

  • Do I have a faulty Floppy drive? Also question on MB Driver uninstall

    First my problem. My floppy drive isnt recognizing any disc that I put in there. If there's a file on the disc it'll just make a clicking noise like its accessing while the system hangs, or if Im trying to format a new disc it'll say a disc couldnt b

  • After importing the transport request status is not changing to imported

    Hi Experts, I have added the data & cofiles from rollout system to sandbox system via sftp on os level. Now when I am trying to import these requests, the requests are not getting imported. Can any one tell me the reason? In tp system log, I found th

  • F4140 Pringting blank page from web pages & pdf

    My F4140 is working and printing but is printing blank pages when I try to print from a PDF.  I just tried to print a word document and it only printed the black and white section and left the color sections blank.  It is also only printing the  blac