Regarding Sequence  creation

i have tried to create a sequence like 'e0001', 'e0002','e0003',.........'e0010'............ 'e0100'....... using concatenation operator in insert statement.
But the problem m facing is how it will automatically use the remaining zeros as it increments.. plz help

may be like this
select 'e'||lpad(seq.nextval,4,'0') from dual;Vivek L

Similar Messages

  • Problem regarding the creation of Table using CSS.

    Hi ,
    Here I have a Problem regarding the creation of Table using CSS.
    In My Application i have a table with multiple rows(Rows are Dynamically added to the table).First i am setting the table with the following properties:
    width:900px;
    height : auto,
    Overflow : visible,
    Max-height: : 200px.
    If I use above properties,I'm getting a table with 5 or 6 rows(height upto 200px).After that i am getting the Vertical ScrollBar.
    The problem is when a table has many columns, Vertical and Horizontal Scrolls are coming at the time of setting the table. The table height is not Increasing dynamically.
    How can i use "height" property in CSS? (I want the table height to be increased when the columns are more.)
    Thanks & Regards
    Madhavi

    Hey humble user. Errr I'm trying to understand what ur trying to do. U want to create a section of a region destructively from an existing region right? If so select the option convert to new region (opt-comm-R or selecting it by right clicking). Check your audio bin to make sure. Whats the "merge" function? Are u refering to the glue tool?

  • Sequence Creation Date

    Is there a way to see the sequence creation or modification date on Premiere Pro?

    Maybe  I'm doing something wrong but In my machine I can't see neither Creation or Modification Date for my sequences.
    Is there something I have to change?
    Thanks in Advance,
    v

  • Regarding Thread Creation

    Hello,
    To create a thread in java there are two methods.
    (1) by extending from thread class.
    (2) by implementing runnable interface.
    implementing runnable interface is the preferred method to create a thread because we still have the option to extend from any other class.
    But does anybody know why java provides 2 methods for thread creation, why doesn't it provide only option 2 (i.e. by implementing runnable interface) when it is the preferred option.
    Regards,
    Sandy.

    Though Runnable interface is preferred to create threads in Java,most programmers extends Thread class.As jschell would say, 'I am rather certain' that the opposite is true.
    The reason behind of this is that you can have a clear logic of your code by using ThreadThat's not even true and it certainly isn't a reason to extend Thread rather than implement Runnable.
    most of the system programming written in java used Thread class instead of Runnable interface .If you have some evidence on the point please produce it. The consensus of opinion on these forums has been the other way round for many years.

  • Regarding equipment creation..

    Hi Genius,
                  Now I want some details about Equipment creation in PM module, and what r all the table comes... please send some link to learn equipment creation.

    hi thanus,
                  This is vijay here, currently i m working with this epm module.
    for equipment creation you will use ie01 for change ie02 and for display ie03.
    some times you may be asked to create by regarding doccument no.
    then go to j3gi.
    well main fields are equipment no, recipient, sender, planning plant, maintenance plant, bussiness area, company code etc.
    there r lots of table.
    but usefull are
    equi,faglflaxa,j_3gbelp,j_3gbelk,iloa,ITOB,EQKTX,IMPTT,IMRG,CKBS,CKIS ETC
    REGARDS
    VIJAY DWIVEDI
    REWARDS IF USEFULL*
    FOR ANY FURTHER INFORMATION U CAN GET BACK TO ME

  • Regarding RFC creation

    hi all,
    after creation of RFC,we have to release the RFC or not.
    regards,
    subba reddy

    Hi Subbareddy,
    Yes you have to release the RFC after compeltion of creation.
    After creation of RFC first import it into XI system and then test it once.If everything is working fine then you have to create a request for transporting this RFC from Dev system to QUALITY system.After creatiing the transport request then you can release the RFC with that transport request.With out releasing the RFC you can't move from Dev system to Quality system.
    Plz close this post if you got the answer.
    Regards,
    Raju.

  • Regarding the creation of Webservice

    Hi,
    I have created a webservice and deployed sucessfully.
    I would like to modify it and I deleted the Virtual Interface and the webservice definition.
    After building the EJB module and EAR module, I cannot create the Webservice and the Virtual Interface.
    I need help in tracing the problem.
    Thanks and regards
    Vivek

    HI..
    Two roles are provided for creating Web services:
    ● Web Service Developer
    The Web service developer defines the Web service at design time. He or she knows the application logic as well as the resulting conditions for the communication type (for example, stateless/stateful), and the required security level. He or she defines these properties at an abstract level. Specific details, such as the transport binding or security concept to be used, are defined only later during the Web service configuration.
    ● Web Service Configurator
    The Web service configurator defines the behavior of the Web service at runtime. He or she knows the system landscape and the technical requirements of the application server where the Web service is to be called. On the basis of the abstract definition of the Web service, the configurator can decide during configuration which specific attributes should be assigned to the features defined at design time.
    Prerequisites
    To create or consume Web services, you need the authorizations associated with the role SAP_BC_WEBSERVICE_ADMIN. You must add the authorization S_ICF_ADMIN (authorization for the Internet Communication Framework) to your profile. You use the authorization S_SERVICE for starting external services.
    To create a Web service for a function module, function group, BAPI, or XI message interface with a predefined feature profile, use the Web Service Creation Wizard.
    To specify the features of the Web service yourself, follow the procedure described in Creating a Virtual Interface.
    You can also create Web services using the Web Service Creation Wizard, and then change the virtual interface and Web service definition in the Object Navigator (SE80), by choosing Enterprise Services ® Web Service Library.
    for more Information click on the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/76/084e3ce0f9fe3fe10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/76/084e3ce0f9fe3fe10000000a114084/frameset.htm
    Regards,
    Arun

  • Regarding spool creation with 0 pages...

    Hello,
    I am using following code for spool creation but it gets created with 0 pages. Even though I can see data the spool has 0 pages due to which it causes issues when I try to convert spool to pdf.
    DATA :
         lv_handle     TYPE sy-tabix,
         lv_spoolid    TYPE tsp01-rqident,
         lv_rc         TYPE c,
         lv_errmessage TYPE c,
          et_table     TYPE scarr OCCURS 0 WITH HEADER LINE.
    SELECT *
    FROM scarr
    INTO TABLE et_table.
    CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
      EXPORTING
        dest       = 'LP01'
      IMPORTING
        handle     = lv_handle
        spoolid    = lv_spoolid
        rc         = lv_rc
        errmessage = lv_errmessage.
    LOOP AT et_table.
      CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
        EXPORTING
          handle     = lv_handle
          text       = et_table-url
        IMPORTING
          rc         = lv_rc
          errmessage = lv_errmessage.
    ENDLOOP.
    CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
      EXPORTING
        handle     = lv_handle
      IMPORTING
        rc         = lv_rc
        errmessage = lv_errmessage.
    DATA: v_pdf_bytecount TYPE i,
                   it_pdf          TYPE tlinetab.
    " convert spool number to PDF
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid   = lv_spoolid
        no_dialog     = ' '
      IMPORTING
        pdf_bytecount = v_pdf_bytecount
      TABLES
        pdf           = it_pdf.
    Please help.
    Regards,
    Jainam.
    Edited by: Jainam Shah on Aug 26, 2009 5:53 PM
    Edited by: Jainam Shah on Aug 26, 2009 5:53 PM
    Edited by: Jainam Shah on Aug 26, 2009 6:07 PM

    Solved by my own.
    We need to use a FM as below to create page..
    CALL FUNCTION 'RSPO_PAGE_BREAK_SPOOLREQUEST'
      EXPORTING
        HANDLE                 = LV_HANDLE
      OPTIONS                =
      LENGTH                 =
    IMPORTING
      RC                     =
      ERRMESSAGE             =
    EXCEPTIONS
      HANDLE_NOT_VALID       = 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.

  • About runtime sequence creation and view dare pre commmit.

    Dear All,
    My 2 New Question are:
    1)Could Oracle suggest to create sequence(DDL) from run-time.That means I need(My client requirement) regenerate of sequence(I know it is possible by cycle but i don't know MAX value when it will cycle)as monthly or a specific time so I want to drop sequence and create sequence by a)Programmetically runtime
    b) Oracle scheduler runtime .
    Have any good and better Idea? Any risk factor?
    Note that at a time possibly more than 100 users will data entry with our software.
    2)My New query is Could I view table data which was not yet COMMITTED from other session-other user.
    Regards and Thanking you,
    ZAKIR
    Analyst ,
    SynesisIT,
    www.Synesisit.com
    =====

    I tried that, but there are too many trouble.
    For only references.
    -- Usage
    Procedures
     execute periodic_seq.seq_def   create sequence
     execute periodic_seq.seq_undef drop sequence
    Functions
      periodic_seq.nextvalue
       get nextval of specified sequence
      periodic_seq.currvalue
       get currval of specified sequence
    seq_def
     in_seq_name varchar2 (30)
        sequence name (current schema)
     in_trunc_unit varchar2
      'yyyy','mm','dd','hh24','mi' : format on trunc(date)
    seq_def
     in_owner varchar2 (30)
      schema name
     in_seq_name varchar2 (30)
      sequence name
     in_trunc_unit varchar2
      'yyyy','mm','dd','hh24','mi' : format on trunc(date)
     incr_by integer (default:1)
      increment by
     start_with integer (default:1)
      start with
     maxvalue integer (default:to_number('1e27'))
      maxvalue
     minvalue integer (default:1)
      minvalue
     cycle varchar2 (default:'N')
      'Y':cycle/'N':nocycle
     cache integer (default:20)
      cache
     time_order varchar2 (default:'N')
      'Y':order/'N':noorder
    seq_undef
     in_seq_name varchar2 (30)
        sequence name (current schema)
    seq_undef
     in_owner varchar2 (30)
      schema name
     in_seq_name varchar2 (30)
      sequence name
    nextvalue
     in_seq_name varchar2 (30)
        sequence name (current schema)
    nextvalue
      in_owner varchar2 (30)
      schema name
     in_seq_name varchar2 (30)
      sequence name
    currvalue
     in_seq_name varchar2 (30)
        sequence name (current schema)
    currvalue
      in_owner varchar2 (30)
      schema name
     in_seq_name varchar2 (30)
      sequence name
    -- Source --
    -- Control table
    create table cycle_seq_ctrl
    (sequence_name varchar2(30) not null
    ,min_value integer
    ,max_value integer
    ,increment_by integer not null
    ,cycle_term varchar(10) default('dd') not null
    ,last_number integer not null
    ,reset_time date
    ,prev_nextval integer not null
    ,constraint pkey_cycle_seq_ctrl primary key (sequence_name)
    organization index
    create or replace
    package cycle_seq
    authid current_user
    is
    function nextvalue
    (seq_name varchar2
    ,in_date date := sysdate
    ) return integer
    function currvalue
    (seq_name varchar2
    ) return integer
    procedure seq_def
    (seq_name varchar2
    ,cycleterm varchar2 := 'DD' /* Defaults : reset by a day */
    ,incr_by integer := 1
    ,start_with integer := 1
    ,maxvalue integer := to_number('1e27')
    ,minvalue integer := 1
    procedure seq_undef
    (seq_name varchar2
    end; -- package cycle_seq
    create or replace
    package body cycle_seq
    is
      type currval_tab_type is table of integer index by varchar2(30);
      currval_tab currval_tab_type;
    function nextvalue
    (seq_name varchar2
    ,in_date date := sysdate
    ) return integer
    is
    pragma autonomous_transaction;
      timeout_on_nowait exception;
      timeout_on_wait_sec exception;
      pragma exception_init(timeout_on_nowait, -54);
      pragma exception_init(timeout_on_wait_sec, -30006);
      p_seqname cycle_seq_ctrl.sequence_name%type;
      p_ctrl cycle_seq_ctrl%rowtype;
      p_currtime date;
      p_nextval integer;
    begin
      p_currtime := in_date;
      p_seqname := upper(trim(seq_name));
      select *
        into p_ctrl
        from cycle_seq_ctrl
       where sequence_name = p_seqname
      for update wait 1
      if (p_ctrl.cycle_term<>'SS') then
        p_currtime := trunc(p_currtime,p_ctrl.cycle_term);
      end if;
      -- need to reset
      if (p_ctrl.reset_time < p_currtime) then
        if (p_ctrl.increment_by > 0) then
          p_nextval := p_ctrl.min_value;
        elsif (p_ctrl.increment_by < 0) then
          p_nextval := p_ctrl.max_value;
        else
          p_nextval := p_ctrl.last_number;
        end if;
        update cycle_seq_ctrl
          set last_number = p_nextval
             ,reset_time = p_currtime
             ,prev_nextval = last_number + increment_by
        where sequence_name = p_seqname
        currval_tab(p_seqname) := p_nextval;
        commit;
        return p_nextval;
      end if;
      -- already reseted (in a same second)
      if (p_ctrl.reset_time = p_currtime) then
        p_nextval := p_ctrl.last_number + p_ctrl.increment_by;
        update cycle_seq_ctrl
          set last_number = p_nextval
        where sequence_name = p_seqname
        currval_tab(p_seqname) := p_nextval;
        commit;
        return p_nextval;
      -- already reseted
      else
        p_nextval := p_ctrl.prev_nextval + p_ctrl.increment_by;
        update cycle_seq_ctrl
          set prev_nextval = p_nextval
        where sequence_name = p_seqname
        currval_tab(p_seqname) := p_nextval;
        commit;
        return p_nextval;
      end if;
    exception
      when no_data_found then
        raise_application_error(-20800,
           'cycle_seq.seq_def('''||seq_name
           ||''') has not been called.');
      when timeout_on_nowait or timeout_on_wait_sec then
        raise_application_error(-20899,
           'cycle_seq.nextvalue('''||seq_name
           ||''') is time out.');
      when others then
        raise;
    end
    function currvalue
    (seq_name varchar2
    ) return integer
    is
      p_seqname cycle_seq_ctrl.sequence_name%type;
    begin
      p_seqname := upper(trim(seq_name));
      return currval_tab(upper(seq_name));
    exception
      when no_data_found then
        raise_application_error(-20802,
           'cycle_seq.nextvalue('''
           ||seq_name||''') has not been called in this session.');
      when others then
        raise;
    end
    procedure seq_def
    (seq_name varchar2
    ,cycleterm varchar2 := 'DD'
    ,incr_by integer := 1
    ,start_with integer := 1
    ,maxvalue integer := to_number('1e27')
    ,minvalue integer := 1
    is
      p_seqname cycle_seq_ctrl.sequence_name%type;
      p_currtime date;
      p_cycleterm cycle_seq_ctrl.cycle_term%type;
    begin
      p_currtime := sysdate;
      p_seqname := upper(trim(seq_name));
      p_cycleterm := upper(trim(cycleterm));
      if (p_cycleterm<>'SS') then
        p_currtime := trunc(p_currtime,cycleterm);
      end if;
      insert into cycle_seq_ctrl
        (sequence_name
        ,min_value
        ,max_value
        ,increment_by
        ,cycle_term
        ,last_number
        ,reset_time
        ,prev_nextval
      values
        (p_seqname
        ,minvalue
        ,maxvalue
        ,incr_by
        ,p_cycleterm
        ,start_with - incr_by
        ,p_currtime
        ,start_with - incr_by
      commit; -- Because this is as like a DDL
    exception
      when dup_val_on_index then
        raise_application_error(-20955,
           'already defined with '
          ||'cycle_seq.seq_def('''||seq_name||''')');
      when others then
        raise;
    end
    procedure seq_undef
    (seq_name varchar2
    is
      p_seqname cycle_seq_ctrl.sequence_name%type;
    begin
      p_seqname := upper(trim(seq_name));
      delete from cycle_seq_ctrl
      where sequence_name = p_seqname
      commit; -- Because this is as like a DDL
    end
    end; -- package body cycle_seq
    /

  • Regarding DC creation(DTR)

    Hi all,
    i am trying to create DC in the existing serevr track with the present DTR. But at the time of creation i am geting errors. They are;-
    java.lang.reflect.InvocationTargetException
    Create DC failed:
    1) com.sap.tc.devconf.SyncException
    2)Jul 21, 2008 11:51:31 AM com.sap.ide.eclipse.component.core.DCController [Threadmain,5,main] ERROR: Create DC failed: Unable to sync file or folder.: Sync for folder C:\Documents and Settings\JB67375\.dtc\1\SCs\sap.com\SAP_ESS\_comp\ failed: Communication error cause: Read timed out
    Jul 21, 2008 11:51:25 AM com.tssap.dtr.client.lib.exceptions.ClientLibraryException [Threadmain,5,main] ERROR:
    VFS version: 7.00 645_VAL_REL 0010 (2005-09-17 17:36:45 CEST) com.tssap.dtr.client.lib.vfs.VfsException: Sync for folder C:\Documents and Settings\JB67375\.dtc\1\SCs\sap.com\SAP_ESS\_comp\ failed: Communication error cause: Read timed out
    Please help me out.
    Regards,
    Deepak

    Hi Deepak,
    Since the error is showing Read Timeout Error, can you just ping the DTR server from NWDS itself and check if the ping is successful or check the DTR URL..
    Thanks
    Namrata

  • Help needed regarding sequence

    is there any way of finding what was the last ddl operation peformed on a sequence. I am able to find the exact time of ddl operation on sequence but no the exact operation... plz reply me as soon as possible...
    thanks in advance
    regards,
    Adarsh.P

    hi,
    for what all ddl operations does the last_ddl_column of all_objects (in case of sequence) view gets updated...
    does it get change even for Grant and Revoke statements on sequence also?
    Thanks in advance.
    bye
    Adarsh

  • Question regarding sequences and fragmented data

    Hi all,
    I plan to implement two identical database schemas on two different oracle database servers. The two databases will then be linked via a Database Link and a View will be used to show the data from both db's using 1 sql statement.
    My question is this:
    If 5 records are inserted into the table on the first database and then 10 records are inserted into the matching table on the second database, how would the sequence for the table in the first database know that the next value should be 16 and not 6.
    I hope this makes sense, any questions just ask.
    Thanks,
    Martin

    Ok, I am not sure if I fully undserstand the question but let's give it a go. In the first place a sequence is stored in the data dictionary of a database. Te fact that you have two servers (and two databases : is that correct ?) means that you have two sequences also. The sequence is local to each db.
    If you want the tables to be aware of each other so that the next record takes into account also the records in the other db you may have to manually generate the sequence. I don't know if you can share the sequence between two dbs but let's see if anyone else does.
    Regards

  • Problem regarding the creation of sales order using bapi.

    Hai all,
    I am creating sales order using bapi but i am, get following error messages :
    TYPE ID  NUMBER MESSAGE
    E       VP   112       Please enter sold-to party or ship-to party
    E       V4   219       Sales document  was not changed
    I have entered all the parameters.
    my program is as follows :
    *& Report  ZSD_SALES_ORDER
    REPORT  ZSD_SALES_ORDER.
        Tables
    *table definitions
    TABLES:vbak,      "Sales Document: Header Data
            knvv,     "Customer Master Sales Data
            mara,     "General Material Data
            t001l,    "Plants/Branches
            mvke,     "Sales Data for Material
            vbap,     "Sales Document: Item Data
            konv.     "Conditions (Transaction Data)
        Types
    *type for upload data
    TYPES :BEGIN OF ty_upload,
           matnr(20) TYPE c,                  " Old material number
           quantity(20) TYPE c,               " Cumulative order quantity in sales units
    VALUE TYPE       BAPIKWERT1,
          value(20) TYPE c,                  " Condition value
                 value TYPE konv-kwert,                  " Condition value
    END OF ty_upload.
    *type for final output table
    TYPES :BEGIN OF ty_main,
               bismt  TYPE mara-bismt,    "Old material number
               matnr  TYPE vbap-matnr,    "Material Number
               kunnr  TYPE vbak-kunnr,    "customer number
               auart  TYPE vbak-auart,    "Sales Document Type
               vkorg  TYPE vbak-vkorg,    "Sales Organization
               vtweg  TYPE vbak-vtweg,    "Distribution Channel
               spart  TYPE vbak-spart,    "Division
               vbeln  TYPE vbak-vbeln,    "Sales document
               werks  TYPE marc-werks,    " Plant
               lgort  TYPE mard-lgort,    "Storage Location
               posnr  TYPE vbap-posnr,    "Sales Document Item
               parvw  TYPE vbpa-parvw,    "Partner function
               kwmeng TYPE vbap-kwmeng,   "Cumulative order quantity in sales units
               kschl  TYPE konv-kschl,    "Condition type
              kwert  TYPE konv-kwert,    "Condition value
    KWERT TYPE       BAPIKWERT1,
              kwert(20)  TYPE c,    "Condition value
               waers  TYPE konv-waers,    "Currency
         END OF ty_main.
    *type for old material number
    TYPES: BEGIN OF ty_matnr,
           matnr TYPE mara-matnr,
           bismt TYPE mara-bismt,
           END OF ty_matnr.
    *type for order number
    TYPES :BEGIN OF ty_output,
           vbeln  TYPE vbak-vbeln,       "Sales Document
         END OF ty_output.
        Constants                Begin with C_                           *
    CONSTANTS:
    c_zpmu(4) TYPE c VALUE 'ZPMU',
    c_zpmm(4) TYPE c VALUE 'ZPMM'.
    DATA: c_ch(1) TYPE c VALUE 'X'.
        Data                     Begin with W_                           *
    *global data for validations
    DATA: w_count TYPE i,
          w_vkorg TYPE vbak-vkorg,
          w_vtweg TYPE vbak-vtweg,
          w_spart TYPE vbak-spart,
          w_werks TYPE t001l-werks,
          w_check TYPE c,
          w_itemno TYPE posnr_va,
         W_COND TYPE C.
          w_cond(3) TYPE c.
        Internal tables          Begin with IT_                          *
    *internal table definitions
    DATA : it_upload TYPE STANDARD TABLE OF ty_upload ,
           wa_upload TYPE ty_upload.
    DATA : it_main TYPE STANDARD TABLE OF ty_main,
           wa_main TYPE ty_main.
    DATA: it_matnr TYPE STANDARD TABLE OF ty_matnr,
          wa_matnr TYPE ty_matnr.
    DATA : it_output TYPE STANDARD TABLE OF ty_output.
    Internal table for BAPI.
    DATA: it_bapisdhd1  TYPE STANDARD TABLE OF bapisdhd1,        "Sales and Distribution Document Header
          wa_bapisdhd1 TYPE bapisdhd1.
    DATA: it_bapisditm  TYPE STANDARD TABLE OF bapisditm ,       "Sales and Distribution Document Item
          wa_bapisditm TYPE bapisditm.
    DATA: it_bapiparnr  TYPE STANDARD TABLE OF bapiparnr,        "SD Document Partner: WWW
          wa_bapiparnr TYPE bapiparnr.
    DATA: it_bapischdl  TYPE STANDARD TABLE OF bapischdl,       "Schedule Lines
          wa_bapischdl TYPE bapischdl.
    DATA: it_bapicond TYPE STANDARD TABLE OF bapicond,       "Communication Fields for Maintaining Conditions in the Order
          wa_bapicond TYPE bapicond.
    DATA: it_bapiret2 TYPE STANDARD TABLE OF bapiret2,        "Return Parameter
          wa_bapiret2 TYPE bapiret2.
          Parameters              Begin with PR_                        *
    *selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME .
    PARAMETERS: pr_vkorg TYPE vbak-vkorg OBLIGATORY,
                pr_vtweg TYPE vbak-vtweg  OBLIGATORY,
                pr_spart TYPE vbak-spart  OBLIGATORY,
                pr_kunnr TYPE kna1-kunnr  OBLIGATORY,
                pr_werks TYPE marc-werks  OBLIGATORY,
                pr_lgort TYPE mard-lgort  OBLIGATORY.
    PARAMETERS: pr_auart TYPE vbak-auart OBLIGATORY,
               PR_AUGRU TYPE VBAK-AUGRU OBLIGATORY.
                            pr_augru TYPE vbak-augru.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME.
    PARAMETERS : pr_file TYPE ibipparms-path OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk2.
          At selection-screen                                           *
    AT SELECTION-SCREEN.
      PERFORM f006_validate_vkorg.
      PERFORM f007_validate_vtweg.
      PERFORM f008_validate_spart.
      PERFORM f009_validate_kunnr.
      PERFORM f010_validate_werks.
      PERFORM f011_validate_lgort.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_file.
    *for f4 help----
      PERFORM f003_f4_help.
          S T A R T   O F   S E L E C T I O N                           *
    START-OF-SELECTION.
    *for material ,quantity and value upload
      PERFORM f001_upload_file.
    *get data
      PERFORM  f003_get_data.
    *for check the data
      PERFORM f002_check_data .
      PERFORM f004_process.
    *for posting
      PERFORM f005_posting.
    END-OF-SELECTION.
          E N D       O F   S E L E C T I O N                           *
    *&      Form  f001_upload_file
          upload file
    FORM f001_upload_file .
      DATA : lw_fname TYPE string.
      CLEAR lw_fname.
      lw_fname = pr_file.
      REFRESH it_upload.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lw_fname
          filetype                = 'ASC'
          has_field_separator     = c_ch
        TABLES
          data_tab                = it_upload
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT it_upload INTO wa_upload.
       wa_upload-value = ( wa_upload-value ) / 10.
       MODIFY it_upload FROM wa_upload.
      ENDLOOP.
    ENDFORM.                    "F001_UPLOAD_FILE
    *&      Form  f003_f4_help
          f4 help
    FORM f003_f4_help .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = pr_file.
    ENDFORM.                    " f003_f4_help
    *&      Form  check_data
          text
    FORM f002_check_data .
      DATA: lw_lines TYPE i.
      DESCRIBE TABLE it_main LINES lw_lines.
      IF lw_lines LE 0.
        RETURN.
      ENDIF.
      SELECT a~matnr
             a~bismt FROM mara AS a INNER JOIN mvke AS b
                   ON amatnr = bmatnr
                   INTO CORRESPONDING FIELDS OF TABLE it_matnr
                   FOR ALL ENTRIES IN it_main
                   WHERE a~bismt = it_main-bismt.
      IF sy-subrc = 0.
        LOOP AT it_main INTO wa_main.
          CLEAR : wa_matnr.
          READ TABLE it_matnr INTO wa_matnr WITH KEY bismt = wa_main-bismt.
          IF sy-subrc = 0.
            MOVE: wa_matnr-matnr TO wa_main-matnr.
          ENDIF.
          MODIFY it_main FROM wa_main TRANSPORTING matnr WHERE bismt = wa_main-bismt.
        ENDLOOP.
      ELSE.
       MESSAGE e000(zmsd) WITH  text-001.
      ENDIF.
    ENDFORM.                    "CHECK_DATA
    *&      Form  F009_validate_vkorg
          text
    FORM f006_validate_vkorg .
      CLEAR w_vkorg.
      SELECT SINGLE vkorg
          INTO w_vkorg FROM tvko
          WHERE vkorg EQ pr_vkorg.
      IF sy-subrc <> 0.
        MESSAGE e000(zmsd) WITH text-012 pr_vkorg.
      ENDIF.
    ENDFORM.                    " F009_validate_vkorg
    *&      Form  f007_validate_vtweg
          text
    FORM f007_validate_vtweg .
      CLEAR:w_vtweg.
      SELECT SINGLE vtweg
           INTO w_vtweg FROM tvtw
           WHERE vtweg EQ pr_vtweg.
      IF sy-subrc <> 0.
        MESSAGE e089(zmsd).
      ENDIF.
    ENDFORM.                    " f007_validate_vtweg
    *&      Form  f008_validate_spart
          text
    FORM f008_validate_spart .
      CLEAR:w_spart.
      SELECT SINGLE spart
            INTO w_spart FROM tspa
            WHERE spart EQ pr_spart.
      IF sy-subrc <> 0.
        MESSAGE e087(zmsd).
      ENDIF.
    ENDFORM.                    " f008_validate_spart
    *&      Form  F010_validate_kunnr
          text
    FORM f009_validate_kunnr .
      DATA: l_kunnr TYPE kunnr.
      CLEAR: w_vkorg, w_vtweg,w_spart.
      SELECT  SINGLE  kunnr FROM  knvv
             INTO l_kunnr
             WHERE  kunnr  = pr_kunnr
             AND    vkorg  = pr_vkorg
             AND    vtweg  = pr_vtweg
             AND    spart  = pr_spart.
      IF sy-subrc <> 0.
       MESSAGE e000(zmsd) WITH text-010 pr_kunnr text-011 pr_vkorg  .
      ENDIF.
    ENDFORM.                    " F010_validate_kunnr
    *&      Form  f010_validate_werks
          text
    FORM f010_validate_werks .
      CLEAR:w_werks.
      SELECT SINGLE werks
            INTO w_werks FROM t001w
            WHERE werks EQ pr_werks.
      IF sy-subrc <> 0.
        MESSAGE e088(zmsd).
      ENDIF.
    ENDFORM.                    " f010_validate_werks
    *&      Form  F011_validate_lgort
          text
    FORM f011_validate_lgort .
      CLEAR:w_werks .
      SELECT   SINGLE werks  FROM  t001l
             INTO w_werks
             WHERE  werks  = pr_werks
             AND    lgort  = pr_lgort.
      IF sy-subrc <> 0.
        MESSAGE e000(zmsd) WITH text-007 pr_lgort text-008 pr_werks .
      ENDIF.
    ENDFORM.                    " F011_validate_lgort
    *&      Form  f003_get_data
          text
    FORM f003_get_data .
      CLEAR wa_main.
      REFRESH it_main.
      LOOP AT it_upload INTO wa_upload.
        CLEAR : wa_main.
        MOVE: wa_upload-matnr     TO  wa_main-bismt,
              wa_upload-quantity  TO  wa_main-kwmeng,
              wa_upload-value     TO  wa_main-kwert,
              pr_vkorg            TO  wa_main-vkorg,
              pr_vtweg            TO  wa_main-vtweg,
              pr_spart            TO  wa_main-spart,
              pr_kunnr            TO  wa_main-kunnr,
              pr_werks            TO  wa_main-werks,
              pr_lgort            TO  wa_main-lgort.
        APPEND wa_main TO it_main.
      ENDLOOP.
    ENDFORM.                    " f003_get_data
    *&      Form  f004_process
          text
    FORM f004_process .
    CLEAR w_check.
    LOOP AT it_main INTO wa_main.
       IF wa_main-matnr = ''.
         WRITE:/ text-006,
                     wa_main-bismt.
         w_check = 1.
       ENDIF.
       IF wa_main-kwmeng = 0.
         WRITE:/ text-005,
                 wa_main-bismt.
         w_check = 1.
       ENDIF.
       IF    pr_auart <> 'ZM01'.
         IF wa_main-kwert IS INITIAL.
           WRITE:/ text-004,
                    wa_main-bismt.
           w_check = 1.
         ENDIF.
       ENDIF.
    ENDLOOP.
    ENDFORM.                    " f004_process
    *&      Form  f005_posting
          text
    FORM f005_posting .
      CLEAR: w_itemno,
             w_cond.
      w_itemno = 10.
      w_cond = 1.
    IF w_check = '' OR w_check = 1.
      wa_bapisdhd1-doc_type = pr_auart.
      wa_bapisdhd1-ord_reason = pr_augru.
      LOOP AT it_main INTO wa_main.
        IF w_cond = 1.
          CLEAR: it_bapiret2,
                 it_bapisditm,
                 it_bapiparnr,
                 it_bapischdl,
                 it_bapicond.
          REFRESH:it_bapiret2,
                  it_bapisditm,
                  it_bapiparnr,
                  it_bapischdl,
                  it_bapicond.
          MOVE: wa_main-vkorg TO wa_bapisdhd1-sales_org,
                wa_main-vtweg TO wa_bapisdhd1-distr_chan,
                wa_main-spart TO wa_bapisdhd1-division.
          wa_bapisdhd1-wbs_eleM = 'Y561.1'.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              INPUT         = pr_kunnr
           IMPORTING
             OUTPUT        = pr_kunnr.
          wa_bapisdhd1-PURCH_NO_S = pr_kunnr.
          wa_bapisdhd1-PURCH_NO_C = pr_kunnr.
        ENDIF.
        MOVE: w_itemno TO wa_bapisditm-itm_number,
               wa_main-matnr TO wa_bapisditm-material,
              wa_main-BISMT TO wa_bapisditm-material,
              wa_main-werks TO wa_bapisditm-plant,
              wa_main-lgort TO wa_bapisditm-store_loc.
                           wa_bapisditm-target_qty = '10'.
        wa_bapisditm-PURCH_NO_S = pr_kunnr.
        wa_bapisditm-PURCH_NO_C = pr_kunnr.
        APPEND wa_bapisditm TO it_bapisditm.
        IF w_cond = 1.
          wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-itm_number = 10.
            wa_bapiparnr-partn_role = 'SP'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          wa_bapiparnr-partn_role = 'AG'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'RE'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'RG'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'WE'.
          APPEND wa_bapiparnr TO it_bapiparnr.
        ENDIF.
        wa_bapischdl-itm_number = w_itemno.
        wa_bapischdl-req_qty    = wa_main-kwmeng.
         wa_bapischdl-PURCH_NO_S = pr_kunnr.
        APPEND wa_bapischdl TO it_bapischdl.
        wa_bapicond-itm_number = w_itemno.
        wa_bapicond-cond_type  = 'ZECL'.
         IF    ( wa_bapisdhd1-doc_type = 'ZPMU' ) OR ( wa_bapisdhd1-doc_type = 'ZPMM' ).
           wa_bapicond-cond_type  = 'ZVAL'.
         ELSE.
           wa_bapicond-cond_type  = 'ZMRP'.       "+PK12122006
         ENDIF.
        wa_bapicond-cond_value = wa_main-kwert.
        APPEND wa_bapicond TO it_bapicond.
        w_itemno = w_itemno + 10.
        w_cond   = w_cond + 1.
      ENDLOOP.
      data : SALESDOCUMENTIN like BAPIVBELN-VBELN.
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in     = wa_bapisdhd1
        IMPORTING
          salesdocument       = SALESDOCUMENTIN
        TABLES
          return              = it_bapiret2
          order_items_in      = it_bapisditm
          order_partners      = it_bapiparnr
          order_schedules_in  = it_bapischdl
          order_conditions_in = it_bapicond.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = c_ch.
    ENDIF.
      LOOP AT it_bapiret2 INTO wa_bapiret2.
        DATA : w_err(100) TYPE c,
        w_matnr TYPE matnr.
        IF wa_bapiret2-type = 'E' AND wa_bapiret2-id = 'V1' AND wa_bapiret2-number = 392.
          UNPACK wa_bapiret2-message_v1 TO w_matnr.
          READ TABLE it_matnr INTO wa_matnr WITH KEY matnr = w_matnr.
          IF sy-subrc EQ 0.
            CONCATENATE text-013 wa_matnr-bismt INTO w_err SEPARATED BY space.
            MESSAGE w_err TYPE 'S'.
          ENDIF.
        ENDIF.
        IF WA_BAPIRET2-TYPE = 'S'.  " Comment
          WRITE: 40 TEXT-009, WA_BAPIRET2-MESSAGE_V2+0(10).
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " f005_posting
    I have given all the necessary parameters. it is telling that error is in parameter
    sales_header_in.
    I have checked it.
    i have assigned purch_no_s and purch_no_c of the structure BAPISDHD1(ORDER_HEADER_IN)
    in the bapi with customer number.
    and also i have assigned the partnumber of the structure BAPIPARNR ORDER_PARTNERS
    in the bapi with customer number.
    but still , it is diplaying the error message, please enter the sold to or ship to party number.
    how to resolve this error.
    this is urgent requirement.
    points will be awarded.
    thanking u in advance,
    a.srinivas.

    Hi,
    Did u have a look at the standard programs which make use of BAPI_SALESORDER_CREATEFROMDAT1
    Heres a list...
    LWSSOU08                     
    MV45WF0S                     
    MWWMJF21_BAPI_SALESORDER_CREAT
    RBUS2032                    
    Regards,
    Tanveer.
    <b>Please mark helpful answers</b>

  • Sequence creation for Super Type and Sub Type (Parent-Child)

    Data Model is structured with Super Type-Sub Type Concept.When data is being inserted in the Super Type table, I will be using a sequence Supertype.NEXTVAL as Primary Key.Now the same sequence will be the Primary Key for Sub Type table also. Can I use Supertype.CURRVAL during insertion in Sub Type table?
    If Yes, I have lot of records being created in Super Type table within a second. So before data is being inserted in Subtype table there may be chance of a row being inserted in Super Type table and if I use Supertype.CURRVAL it may lead to wrong data.
    How can I make sure that Supertype Primary Key is being inserted as Primary key in sub type table?

    What happens when you try it? Something like:
    session1> select t_seq.nextval from dual;
       NEXTVAL
         40061
    session2> select t_seq.nextval from user_objects;
       NEXTVAL
         40062
         40063
         40064
         <snip>
         40270
         40271
         40272
    211 rows selected.
    session1> select t_seq.currval from dual;
       CURRVAL
         40061john

  • Regarding MIGO Creation

    Hello,
    While creating MIGO in Material Management, I'm getting this error " Account Determination for entry OPB0 (OPerational Chart of Accounts) BSX BPGC (Group Chart of Accounts) ____3000 not possible."
    Please help me regarding this.
    Thanks rin Advance,

    Hi,
    Please send the full error message along with the message number.
    Regds
    Aloysius

Maybe you are looking for

  • Writing Dynamic code in smart form

    Hi All,    I have a issue on Smart form . the smart form is customized view of bbp_po(srm) for po(purchase order) details  in that in a secoundary window where vedor adress is displaying .In the first line of the address name1 and name2 are displayin

  • How to uncheck all radio buttons in WHEN-NEW-FORM-INSTANCE trigger

    Hi, I have one radio group(RDBTNGRP) having three radio buttons (RDBTN1,RDBTN2,RDBTN3) in a control block, i want to uncheck all these three buttons through code. Any help please. Regards,

  • Anybody can copy my signature from signed documents opened in Acrobat Reader. How do I prevent that?

    The problem occurs when I take a word document in which I've pasted a jpeg of my signature and save it to pdf. I can go straight into Acrobat Reader and make a copy of the signature. That never used to happen. Is there some way to fix that? I see thi

  • QA32: Stock In Quality But no Inpsection Lot

    Greeting..             I have raw maetrial which i recievd against Purchase order , and its showing under qulity stock in stock overview.....But in QA32 i m not getting the Lot for this..no where i m founding the Lot of this material.. How to make th

  • Thorowing error

    Hi Apo Masters, I am getting following when copying data from one version to another version through report it is throwing following error please suggest me. Date       Time     Message text