Add datas to UDT using business objects

Hi,
How to add datas to user defined tables using Business Objects.
Regards,
M.Dhivya.

Hi,
Check for following provided bt SAP...
Dim ret As Long
d
Private Sub Add_Table_Click()
    Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
    Set oUserTablesMD = oCompany.GetBusinessObject(oUserTables)
    ' When adding user tables or fields, use a prefix
    ' identifying your partner name space. This will
    ' prevent collisions from different partner add-ons
    ' SAP's name space prefix is "BE_"
    'Set the two mandatory fields
    oUserTablesMD.TableName = "T1"
    oUserTablesMD.TableDescription = "Table1"
    'Add the table (which contains 2 default, mandatory fields, 'Code' and 'Name')
    ret = oUserTablesMD.Add
    If ret <> 0 Then
        oCompany.GetLastError ret, Str
        MsgBox Str
    Else
        MsgBox "Table: " & oUserTablesMD.TableName & " was added successfully"
    End If
End Sub
Private Sub Add_UDF_Click()
    Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
    Set oUserFieldsMD = oCompany.GetBusinessObject(oUserFields)
    oUserFieldsMD.TableName = "T1"
    oUserFieldsMD.Name = "AlbUDF"
    oUserFieldsMD.Description = "Albert UDF"
    'Add the field to the table
    lRetCode = oUserFieldsMD.Add
    If lRetCode <> 0 Then
        oCompany.GetLastError ret, Str
        MsgBox Str
    Else
        MsgBox "Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table"
    End If
End Sub
Private Sub Add_Data_Click()
    Dim oUserTable As SAPbobsCOM.UserTable
    Set oUserTable = oCompany.UserTables.Item(1)
    oUserTable.GetByKey ("T1")
    'Set default, mandatory fields
    oUserTable.Code = "A"
    oUserTable.Name = "Albert"
    'Set user field
    oUserTable.UserFields.Fields.Item("U_AlbUDF").Value = "1"
    oUserTable.Add
    If ret <> 0 Then
        oCompany.GetLastError ret, Str
        MsgBox Str
    Else
        MsgBox "Value to field: '" & oUserTable.UserFields.Fields.Item("U_AlbUDF").Name & "' was updated successfuly to " & oUserTable.TableName & " Table"
    End If
End Sub
Hope this helps,
Vasu Natari.
Edited by: vasu natari on Jun 12, 2009 11:21 AM
Edited by: vasu natari on Jun 12, 2009 11:21 AM

Similar Messages

  • Extract account Based COPA from R/3 using Business Object data services

    Hello,
    We have a requirement to extract Account Based COPA from SAP R/3 to Teradata using Business Objects data services.
    I have read couple of white papers which give information on Rapid Marts( which are built in packages) already available for some applications like inventory, GL, AP, AR etc. But I could not find anything for COPA.
    Would anyone give me any information on how to use BO data services for COPA?
    Also if there is no rapid mart available for COPA, does anyone know how to create custom data marts in BO Data services?
    Is there any document available on this?
    Please respond as soon as possible.
    Thanks.

    Hi,
    this forum is for the SAP Integration Kit. Would suggest you post your question into the EIM area for Data Services.
    Ingo

  • How to use  Business Object like Vendor or PurchasingInfo

    Hi,
    How to use Business Object ( like Vendor or PurchasingInfo ) from my Object?
    For example:
    CLASS myEntity DEFINITION.
              PUBLIC SECTION.
                   METHODS: getVendor EXPORTING pVendor TYPE Vendor.
               PRIVATE SECTION.
               DATA: aVendor TYPE REF TO Vendor.
    ENDCLASS.
    CLASS myEntity IMPLEMENTATION.
    METHOD getVendor
               pVendor = aVendor .
    ENDMETHOD.
    ENDCLASS

    Hi,
    I am giving u a demo Program for ur doubt.
    REPORT demo_class_counter .
    CLASS counter DEFINITION.
      PUBLIC SECTION.
        METHODS: set IMPORTING value(set_value) TYPE i,
                 increment,
                 get EXPORTING value(get_value) TYPE i.
      PRIVATE SECTION.
        DATA count TYPE i.
    ENDCLASS.
    CLASS counter IMPLEMENTATION.
      METHOD set.
        count = set_value.
      ENDMETHOD.
      METHOD increment.
        ADD 1 TO count.
      ENDMETHOD.
      METHOD get.
        get_value = count.
      ENDMETHOD.
    ENDCLASS.
    DATA number TYPE i VALUE 5.
    DATA cnt TYPE REF TO counter.
    START-OF-SELECTION.
      CREATE OBJECT cnt.
      CALL METHOD cnt->set EXPORTING set_value = number.
      DO 3 TIMES.
        CALL METHOD cnt->increment.
      ENDDO.
      CALL METHOD cnt->get IMPORTING get_value = number.
      WRITE number.
    For more demo programs type 'abapdocu' in the command field
    U will be getting some demo programs.
    There select the abap objects.
    Regards,
    Jagadish

  • Issue with the Data Type 'Number' in Business Objects

    Hi,
    I have an Object in the Universe where the Data Type of the Object is a number. This Column pertaining to this Object has certain values in the database out of which there is a 17 Digit Value which is 00000000031101165.
    Now, when trying to retreive the same value through Business Objects it is getting rounded off to 00000000031101200 automatically when trying to view in Webi and when trying to retreive the same in Designer/Deski, it displays as 0.000000003110116E+16.
    So, I would like to know if there is any other alternative in trying to retreive the Original Value that would not round off. Also, do we have any Limitation for the Data Type Number in Business Objects? The Version we are on is XI3.1.
    Note: There are no functions that are used on this Object at the Universe Level and would not like to use any functions here.

    What is the underlying database?
    It looks like the data is considered to have two decimals, but is rounded to zero decimals.
    Only you don't see the number formatting.
    Is this a BW query?
    Is this a calculated keyfigure?
    In the query you can specify the rounding you want and it is also possible to specify it on an infoobject level.
    Check those settings...
    Hope this helps,
    Marianne
    PS. Oh, and about the formatting, you can specify a default object format in the universe and override it on the final client (WebI, Crystal)

  • Comraden! How to use business objects in Netweaver?

    And more specifically, how to import(put) some data in to business object from business process? For example a have process, wich i have released in Netweavwer developing studio, by using the perspective "process developing", "web dynpro", "composite application perspective", e.t.c.
    So my process is work perfectly, and i have created business objects, but i need on some steps of process input some data in to my business objects (for example from data contexts, or may be directly from user interfaces).
    Thank you, my friends!

    Hi Madhu,
    The below links 2 will really help
    http://help.sap.com/saphelp_46c/helpdata/en/59/ae4477488f11d189490000e829fbbd/content.htm
    http://help.sap.com/saphelp_46c/helpdata/en/59/ae4484488f11d189490000e829fbbd/frameset.htm
    Cheers!!
    VEnk@
    Edited by: Venkat Reddy on Oct 29, 2008 2:21 PM

  • Restriction when using Business object

    hi all,
    Currently i want to use Business Object to create a new Company code. After searching the Business object in Transaction SWO1, I find 'BUS0002' can realize it. But there is only one import parameter of method 'create' , that's the company code key id. 
    Is there any solution to import other parameters,such as description of the company code, currency etc. when using the business object to create the company code?
    Thanks in advance.
    Vivi

    hi RS
       just writes a test program :
      DATA: BEGIN OF objectkey,
             bukrs LIKE t001-bukrs,
             butxt LIKE t001-butxt,
             ort01 LIKE t001-ort01,
             land1 LIKE t001-land1,
             waers LIKE t001-waers,
             spras LIKE t001-spras,
           END OF objectkey.
      objectkey-bukrs = '2010'.
      objectkey-butxt = 'My company code description'.
      objectkey-ort01 = 'NEW YORK'.
      objectkey-land1 = 'US'.
      objectkey-waers = 'USD'.
      objectkey-spras = 'EN'.
      swc_container container.
      lv_object_type = 'BUS0002'.
      swc_create_object obj lv_object_type ''.
      swc_create_container container.
      swc_set_element container 'objectkey' objectkey.
      swc_set_element container 'CORR_NUMBER' 'EB2K900952'.
      swc_set_element container 'SUPPRESSDIALOG' ' '.
      swc_call_method obj 'Create' container.
    At runtime session, there is no value transfered to the maintainence view except the company code id.
    When i go through the program of 'create' method,
    i found that:
    Call maintenance of CompanyCodeId
      CLEAR V_T001.
      V_T001-MANDT = SY-MANDT.
      V_T001-BUKRS = OBJECT-KEY-COMPANYCODEID.
      CALL FUNCTION 'VIEW_MAINTENANCE_SINGLE_ENTRY'
           EXPORTING
                ACTION                       = 'INS '
                CORR_NUMBER                  = CORR_NUMBER
                VIEW_NAME                    = 'V_T001'
                SUPPRESSDIALOG               = SUPPRESSDIALOG
                INSERT_KEY_NOT_FIXED         = INSERT_KEY_NOT_FIX
           IMPORTING
                CORR_NUMBER                  = CORR_NUMBER
           CHANGING
                ENTRY                        = V_T001.
    so i guess, it should be enhanced some coding here, something like
    V_T001-BUTXT = OBJECT-KEY-description  ?
    but i am not sure about it.
    What do you think about it?
    Thanks again for your kindly help.
    Regards
    Vivi
    Message was edited by:
            Vivi Sun

  • Need to use business objects with a project, please guide on basics.

    Hello
    I am a dotnet developer (asp.net with C#). I am sorry I dont know much about Business objects. Our client a financial firm wants to use Business object with a web based application. I couldn't got a clear and good understanding of Business object. The client just said Business objects allows dynamically creating reports even clients can create reports very easily even without knowing SQL.
    Kindly guide me about Business Object product and its what component I should check for using it. Please mention some links that can give me introduction.
    Thanks a lot,
    haansi

    Hi
    Business Objects is not just one tool. You should ask your client what they will use e.g. Crystal Reports or Web Intelligence.
    Here you can see half an hour Webinars that give you a good understanding of Business Objects:
    Webinars
    Regards
    Roland

  • J2EE - Reports using Business Objects.

    Hi Friends,
    We have a requirement to generate reports in our project using Business Objects v5.1.8.
    Some users/Actors will have assess the reports through Webi of business objects and other requirement is to do some selection criteria in web page and once you get the right details, we should be able to generate report directly from web page (Calling .rpt file of Business objects), J2EE application calling business object report. (similar to calling PDF file in browser).
    Did any body of you did similar thing and is it possible to do through business objects, I know we can do from crystal reports. Do we need any plug-in ?
    I would be grateful, If you have sample code and willing to share.
    Thank You
    srikanth

    oh no, you have that as a requirement! :) well, have fun!! (the guy beside me develops our crystal reports stuff all day).

  • SSO2DB / Use Business Objects Credential Mapping

    Hi,
    We standardized our universe connections to SQL Server on "Use Single Sign On when refreshing reports at view time". There however is an issue with this when scheduling reports, see
    1199774 - How to schedule Web Intelligence documents based on SSO2DB universes for Oracle and SQL Server to avoid scheduling issues
    Given the solution proposed there is not optimal for us, we are looking at an alternative by standardizing on: "Use Business Objects Credential Mapping" on the universe connection. We want to use OLE DB (SQL Server native connection) for querying.
    There are 2 ways to do this:
    1. On universe connection, in the tab "Database Middleware", we directly select OLE DB. This way we do not need to create a DSN. We however get: A database error occured. The database error text is: Microsoft SQL Native Client : Login failed for user '<user>'.. (WIS 10901)
    Apparently the default authentication mode to SQL server is "native". SQL server specific user. When we create a native SQL server <user> with same password as in the mapped database credentials in the CMC, it works fine. Indicating native SQL server authentication is used instead Integrated Windows authentication.
    Can we somehow change the authentication mode towards SQL server to Win AD?
    Can we get to the SSO2DB functionality in this way?
    2. When selecting ODBC on universe connection in tab"Database Middleware", we can still use OLE DB by creating a DSN based on the SQL Server native drivers. This also allows use to fix the DSN on authentication setting "With Integrated Windows authentication".
    When we run a WebI report from InfoView and select as one of the objects the "system_User", we get the service account running the SIA. This account is also running the WebIntelligenceProcessingServer.
    Does the credential mapping setting not work in this setup?
    We expected the DBUSER/DBPWD to be passed.
    See also SSO2DB / Use Database Credentials
    Quote "Use DB credentials is not kerberos it uses DBuser/DBpass variable for accounts if they are populated. I currently have an escalation in on this with SQL there may be a bug with AD users although SQL users work fine."
    Thx in advance!
    Raf

    Ganesh, using BO credentials will only work if you have BO logins that map to specific users in SAP BW.
    It may be that you wish to section the BW reporting differently to the SAP reporting or that there are specific requirements for a particular reporting area where you can in effect use an "overrule" to replace an individual's log in with one that has a wider set of access privileges for reporting purposes. Quite why you'd let them report on more than they can see in SAP, I don't know, but there you go!
    It's more traditionally used in database-based universes for a variety of reasons, particularly access.

  • Using Business Objects to query the CRMOD database

    Has anybody successfully used Business Objects to query CRMOD via web services? Our BO people are trying to do this and would like to learn from other's experience.
    Regards,
    Jeff

    Please refer to online document "OnDemWebSvcs.pdf". You can download this doc at:
    Admin -> Web Services Administration -> Download Documentation
    Edited by: PPL on Oct 8, 2011 12:13 AM

  • What is the use Business objects over WAD.

    Hi Folks,
    what is the use Business objects over WAD.
    How sap bw is going to use Business Objects.
    Thanks,
    Cheta.

    hi,
    A business object is a master record within the Measurement System, and is defined as part of the measurement class within Customizing.
    Examples of business objects are wells, well completions, and measurement points.
    Once the measurement object is maintained, it is saved with the business object so that when viewed, the measurement object is part of the business object.
    regards,
    Siddharth.

  • Possible to report on QC using Business Objects?

    Hello Geeks,
    Please excuse me if I am posting this in wrong thread and help me moving it in right one.
    As I am new to Sol Man, I heard that we could use  Business Objects reporting on/for/with HPQC.
    After going through forum links and sdn search, I found that Sol Man Adapter is used for the same.
    My simple question, is, can we use HPQC for BO reporting (Universe, Webi), if yes is Sol Man the adapter which could help me to achiecve it? Also do we have any white paper, which will help me to use Business Objects as a QC reporting tool?
    Thanks
    P

    You need someone who is very comfortable with the QC database Schema.
    You will need someone who can develop reports for you on the fly. The BO piece can connect directly to the QC database just like a reporting tool like SSRS does and you can build reports and host them on MOSS or something.
    That is what I have done in the past and recommend it at places as a best practice.
    Knowing the QC schema inside out is the key piece and you do not need any adapter in this whatsoever.

  • Is there a way to use business objects in the program or function module?

    Hi Experts,
    Is there a way to use business objects in the program or function module.
    Thanks in Advance.
    Naval bhatt

    Hi Naval,
    Ofcourse you can use business objects in your programms/ methods.
    You can use function modules or macros (available from include <cntn01>) for using business objects in your application.
    refere following two links for startup information
    http://www.sap-img.com/abap/reading-attribute-of-a-business-object-in-abap.htm
    http://www.jt77.com/business-warehouse/work-flow-12619.html
    Regards,
    Abhijit

  • Using JSP, how to add new items to Fuego Business Object "Group" ?

    Given the classic Fuego Business Object (FBO) example of an Order, which has a few attributes (orderNumber, customerName, Order Date) and a GROUP attribute called OrderItems (ItemName, ItemPrice, etc.), I want to use a JSP to allow user to submit order. My JSP has a form and uses the Fuego Tag Library. There are FORM INPUT elements for Order.orderNumber, Order.customerName, Order.OrderDate, and a table using dynamic HTML to add rows and INPUT elements for new items to add to the GROUP attribute OrderItems - ItemName, ItemPrice, etc.)
    But when the user wants to add "OrderItems" to the order, I don't know how to get Fuego to create OrderItem Objects to add to the array (aka GROUP).
    Thx in advance.

    ###### below is the response I response I received from a BEA Engineer. From looking at the html source of fuego presentations that implement desired functionality, it appears as though they handle it using the first suggested workaround below ######
    Hi,
    The short answer to your question is that there is no out of the box feature to support directly what you are asking for.
    The problem is that JSPs receives a Fuego Object that is accessed at rendering time (JSP compilation/ HTML rendering). And then all the updated values are sent back to the engine in a new request when you hit the submit button of a FOR tag that has the postResult tag in the action attribute. At this point all these values are automatically taken from the request and the Fuego Object instance variable in the screenflow is updated.
    After saying this you will notice that it doesn’t make sense to update the Fuego Object instance on the JSP. Because you only could do this ate rendering time and because this instance is not going back to the engine (just the values).
    Fuego Object tag Library was designed basically to be able to show Fuego Object data and invoke runs-on-server FO methods.
    I see 3 different approaches to solve the problem you have:
    1)Use JavaScript to call a runs-on-server method that recive the required arguments to extend the group and set the values. You should use the new tag called invokeUrl that allows you to use AjaX, in this way you could update the page with partial rendering.
    2)Use JavaScritp to submit the form when the user click the add row button. And have a loop in the Screenflow with an automatic activity that will extend the group and the go back to the component activity that now will show the page again but with one more row. The drawback is that each time the user wants to add a row, it will require the entire page to be refresh.
    3)Handle the table and values using JavaScritp and DHTML, and put all the new values in the request (input element), then in the Screenflow use an automatic activity to set this values to the Fuego Object.
    Look at the Samples of using Fuego Tag Lib and AJaX
    albpm5.7\studio\samples\Integration\Portlets\PFoodDelivery.fpr
    albpm5.7\studio\samples\Integration\ThirdParty\AJaX.fpr

  • Is it mandatory to use Business object for data transfer and work flow?

    <font size="3">
    <pre>
    In our enterprise projects we deal with some screens where we add or update some data and again
    we retrieve that data and display to user in various ways like displaying on screen as
    a report or viewing in excel etc.. Most of the times, though we identify the business objects
    based on the nouns in requirements document, really while implementing there will not be any
    business logic in the objects. Almost all the objects which we identfy as business objects
    may have methods like add, delete, update and retrieve methods. Still in these cases, is it required to
    have business objects or can we use transfer object to send the data for saving and retriving or any other
    pattern/guideline is there for dealing such cases?
    I really appreciate your comments on this topic.
    Also I apologize ahead of time if my explanation is not clear to you.
    </pre>
    </font>
    <p>
    Thanks in advance.
    <p>
    Regards,
    <p>
    Rizwan.

    In my opinion, DAO pattern would be suitable for you. Generally the DAO (Data Access Object) will have the CRUD (create, read, update, delete) methods to retrieve data from data-source (e.g. database). Based on the data it will create the DTOs (Data Transfer Objects) and pass them to the caller. It will also receive the DTOs from the caller and save it the data-source. Thus in your case you can
    - remove the CRUD methods from the Business Objects (BO) and make them pure DTOs and use them with DAOs (If you are using JDBC codes inside your application and you don't have much of validation or processing logic in your BOs).
    http://www.corej2eepatterns.com/Patterns2ndEd/DataAccessObject.htm
    OR
    - use BOs in combination in DAOs (if using the database connection from a pool and BOs are having complicated processing logic).
    http://www.corej2eepatterns.com/Patterns2ndEd/BusinessObject.htm

Maybe you are looking for