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

Validations in Webdynpro

Hi,

I'm new to WDABAP. In my webdynpro I have used one zBAPI and in that BAPI there are few validations which are already maintained. So, now in my webdynpro how to use those validations?

Can some one guide me regarding these validations to maintain in Webdynpro.

Regards,

Smitha

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 10:22 AM

    Hi Smitha,

    I am not clear with your requirement but in case if you want to catch the error and waring messages thrown by BAPI in that case in your web dynpro code after calling the BAPI you have to catch all the error messages which BAPI must be returning in some internal table. In web Dynpro you can display all these messages using Message Manager. Here is the small example:

    Suppose this is a BAPI call:

    CALL FUNCTION 'BAPI_GOODSMVT_GETDETAIL'

    EXPORTING

    MATERIALDOCUMENT = LS_DOCNO_OUTPUT-MAT_DOC

    MATDOCUMENTYEAR = LS_DOCNO_OUTPUT-DOC_YEAR

    • IMPORTING

    • GOODSMVT_HEADER =

    TABLES

    GOODSMVT_ITEMS = DOC_ITEM_DETAILS

    RETURN = LT_RETURN

    Now here LT_RETURN is the table which will have errors if any. So you can simply display all these errors by the following code:

    DATA: LV_WDCOMPONENT TYPE REF TO IF_WD_COMPONENT,

    LV_MESSAGE TYPE REF TO IF_WD_MESSAGE_MANAGER.

    LV_WDCOMPONENT = WD_THIS->WD_GET_API( ).

    LV_MESSAGE = LV_WDCOMPONENT->GET_MESSAGE_MANAGER( ).

    LOOP AT LT_RETURN INTO WA_RETURN.

    DATA: MESSAGE TYPE STRING.

    MESSAGE = WA_RETURN-MESSAGE.

    LV_MESSAGE->REPORT_ERROR_MESSAGE( MESSAGE_TEXT = MESSAGE ).

    ENDLOOP.

    This was just a sample code to give you a start. You can explore IF_WD_MESSAGE_MANAGER and other classes more to get idea about several methods of these classes.

    In case if this was not you qurey please frame you question again so that may be I or somebody can help you out.

    Regards,

    Neha

    .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 05:00 AM

    Hi Smitha,

    I understood your requirement . Initially ensure that your Zbapi is returning any stucture called bapiret2.

    secondly in webdynpro call use the Code generator and select the option called Generate Message and select the method called REPORT_T100_message.

    declare as

    Data: lt_retun type bapiret2,

    ls_return type bapiret2.

    Loop at lt_return into ls_return.

    • report message

    CALL METHOD lo_message_manager->report_t100_message

    EXPORTING

    msgid = ls_return-id

    msgno = ls_return-number

    msgty = ls_return-type.

    endloop.

    Follow this procedure it will solve your problem .

    Regards,

    Misbah

    Add a comment
    10|10000 characters needed characters exceeded

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.