Need help in using FM BAPI_MATERIAL_SAVEDATA

Gurus,
I need help in using the FM BAPI_MATERIAL_SAVEDATA. The FM is returning a message that says "The field MARA-MEINS/BAPI_MARA-BASE_UOM(_ISO) is defined as a required field; it does not contain an entry".
I have supplied the necessary details and yet the FM won't push through.
If possible, please post sample codes.
Below is my sample code:
===============================================
REPORT  zmm_materialupload.
eject
$$******************************************************************************
$$    TYPES
$$******************************************************************************
eject
$$******************************************************************************
$$    INTERNAL TABLES (custom structure
$$******************************************************************************
eject
$$******************************************************************************
$$    RANGES
$$******************************************************************************
eject
$$******************************************************************************
$$    FIELD-SYMBOLS
$$******************************************************************************
eject
$$******************************************************************************
$$    PARAMETERS & SELECT-OPTIONS
$$******************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
*SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT-OPTIONS: s_mtart FOR mara-mtart.
SELECT-OPTIONS: s_mbrsh FOR mara-mbrsh DEFAULT 'P'.
SELECT-OPTIONS: s_werks FOR marc-werks DEFAULT '1000' OBLIGATORY.
SELECT-OPTIONS: s_lgort FOR marc-lgpro DEFAULT 'OPSL' OBLIGATORY.
PARAMETERS: p_path  LIKE rlgrap-filename DEFAULT 'C:\Documents and Settings\training_11\Desktop\Book4 (2ITEMS).txt' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      field_name = 'P_FNAME'
    IMPORTING
      file_name  = p_path.
eject
$$******************************************************************************
$$    START-OF-SELECTION
$$******************************************************************************
START-OF-SELECTION.
  PERFORM check_input.
  PERFORM get_file.
  PERFORM filter_input.
PERFORM populate_tabs.
  PERFORM bapi_mat.
eject
$$******************************************************************************
$$    FORMS
$$******************************************************************************
FORM bapi_mat.
  LOOP AT it_tab INTO wa_tab.
    CALL FUNCTION 'BAPI_MATERIAL_GETINTNUMBER'
      EXPORTING
        material_type    = wa_tab-mtart
        industry_sector  = wa_tab-mbrsh
        required_numbers = 1
      TABLES
        material_number  = it_matnr.
  ENDLOOP.
  LOOP AT it_matnr INTO wa_matnr.
    READ TABLE it_tab INTO wa_tab INDEX sy-tabix.
    wa_tab-matnr = wa_matnr-material.
    MODIFY it_tab FROM wa_tab INDEX sy-tabix.
  ENDLOOP.
  PERFORM populate_tabs.
  CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
     headdata                   = it_headdata
    clientdata                 = it_clientdata
    clientdatax                = it_clientdatax
    plantdata                  = it_plantdata
    plantdatax                 = it_plantdatax
    FORECASTPARAMETERS         =
    FORECASTPARAMETERSX        =
    PLANNINGDATA               =
    PLANNINGDATAX              =
    STORAGELOCATIONDATA        =
    STORAGELOCATIONDATAX       =
    valuationdata              = it_valuationdata
    valuationdatax             = it_valuationdatax
     WAREHOUSENUMBERDATA        =
    WAREHOUSENUMBERDATAX       =
    SALESDATA                  =
    SALESDATAX                 =
    STORAGETYPEDATA            =
    STORAGETYPEDATAX           =
    flag_online                = ' '
    flag_cad_call              = ' '
    NO_DEQUEUE                 = ' '
    NO_ROLLBACK_WORK           = ' '
   IMPORTING
     return                     = it_return
   TABLES
     materialdescription        = it_materialdescription
     unitsofmeasure             = it_unitsofmeasure
     unitsofmeasurex            = it_unitsofmeasurex
     internationalartnos        = it_internationalartnos
     materiallongtext           = it_materiallongtext
     taxclassifications         = it_taxclassifications
     returnmessages             = it_returnmessages
    PRTDATA                    =
    PRTDATAX                   =
    EXTENSIONIN                =
    EXTENSIONINX               =
  IF sy-subrc = 0.
  ENDIF.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait   = 'X'
    IMPORTING
      return = it_return.
ENDFORM.                    "bapi_mat
*&      Form  GET_FILE
      text
FORM get_file.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      text = 'Getting data from file...'.
  MOVE: p_path TO gv_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = gv_file
      filetype                = 'ASC'
      has_field_separator     = 'X'
      read_by_line            = 'X'
    TABLES
      data_tab                = it_tab
    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.
ENDFORM.                    "GET_FILE
*&      Form  check_input
      text
FORM check_input.
Material Type
  IF s_mtart-low IS INITIAL AND s_mtart-high IS INITIAL.
   s_mtart = 'IEQ'.
   s_mtart-low = 'ABF'.        "Waste
   s_mtart-high = 'ZTRD'.      "Stock Items
   APPEND s_mtart.
  ENDIF.
  IF s_mtart-low IS NOT INITIAL AND s_mtart-high IS INITIAL.
    MOVE: s_mtart-low TO s_mtart-high.
  ENDIF.
Industry Sector
  IF s_mbrsh-low IS INITIAL AND s_mbrsh-high IS INITIAL.
   s_mbrsh = 'IEQ'.
   SELECT mbrsh
   FROM mara
   INTO TABLE it_mbrsh.
   s_mbrsh-low = wa_mbrsh-mbrsh.
   LOOP AT it_mbrsh INTO wa_mbrsh.
     s_mbrsh-high = wa_mbrsh-mbrsh.
   ENDLOOP.
   APPEND s_mbrsh.
  ENDIF.
  IF s_mbrsh-low IS NOT INITIAL AND s_mbrsh-high IS INITIAL.
    MOVE: s_mbrsh-low TO s_mbrsh-high.
  ENDIF.
Plant
  IF s_werks-low IS INITIAL AND s_werks-high IS INITIAL.
    s_werks = 'IEQ'.
    s_werks-low = '1000'.
    s_werks-high = '2000'.
  ENDIF.
  IF s_werks-low IS NOT INITIAL AND s_werks-high IS INITIAL.
    MOVE: s_werks-low TO s_werks-high.
  ENDIF.
Storage Location
  IF s_lgort-low IS NOT INITIAL AND s_lgort-high IS INITIAL.
    MOVE: s_lgort-low TO s_lgort-high.
  ENDIF.
ENDFORM.                    "check_input
*&      Form  Filter_input
      text
FORM filter_input.
  SORT it_tab BY matnr mtart mbrsh werks lgort.
  LOOP AT it_tab INTO wa_tab.
   IF wa_tab-mtart NOT IN s_mtart.
     DELETE it_tab WHERE mtart NOT IN s_mtart.
   ENDIF.
   IF wa_tab-mbrsh NOT IN s_mbrsh.
     DELETE it_tab WHERE mbrsh NOT IN s_mbrsh.
   ENDIF.
    IF wa_tab-werks NOT IN s_werks.
      DELETE it_tab WHERE werks NOT IN s_werks.
    ENDIF.
    IF wa_tab-lgort NOT IN s_lgort.
      DELETE it_tab WHERE lgort NOT IN s_lgort.
    ENDIF.
  ENDLOOP.
ENDFORM.                    "Filter_input
*&      Form  populate_tabs
      text
FORM    populate_tabs.
  LOOP AT it_tab INTO wa_tab.
    MOVE: wa_tab-matnr TO wa_headdata-material,
          wa_tab-mbrsh TO wa_headdata-ind_sector,
          wa_tab-mtart TO wa_headdata-matl_type,
                   'X' TO wa_headdata-basic_view,
                   'X' TO wa_headdata-sales_view,
                   'X' TO wa_headdata-purchase_view,
                   'X' TO wa_headdata-mrp_view,
                   'X' TO wa_headdata-account_view.
         wa_tab-matkl TO wa_clientdata-matl_group,
         wa_tab-meins TO wa_clientdata-base_uom,
         wa_tab-groes TO wa_clientdata-size_dim,
         wa_tab-gewei TO wa_clientdata-unit_of_wt,
         wa_tab-ntgew TO wa_clientdata-net_weight,
                  'X' TO wa_clientdatax-matl_group,
                  'X' TO wa_clientdatax-base_uom,
                  'X' TO wa_clientdata-size_dim,
                  'X' TO wa_clientdatax-unit_of_wt,
                  'X' TO wa_clientdatax-net_weight,
         wa_tab-werks TO wa_plantdata-plant,
         wa_tab-ekgrp TO wa_plantdata-pur_group,
         wa_tab-prctr TO wa_plantdata-profit_ctr,
         wa_tab-werks TO wa_plantdatax-plant,
                  'X' TO wa_plantdatax-pur_group,
                  'X' TO wa_plantdatax-profit_ctr,
         wa_tab-werks TO wa_valuationdata-val_area,
         wa_tab-bklas TO wa_valuationdata-val_class,
         wa_tab-peinh TO wa_valuationdata-price_unit,
         wa_tab-verpr TO wa_valuationdata-moving_pr,
         wa_tab-stprs TO wa_valuationdata-std_price,
         wa_tab-xlifo TO wa_valuationdata-lifo_fifo,
         wa_tab-werks TO wa_valuationdatax-val_area,
                  'X' TO wa_valuationdatax-val_class,
                  'X' TO wa_valuationdatax-price_unit,
                  'X' TO wa_valuationdatax-moving_pr,
                  'X' TO wa_valuationdatax-std_price,
                  'X' TO wa_valuationdatax-lifo_fifo.
    APPEND wa_headdata TO it_headdata.
   APPEND wa_clientdata TO it_clientdata.
   APPEND wa_plantdata TO it_plantdata.
   APPEND wa_valuationdata TO it_valuationdata.
   MODIFY it_tab FROM wa_tab TRANSPORTING matnr.
  ENDLOOP.
ENDFORM.                    "populate_tabs
$$******************************************************************************

Hai.
check the below example.
REPORT z34332_bdc_create_material .
data: la_headdata type BAPIMATHEAD,
la_clientdata type BAPI_MARA,
la_CLIENTDATAX type BAPI_MARAX,
la_return type BAPIRET2.
data: i_materialdescription type table of BAPI_MAKT,
wa_materialdescription like line of i_materialdescription.
la_headdata-MATERIAL = '000000000000000004'.
la_headdata-IND_SECTOR = 'M'.
la_headdata-MATL_TYPE = 'FERT'.
la_clientdata-BASE_UOM = 'FT3'.
la_CLIENTDATAX-BASE_UOM = 'X'.
la_clientdata-MATL_GROUP = '01'.
la_CLIENTDATAX-MATL_GROUP = 'X'.
wa_materialdescription = 'TEST'.
append wa_materialdescription to i_materialdescription.
clear: wa_materialdescription.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = la_headdata
CLIENTDATA = la_clientdata
CLIENTDATAX = la_CLIENTDATAX
PLANTDATA =
PLANTDATAX =
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA =
VALUATIONDATAX =
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA =
SALESDATAX =
STORAGETYPEDATA =
STORAGETYPEDATAX =
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
IMPORTING
RETURN = la_return
TABLES
MATERIALDESCRIPTION = i_materialdescription
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
write: la_return-TYPE, ',', la_return-MESSAGE.
clear: la_headdata, la_return, la_clientdata, la_clientdatax.
regards.
sowjanya.b.

Similar Messages

  • Need help in using ActiveX to retrieve a VARIANT

    Need help in using ActiveX to retrieve a VARIANT.
    Variant is shown as       var{VT_Ul1,1}  in debug
    Using the following
    hr = CA_VariantGetShort (&var, &value);
    I get 0 for my answer instead of 1.
    Solved!
    Go to Solution.

    Answered my own question.
    VT_Ul1 is an unsigned char and not a short.

  • Need help on Using Oracle Acces Manager 11g

    Hi
    I Need help on Using Oracle Acces Manager Admin console to configure for SSO.
    I am new to Identity Management
    I have installed OAM 11g and configured for OAM in new weblogic domain
    Please help to proceed forward.
    Thanks
    Swapnil

    Hi
    Thanks for your reply
    I am able to login to the console
    I am unable to login the the weblogic server from another machine but abl eto do so from the machine where all this is installed
    What i feel is there needs to be some configurataion maybe policy or Agent
    IDMDomainAgent is configured and so is the OAM server configured .
    Please advice some books or link how to do achieve logging into the weblogic em/console from a remote machine
    Thanks in Advance

  • I need help on using up Microsoft.

    i need help on using up microsoft
    Moderator's Note: Post was moved and changed the title into a subject-related title. This is to keep the forum organized and let other forum users easily see and respond to this post.

    Please, we need the error message word for word. If you do not get an error message, please, elaborate in greater detail …
    Furthermore, which phone model do you use?

  • Need help in using sleep function in pl/sql

    Hi,
    need help:
    I have a condition where i want to validate total_pass=total_fail and
    I want to use the sleep function in a pl/sql where i want to wait for 2 minutes ie.checking
    whether total_pass=total_fail based upon class_id .
    I have the data in the table as:
    CLASS_ID TOT_PASS TOT_FAIL
    1 10 10
    2 5 4
    3 6 6
    4 7 5
    Any help will be needful for me

    I'm not quite sure what you are lookg for here, but whatever it is, your code as posted won't do it. You will never break out of the WHILE r_Class.Tot_Pass = r_Class.Tot_Fail loop, since these values will never change because you never get the next record form the cursor.
    From your original data, it looks like your cursor will return multiple rows which implies to me that you want to fetch the first row from the cursor, check if tot_pass = tot_fail, if they are equal, sleep for two minutes then get the next row. This does not make sense to me. Once the select in the cursor is executed, the data it returns will not change due to Oracle's read consistency model, so there seems to me no point in the sleep.
    The other alternative I can see is that you want to check all the returned rows, and if tot_pass = tot_fail for one of the rows (or possibly for all of the rows), then you want to sleep and try again.
    If you can explain in words what it is you are trying to accomplish, someone will be able to point you to a solution.
    John

  • New User,need help, charging, using, everythi

    I recently bought a Zen V Plus and have no tech savy so need help. I've checked with support but don't get th answers I need so thought someone here could help. Here are my questions.
    1. Is there anything else that can be used as a charger besides a Zen product. I have several cell phone chargers both for house and can, can any of these be used? need to save money
    2. Can the Zen be used while charging? All I get is the docked message and nothing else?
    3. I use my player mainly for audio books and the battery doesn't hold for a whole book so I have to charge but when I do the book goes? back to the first part instead of holding my place. I do I hold my place?
    Anybody that can give me simple clear answers please help. Because of my age I have trouble reading and the player allows me to enjoy books but I have trouble understanding how to make it work. Don't laugh but my 3 year old grandson would probably have better luck with getting it to work.
    Thanks for any help provided

    Li'vewolf,
    First, no three year old will do better than you can with the player. That said, spend some time reading the tutorials listed under support at the top of this page, and use the search in this forum to find everything you can about the Zen V Plus.
    When I shut down my Zen V plus, while reading my current audiobook, I just hit the pause button and then pull down the slide button on the left for "shutting down". Some of my books seem to do better with just a shut down instead of pause first. I have found that the bookmark feature is more trouble than it is worth. I use audiobooks from NetLibrary and Overdri've and a few extra from a forum on audiobooks. It seems that they all work differently when shutting down and holding a place.
    Anyway, spend some time trying different methods of bookmarking. The Zen V Plus is fairly forgiving player.
    Best Wishes.
    luvmyrescuedogs
    One more thought for recharging your battery. Try Amazon or eBay for a recharger, if you can't afford the Creative charger, but remember that you can fry the player if you use the wrong one and the warranty doesn't cover that damage. The easiest and cheapest way to recharge is to use the computer.

  • I need help in using iphoto?

    i have the appleipdmini but need help with iphoto, also how to move the cursor forward to delete error

    There is some help for the iPhoto app on this page : http://help.apple.com/iphoto/ipad/2.0/
    In terms of moving the cursor, you can use your find on the screen to reposition the insertion point - press and hold on the screen and after a second or so you should get a amgnifying symbol allowing you to position the insertion point. You can then delete backwards (there isn't a forward delete).

  • Need help for use crm fields into EJB2

    hello i need help.
    i have one db table (table_1):
    id_1
    field_1
    nad the second table that depends from the tale 1:
    id_2
    fields
    id_1
    id_1 is the field that join the table 2 with the table 1.
    can anybody helps me to implemet this relationship into the xml files and into the java class?
    into the java class for the second table i have:
    public abstract long getId_1();
    public abstract void setId_1(long Id_1);
    public abstract long getId_2();
    public abstract void setId_2(long Id_2);
    public abstract String getField();
    public abstract void setField(String field);
    how must i reference the relation into the bean and into the confdiguration xml files (i use Weblogic 8 and EJB 2.1)
    Thanks

    SRM doesn't use kind of "cockpit" LO-like in ECC.
    Overall picture:
    http://help.sap.com/saphelp_srm40/helpdata/en/b3/cb7b401c976d1de10000000a1550b0/content.htm
    If you setup data flows accordign Business Content of SRM:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/7aeb3cad744026e10000000a11405a/frameset.htm
    Then just perform an init load and schedule the deltas.

  • I have Iconia Tab A500, running 3.0, need help updating using microsd card, got Acer update download

    I have Iconia Tab A500 running 3.0, need help updating, I downloaded all updaes list in the acer supprt, all versions, 3.0, 3.1, 3.2, and 4.something, I read on the acer support somewhere I can use a microsd card to update my device, because acer no longer provides automatically, when i try it says "poor network connection, move to anthoer location.", Do I need to update all the listed updates, or can i only update, using the 4. 0? to get the last known update. I also downloaded, "Documents, Apllications, Drivers, Patches, and O.S..... How do i intsall all these updates, I think am running the very lowest version available, Please Help me... Thank you in advance.

    the update listed on the acer website, that mentions the a500 update is 'kernal source code (for Android 4.0 Ice Cream Sandwich) it's 96.7MB's released 2012/05/08' is that the right one i need? There is also a list of 3 O.S updates, released in 2014/09/05, 391.5MB's, 394.3MB's, and 391.5MB's large, what are those updates, I clicked the model and followed the directions that the acer website asks, and i ended with a list of update released in 2014/09/05, and a Document update released in 2014/12/17, 112.7KB's large,  list of updates reased in 2014/.... and in the Android 4.0 culumn, there is an update that says O.S update released in 2014/09/05, 434.2MB's large, and a Patch Update, that was released in 2013/03/21, what are these updates? listedin the aver website... http://www.acer.ca/ac/en/CA/content/drivers 

  • Need help with using Solaris FLAR across disparate platforms

    All,
    I need help with what needs to be done to use solaris Flash for disaster recovery between the disparate Server platforms listed below.
    I am concerned about the platform specific files that would be missing?
    Note: All our servers are installed with the SUNWCprog cluster through Custom jumpstart and We use disksuite for mirroring the operating system drives.
    Primary Server     Recovery Server
    Sun Fire 6800     Sun Fire E2900
    Sun Fire E2900     Sun Fire 6800
    Sun Fire-880     Sun Fire-V440
    Sun Fire-V440     Sun Fire-880
    Sun Fire 4800     Sun Fire-880
    Sun Fire-V890     Sun Fire 4800          
    Me

    jds2n,
    Is it possible to get around installing the Entire Distribution + OEM and include only the platform specific files?
    Just a thought
    Example:
    I would like to create a Flash Archive of a E2900 server which i plan to use to recover a 6900.
    The 2900 was installed with a developer cluster.
    When creating the Flash archive of the 2900 is it possible to add the 6900 platform specific files and drivers
    from the Solaris CD?
    Thanks

  • Need help in using a case statement in expression operator

    Hi All,
    I am using OWB version 10.2.0.1.0.
    My requirement is to add a new column called call _zone_key in expression operator and map it to the target table. I need to use the below expression for populating call_zone_key values
    Expression:
    case when (INGRP1.CHARGETYPE in ('O','F') or  INGRP1.TARIFF_GROUP in ('SMSINT','MMSINT')or ( INGRP1.CALL_TYPE = '002' and   INGRP1.TARIFF_GROUP  = 'MTV'))
    then
    (select call_zone_reltn_key from call_zone_reltn where
    call_zone_cd=substr(case
      when substr( INGRP1.B_SUBNO,1,2)='00'
      then
      substr( INGRP1.B_SUBNO,3)
      else substr( INGRP1.B_SUBNO,1)
      end,1,length(call_zone_cd))and rownum=1)
    else -1
    end
    All the columns needed for using the above expression is available in INGRP1 but still I am unable to deploy the mapping using above expression. Call_zone_reltn table is also imported to the module. I am getting below error
    Error:
    Warning
    ORA-06550: line 4980, column 2:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
       ( - + case mod new not null others <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> avg
       count current exists max min prior sql stddev sum variance
       execute forall merge time timestamp interval date
       <a string literal with character set specification>
       <a number> <a single-quoted SQL string> pipe
       <an alternatively-quoted string literal with character set specification>
       <an alternativ
    NEW_MOD_MAP_CELL_USAGE_FCT_PRE
    Create
    Warning
    ORA-06550: line 4989, column 43:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
       * & - + ; / at for mod remainder rem <an exponent (**)> and
       or group having intersect minus order start union where
       connect || multiset
    If i replace the expression with numbers such as 1 or 2, I am able to deploy the mapping.
    Kindly help in fixing this issue.
    Thanks,
    Kabilan

    You can't use the SELECT statement inside the expression, you need to join both tables before the expression. Use a Join operator with this JOIN condition:
    CALCULATED_CALL_ZONE_CD = call_zone_reltn.call_zone_cd ( + )
    Where Calculated_call_zone_cd proceed from a previous expression:
    CALCULATED_CALL_ZONE_CD = substr(case when substr( INGRP1.B_SUBNO,1,2)='00' then substr( INGRP1.B_SUBNO,3) else substr( INGRP1.B_SUBNO,1) end,1,length(call_zone_cd))
    And after joining both tables, you can use another expression to get the rownum, then another filter operator to keep only the rownum = 1, and now you can use your expression without the SELECT, using the call_zone_cd column from the outgroup in the joiner operator (you need to include that column in the filter operator to use it).
    Regards
    ANA GH

  • Need help in using SUBSTR

    Hi,
    I have a table tablea where a column stores values like ABC LTD,BCD LTD,CEF LTD,DEFEF LTD.
    I want the output as
    ABC,BCD,CEF,DEF
    i have used substr but could not frame the result as the last value stores DEFEF so culd not do substr(1,3) from the table
    Any help will be needful for me
    Edited by: user13443042 on Jan 26, 2011 2:31 AM

    You mean like this?
    SQL> ed
    Wrote file afiedt.buf
      1  select trim('.' from replace('ABC LTD,BCD LTD,CEF LTD,DEF LTD.',' LTD'))
      2* from dual
    SQL> /
    TRIM('.'FROMREP
    ABC,BCD,CEF,DEF
    SQL>However, it looks like your data structure is wrong. You shouldn't store multiple values in a single string in a colulmn. These should be multiple records or multiple columns as appropriate.

  • Need help in using dbms_lob.read

    I need to upload a file into an Oracle table into a Blob column. The file name along with the file contents are all in one BLOB column.
    Once that is done I need to read from the file and extract the file contents and load it into a staging table.
    File being uploaded is a *.CSV* file.
    E.g. Of the .CSV file is: ABC.csv file and its contents will look like:
    1,Hello,Nisha
    2,Hi,Ravi
    3,Bye, Rahul
    Etc…..
    Therefore the table containing the BLOB column will contain:
    File Creation_date
    ABC.csv 09/11/2009
    How can I read a file from the BLOB column and upload into a staging table?
    Final Staging table should look like:
    Record Number Greet Name
    1 Hello Nisha
    2 Hi Ravi
    3 Bye Rahul
    I think I am suppose to use dbms_lob.read, but I am not really sure how to use it. If there is any script, kindly mail me the same.
    Thanks....

    Nisha,
    Check this example (test) and see if it can be any help. I have utl_file and sqlldr
    First Method -- I loaded alert.log successfully and you can imagine how big this file can be (5MB in my test case)
    create table t1clob
    ( clob_text clob);
    CREATE OR REPLACE DIRECTORY DIR AS '/path_to_csv_file/;
    DECLARE
       clob_data   CLOB;
       clob_file   BFILE;
    BEGIN
       INSERT INTO t1clob
       VALUES (EMPTY_CLOB ())
       RETURNING clob_text INTO clob_data;
       clob_file   := BFILENAME ('DIR', ABC.csv');
       DBMS_LOB.fileopen (clob_file);
       DBMS_LOB.loadfromfile (clob_data,
                              clob_file,
                              DBMS_LOB.getlength (clob_file)
       DBMS_LOB.fileclose (clob_file);
       COMMIT;
    END;Second Method: Use of Sqlldr
    Example of controlfile
    LOAD DATA
    INFILE alert.log "STR '|\n'"
    REPLACE INTO  table t1clob
       clob_text char(30000000)
    )Hope this helps.

  • Need help in using my GPRS connection to surf internet on macbook

    Hi,
    I have a Nokia 9300 communicator, with a GPRS conenction. I want to use it to connect to the internet on my macbook. Since I am in India, my service provider, not having sufficient knowledge of the mac, cannot help me with configuring it.
    can anyone hwlp me here?
    i want to connect using bluetooth. Also, although I can connect the phone to the macbook via bluetooth and can trabsfer files to & fro, I cannot syncronise my phone book.
    How do I go about doing that??
    Thanks in advance.

    Hi Brian, Thanks for that. I went to meet my service provider (Hutch) yesterday. What he told me is very close to yours. Here it is
    First, when we have to make the new connection, there are 2 options - dial up or GPRS line. We tried GPRS line and set up as follows:
    Username: Blank
    Password:Blank
    Number to dial 99**# or *99#
    Here, the guy wants to know where we can enter the APN number - & I have no clue.
    Second, using these settings, I got connected, the MB says it was authenticating user and my call also showed the "G" sign, but it went away after a second, giving me an error message - Could not negotiate connection with PPP server.
    Just for curiousity sake, this guy tried his cell- a Nokia 6230. & it worked just fine. There was this problem, though, that every few seconds, the connectiion went off, giving the message that the modem had unexpectedly hung -up (& the poor guy's cell would switch off & on again on its own). But this is still distant for me.
    I need your help in getting the modem script that you are talking about. I can only see 3 nokia modems- & they are all ir, none of them are for GPRS.
    My problem is that there is no store or anything like that in India. I just bought the MB when in London recently, as it looked nice. Not very sure what to do now.
    Awaiting more help
    Rajat

  • NEED HELP IN USING ALL_TAB_COLUMNS FOR RETRIEVING DATA???

    A table say T1 contains column like Emp_id,Code.
    and there are several Code like C1,C2,C3.
    Another table say T2 contains column like
    Emp_id,C1,C2,C3.Here the value of the code field of the
    T1 table is now column of the T2 table.And the amount of
    each code of T1 table is equal to column value of T2
    table.
    Now I want to retrieve data from T2 table like
    C1 200
    C2 300
    C3 140
    I cannot retrieve data like this using all_tab_columns.
    I can only getting the column_name but cannot its value.
    PLEASE HELP ME...
    Edited by: user630863 on Apr 8, 2009 11:37 AM

    emp_id | code
    001 | C1
    001 | C2
    005 | C3
    005 | C1
    002 | C2
    002 | C3
    Table T1
    emp_id | C1 | C2 | C3
    001 | 10 | 15 |
    002 | | 7 | 12
    005 | 45 | | 94
    Table T2
    I have written a query
    select column_name from all_tab_columns a,T1 b
    where a.column_name=b.code
    and table_name='T2'
    OUTPUT:
    C1
    C2
    C3
    But I Need data for each employee like
    001 C1 10
    001 C2 15
    002 C2 7
    002 C3 12
    005 C1 45
    005 C3 94
    Edited by: user630863 on Apr 8, 2009 1:28 PM

Maybe you are looking for