cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Notification Number thru WD Java code

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

former_member192434
Active Contributor
0 Kudos
former_member211296
Participant
0 Kudos

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

PradeepBondla
Active Contributor
0 Kudos

Hi,

Try invalidating node after execute() statement.

wdcontext.outputnode.invalidate();

Hope this will solve you issue.

PradeeP