Updating HRP table through abap codes - is it correct

Hi all,
In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP  table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
REPORT  ZHRPAR0005 .
TABLES: HRP1000, HRP1001.
DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
IT_1001-OTYPE = 'S'.
APPEND IT_1001.
INSERT INTO HRP1001 VALUES IT_1001.
Thanks
Ribhu

Hi Ribhu..
there are various FMs available for this purpose..
use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
then some related table might not be updated..
So use FMs..
RH_COPY_INFTY
RH_CUT_INFTY
RH_DELETE_INFTY
RH_INSERT_INFTY
RH_INVERT_RELA_INFTY
RH_UPDATE_INFTY
<b>For IT 1001 </b>
RH_CUT_INFTY_1001_EXT
RH_CUT_INFTY_1001_EXT_GENERIC
RH_DELETE_INFTY_1001_EXT
RH_DEL_INFTY_1001_EXT_GENERIC
RH_INSERT_INFTY_1001_EXT
RH_UPDATE_INFTY_1001_EXT
RH_BASE_READ_INFTY_1001
RH_READ_INFTY_1001
RH_READ_INFTY_1001_EXT
RH_READ_INFTY_1001_EXT_ONLY
Reward if useful
Regards
Prax

Similar Messages

  • Updating HRP tables through abap code- is it correct?

    Hi all,
    In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
    For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
    Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
    REPORT ZHRPAR0005 .
    TABLES: HRP1000, HRP1001.
    DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
    SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
    IT_1001-OTYPE = 'S'.
    APPEND IT_1001.
    INSERT INTO HRP1001 VALUES IT_1001.
    Thanks
    Ribhu

    Hi Ribhu..
    there are various FMs available for this purpose..
    use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
    then some related table might not be updated..
    So use FMs..
    RH_COPY_INFTY
    RH_CUT_INFTY
    RH_DELETE_INFTY
    RH_INSERT_INFTY
    RH_INVERT_RELA_INFTY
    RH_UPDATE_INFTY
    For IT 1001
    RH_CUT_INFTY_1001_EXT
    RH_CUT_INFTY_1001_EXT_GENERIC
    RH_DELETE_INFTY_1001_EXT
    RH_DEL_INFTY_1001_EXT_GENERIC
    RH_INSERT_INFTY_1001_EXT
    RH_UPDATE_INFTY_1001_EXT
    RH_BASE_READ_INFTY_1001
    RH_READ_INFTY_1001
    RH_READ_INFTY_1001_EXT
    RH_READ_INFTY_1001_EXT_ONLY
    Reward if useful
    Regards
    Prax

  • How to transfer data in change log table of dso to z-table using abap code

    Hi  can you please explain me how to transfer data in change log table of dso to z-table using abap code ,with out using Function module concept

    PROGRAM NAME:   ZBW_DELTA_TO_GSTAR                                 **
    report ZBW_DELTA_TO_GSTAR no standard page heading
                                     line-size 120
                                     line-count 75
                                     message-id ZBW_MSG_CLS.
    tables:   ZGIV_DLTA_EBV_BB,
              ZGIV_DLTA_EM2_BL,
              ZGIV_DLTA_EM2_BK.
    Selection Screen Definitions
    SELECTION-SCREEN: BEGIN OF BLOCK INNER WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN: SKIP 1.
    PARAMETERS:       EBVBB RADIOBUTTON GROUP ROLL,
                      EM2BL RADIOBUTTON GROUP ROLL,
                      EM2BK RADIOBUTTON GROUP ROLL.
    SELECTION-SCREEN: END OF BLOCK INNER.
    Data:  WS_UPDATE_FLAG  Type C,
           UCounter(9)      Type N,
           ICounter(9)      Type N.
    DATA:  T_ZGIV_DLTA_EBV_BB Type Standard Table of ZGIV_DLTA_EBV_BB,
           s_ZGIV_DLTA_EBV_BB LIKE line of T_ZGIV_DLTA_EBV_BB.
    DATA:  T_ZGIV_DLTA_EM2_BK Type Standard Table of ZGIV_DLTA_EM2_BK,
           s_ZGIV_DLTA_EM2_BK LIKE line of T_ZGIV_DLTA_EM2_BK.
    DATA:  T_ZGIV_DLTA_EM2_BL Type Standard Table of ZGIV_DLTA_EM2_BL,
           s_ZGIV_DLTA_EM2_BL LIKE line of T_ZGIV_DLTA_EM2_BL.
    Standard Internal Tables - Describe usage.
    data: begin of i_AEPSD_O0140 occurs 0.
            include structure /BIC/AEPSD_O0140.
    data: end of i_AEPSD_O0140.
    data: begin of i_AEPSD_O0240 occurs 0.
            include structure /BIC/AEPSD_O0240.
    data: end of i_AEPSD_O0240.
    data: begin of i_AEPSD_O0340 occurs 0.
            include structure /BIC/AEPSD_O0340.
    data: end of i_AEPSD_O0340.
    data: begin of i_GIV_DLTA_EBV_BB occurs 0.
            include structure ZGIV_DLTA_EBV_BB.
    data: end of i_GIV_DLTA_EBV_BB.
    data: begin of i_GIV_DLTA_EM2_BK occurs 0.
            include structure ZGIV_DLTA_EM2_BK.
    data: end of i_GIV_DLTA_EM2_BK.
    data: begin of i_GIV_DLTA_EM2_BL occurs 0.
            include structure ZGIV_DLTA_EM2_BL.
    data: end of i_GIV_DLTA_EM2_BL.
    Miscellaneous Program Variables and Constants.
    TOP-OF-PAGE
    top-of-page.
    START-OF-SELECTION
    start-of-selection.
      Clear: i_GIV_DLTA_EBV_BB,
             i_GIV_DLTA_EM2_BK,
             i_GIV_DLTA_EM2_BL,
             UCounter, ICounter.
      IF EBVBB = 'X'.
        PERFORM 100_EXTRACT_EBV_BB_DELTA_RECS.
      ELSEIF EM2BK = 'X'.
        PERFORM 100_EXTRACT_EM2_BK_DELTA_RECS.
      ELSE.
        PERFORM 100_EXTRACT_EM2_BL_DELTA_RECS.
      ENDIF.
    FORM 100_EXTRACT_EBV_BB_DELTA_RECS
    FORM 100_EXTRACT_EBV_BB_DELTA_RECS.
      Refresh:   i_AEPSD_O0140,
                 i_GIV_DLTA_EBV_BB.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EBV_BB .
      Select * From /BIC/AEPSD_O0140
        Into TABLE i_AEPSD_O0140.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0140.
          MOVE-CORRESPONDING i_AEPSD_O0140 TO s_ZGIV_DLTA_EBV_BB.
          MOVE SY-DATUM to s_ZGIV_DLTA_EBV_BB-create_dt.
          INSERT ZGIV_DLTA_EBV_BB FROM s_ZGIV_DLTA_EBV_BB.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EBV_BB FROM  s_ZGIV_DLTA_EBV_BB.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EBV_BB_DELTA_RECS
    FORM 100_EXTRACT_EM2_BK_DELTA_RECS
    FORM 100_EXTRACT_EM2_BK_DELTA_RECS.
    Refresh:   i_AEPSD_O0240,
               i_GIV_DLTA_EM2_BK.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EM2_BK .
      Select * From /BIC/AEPSD_O0240
        Into TABLE i_AEPSD_O0240.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0240.
          MOVE-CORRESPONDING i_AEPSD_O0240 TO s_ZGIV_DLTA_EM2_BK.
          MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BK-create_dt.
            INSERT ZGIV_DLTA_EM2_BK FROM s_ZGIV_DLTA_EM2_BK.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EM2_BK FROM  s_ZGIV_DLTA_EM2_BK.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EM2_BK_DELTA_RECS
    FORM 100_EXTRACT_EM2_BL_DELTA_RECS
    FORM 100_EXTRACT_EM2_BL_DELTA_RECS.
    Refresh:   i_AEPSD_O0340,
               i_GIV_DLTA_EM2_BL.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EM2_BL .
      Select * From /BIC/AEPSD_O0340
        Into TABLE i_AEPSD_O0340.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0340.
          MOVE-CORRESPONDING i_AEPSD_O0340 TO s_ZGIV_DLTA_EM2_BL.
          MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BL-create_dt.
            INSERT ZGIV_DLTA_EM2_BL FROM s_ZGIV_DLTA_EM2_BL.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EM2_BL FROM  s_ZGIV_DLTA_EM2_BL.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EM2_BL_DELTA_RECS
    END-OF-SELECTION
    end-of-selection.
      perform D1000_REPORT_DATA.
    D1000_REPORT_DATA
    form D1000_REPORT_DATA.
    *Display the title of the program
      write: /25 SY-TITLE.
      skip.
    Diaplay the details of the user and time
      write: /1 'Executed by', 15 SY-UNAME, 30 'Date',
      38 SY-DATUM, 53 'Time', 60 SY-UZEIT.
      skip 2.
      write: /  'Delta Records have been extracted  ',
             /   'Updates : ', UCounter,
             /   'Inserts : ', ICounter.
      skip.
      skip 3.
      write: /20 'End of the report'.
    endform.                                           "D1000_REPORT_DATA
    chgeck it out this also may hep you

  • Help regarding calling BRFPLUS function through ABAP code

    Hi,
          I have  a situation where I have to input  data into a BRFPLUS function  as a table (i.e the data is input as select options where list or range of data can be provided).The corresponding output is also in the form a table .I've created this function in BRFPLUS and is working fine .Now I have to call it through ABAP code.Can someone kindly  provide me with the probable code for this scenario.
    E.g:
            ZT_MATNR  is the table in brfplus representing the list of MATNR values input along with other such inputs to function module Z_FM
            ZT_ATM   is the  resultant output table  of the function  which contains several fields.
    Now I have to call this BRFPLUS function with help of ABAP code.Could someone kindly help.

    Hello ,
    There should be a number of BRF+ tutorials available in SCN which discuss the FDT APIs. You can have a look at them to get an idea of the various APIs available and their uses.
    For your usecase, you should do the following.
            lo_fdt_function         TYPE REF TO if_fdt_function,
            lo_fdt_result           TYPE REF TO if_fdt_result,
    * Get function handle
          CALL METHOD lo_fdt_factory->get_function
            EXPORTING
              iv_id       = lv_function_id
            RECEIVING
              ro_function = lo_fdt_function.
    where lv_function_id is the GUID of the BRF+ function . You can either make it a constant , or you can use a FDT API to get the function GUID from the BRF+ application name and function name.
    *   Set function context
        TRY.
            CALL METHOD lo_fdt_context->set_value
              EXPORTING
                iv_id    =
                ia_value =
    This is one way to set the input context ( pass the input to the BRF+ function to process ). There are other ways to do this as well. Which one you use would depend on the kind of input you want to pass.
    * Execute BRFPLUS function
      TRY.
          CALL METHOD lo_fdt_function->process
            EXPORTING
              io_context = lo_fdt_context
            IMPORTING
              eo_result  = lo_fdt_result.
    * Get result output
      TRY.
          CALL METHOD lo_fdt_result->get_value
            IMPORTING
              ea_value =
    Another direct way of doing it would be to use the method PROCESS of the class CL_FDT_FUNCTION_PROCESS.
    I have not gone into much explaination here , but it should provide you an idea of how you can go about it.Read the SCN docs on the APIs to get a better idea , or better still if you can get hold of a copy of the BRF+ book by Carsten Ziegler , you will get an end to end explaination of all BRF+ APIs in it.
    Regards,
    Indranil.

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • Uncaught Exception occured while sending mail through abap code.

    Hi,
    Uncaught Exception occured while sending mail through abap code.Run time Errors "UNCAUGHT_EXCEPTION" occured after excuting the call method  CALL METHOD SEND_REQUEST->SEND( ).kindly help in resolving the issue.

    HI,
    Runtime Error:  UNCAUGHT_EXCEPTION details.
    Runtime Errors         UNCAUGHT_EXCEPTION
    Exception              CX_ADDRESS_BCS
    Short text
         An exception occurred that was not caught.
    What happened?
         The exception 'CX_ADDRESS_BCS' was raised, but it was not caught anywhere along
         the call hierarchy.
         Since exceptions represent error situations and this error was not
         adequately responded to, the running ABAP program 'SAPLZSEND_MAIL' has to be
         terminated.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_ADDRESS_BCS', was not caught in
        procedure "SEND_MAIL" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        An exception occurred
    How to correct the error
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "UNCAUGHT_EXCEPTION" "CX_ADDRESS_BCS"
        "SAPLZSEND_MAIL" or "LZSEND_MAILU01"
        "ZSEND_EMAIL"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    The exception must either be prevented, caught within proedure
    "SEND_MAIL" "(FORM)", or its possible occurrence must be declared in the
    RAISING clause of the procedure.
    Please help me to resolve this issue.

  • How  To Remove Tables Through SDK Code(Using MetaDataObject)

    Hi Experts,
    I am with a problem in my sdk code.As follows,I added a table with no object  into the database through the sdk code using OUsertablesMd object.Now My Query is i want to delete the same table through my code.I am using oUserTablesMD.Remove()
    Method.It's throwing an error message.If any one culd send the sample of removing sap tables through dk code would be helpful
    Help Would be appreciated!!
    Thanking You,
    Vijay Kumar

    Hi,
    try this one
    Dim rsd As SAPbobsCOM.Recordset
            rsd = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            rsd.DoQuery("SELECT T0.[TableName] FROM OUTB T0")
            Dim sTableID As String
            Do Until rsd.EoF
                sTableID = rsd.Fields.Item("TableName").Value.ToString.Trim
                Dim oTables As SAPbobsCOM.UserTablesMD
                oTables = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
                If oTables.GetByKey(sTableID) = True Then
                    oTables.Remove()
                End If
                oTables = Nothing
                rsd.MoveNext()
            Loop
    Regards,
    Siva

  • How does SAP updates MKPF Table Through TCODE MB0A

    Hello There,
       how does SAP updates MKPF Table Through TCODE MB0A ( POST GOODS RECEIPT )? I tried to debug the same by posting GR, but could not figure out.
    Awaiting Reply
    Santosh

    Hi ,
    These are the table that are updated through the MB0A ,,
    DGESV DMAEX DMAKT DMAPE
    DMARM DMEAN DMKAL DMLAN
    DPROW DQMAT DUNGV MARA
    MARC MARD MBEW MFHM
    MLGN MLGT MPGD MPOP MVKE,
    MCHA, MCHB, MCHD.
    Regards,
    Bharani

  • Get Error while update the User defined row table through DSK Code

    Hi experts,
    I have got an error while updating the user row defined table.
    Error is - "Invalid row"
    I have created one master table "@CBF_FARM " and Child table "@CBF_FAR1"
    First i inserted 5 record in the child table so in my my child table there are 5 Line id (1,2,3,4,5 one for each row).
    after that i delete 2 rows (3rd & 4th row) from child table now in my child table there are 3 rows( Line id 1, 2, 5). Please See attachment.
    Now i am updating  the last record of child table through Code  (Line id is 5)  from other form, then i got error  invalid row.
    Following Code used for updating the user defined child table.
      SAPbobsCOM.GeneralService oGeneralService1 = null;
                                    SAPbobsCOM.GeneralData oGeneralData1 = null;
                                    SAPbobsCOM.GeneralDataParams oGeneralParams1 = null;
                                    SAPbobsCOM.CompanyService sCmp1 = null;
                                    SAPbobsCOM.GeneralData oChild1 = null;
                                    SAPbobsCOM.GeneralDataCollection oChildren1 = null;
                                    sCmp1 = clsAddOn.LDNA_Company.GetCompanyService();
                                    oGeneralService1 = sCmp1.GetGeneralService("CBF_FARM");
                                    // Get UDO record
                                    oGeneralParams1 = ((SAPbobsCOM.GeneralDataParams)(oGeneralService1.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)));
                                    oGeneralParams1.SetProperty("Code", oForm.Items.Item("edtFarmCd").Specific.Value);
                                    oGeneralData1 = oGeneralService1.GetByParams(oGeneralParams1);
                                    // Add lines on UDO Child Table
                                    oChildren1 = oGeneralData1.Child("CBF_FAR1");
                                    // Create data for rows in the child table
                                    SAPbouiCOM.Item oItem = oForm.Items.Item("cmbShed");
                                    oCombo = oItem.Specific;
                                    string ShedCode = oCombo.Selected.Value;
                                    ldna_Rec = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                                    string strQuery1 = "select LineId from [@CBF_FAR1] where U_ShedCd = " + ShedCode;
                                    ldna_Rec.DoQuery(strQuery1);
                                    oChild1 = oChildren1.Item(ldna_Rec.Fields.Item("LineId").Value - 1);
                                    oChild1.SetProperty("U_Status", "Ready For Schedule");
                                    //Update the UDO Record
                                    oGeneralService1.Update(oGeneralData1);
    Please Help me it is an urgent requirement,
    -Regards
    Vikas

    hi.
    Error is - "Invalid row"
    Now i am updating  the last record of child table through Code  (Line id is 5)  from other form, then i got error  invalid row.
    As per my knowledge
    What i understood is you have 5 lines and you are going to be update 5th line
    am i correct..
    while u are updating the line in child table
    you have to consider like this..
    line number         u have to update like
    1                                        0
    2                                        1
    3                                        2
    4                                        3
    5                                        4
    which means in child table treat
    line 1  as 0
    line 2 as  1
    line 5 as 4
    If you want to update the line 5 u have to mention 4 th line

  • Error while updating lookup table through PSI

    Hi,
    I am trying to update a lookuptable through PSI using following code : 
    $lookupTableGuid = $svcPSProxy.ReadLookupTables($EPMTYString, 0 , 1033).LookupTables | where {$_.LT_NAME -eq $Lookuptablename}
    $lookuptable = $svcPSProxy.ReadLookupTablesbyUids($lookupTableGuid.LT_UID, 1 , 1033)
    $lookuptablerowValues = $svcPSProxy.ReadLookupTablesbyUids($lookupTableGuid.LT_UID, 0 , 1033).LookupTableTrees
    #get lookup table count
    $lookuptableValues = $svcPSProxy.ReadLookupTablesbyUids($lookupTableGuid.LT_UID, 0 , 1033).LookupTableTrees
    $count = $lookuptableValues.Count +1
    #Insert the rows of table in Lookup Table
    foreach ($rows in $table)
    $value_Code = $rows.Item("Project_code")
    $value_Name = $rows.Item("project_desc")
    $GUID = [System.Guid]::NewGuid()
    $LookupRow = $lookuptable.LookupTableTrees.NewLookupTableTreesRow()
    $LookupRow.LT_STRUCT_UID = $GUID
    $LookupRow.LT_UID = $lookupTableGuid.LT_UID
    $LookupRow.LT_VALUE_TEXT = $value_Code
    $LookupRow.LT_VALUE_DESC = $value_Name
    $LookupRow.LT_VALUE_SORT_INDEX = ($count ++)
    $lookuptable.LookupTableTrees.AddLookupTableTreesRow($LookupRow)
    $error.clear()
    #Exceptions Handling :
    Try
    $svcPSProxy.UpdateLookupTables($lookuptable , 0 , 1 , 1033)
    Catch
    write-host "Error updating the Lookup table, see the error below:" -ForeGroundColor Red -BackGroundColor White
    write-host "$error" -ForeGroundColor Red
    Initially, I tried to run with value of $value_code as "AACL", the code worked.
    But when I tried to insert value of code as "AACL - ALKYL AMINES CHEMICALS LIMITED"
    I got following error:
    Exception calling "UpdateLookupTables" with "4" argument(s): "Response is not well-formed XML."
    I could not understand why this error is appearing as I just added ' - ' to my code value. I checked for validity of ' -  'in the targeted column. No issue with that.
    Please help.
    Thanks and regards,
    Jayesh

    Hi All,
    The entries are maintained from DB level.
    Thanks for the help.
    DVRK

  • PL/SQL Trying to update a table through trigger on the same table

    Hi everyone my name is Edwin and I'm new to this forum. I hope I can learn a lot from this community and over time contribute to it.
    The problem I'm facing at the moment is a tough one. I need to update a table (table a) with a value called block_id. This block_id is generated by a procedure I have written myself, the end result is stored in another table (table b). This block_id needs to be generated after certain rows of table a get updated with a trans_id. The trans_id is all the same for these rows in table a, but the generated block_id isn't. In my code I use an after update on collumn a of table a trigger. So if the the collumn gets updated the trigger fires. The trigger calls the procedure that generates the block_id and the procedure generates table b with all the block_id's. But then I want to update the rows in table a with the generated block_id in table b. The problem is that this self-deadlocks.
    You might think that this would call a recursive trigger, but I have written code in the trigger that checks if the block_id isn't allready filled in on table a.
    Also I really need all the values wich get updated (table a), so I believe a before update is also out of the question.
    And the first update of table a is done through an erp-packet and I can't get at that code, otherwise I would just have run my code from there.
    Message was edited by:
    user625855

    CREATE OR REPLACE TRIGGER block_id_trigger AFTER UPDATE ON unload_details_tab
    DECLARE
    current_transport_id NUMBER;
    check_value NUMBER;
    check_block_id NUMBER;
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    current_transport_id := get_curent_trans_id; --function that gets the current transport_id
    check_value := check_site_and_directive(current_transport_id); --function checks if this transport_id should have a block_id
    check_block_id := check_for_block_id(current_transport_id); --function checks if there isn't allready a block_id set.
    IF check_value = 1 AND check_block_id = 0 THEN
    create_blok_id_table(current_transport_id); --this procedure creates the blok_id in temptable
    UPDATE unload_details_tab a SET a.block_id = (SELECT DISTINCT b.blok_id FROM temptable b WHERE b.mark = a.mark_1) WHERE a.transport_id = current_transport_id; --this statement should update the table back, if I leave it out everything works fine, but when I leave it I get the self-deadlock error.
    ELSE
    null;
    END IF;
    END block_id_trigger;
    Ok, I cleaned the code somewhat.
    user625855

  • BPC Master Data Deletion through ABAP code

    Hi All,
    I have a requirement of deleting the orphan nodes for one of the dimension in BPC using ABAP code.
    Please let me know any standard program or classes for deleting the master data from dimension.
    Regards
    Pratibha Biradar

    Hi Pratibha,
    Here is the code to add master data, you can change the flag to 'D' to delete, i have not checked it for delete, it is working for adding.
    DATA: ls_message TYPE uj0_s_message,
    lt_messages TYPE uj0_t_message,
    l_success TYPE uj_flg,
    l_appset_id TYPE uj_appset_id,
    l_dimension_id TYPE uj_dim_name,
    lo_member_mgr TYPE REF TO if_uja_member_manager,
    lo_dimension TYPE REF TO if_uja_dimension_manager,
    lo_master_data_store TYPE REF TO if_ujam_master_data_store,
    lo_context TYPE REF TO if_uj_context,
    ls_dimension TYPE uja_s_dimension,
    lt_errors TYPE uja_t_members_error,
    lr_members TYPE REF TO data,
    lr_data TYPE REF TO data.
    FIELD-SYMBOLS:
    <lt_member_data> TYPE STANDARD TABLE,
    <ls_member_data> TYPE any,
    <lv_field> TYPE any.
    TRY.
        lo_context = cl_uj_context=>get_cur_context( ).
        cl_uj_context=>set_cur_context(
        i_appset_id = l_appset_id
        i_module_name = lo_context->d_calling_module
        is_user = lo_context->ds_user
        lo_dimension = cl_uja_bpc_admin_factory=>get_dimension_manager(
        i_appset_id = l_appset_id
        i_dimension_id = l_dimension_id
        lo_dimension->get(
        EXPORTING
        if_with_hier_maxlevel = abap_false
        IMPORTING
        es_dimension = ls_dimension
        CREATE OBJECT lo_master_data_store TYPE cl_ujam_master_data_store.
    * creating masterdata table
        lr_members = lo_master_data_store->get_table_buffer( ls_dimension ).
        ASSIGN lr_members->* TO <lt_member_data>.
    * Add members to <LT_MEMBER_DATA>, these are the member that will be saved.
        CREATE DATA lr_data LIKE LINE OF <lt_member_data>.
        ASSIGN lr_data->* TO <ls_member_data>.
    * Fill each field, such as ID, and EVDESCRIPTION, update other fields here as well as
    * any properties that need to be updated.
        ASSIGN COMPONENT 'ID' OF STRUCTURE <ls_member_data> TO <lv_field>.
        IF sy-subrc = 0.
          <lv_field> = 'ProductD'.
        ENDIF.
        ASSIGN COMPONENT 'MBR_NAME' OF STRUCTURE <ls_member_data> TO <lv_field>.
        IF sy-subrc = 0.
          <lv_field> = 'ProductD'.
        ENDIF.
        ASSIGN COMPONENT 'EVDESCRIPTION' OF STRUCTURE <ls_member_data> TO <lv_field>.
        IF sy-subrc = 0.
          <lv_field> = 'Product D Update'.
        ENDIF.
        ASSIGN COMPONENT 'PARENTH1' OF STRUCTURE <ls_member_data> TO <lv_field>.
        IF sy-subrc = 0.
          <lv_field> = 'TotalProduct'.
        ENDIF.
        ASSIGN COMPONENT 'OBJVERS' OF STRUCTURE <ls_member_data> TO <lv_field>.
        IF sy-subrc = 0.
          <lv_field> = 'A'. "Version flag, should be "A" for Active
        ENDIF.
        ASSIGN COMPONENT 'ROWFLAG' OF STRUCTURE <ls_member_data> TO <lv_field>.
        IF sy-subrc = 0.
    """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Here you can change it to 'D' for Deleting """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
          <lv_field> = 'I'. " This is an action flag, I=Insert, M=Modify """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
        ENDIF.
        APPEND <ls_member_data> TO <lt_member_data>. " Add to the table.
    * Create member manager
        lo_member_mgr = cl_uja_bpc_admin_factory=>get_member_manager(
        i_appset_id = l_appset_id
        i_dimension_id = l_dimension_id ).
    * Save the members UNCOMMENT ONLY when you want to write the data!!!!!
    * lo_member_mgr->save(
    * EXPORTING
    * ir_members = lr_members " List of members to save
    * IMPORTING
    * et_errors = lt_errors
    * NOW PROCESS THE DIMENSION
        DATA: ls_dimensions TYPE uja_s_dim_name,
        lt_dimensions TYPE uja_t_dim_name.
        CLEAR ls_dimensions. REFRESH lt_dimensions.
        ls_dimensions-dimension = l_dimension_id. " Add dimensions to the list
        APPEND ls_dimensions TO lt_dimensions.
        lo_member_mgr->process(
        EXPORTING
        it_dim_list = lt_dimensions
        if_set_offline = abap_false
        if_validate = abap_true
        IMPORTING
        ef_success = l_success
        et_message_lines = lt_messages ).
      CATCH cx_uj_no_auth .
    ENDTRY.
    hope this will help,
    thanks,
    Rishi

  • How to assign a class to the material through ABAP code

    Hi,
    I am working on a transaction in ABAP which takes material name, material description and a class from the user. Now, after this much input I create the material, its configuration profile through the ABAP code. For this I know I have to make relevant entries in tables MARA, MAKT, CUCO.. and also check for the existence of the class in the table KLAH.
    Now the point where I am stuck is that I am not able to get how to assign the class to the material through the code. I am able to get the internal class id from the table KLAH but I am not able to figure how the internal material number is being generated in the table INOB and i need this number as well as the internal class id number to insert a record in the table KSSK to show proper assignment.
    Can anyone please suggest me some solutions?
    Thanks....

    Hi,
    I tried using BAPI_OBJCL_CREATE. In order to understand it functioning better I created a material and class (of type 300) through transactions MM01 and cl01 respectively. Then i  created a report and called the FM BAPI_OBJCL_CREATE, gave the material name as the material above, table as MARA, class as the one i created above and class type 300. I even analysed the message of the table return (return-message) after executing the report. The messahe said assignment done. But when I checked mnaually in cl20n there was no assignment done to the required material. There was also no entry for the required material in the table INOB which I need.
    Can anyoene tell me that where am i going wrong? Please do help.

  • How can I modify data from a Transparent Table without ABAP code.

    Hi,All
    How can I modify data from a Transparent Table (like TCURR),  and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
    I had fond that there is a way can do that:
    1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
    2, type '/h' and let debugging on
    3, select one of this data then click 'Display',enter in debugging system.
    4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
    and, My system is ECC6.
    thank you all
    Edited by: xuehui li on Aug 20, 2008 6:30 PM

    Hello,
    Your approach (with Vijay's suggestion) MAY work.  However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT.  This will be especially true if you are working in a Production environment.  Vijay's other comment is true as well.  This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment.  The auditors will not be impressed.
    Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
    Regards
    Greg Kern

  • Triggering Process chains through abap code

    Hi Experts,
    Can you please let me know if it is possible to trigger a BW Process chain using an abap code.
    If yes , kindly let me know the sample code.
    Help done would be appreciated.
    Regards,
    Uday

    Hi Thanks for your reply.
    When I am trying to execute process chain with variant as a APD ( In this APD data is getting loaded form one Query to Transactional ODS.) This process chain being executing through one ABAP program using the following code
    CALL FUNCTION 'RSPC_API_CHAIN_SCHEDULE'
    EXPORTING
    I_CHAIN = 'XYZ'. ( Dummy Process chain name)
    While executing this program I am getting following message :
    You can specify the name of the application server here
    on which all jobs in the chain are scheduled
    If you do not specify a name, the jobs from batch
    management are divided between the available servers
    How to avoid this message.
    Can we write any code in the above program to assign any fixed server name so that it will not ask for any server name.
    Your help is much appreciated.

Maybe you are looking for