cancel
Showing results for 
Search instead for 
Did you mean: 

What is the ARFC part II

Former Member
0 Kudos

Hi Friends

That Edit Context Mapping is OK .

If I add "wdContext.nodeZben_Demo_Rfc_Input().bind(Ak);"

I will get error: java.lang.ArrayIndexOutOfBoundsException: -1 .

public void wdDoInit()

{

//@@begin wdDoInit()

Zben_Demo_Rfc_Input Ak = new Zben_Demo_Rfc_Input();

//wdContext.nodeZben_Demo_Rfc_Input().bind(Ak);

//@@end

}

.

Plz tell me how to do? ......

regards,

Ben

Edited by: BenChen on May 19, 2010 8:16 AM

Accepted Solutions (1)

Accepted Solutions (1)

p330068
Active Contributor
0 Kudos

Hi BenChen,

Please use required statement for executing RFC/BAPI in web dynpro.

First Create method in component controller like getDemoRFCDetails().

Write the code in method like

Zben_Demo_Rfc_Input Ak = new Zben_Demo_Rfc_Input(WDModelScopeType.APPLICATION_SCOPE);

wdContext.nodeZben_Demo_Rfc_Input().bind(Ak);

//Execute RFC

Ak.execute();

//Invalidate Output node for context node Zben_Demo_Rfc_Input

wdContext.nodeOutput().invalidate();

Then call method from wdDoInit()

public void wdDoInit()

{

getDemoRFCDetails();

}

Hope it helps

Regards

Arun

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ben,

Try to follow these Steps.

First you are getting bapi from the ECC by using Adaptive RFC Model

By using context mapping you will pass model node and model attributes to the Component Controller

Now in Component Controller you can write the code.

In wdinit() this method you can write the code.

ModelNodeName input = new ModelNodeName ();

wdContext. ModelNodeName ().bind(input);

Next you have to Create on One method in CC that method name ABC(). Now you have to Execute u BAPI in ABC Method

Can you follow the code.

public void executeABC( )

{

//@@begin executeYmm_Sc_Bapi_Podelay_Input()

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try

{

wdContext.ModlelNodeElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

catch(WDDynamicRFCExecuteException e)

{

manager.reportException(e.getMessage(), false);

}

//@@end

}

Hope this will helps you. If you have any problem please ask me.

Thanks

Vijay Kalluri

former_member214651
Active Contributor
0 Kudos

Hi Ben,

Form the code u have pasted, I can see that the bind statement is commented?????

Did u try executing after doing this?

//wdContext.nodeZben_Demo_Rfc_Input().bind(Ak);

This is the code to execute an RFC:

Bapi_Salesorder_Getlist_Input salesOrder = new Bapi_Salesorder_Getlist_Input();
wdContext.nodeBapi_Salesorder_Getlist_Input().bind(salesOrder);
		
wdContext.currentBapi_Salesorder_Getlist_InputElement().setCustomer_Number(wdContext.currentContextElement().getCustomer_Number());
wdContext.currentBapi_Salesorder_Getlist_InputElement().setSales_Organization(wdContext.currentContextElement().getSales_Org());
		
wdContext.currentBapi_Salesorder_Getlist_InputElement().modelObject().execute();

Regards,

Poojith MV

Former Member
0 Kudos

Hi Poojith MV

U are so nice.

your code is succeed in BAPI_SALESORDER_GETLIST ~ thx.

I test two times that same code .

First is error , Second is OK.

I do same way in My RFC ( zben_demo_rfc ) was fail.

Maybe I will send mail to BASIS.

Regards,

Ben

p330068
Active Contributor
0 Kudos

Hi Ben,

Try to execute the your RFC zben_demo_rfc in SAP System in t-code se37.

Check the reqiored parameter for executing the RFC zben_demo_rfc and execute it.

then pass required parameter for zben_demo_rfc from web dynpro for execute.

Hope it helps

Regards

Arun

Former Member
0 Kudos

HI Arun Jaiswal

I chcek the parameter for the RFC zben_demo_rfc is optional ~~

but still have error.

thx your propose.

the error become

com.sap.tc.webdynpro.progmodel.context.ContextConfigurationException: DataNodeInfo(Bencust.Zben_Demo_Input.Output.Gtb): structure field Zurid not found

Regards

Ben

Edited by: BenChen on May 19, 2010 11:04 AM

former_member214651
Active Contributor
0 Kudos

Hi Ben,

Is this happening for all BAPI's which u try to access or only few. If its happening for all the BAPI's, then u should inform your BASIS team to have a look at the permissions of the user which they have used for the JCo destinations.

By the way, what mode are u using for authentication for METADATA and MODELDATA?

Regards,

Poojith MV

Former Member
0 Kudos

Hi Poojith

METADATA is

Data Type = Dictionary Meta Data

User Authentication = user/password

MODELDATA:

Data Type = Application Data ,

Destination Type = Single Server Connection (should be used only for debugging)

User Authentication = user/password