cancel
Showing results for 
Search instead for 
Did you mean: 

can anyone give an example for updating sales order using bapi_salesorder_change?

Former Member
0 Kudos

I need an complete application which explains how to update records for sales order using bapi_salesorder_change in WDJava.

Accepted Solutions (0)

Answers (1)

Answers (1)

Sharathmg
Active Contributor
0 Kudos

What do you mean complete application?

you cannot get a ready to use application In the forum. try to make use of existing tutorials in scn to understand how to use a model and build a Wdj application. It is a standard scenario.

when you attempt to build appln. If you get struck with any technical issue then pls. Post the query on the forum. That will be easier to get replies for you.

regards,

sharath

Former Member
0 Kudos

Hi Sharath,

im looking for some coding help on using bapi_salesorder_change like updating some field like bill_date. i dont know how to use this bapi to set values values for bill_date to perform update. any help on this will be very greatful.

Thanks & Regards,

Rajasekar.C

Sharathmg
Active Contributor
0 Kudos

// Sample code from my project.

// Instantiate the model

Z575F_Sd_Rfc_Salesdocu_Display_Input inputModel = new Z575F_Sd_Rfc_Salesdocu_Display_Input();

// Create the model node element

IPublicOrderDisplayComp.IZ575F_Sd_Rfc_Salesdocu_Display_InputElement modelEle =          wdContext.nodeZ575F_Sd_Rfc_Salesdocu_Display_Input().createZ575F_Sd_Rfc_Salesdocu_Dis               play_InputElement(inputModel);

// Build the input model element with the values to execute the RFC

// Set the import parameters of the RFC ex: "bapi to set values values for bill_date to perform update"

  modelEle.setIm_Screen_Flag(SCREEN_DATA);

  modelEle.setIm_Vbeln(SalesOrderNo);

  modelEle.setIm_Vbtyp_N(DocType._O.toString()); // O - Order

  modelEle.setIm_Vtweg("----------");

  modelEle.setIm_Spras("EN");

// bind the model

  wdContext.nodeZ575F_Sd_Rfc_Salesdocu_Display_Input().bind(modelEle);

  // Clear the existing values in the model node

  wdContext.nodeZ575F_Sd_Rfc_Salesdocu_Display_Input().nodeOutput_Detail().invalidate();

  wdContext.nodeOrderItemDetails().invalidate();

// Execute the RFC

  wdContext.currentZ575F_Sd_Rfc_Salesdocu_Display_InputElement().modelObject().execute();

Steps:

1. Understand the code

2. Use the code and adapt according to your nodes and import params.

3. Execute it and test it.

Regards,

Sharath