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

How to get Notification Number thru WD Java code

Hi all,

i am writing a program in WD Java, when i create a Service Notification (using Bapi_Servnot_Create), how can i get Notification number? I am using the following one, is it right?

String notifNo="";

notifNo = wdContext.currentBapi_Servnot_Create_InputElement().modelObject().getOutput().getNotifheader_Export().getNotif_No();

Bapi_Servnot_Save_Input bapiSaveInput = new Bapi_Servnot_Save_Input();

wdContext.nodeBapi_Servnot_Save_Input().bind(bapiSaveInput);

bapiSaveInput.setNumber(notifNo);

wdContext.currentBapi_Servnot_Save_InputElement().modelObject().execute();

If not then please inform me about the mistake

Thanks

Adnan

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 Dec 20, 2008 at 07:03 AM

    Hi

    Let us consider you have a BAPI Structure,

    BAPI_SERVICE_INPUT

    BAPI_SERVICE_OUTPUT.

    consider you have inputval under the input node. After executing the BAPI you are getting value attributes under the BAPI_SERVICE_OUTPUT. Let us say the attributed named as notification.

    To fetch the values you can use the following code:

    BAPI_SERVICE_INPUT input1=new BAPI_SERVICE_INPUT ();

    input1.setinputval(input);

    wdContext.nodeBAPI_SERVICE_INPUT().bind(input1);

    // Execute the BAPI

    wdContext.currentBAPI_SERVICE_INPUTElement().modelObject().execute();

    // Fetch the values from the output node

    String Notification=wdContext.currentBAPI_SERVICE_OUTPUTElement().getnotification();

    //Close the BAPI connection

    wdContext.currentBAPI_SERVICE_INPUTElement().modelObject().modelInstance().disconnectIfAlive();

    Regards,

    Prasath

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 22, 2008 at 05:37 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 12:56 PM

    Hi,

    i am accessing the R3 thru WD Java but my code is not able to show the Notification Number.

    using the following line:

    notifNo = wdContext.currentBapi_Servnot_Create_InputElement().modelObject().getOutput().getNotifheader_Export().getNotif_No();

    If we create a Service Notification thru WD Java then Notification Number will be created automatically?

    if yes How to catch it thru code?

    My above-mentioned command is not giving the Notificaion Number, Which line i have to use to get it?

    @parsath: Thanks, i already did all the steps which u mentioned but it is NOT giving the Notif number.

    @Anup: link is ok but i am not using JavaMailAPI....it is BAPI Application with RFC.

    Thanks

    Adnan

    Edited by: Adnan Mehboob on Dec 22, 2008 1:56 PM

    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.