Hi How do we create Methods inside the Business objects of Z

Hi Abapers,
                    How do we create Methods inside the Business objects (z objects) and how *** an import parameter or export parameter  to be defined for the new Methods.
Regards
Bhaskar Rao.M

Hi Bhaskar,
that ´s not difficult.
Open your Bus.Obj. in SWO1 with CHANGE/EDIT
Click on the "Methods" header line and then use the button for "Create".
If you want to add the method on basis of a function module, choose next in the next pop up. Then the system will offer you the ex/import parameter from the function module. So this is a really simple way.
If you don´t have a FM, it is a little bit more difficult.
Choose No on the quetion about a FM, fill in the next pop up  methode name (no blanks allowed).
Dialogue is for user related method (call screen...) synchronous for methods which have to give back a result directly in to the workflow.
After completing the screen the method will be displayed as new method at the end of method list. Now add parameters (first click on the method name, then choose parameter button, same functionality to add program to the method).
Programm:
Code snip:
BEGIN_METHOD ZWFCHECKMIRO CHANGING CONTAINER.
DATA:
      ZBELNR TYPE RBKP-BELNR,
      ZGJAHR TYPE RBKP-GJAHR,
      RESULT TYPE HRP1001-ISTAT,
      BELNR TYPE BKPF-BELNR,
      GJAHR TYPE BKPF-GJAHR,
      BUKRS TYPE BKPF-BUKRS.
to import parameter
  SWC_GET_ELEMENT CONTAINER 'Zbelnr' ZBELNR.
  SWC_GET_ELEMENT CONTAINER 'Zgjahr' ZGJAHR.
*(or SWC_GET_TABLE)
here add the functionality of your method!
to export parameter
SWC_SET_ELEMENT CONTAINER 'Result' RESULT.
  SWC_SET_ELEMENT CONTAINER 'Belnr' BELNR.
*(or SWC_SET_TABLE)
!!! Important: naming convention!!! Use same writing of parameter names in
PARAM area (button PARAMETER) and here in code.
To use your method, change it to implemented after adding your code.
-> Edit -> Change release status -> object type component -> into implemented
(Sorry , have a german screen here, possibly terms are a little bit different.
Hope this helps a little bit.!
regards
Dirk

Similar Messages

  • Calling methods from the Business Object BUS2032

    Hi all,
    Is it possible to call methods from the Business Object BUS2032.
    If so, how can it be done??
    Regards,

    Hi Marv,
    you sure can. Here is an extract from the SAP Help. I found it at http://help.sap.com/saphelp_46c/helpdata/en/c5/e4ad71453d11d189430000e829fbbd/frameset.htm
    <b>Programmed Method Call</b>
    Call (fictitious) method Print of object type VBAK (sales document). The method receives the parameters Paperformat and Printertype as input.
    * Call method Print of object type VBAK
    * Data declarations
    DATA: VBAK_REF TYPE SWC_OBJECT.
    SWC_CONTAINER CONTAINER.
    * Create object reference to sales document
    SWC_CREATE_OBJECT VBAK_REF 'VBAK' <KeySalesDoc>
    * Fill input parameters
    SWC_CREATE_CONTAINER CONTAINER.
    SWC_SET_ELEMENT CONTAINER 'Paperformat' 'A4'.
    SWC_SET_ELEMENT CONTAINER 'Printertype' 'Lineprinter'.
    * Call Print method
    SWC_CALL_METHOD VBAK_REF 'Print' CONTAINER.
    * Error handling
    IF SY-SUBRC NE 0.
    ENDIF.
    Cheers
    Graham

  • How can i create text elements in business object?

    is dis possible to crete text elements in business objects...if any body knows please give me the idea...

    Hello,
    are we talking about the BEx Text elements that are also available in the BEx Analyzer ? if so then this is right now only possible in Analysis, OLAP Edition and Analysis, Edition for Microsoft Office.
    Ingo

  • How  can call a method incide  the method in jsp

    I wrote some statement inside the scriptlet(<% %>)
    then i want call another method ,that one inside the same script let..please replay...

    please help How can write a function inside the JSP

  • How can I publish artwork inside the artboard only?

    How can I publish artwork inside the artboard only?
    As I don't want to show anything outside the artboard when I publish it.
    Also, how can I make the published swf file fit to the artboard size? As I don't want to show the white area outside the artboard.
    Hope someone could help! Many thanks!

    One thing I have noticed is that when you embed the .swf, if you don't designate the widht and height, sometimes you will see some of the extra outside the artboard. For example:
    I uploaded my published files to www.website.com/flash and my .swf is at www.website.com/flash/Main.swf. If I just use that url I will see the extra from Main.swf. However, if I create a page where I embed the .swf, like www.website.com/main.html, I no longer see it.

  • How can I create cursors within the cursor?

    How can I create cursors within the cursor?
    Table1 2001 - 2007 data
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Seq_Num
    Value1
    Value2
    Table2_Historical (doesn't have Num as a field) 1990 - 2000 data
    Account_no
    Account_eff_dt
    No_account_holder
    Seq_Num
    Value1
    Value2
    Table3_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    My result table should be:
    Table_result_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    I have to get data from Table1 and Table2_Historical. If one account was open in 1998 and is still effective, the minimum value of that account is in the Table2_Historical.
    Let's say I open a cursor:
    cursor_first is
    select * from table3_06;
    open csr_first
    loop
    fetch cursor_first into
    v_Account_no
    v_Account_eff_dt
    v_No_account_holder
    v_Num
    EXIT WHEN csr_first%NOTFOUND;
    How can I open a second cursor from here that will get the Seq_Num from Table1
    csr_second
    select Seq_Num from Table1 where
    v_Account_no = Account_no
    v_Account_eff_dt <= Account_eff_dt
    v_No_account_holder=No_account_holder
    v_Num = Num
    How does it works???
    Thanks a lot

    Thanks so much for replying back. Here is what I am trying to do.
    I have to create a table for each year 2002, 2003, 2004, 2005, 2006 that has all the account numbers that are active each year plus some other characteristics.
    Let’s say I will create Table_result_06. This table will have the following fields. The account number, account effective date, Number of the account holder and the field Num (The primary key is a combination of all 4 fields), the beginning look of value 1 in 2006, the last look of value 1 in 2006.
    Table_result_06
    Account_no key
    Account_eff_dt key
    No_account_holder key
    Num key
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    All the active account numbers with the Account_eff_dt, No_account_holder and Num are in the Table3. As such I can build a query that connects Table3 with table Table1 on all 4 fileds, Account_no, Account_eff_dt, No_account_holder, Num and find the Value1_min for the min of req_sequence in 2006 and Value1_max for the max of req_sequence in 2006. Here my problem starts.
    Table 1 doesn’t have a new entry if nothing has changed in the account. So if this account was open in 1993 and nothing has changed I don’t have an entry in 2006 but this doesn’t mean that this account doesn’t exist in 2006. So to find the minimum value I have to go back in 1993 and find the max and min for that year and that will be max and min in 2006 as well.
    As such I have to go to Table_2 historical and search for min and max. But this table doesn’t have the field NUM and if I match only on the Account_no, Account_eff_dt and No_account_holder I don’t get a unique record.
    So how can I connect all three tables, Table 1 for max and min, if it doesn’t find anything will go to table 2 find the two values and populate Table_result_06.
    Thanks so much again for your hep,

  • Want to know how to debug the Business Object Method called from CRM

    Hi all,
    I have to debug a Method of a custom Business Object. This is being called when a certain action is performed
    on the CRM  ( CIC0 screen). I can not see an option to set an external break point in the Program of the Business Object
    Method.
    This Business Object calls a standard SAP FM. I tried setting an external break point in that FM and tried executing that.
    But it  is not stopping there.
    Can any one please let me know how I can debug this when triggered from CRM?
    Thanks  in advance.
    Thanks & regards,
    Y Gautham

    Hi,
    I have tried checking the option 'IP MATCHING' option. I have given my user id and also the 'WEBUSER' as well.
    But still I am unable to debug the application.
    Can you please let me know if I am missing anything further.
    Thanks & regards,
    Y Gautham

  • How to call the method of a Business Object?

    Hi,
    Can someone guide me how to call the method of a business object?
    For example, I want to use the method SalesDocument.Copy of the Business Object VBAK. How can I do that? If you are familiar with any similar scenario please help.
    Regards,
    Renjith Michael.

    Hi
    double click on the copy  and
    go to abap tab
    there u can get functionmodule name
    u can call that
    Rewards if helpful

  • How do I create in Illustrator the same effect of 'color burn' in Photoshop?

    How do I create in Illustrator the same effect of 'color burn' in Photoshop? I am trying to create a rainbow effect by bleding the colors but need this in Illustrator.

    Thanks! I found it! Thats what I needed!
    Serena Finn
    303.919.5239
    [email protected]
    finndesignshop.com

  • How do I create groups in the address book?

    How do I create groups in the address book?

    Hi,
    Open Address Book > go to the File Menu and come down to New Group.
    Hope this helps.

  • How do I create a column the same size?

    How do I create a column the same size?
    I'm concatenating up to 6 cols into one col. If one of the column has a space it will shrink it (I used varchar2 and char) .
    e.g: col1= '123456', col2= ' ', col3= ' ',col4= ' 123', col5=' 51',....etc
    I want to see them as :colx= '123456', ' ', ' ',' 123',' 51'
    Thanks for your help.

    You are alomost right,:-)
    since OP said :If one of the column has a space it will shrink it (I used varchar2 and char) .
    So you should use replace function not trim function.
    test >  select  replace(' a b c ',' ') from dual
      2  /
    REP
    abc
    test >  select trim(' a b c ') from dual;
    TRIM(
    a b c

  • How do we trap exception inside the function module?

    How do we trap exception inside the function module?

    Use ABAP Help - CATCH, RAISE for starters. Or take a look at an existing function module, for example.

  • How to Execute the Business objects created in ABAP from webDynpro applicat

    Wht is the steps , or where the help documents are available for accessing the Business objects created in ABAP or R/3 systems from webDynpro project.

    Hello Vishal,
    I couldn't find any useful documents for your purpose.
    However i had a similar requirement and had implemented the same using GCP APIs. But before i send you the code help, i would like to know your exact requirement. What are you trying to achieve? Are you just wanting to execute the BO and get the result? Or is your requirement has got something more to do?
    Regards,
    Sudeep.

  • How do I create an effect on on object similar to this on Illustrator?

    How do I create an effect on on object similar to this on Illustrator?
    Please see the type show in the link provided : "CHIVAS"
    http://2.bp.blogspot.com/-F-lpKYp-QnE/UH8jwTkTmfI/AAAAAAAAOWQ/BuN9gm9Pe5U/s1600/Chivas+log o+2012.jpg
    Also if anyone knows what font this is, it would be much appreciated.
    Many thanks in advance,
    Nick

    Hello Ellie,
    This is what I do:
    First Create the brushes by selecting the shapes desired. Select the shape and place it into the burshes window.
    (Main Menu: Window + Brushes)
    Then A new window will show: Please select "New Scatter Brush"
    After you click OK, a new window will appear:
    In here I have selected Random Size, Spacing and Rotation. You may want to adjust the percentages to you design. The last thing to select is the Colorization Method; in this case "Tints" is selected because will allow me to change the color of the shape by using the color pallet window. After that click Ok and use the brush tool.
    This is the end result after using the Mask Feature:
    I know you can do something a lot better than this sample. I hope this helps!

  • How to delete the index for the business object BUS0033

    Hi to all experts,
    I'm applying note 1349496 the error here is no records with F4 help for the funds center .
    solution from the note
    Implement the attached program corrections. Then, in the transaction, delete the index for the business object BUS0033, reactivate it, and start the indexing in the indexing mode "Full". The system then displays the data correctly in the F4 search help.
    how to do the second part i have already applied the note .

    any help

Maybe you are looking for