cancel
Showing results for 
Search instead for 
Did you mean: 

Calling RFC with webdynpro java (in NetWaver Dev.Studio)

Former Member
0 Kudos

Hi,

I have a RFC like below

FUNCTION ZSAP_X.

*"----


*""Local interface:*

*" IMPORTING

*" VALUE(USNAM) TYPE USERNAME

*" EXPORTING

*" VALUE(PWD) TYPE CHAR8

1-I want to write webdynpro java application to call RFC

2-Call RFC with USNAM parameter

3-Get PWD output parameter and write it's value into View TextInput field.

I wrote application but I did not get PWD (output parameter) value. I checked RFC running poreperly.I did not achieve to get PWD.

How can I do that?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

1-I re-imported RFC (Model in NWDevStudio)

2-I restarted NW Enterprise Portal (stopsap, startsap)

Former Member
0 Kudos

Cemil,

try to execute fm from backend with same input and see whether you are getting the output or not.

put an extranl breakpoint and try to debug the java application

put catch statements in java and check the exception.

How are you trying to retrieve the output

it should be wdContext.currentOutputElement.getField() where output is the output node

Thanks

Bala Duvvuri

Former Member
0 Kudos

Hi Bala,

I checked RFC, it is running properly and getting the output value.

And I used command below, but it produces error

String X = wdContext.currentPWDElement().getpwd().toString();

Error:

java.lang.ArrayIndexOutOfBoundsException: -1

Thanks.

Former Member
0 Kudos

Hi Cemil,

This means the data is not coming and you are trying to access a node which does not have data.

Regards

Pankaj Prasoon

Former Member
0 Kudos

Cemil,

did you try with all the things i mentioned in my previous post.

try to check wdContext.currentPWDElement() is null or not.if it is null then rfc is not getting executed.

Check the jco connection used for rfc is working fine or not

Thanks

Bala Duvvuri