Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 22, 2008 at 05:37 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded