Skip to Content
author's profile photo Former Member
Former Member

Work Flow n Business Objects

I m working on creating a test Business Object.

The attribute's value is getting filled and in Test mode i can see the value of attribute.My attribute is a virtual attribute ,,,

But when i m trying to get it in my method i m unable to.

I am using the macro swc_get property.

I am quite new to workflow if anybody can ,please help.

Below is the code,,,

BEGIN_METHOD ZMAYDISPLAY CHANGING CONTAINER.

data : text(30) type c,

price type vbap-netwr, price1 type i .

swc_get_property self 'Net_price' price1.

move price1 to text.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'TestProgram'

  • DIAGNOSE_OBJECT = ' '

text_question = text

TEXT_BUTTON_1 = 'yes'

ICON_BUTTON_1 = 'ICON_OKAY '

  • TEXT_BUTTON_2 = 'cancel'(002)

  • ICON_BUTTON_2 = 'ICON_CANCEL'

DEFAULT_BUTTON = '1'

DISPLAY_CANCEL_BUTTON = 'X'

  • USERDEFINED_F1_HELP = ' '

START_COLUMN = 25

START_ROW = 6

  • POPUP_TYPE =

  • IMPORTING

  • ANSWER =

  • TABLES

  • PARAMETER =

  • EXCEPTIONS

  • TEXT_NOT_FOUND = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

END_METHOD.

Thanks in Advance.

Mayank

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 04, 2005 at 12:16 PM

    Hi Mayank,

    in order to retrieve values of another attribute, I normally use sentence

    SWC_GET_ELEMENT CONTAINER...

    Moreover, as far as I can see, I think you should include a last sentence that "stores" the value into the object. That is, to include the sentence

    SWC_CREATE_OBJECT...

    and then

    SWC_SET_ELEMENT...

    Please let us know if it works. Best regards,

    Alvaro

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 07, 2005 at 11:52 AM

    Hi Alvaro,

    I noticed something strange.When u define a virtual attribute i think its type C by default.Thats why my value of type VBAP-NETWR was not getting assigned to the attribute.

    So u can see in the code that i have declared a variable of type VBAP-NETWR.

    nd i have used it in swc_get_property macro.I have never assigned the attribute with the value of the query output,

    So i need to assign the attribute

    OBJECT-NET_PRICE = price, where the attribute is of type C and price is of type VBAP-NETWR.

    How cud this be done ???I think this can be solved if we can do this.

    Thanks in advance.

    Mayank.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 07, 2005 at 02:48 PM

    You do not have to use the macro "swc_get_property". The value of the virtual attribute is available just like the object key. At the top of the program there is always a "BEGIN_DATA OBJECT" section. This is how the business object key is defined and it will also define all of your business object's attributes. In the example below, I have a virtual attribute "STATUSOBJNUMBER".

    BEGIN_DATA OBJECT. " Do not change.. DATA is generated

    • only private members may be inserted into structure private

    DATA:

    " begin of private,

    " to declare private attributes remove comments and

    " insert private attributes here ...

    " end of private,

    BEGIN OF KEY,

    NOTIFICATION LIKE QMSM-QMNUM,

    NUMBER LIKE QMSM-MANUM,

    END OF KEY,

    STATUSOBJNUMBER TYPE ONR00-OBJNR,

    _VIQMEL LIKE VIQMEL,

    END_DATA OBJECT. " Do not change.. DATA is generated

    Now to use the virtual attribute in your method it as simple as using the correct variable name.

    statusnumb = object-statusobjnumber.

    Its that simple. To reference a key field.

    key = object-key-notification.

    To reference a virtual attribute from table viqmel.

    field = object-_viqmel-qmnum.

    Hope this helps.

    Jerrod

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Jerrod.

      These are the thumb rules it seems...Anyways thanks for the help...I will be working more often on the Business objects from now onwards...so prepare urself for more disturbance.

      To sum up with these postings, I would like to tell all u newcomer people like me,

      Keep following points in mind always with the developments of Business objects:-

      i) To refer to a virtual attribute in a method :

      OBJECT-<Virtual Attribute Name>.With this notation

      we can refer the V.A anywhere in method.

      ii) To refer a Key Field.

      OBJECT-KEY-<Key Field Name>

      iii)To refer a Database field Attribute.

      OBJECT-_<Attribute Name>

      Regards

      Mayank

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.