How to update key fields for table

Hi,
how to update key fields for a table.The update statement is not working for the same.
Regards,

Hi,
See the below example.
TABLES SPFLI.
DATA WA TYPE SPFLI.
MOVE 'AA' TO WA-CARRID.
MOVE '0064' TO WA-CONNID.
MOVE 'WASHINGTON' TO WA-CITYFROM.
UPDATE SPFLI FROM WA.
MOVE 'LH' TO SPFLI-CARRID.
MOVE '0017' TO SPFLI-CONNID.
MOVE 'BERLIN' TO SPFLI-CITYFROM.
UPDATE SPFLI.
CARRID and CONNID are the primary key fields of table SPFLI. All fields of those lines where the primary key fields are "AA" and "0064", or "LH" and "0017", are replaced by the values in the corresponding fields of the work area WA or the table work area SPFLI.
Regards,
raj.

Similar Messages

  • How Update Custom fields for EABL DB table by using BAPI_MTRREADDOC_UPLOAD

    Hi friends,
    How can I Update Custom fields for EABL DB table by using BAPI_MTRREADDOC_UPLOAD
    for the parameter EXTENSIONIN of type BAPIPAREX
    I am passing the Structure as BAPI_TE_EABL
    in that structure MRIDNUMBER as EABL-ABLBELNR field value
    ZMESSAGE some text of 30 char and
    ZSKIPC of 2 char
    but I am not able to update that data for the MRIDNUMBER (ABLBELNR ) in DB table EABL
    I am getting RETURN Structure message type E
    as
    "Upload interim entries: Maintain one table only"
    Can any one provide me solution
    Thanks in Advance
    Ganesh

    Hi,
    Refer the following SAP notes.
    1. Note 485557 - BAPI_REQUISITION_CREATE: 'EXTENSIONIN' customer enhancements
    2. Note 584902 - BAPI_REQUISITION_CHANGE: ExtensionIn not connected
    3. Note 792132 - EBAN, EBKN: user-defined fields are not filled
    Regards,
    Harish

  • How many primary key fields  allowed for one table?

    hi,
    when i creating a table , how many primary key fields are allowed for one table.
    please any one give ans
    thanks

    Just checked it,  Its 255, not 155.  You can have as many key fields as you want, but you can not go over the 255 byte length for the total of all key fields.  You will get a warning for over 120, as it says that there is limited functionality with a key over 120 in length.
    Again, this is a total length of all key fields.
    Regards,
    Rich Heilman

  • How to update ABSKZ field in the table EKPO

    Hi
    Is there any way to update the rejection indicator (ABSKZ) field of table EKPO?.
    I am looking at BAPI_CHANGE_PO FM, But it does not have ABSKZ field in the item structure BAPIMEPOITEM.
    Do I need to extend the BAPI structure with ABSKZ field ?
    Regards
    Raj.

    Hi
    To extend  BAPI_PO_CHANGE  for EKPO-ABSKZ field , we have to add field in the structure BAPI_TE_MEPOITEM to pass it to  EXTENSIONIN. As ABSKZ field already availble in the EKPO it is not allowed to add ABSKZ in the structure BAPI_TE_MEPOITEM. it is throwing below error message.
    Field ABSKZ in table EKPO is specified twice. Please check
    Since it is not Z field and also not availble in the structure BAPIMEPOITEM  not sure how to update ABSKZ field in the EKPO table.
    Please advice.
    Regards
    Raj

  • How to update the field ZLSPR of table BSEG

    HI Friends,
    Can anyone tell me how to update the field ZLSPR of table BSEG? I've a 700 line abap program and I should include some logic in this program to make an entry into BSEG-ZLSPR. Is there any FM/BAPI available? Is BDC a healthy approach?. My team lead do not want me to use UPDATE statement....please help.
    Thanks in advans,
    Varsha.

    Hi,
    Hi ,
    You will need to group that radiobuttons so that SAP knows they are linked together. To do this using the grahical layout editor simply select all the radiobuttons and then right click on them, Now choose define group. Once you have done this you should not need any of the "clear" or "='X'" statements SAP should control it all for you.
    hope this helps
    Reward if found helpfull...
    Venkoji Babu.

  • No entry in key field of table MARC for BAPI_MATERIAL_MAINTAINDATA_RT

    Hi Gurus ,
    I have a requirment to upload Retail Articles. I am using BAPI_MATERIAL_MAINTAINDATA_RT to create articles for Basic View, Listing View and Sales View.
    I got the error:
    No entry in key field of table MARC
    Message no. MG502
    Moderator message - Please respect the 5,000 character maximum when posting. Post only the relevant portions of code
    Please let me know how to fix this.
    Edited by: Rob Burbank on Dec 22, 2010 12:38 PM

    Thanks a lot Rob Burbank  for the hint!
    I figured out that though I was passing the Site under MARC, it wasn't getting transfered to the field. I fixed the code.
    Thanks for prompt response!

  • How to do hibernate mapping for table or view without a primary key

    Hi,
    Anyone knows how to do hibernate mapping for table or view without a primary key?
    thanks.
    cc

    or you can make all column primary key .Anybody seriously considering that as a good idea should understand the implications:
    1. this requires that each row be unique - that's a minor issue normally, but can be a significant problem in some cases
    2. in practically all databases, a primary key constraint creates a unique index - this has many implications:
    a) in most databases, the index stores a copy of the column data that is indexed - this suggestion therefore more than doubles the data storage required for the data
    b) whenever an indexed column is changed, the index has to be maintained - this suggestion then more than doubles the work that each UPDATE statement has to do, since both the table and the index have to be maintained for any UPDATE at all
    This might work OK for toy projects, but it doesn't scale well at all...

  • EEWB: Insert New Table with more than one key field  for BP object

    Hi Gurus,
    I want to enhance Business Partner object with a new table with two key fields, one the address number and another a sequence number, because I need to save several entries for each address belonging to a determined business partner. Something as what happens in communication data (i.e fax number)for an address.
    I have run the wizard from EEWB but the only possibility that offers you is to create only one key field for the new custom table. There is something in EEWB to achieve this, two key fields for the new table?
    Another question is the following: which Badi or BAPI must I enhance to populate my table with the corresponding address number to which the data belong to?
    I mean my custom data are filled through a table control that I have allocated within the screen sequence BUA130 (Detail Address). Thus, when a new address is added to a BP and my particular table control is populated within this address I should fill the key fields from my table (address number and sequence number) when the BP were saved. So, I must know beforehand which address number the system will assign to this new address.
    I repeat the question: which Badi or BAPI must I enhance to populate my table with the corresponding address number to which the data belong to?
    Thanks in Advance.
    Regards,
    Rosa Ferrando

    Hi Rosa,
    Please go through the following links. It will help you.
    <a href="http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm">http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm</a>
    <b>Reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Update PRODH field from table T179T

    hi,
    i want to update PRODH field from table T179T into table VBRP. for this we
    need to take selection option also.
    selection option will be :
    ·             Sales Organization (field VBRK-VKORG)
    ·       Billing Date Range (VBRK-FKDAT)
    ·       Distribution Channel (Vbrk-vtweg
    while i have done this for one field by using hard code but like:
    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    but this is not the right way. please guide me how to solve this.

    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    <b>commit work.</b>
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    use commit work after update statement.
    But this code would make vbrp-vbeln as plc01 only.
    If you want to get the prodh value from t179t, then write a sleect on t179t and then update.
    TABLES: VBRP.
    CLEAR VBRP.
    select single prodh
      from t179t
    where......
    UPDATE VBRP SET PRODH = t179-prodh WHERE VBELN = '0008300051'.
    commit work.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.

  • How to set key fields in a Database view

    Hi guru's
    iam balaji,plz guide me with how to set key fields in a view.......that field is a non key field in the base table....
    thanks in advance,
    Balaji.S

    take a look at this:
    Diagnosis
        In the view, not all of the mandatory fields were included as key
        fields. The key of the view therefore is not unique.
    System Response
        All the fields are regarded as key fields in order to guarantee that th
        key lengths are unique.
    Procedure
        For views with a large number of fields, this could have a negative
        effect on the performance for the language construction described below
        In this case, all the mandatory key fields should be included in the
        view.
    regards

  • How to include key field in classification datasource?

    Hello,
    How can I include key fields in a new classification datasource?
    When i try to generate my classification datasource i get this error:
    No key field found for creation of DataSource
    Diagnosis
    During generation of a classification or configuration DataSource, only those key fields for the object table (field "Obj.Tabelle") that are already present in the basis DataSource transferred to the extract structure. This is the case when none of the key fields of the object table were found in the structure of the basis DataSource.
    Hence the datasource does not get generated.
    Thank you very much and regards.

    Hello Prem,
    Yes, the characteristisc are in the system. I also saved these charateristics, they are in N status at the moment.
    The problem is when i click on Datasouce buttom to generate the datasource, this is when I get the error message i mention above.
    I tried to do an example with 0MATERIAL_ATTR with obj. table MARA and class cat 001 and i had no problem.
    Then i try to do it with 0PLANT_ATTR obj table BETR and class cat 030 and i get this key problem.
    Can this be related to the fact that MARA table has got a key and BETR does not have one?
    Thank you and Regards.

  • How to update single field

    Hi frnds,
                        How to update single field data in Z table .
                       I am taking data from screen, when i press update button  the data will store specific field data in Z table.

    Dear Rakhi,
    You can use the below syntax.
    Hope this would solve your problem.
      LOOP AT tpra INTO wpra.
        UPDATE zpra
        SET    pra2 = wpra-pra2
        WHERE  pra1 = wpra-pra1.
      ENDLOOP.
    In WHERE give KEY VALUES
    In SET give the particular value that has to be changed.
    Regards,
    Pintoo
    Edited by: pintoo2805 on May 18, 2010 7:10 AM

  • How to updated matrix into related table?

    hi, can anyone help me below coding how to updated matrix into related table?
    Thank you.
                For rowNum = 0 To oMatrix.RowCount
                    oRecordset.Fields.Item("Code").Value = oMatrix.Columns.Item("DSCode").Cells.Item(rowNum).Specific.Value
                    oRecordset.Fields.Item("Name").Value = oMatrix.Columns.Item("DSName").Cells.Item(rowNum).Specific.Value
                    oRecordset.Fields.Item("U_RPTC").Value = oMatrix.Columns.Item("DSReport").Cells.Item(rowNum).Specific.Value
                    oRecordset.Fields.Item("U_USRC").Value = oMatrix.Columns.Item("DSUser").Cells.Item(rowNum).Specific.Value
                    oRecordset.MoveNext()
                Next

    For Fast Matrix Loading you can user some thing like this.
            Dim Column As SAPbouiCOM.Column
            Dim Matrix As SAPbouiCOM.Matrix
            Dim Table As SAPbouiCOM.DataTable
            Table = oForm.DataSources.DataTables.Add("Documents")
            Table.Columns.Add("Code", SAPbouiCOM.BoFieldsType.ft_Integer)
            Table.Columns.Add("Name", SAPbouiCOM.BoFieldsType.ft_Integer)
            Table.Columns.Add("U_RPTC", SAPbouiCOM.BoFieldsType.ft_AlphaNumeric, 255)
            Table.Columns.Add("U_USRC", SAPbouiCOM.BoFieldsType.ft_AlphaNumeric, 255)
            Matrix = oForm.Items.Item("MatrixUID").Specific
            Column = Matrix.Columns.Item("Code")
            Column.DataBind.Bind("Documents", "Code")
            Column = Matrix.Columns.Item("Name")
            Column.DataBind.Bind("Documents", "Name")
            Column = Matrix.Columns.Item("U_RPTC")
            Column.DataBind.Bind("Documents", "U_RPTC")
            Column = Matrix.Columns.Item("U_USRC")
            Column.DataBind.Bind("Documents", "U_USRC")
            Table.ExecuteQuery(SQLQuery)
            Matrix.LoadFromDataSource() 'Load The Data to the Matrix
    To pull the data form the display back to the Table you can use this
    Matrix.FlushToDataSource()

  • How to update 2 fields automatically rest manually on page

    Hello folks,
    I have got a question on how to update 2 fields in a table automatically (in my case this is one field for the user and one field for the correct date and time). This should happen automatically every time an user changes a row in the table. But it seems as if i cant change the fields i tried it with the changing of the textfield but he dont change the values in the database. I even tried a separate update statement but since this is set after the commitchanges() command it seems as if he ignores any following commands.
    So anybody a good idea how i can change easily these two data fields? I just cant believe that you must manually change the fields, thats not the use of these 2 fields.
    Thanks in advance for your help
    Acinonyx

    To be exact i have got a page with different fields which get their data from my database. Two fields which contain an userid and the other a date and time value should get updated automatically when the user changes something of the other values on this page and press a button which calls the commitchange method. But since this should happen automatically and not manually i cant put these changes in the database. The manual changes are saved without any problems but the automatical changes not. So my question is how can i change a value programmatically and make him save these canges in the database?
    I already tried to put the new values in the fields or even detailed in the database but i cant get him to update these two fields.
    Acinonyx

  • How to select this field  for the extractor?

    Hi Gurus, I hope you are fine!
    I need to extract the field     PRED_OPPT_GUID   form the Data source  0CRM_SRV_CONTRACT_H inside CRM system.
    If I go inside CRM to:   
    Transaction SBIW -> Settings for BW Adapter -> Maintain DataSource and Enhance BW Adapter Metadata ->
    tipe "0CRM_SRV_CONTRACT_H" and press change buttom -> Mapping TAB
    there I can see the field I need "PRED_OPPT_GUID"  but this is not selected at the "BW Selection" Column , I guess this is the cause why I am not receiving this field from the extractor, Am I right?
    If yes, How can I select this field  for the "BW Selection" Column? (the system does not allow me to click it directly)
    if not, what is the proper procedure if I need to extract this field ? because this is the key field  for  the DSO 
    " Service Orders: Header Data "
    Thanks

    This is what i can see inside the  ROOSFIELD table:
    Filtered by data source = 0CRM_SRV_PROCESS_H
    Comparison with another field:
    BILL_TO_PARTY  (working properly)    columns:        SELECTION = X              NOTEXREL= Y
    PRED_OPPT_GUID (Not working)           columns:        SELECTION = (Empty)    NOTEXREL= Y
    I think that if I try to change the Selection field to X it will cause inconsistencies with the SMOXRELP table am I right ?
    I tried to change using the system and not directly into the tables, but thaere was an inconsitecie between these 2 tables.
    Why is no able this field taking into account that this is the KEY FIELD inside the standard DSO? it has no sense to me.
    What do you think?
    regards.

Maybe you are looking for

  • Flash and quicktime export not possible at all!

    hi iwork dev team! as there was no result on my prev post, here again: i use keynote'08 4.02 on imac with 2gb and osx 10.5.2. i created a presentation with 15 slides and over all 16,5 minutes. each slide has a mp3 sound file attached (the speakers vo

  • Using my 30 inch Cinema display to watch my Comcast Cable?

    Just a thought, my monitor is much larger than my tv. Is there such a way to hook my cinema display into my comcast cable/dvr box? Thanks, Christine

  • Unable to link shapes to track paths

    I had designed a shape then I had established the track (both manually or analizyng the movement) but ...... puttig the track number in the right box to make my shape moving .... the shape stand still !! Where I am wrong ???? Thanks Luca.

  • Get Unix process ID from forms

    Does anyone know how can I get the Unix Process ID of my running forms applicaton from the client side forms application? null

  • My ipod won't update or restore.

    My ipod touch will not update or restore. It's 4th generation. 4.3 software. and im trying to update it to 4.3.3. I'm on a windows computer running Vista. I have done all updates to windows and itunes. I get error code 3194. I have tried everything s