Inserting a single field in a custom table

hi all,
can u tell me hw could i insert a single field in the custom table.
i have abt 6 fields in the custom table.
5 fields are already populated...
i have to insert one field ..i dont want to use insert statement.
thanx in advance

HI,
You can use UPDATE statement
UPDATE ztable SET SIXTH_FIELD  = 'value'
              WHERE key_field = 'asdf'.
Thanks
Naren

Similar Messages

  • Syntax for inserting a single field

    hai
      can u please tell me what is the syntax for inserting a single field in ztable.
    Regards,
    N.selvamuthukumar.

    inserting a single field doesnt make sense if table has more dan one primary keys.
    The syntax is
    INSERT INTO TABLE  VALUES WA_TABLE.
    where wa_table is of type ztable.

  • Setting a default initial value to a CHAR type field in a custom table

    Is it possible to set a default initial value to a field in a customer table(Ztable) that is not SPACE?  SAP sets the initial value to " " space for datatype CHAR.
    I am looking at creating a field in a table that would always default to 'X' on creation of a new row.
    Your response is appreciated..

    Hi,
    I believe this cannot be done..
    If you are inserting the row through a program then you can insert the field value to be 'X'.. If the value is not passed ..Then it will be blank..
    If you are using table maintenance then in the PAI ..you can insert values..
    Thanks,
    Naren

  • How to find out the user who has created  a new field in the custom table.

    How to find out the user details who has created  a new field in the custom table.
    Thanks,
    Joan

    Hi Jesudasan ,
    You can know the user details with version management.Please find the
    below procedure to know.
    Go to table->Utilities tab->version->Version management->Compare the previous one .
    Hope this solves the issue,Let me know if you have any issues.
    Thanks,
    Rajani

  • Changing Non key field to Key field in a custom table

    Hello Abap gurus:
    I have a requirement in which i need to change a non key field in my custom table(Z TABLE) to key field.
    For example; i have field sequence as
    field 1  key field
    field 2 key field
    field 3 key field
    field 4 non-key field
    field 5 non-key field
    field 6 non-key field
    field 7 non-key field.
    i want to change field 7 as key field.
    Can i do perform operation??
    when i am tryingto perform bove operation it is taking long time to get the table activated.
    Could any one please help me in getting this resolved.
    regards,
    Sravanthi.

    Use DB Utility (se14) to perform alter table or conversion. The latter is used when atemps to perform first operation fails. Which one is used, really depends on system and current DB table state (i.e. if has any content and what is being adjusted).
    The way Max suggested is similar to [conversion process|http://help.sap.com/saphelp_nw04/helpdata/EN/cf/21f1b8446011d189700000e8322d00/content.htm] which system takes care of itself.
    Refer [Adjusting Database Structures|http://help.sap.com/saphelp_nw04/helpdata/EN/cf/21f1ab446011d189700000e8322d00/content.htm] and already given link to conversion.
    Please also consider potential errors while doing conversion . This can lead to data loss, so you should think of some backup to prevent that.
    Regards
    Marcin

  • How to delete data from single field in a database table?

    Hi guys,
         Plz suggest me How to delete data from single field in a database table?
    thnks,
    pavan

    hi
    in addition to abv details..chk this:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3aef358411d1829f0000e829fbfe/content.htm
    http://dev.mysql.com/doc/maxdb/en/34/ee7fbd293911d3a97d00a0c9449261/content.htm
    regards,
    madhu

  • Insert delete or update entry in Custom table from KONV entry changed

    Hi All,
    I have custom table ZKONV with only few required columns and should have same number of records as KONV has at any point in time.
    KONV is a cluster table so its not readable from ORACLE level. So ZKONV is created. But I dont know how to keep these both tables in sync.
    I need to perform insert delete or update entry in Custom table if insert delete or update happens on cluster table KONV from any transactions.
    As KONV is a cluster table and does not have changed time stamp I am not able to know the number of records changed in perticulat time period.
    Thanks,

    Thanks for reply,
    There is a Outside SAP system which needs to read KONV data to feed into their system, but as KONV is cluster table they are not able to read it from ORACLE level.
    To solve this we are thinking to create a transparent Z-table and will fill it with KONV and catch Update, delete or Insert statement and do same on ZKONv.
    Is this possible some how? by some database event or something....

  • To populate values into single field in an internal table

    Hi Friends,
    How we need to populate values into single field in an internal table.
    E.g itab consits of single field ( name)
           i need to assign values to this field name .like
          peter,
          john,
          abrahm,
          daneyal
    Pls tell me i how i need to code for this
    Thanks ,
    Parnith

    Hi,
    Please look at the below code :
    DATA : BEGIN OF itab OCCURS 0 ,
             name(20) TYPE c,
           END OF itab.
    START-OF-SELECTION.
      itab-name = 'Peter'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'John'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'Abrahm'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'Daneyal'.
      APPEND itab.
      CLEAR itab.
      LOOP AT itab.
        WRITE : / itab.
      ENDLOOP.
    Thanks,
    Sriram Ponna.

  • WebDynpro -  How to pass a single field value to BAPI table?

    Hello,
    I have just come from WebDynpro ABAP training and being a novice hit my first issue right away.
    I need to use BAPI - BAPI_CONTRACT_CREATEFROMDATA to create SD contract (I have used this BAPI to create a service call inside Webdynpro). I have two required fields: contract start and end dates. These fields passed in a table called CONTRACT_DATA_IN.
    When I use the fields from the structures or individual fields, all I need to do is just put them on the view, and when I hit my submit button they will be passed to the BAPI. They are a part of COMPONENTCONTROLLER context (I have also mapped them in View context), but tables are obviously different.
    Is there any way to pass data to tables as seamlessly without any code as for structures? Or do I need to write code to get the values from the input fields and then populate the table manually?
    Thanks,
    Alex

    Hi,
    Single customer contract creation use the struture-
    If you want to pass only one record then using the input fields for those 2 fields we can pass them to BAPI and then create the Customer Contract. This will work for only one record of customer contract.
    then we can directly read these input fields and pass to BAPI.
    Creating many customer contracts -
    For example, If you want to provide the group of records at a time and then you want to create the cusotmer contracts for so many records then you fill these fields and pass them to table then pass this table to the tables parameters of that BAPI.
    Here we need not create the Table UI element separate input fields would serve the purpose.
    Now we can create the batch of contracts for N customers.
    these input fields of a customer will be passed to table, then next set of input fields etc.
    For this create the Table UI element and fill all the records and then pass it to the Tables of the BAPI.
    Regards
    Lekha

  • Error while inserting value Qualified field in the main table

    Hello,
    I am trying to populate Qualified field in the main table when a new record is inserted in the Products Repository.
    The field is Reference Price and its a qualified lookup field. I am using the below code to create qualified lookup value and create qualified link values.
    QualifiedLookupValue qlvRefPrice = new QualifiedLookupValue();
    TableId qltabid = repSchema.getTableId("ReferencePrices");
    FieldId qlfieldid = repSchema.getFieldId("ReferencePrices","RP_ReferncePrices");
    RecordId rdRefPrice = getRecordId(connPool,session,"RP",qlfieldid,qltabid);
    HashMap map = new HashMap();
    map.put(repSchema.getFieldId("ReferencePrices","StartDate_ReferencePrice"),new DateTimeValue(cal));
    map.put(repSchema.getFieldId("ReferencePrices","EndDate_ReferencePrice"),new DateTimeValue(cal));
    map.put(repSchema.getFieldId("ReferencePrices","ListPrice"),new FloatValue(Float.parseFloat("123.3")));
    map.put(repSchema.getFieldId("ReferencePrices","Currency"),new LookupValue(getLookupRecordId(connPool,session,"Currencies","Currency_Currencies","EUR")));
    QualifiedLinkValue qlvLinkValue = MdmValueFactory.createQualifiedLinkValue(rdRefPrice,map);
    qlvRefPrice.addValue(qlvLinkValue);
    emptyRecord.setFieldValue(fieldIdRefPriceHistory,qlvRefPrice);
    However when the createrecord command is executed I get the following error.
    java.lang.RuntimeException: No matching validation Id 97. at com.sap.mdm.internal.validation.ValidationInfoHelper.retrieveValidations(ValidationInfoHelper.java:71) at com.sap.mdm.data.commands.CreateRecordCommand.execute(CreateRecordCommand.java:246) at com.alcatel_lucent.productdetail.ProductItemDetail_Comp.createProduct(ProductItemDetail_Comp.java:2927) at com.alcatel_lucent.productdetail.wdp.InternalProductItemDetail_Comp.createProduct(InternalProductItemDetail_Comp.java:656) at com.alcatel_lucent.productdetail.ProductItemAddView.onActionSave(ProductItemAddView.java:971) at com.alcatel_lucent.productdetail.wdp.InternalProductItemAddView.wdInvokeEventHandler(InternalProductItemAddView.java:662) at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:761) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:696) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73) at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:869) at com.sap.tc.webdynpro.portal.pb.impl.localwd.LocalApplicationProxy.sendDataAndProcessAction(LocalApplicationProxy.java:77) at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1356) at com.sap.portal.pb.PageBuilder.SendDataAndProcessAction(PageBuilder.java:327) at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:869) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:219) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)      
    I spoke to my MDM team and they say there is no validation which they have put for Reference Price field. I have tried inserting values in another field of type qualified lookup in the same main table and that works without any issue.
    The code is as below:
    QualifiedLookupValue qlvRating = new QualifiedLookupValue();
    TableId qlvtable = repSchema.getTableId("ProductRatings");
    FieldId qlvratinglink = repSchema.getFieldId("ProductRatings","RatingLink");                    
    RecordId rdidPR = getRecordId(connPool,session,"CI",qlvratinglink,qlvtable);
    wdComponentAPI.getMessageManager().reportSuccess("rdidPR "+rdidPR);
    HashMap mapPR = new HashMap();
    mapPR.put(repSchema.getFieldId("ProductRatings","AvailRating"),new LookupValue(getLookupRecordId(connPool,session,"AvailabilityRatings","AvailabilityRating_AvailabilityRatings","CI")));
    mapPR.put(repSchema.getFieldId("ProductRatings","EffectiveDate"),new DateTimeValue(cal));
    mapPR.put(repSchema.getFieldId("ProductRatings","FERAIndic"),new LookupValue(getLookupRecordId(connPool,session,"ReplacementIndicators","Code","FE")));
    mapPR.put(repSchema.getFieldId("ProductRatings","FERAOrdItem"),new LookupValue(getLookupRecordId(connPool,session,"ReplProducts","ProdID","100008200")));
    QualifiedLinkValue qlvLink = MdmValueFactory.createQualifiedLinkValue(rdidPR,mapPR);
    qlvRating.addValue(qlvLink);
    emptyRecord.setFieldValue(fieldIdRatingHistory,qlvRating);     
    I would really appreciate if someone can help in solving the issue.
    Thanks in advance,
    Aamod

    Hi Aamod,
    Sees that some validation/assignments are getting triggered as soon as you make changes to the record in MDM. Please check once after removing validations/workflow that you may have. This way you may debug the issue.
    Hope this helps!!
    Cheers,
    Arafat

  • HOW TO HIDE FIELDS IN A CUSTOM TABLE - URGENT

    Hi all,
    I've a requirement where I need to hide 2 fields of a custom created table(Z table with 4 fields). When I create a new record and when I Click on save it should display only 2 fields instead of all the 4 fields.
    A table maintainence generator is created for this table. Can somebody help me on how and where to code to hide 2 fields whenever I click on save creating a new record.
    All inputs in this regard will be highly valuable to me and appreciated.
    Thanks in Advance,
    Vaishnavi Varadarajan

    Use events in table maintenance generator '05' and write the code.
    go to se11-table name-utilities-table maintenance generator-extras-events in table maintenance generator . In the source code
    Put form abc.
    code.
    endform.

  • How to add F4 help for the custom field of a custom table

    Hi All,
    How to add F4 help to the custom table field? in the table maintainance when user clicks on F4 i want to provide possible values for this field I am trying to write the code in the screen of table maintainace like the following
    PROCESS ON VALUE-REQUEST.
      FIELD ZTEST_MAH_F4-KUNNR MODULE zVALUE_kunnr .
    But when i am double clicking on module it's giving options to create include program but after that it's giving user is currently editing the table i am not getting this can some body clarify my doubt it's gr8 if some body give some examp code
    Thanks&Regards
    mahesh

    Hi,
    Create a subroutine under the event and call the following FM
    1. Select all the related data into an itab, for ex i_kunnr
    2.    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
        DDIC_STRUCTURE         = ' '
           retfield               = 'KUNNR'
        PVALKEY                = ' '
           dynpprog               = sy-repid
           dynpnr                 = '1000'
           dynprofield            = <selection screen field>
        STEPL                  = 0
        WINDOW_TITLE           =
        VALUE                  = ' '
           value_org              = 'S'
        MULTIPLE_CHOICE        = ' '
        DISPLAY                = ' '
        CALLBACK_PROGRAM       = ' '
        CALLBACK_FORM          = ' '
        MARK_TAB               =
      IMPORTING
        USER_RESET             =
          TABLES
           value_tab              = <b>i_kunnr</b>
        FIELD_TAB              =
           return_tab             = < return table >
        DYNPFLD_MAPPING        =
         EXCEPTIONS
           parameter_error        = 1
           no_values_found        = 2
           OTHERS                 = 3

  • HOW TO HIDE FIELDS IN A CUSTOM TABLE

    Hi all,
    I've a requirement where there's a maintainence view attached to  a custom created table. Whenever I add new entries via View, on saving the record, 2 of its fields only should appear.
    For example, if my table looks like this,
    SAP ID     OBJECT ID     FROM DATE     TO DATE
    Once i add a new record, when i press save, only 2 of fields say, SAP id and Object Id should appear instead of all the fields.
    Can someone throw light on this if you're aware? Any input in this regard will be highly valuable to me and appreciated. If someone is unable to intrepret this question, do let me know, I'll detail it again.
    Thanks in Advance,
    Vaishnavi Varadarajan

    hi Vaishu,
    Hide parameter / select option in selection screen
    We can Hide parameter / select option in selection screen dynamically by manipulating screen object.
    SCREEN is like an internal table with a header line. However, you do not have to declare it in your program. Go to debugging mode and then view structure of screen.
    You can modify SCREEN in your ABAP program during the PBO event of a screen. Its contents override the static attributes of the screen fields for a single screen call. The only statements that you can use with SCREEN are:
    LOOP AT SCREEN.
    MODIFY SCREEN.
    ENDLOOP.
    We can hide parameter by set screen-active to 0.
    Here is example of how to hide parameter in selection screen. Write it, and change click on radiobutton to hide parameter.
    REPORT ZAALGAL0006.
    DATA: d_ucomm LIKE sy-ucomm.
    PARAMETERS: p_grpa1(10) MODIF ID A,
    p_grpa2(5) MODIF ID A,
    p_grpb1(2) MODIF ID B.
    PARAMETERS: p_actA RADIOBUTTON GROUP rad1 USER-COMMAND ACT DEFAULT 'X',
    p_actB RADIOBUTTON GROUP rad1.
    AT SELECTION-SCREEN.
    d_ucomm = sy-ucomm.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT screen.
    IF p_actA = 'X'.
    IF screen-group1 = 'B'.
    screen-active = 0.
    ENDIF.
    ELSEIF p_actB = 'X'.
    IF screen-group1 = 'A'.
    screen-active = 0.
    ENDIF.
    ENDIF.
    MODIFY screen.
    ENDLOOP.
    START-OF-SELECTION.......
    pls refer the below sites for reference. they may help you
    http://www.blogtoplist.com/software/blogdetails-14026.html
    http://sap.ionelburlacu.ro/abap/sap2/Other_Useful_Tips.html
    https:/.../servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/905e3d36-0301-0010-30ac-b55865545635
    thanks
    sagar
    reward me points if usefull

  • How can I Insert a Text field in a DATABASE TABLE???

    Hello at all,
    i have a database Table ZTEST with 2 columns.
    MANDT     TYPE     CLNT
    TEXT         TYPE     char     (255)
    In my internal table tab, i have a text content. I want insert this content in my database table ZTEST.
    DATA: tab TYPE TABLE OF ZTEST,
               lin TYPE ZTEST.
    lin-text = 'HELLO WORLD'
    APPEND lin TO tab.
    INSERT INTO ZTEST VALUES tab.
    Commit Work.
    Is this correct???? BECAUSE it doesnt work.
    Edited by: ETN_58 on Mar 31, 2010 10:27 AM

    Hi All,
    Here table ZTEST has two fields kunnr and text where kunnr is the key field.
            REPORT  ZATEST                                  .
           tables ztest.
          DATA: itab TYPE TABLE OF ZTEST with header line.
            itab-kunnr = '67890'.
            itab-text = 'HELLO WORLD'.
            APPEND itab.
           if sy-subrc eq 0.
               INSERT  ZTEST from table itab.
            Commit Work.
          endif.
           Check with this, its working fine.
                 Regards,
                Md Ziauddin.

  • Changing the size of a single field in runtime in table view

    Is it possible to change the row height to fit the entire text into the field for the column Exception text ?
    Is it possible to change the row height of the field exception text in run time, based on the amount of text it carries ??
    Please suggest.

    Hello,
    you can try to put the code similar to the one below in table iterator.
    METHOD if_htmlb_tableview_iterator~render_cell_start.
      DATA: lr_input TYPE REF TO cl_thtmlb_inputfield,
            lr_text TYPE REF TO cl_thtmlb_textview.
      IF p_column_key EQ 'ZLIKEATTRS'.
        lr_input ?= p_replacement_bee.
        lr_input->encode = abap_false.
        IF ( lr_input->disabled EQ 'TRUE' ) OR ( lr_input->disabled EQ abap_true )
          OR ( p_edit_mode IS INITIAL ).
    * --> input is readonly, instead of disabled input render text
          CREATE OBJECT lr_text.
          lr_text->id        = p_cell_id.
          lr_text->text      = lr_input->value.
          lr_text->_text     = lr_input->_value.
          lr_text->type      = lr_input->type.
          lr_text->_type     = lr_input->_value.
          lr_text->tooltip   = lr_input->tooltip.
          lr_text->align     = lr_input->alignment.
          lr_text->textdirection = lr_input->textdirection.
          lr_text->design    = 'VALUE'.                         "#EC NOTEXT
          lr_text->size      = lr_input->size.
          lr_text->width     = lr_input->width.
          IF lr_text->tooltip IS INITIAL.
            IF lr_input->_value IS NOT INITIAL.
              lr_text->_tooltip = lr_input->_value.
            ELSE.
              lr_text->tooltip = lr_input->value.
            ENDIF.
          ENDIF.
          lr_text->encode = abap_false.
          p_replacement_bee ?= lr_text.
        ENDIF.
      ENDIF.
    ENDMETHOD.
    In get method of your description column split the text into lines using <br> tag.
    Something like this:
    LOOP AT lt_attrs INTO lv_attr.
            CONCATENATE lv_value '<br>' lv_attr INTO lv_value.
        ENDLOOP.

Maybe you are looking for