cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Model Structure BAPI_SALESORDER_CREATEFROMDAT2

StefanReitz
Explorer
0 Kudos

Hello Forum,

i need help concerning Web Dynpro Java, i think i have a comprehension problem:

When i import the Bapi_Salesorder_Getlist as Adaptive RFC, Map the Model to the context via Apply Template (Service Controller), Apply Template into the View and create a InputForm (Values are of InputField-Type), Button and an Output-Table (TextViews), i'm able to Deploy the Project and use the Input Fields CustomerNumber and Salesorganization to generate the wanted Results.

If i to the same with Bapi_Salesorder_Createfromdat2 it doesn't work. What i can do is to hard-code the Entries for OrderHeaderIn etc., but i cannot use the Input Filds because they're blanked out.

See this posting ->

I think this is because of the imported Model-Structure. When i test the Bapis i can directly enter the Test-Data, in Salesorder_Createfromdat2 there are underlying Structures like OrderHeaderIn.

Do i have to manually create Sub-Model Nodes or something like that? How am i getting theese Structures filled? Could it be another Problem perhaps with the Apply-Template mechanism?

Any help is appreciated!

Regards

Accepted Solutions (1)

Accepted Solutions (1)

StefanReitz
Explorer
0 Kudos

Hi abhijeet,

The only mandatory input parameter of the Bapi is Order_Header_In with reference-type bapisdhd1.

Under Model, the Class Bapi_Salesorder_Createfromdat2_Input contains the structured parameter Order_Header_In. In the Model Class of the imported Model there the non-executable model class Bapisdhd1 which is containing the method set.Division

If i try Salesorder. i'm not getting the setDivision Method!

abhijeet_mukkawar
Active Contributor
0 Kudos

if i understood whatever u said , so it is , Order_Header_In acting as a parameter name for Bapisdhd1,

so you should use,

<set relevant parameter for "header" using header.set<name>()>

and then

Salesorder.setOrder_Header_In(header) ;

hope it helps

regards

Answers (7)

Answers (7)

StefanReitz
Explorer
0 Kudos

Thank you both for your Help, it works now.

Best Regards

Stefan

StefanReitz
Explorer
0 Kudos

Ramganesan

i tried implementing like you said but Salesorder doesnt know the Method setDivision, Bapisdhd1 does contain the set.Division Method.

Bapi_Salesorder_Createfromdat2_Input Salesorder = new Bapi_Salesorder_Createfromdat2_Input();

wdContext.nodeBapi_Salesorder_Createfromdat2_Input().bind(Salesorder);

Bapisdhd1 header = new Bapisdhd1();

Salesorder.setDivision(header);

This produces following Error:

"The Method setDivision(Bapisdhd1) is undefined for the type Bapi_Salesorder_Createfromdat2_Input"

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

in model , is Division is the parameter name of structure Bapisdhd1(check import paramter of bapi),

if not then it should be

Salesorder.set<parameter name>(header);

hope it helps

regards,

abhijeet

former_member189631
Active Contributor
0 Kudos

Stefan,

Please visit this link also,

Regards,

Ramganesan K.

StefanReitz
Explorer
0 Kudos

Hi abhijeet,

yes, i want to pass a table respectively a structure. In my Case the Structure Bapisdhd1 containing OrderHeaderIn.

Regards

StefanReitz
Explorer
0 Kudos

Hi Ramganesan,

thanks for your Reply;

I'm not working with Material_Savedata, but with Salesorder_Createfromdat2. What exactly do you mean by "Object of corresponding Field" ? Could you perhaps give a code-sample?

I already did this:

Bapi_Salesorder_Createfromdat2_Input Salesorder = new Bapi_Salesorder_Createfromdat2_Input();

wdContext.nodeBapi_Salesorder_Createfromdat2_Input().bind(Salesorder);

Bapisdhd1 header = new Bapisdhd1();

header.setDivision("");

...

Is it btw important WHERE i add the code, could i use the executeBapi-Method OR the DoInitMethod? Do i have to do somethong with the Input Fields except create them with Apply Template?

former_member189631
Active Contributor
0 Kudos

Hi Stefen,

You can place your code Doinit Method itself.

Object of corresponding Field means Try Like This,

Bapi_Salesorder_Createfromdat2_Input Salesorder = new Bapi_Salesorder_Createfromdat2_Input();

wdContext.nodeBapi_Salesorder_Createfromdat2_Input().bind(Salesorder);

Bapisdhd1 objHeader = new Bapisdhd1();

Saleorder.setDivision(ObjHeader);

Thankyou.

Regards,

Ram.

abhijeet_mukkawar
Active Contributor
0 Kudos

hi

whatever structure you want to fill data in is that a tables parameter passed to the FM ?

if this is a tables parameter then that need other way to populate and for that you should better use population method using context attribute

let me kno if that is a table

regards

former_member189631
Active Contributor
0 Kudos

Hi Stefan,

Applying template mechanicanism could nor be the problem.

You have to create the Object for the corresponding context values classes

and set them to the corresponding attrributes.

Bapi_Material_SaveData_Input input = new Bapi_Material_SaveData_Input ();

wdcontext.nodeBapi_Material_SaveData_Input.bind(input);

input.setMaterial(obj); //Object ofcorresponding field

(Or)

You have to set some default values for those fields.

Eg:

Bapi_Material_SaveData_Input input = new Bapi_Material_SaveData_Input ();

wdcontext.nodeBapi_Material_SaveData_Input.bind(input);

input.setMaterial(""); //empty Values

Regards,

Ramganesan K.