cancel
Showing results for 
Search instead for 
Did you mean: 

Passing import parameter to bapi (Urgent)

Former Member
0 Kudos

Hi,

I have two drop down boxes

the first one is dropdowns country code and name and the secon one is region.

in first dropdown if select any country code this has to pass to import of region bapi and then inport bapi has to be excuted and display regions.

Example: if i select US (country code) it has to pass import parameter of Region Bapi and then excute this bapi get all the states(Region)

i am getting error while excuting region bapi, i think i am not passing country code to region bapi properly

is there any simple steps invloved to encounter this error

Regards,

Message was edited by: Murali Manohar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi, Murali!

Are these dropdowns DropDownByKey-lists? If so, did you bind the selectedKey-property to your context-attribute and are you using its value as an import-parameter for your bapi?

You should switch your server-node to Debug to check values. If you think, you' re passing the correct arguments, but the bapi-call still doesn't work, you should activate external debugging in r/3 and set an http-breakpoint in the bapi to check what goes wrong.

Hope, this helps a little!

BR

Thomas

Former Member
0 Kudos

Hi,

drop down is not by key , i am dispalying in an input fiels (EVS)

Actually

i am displaying country code and country name in a input field it's working fine.(code is below)

public void setCountryName( )

{

//@@begin setCountryName()

List countryName = inputCountry.getOutput().getT_T005T();

int countrySize = countryName.size();

IWDAttributeInfo attributeInfo =

wdContext.getNodeInfo().getAttribute("Country");

ISimpleTypeModifiable objType = attributeInfo.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet =

objType.getSVServices().getModifiableSimpleValueSet();

for (int i = 0; i < countrySize; i++) {

T005T country = (T005T) countryName.get(i);

valueSet.put(country.getLand1(), country.getLandx());

}

now in order to excute Region bapi

i have to pass country code to import parameter of the Region bapi

any how i can get country code

wdContext.currentContext.getCountry();

but even though if i set country code to import parameter of Region bapi

Z_Bapi_Ca_Regio_Input inputRegio = new Z_Bapi_Ca_Regio_Input inputRegio()

inputRegio.setLand1(wdContext.currentContext.getCountry());

Still my bapi is not getting excuted

I think country code is not mapped to import parameter of region bapi (any suggestions). if it mappes i think i can get export parameter from region bapi and display region code and region name another drop down.

Over all how to pass import parameter to Region bapi and get export parameters.

Regards,

any suggestions

Former Member
0 Kudos

If you are using an InputField with EVS, there is no event triggered after selecting an item.

You could assign an action to the "onEnter" event of the InputField and execute the action that loads the regions in the second field after the user has pressed the ENTER key.

Armin

Former Member
0 Kudos

HI Armin,

yes exactly

the event selectExcuteRegionBapi is event of the inputfield Countrycode

public void onActionselectExcuteRegionBapi(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionselectExcuteRegionBapi(ServerEvent)

inputRegion = new Z_Bapi_Ca_Regio_Input();

wdContext.nodeZ_Bapi_Ca_Regio_Input().bind(inputRegion);

inputRegion.setL_Land1(wdContext.currentContextElement().getCountry());

wdThis.wdGetVendorSetupCustomControllerController().excuteRegionBapi();

wdThis.wdGetVendorSetupCustomControllerController().setRegionvalues();

//@@end

}

and i am excuting region bapi in custome controller

what may be wrong

Former Member
0 Kudos

As a work around you can use calculated attributes.

Make country as "calculated" to true.

In the Setter method, call executeRegionBapi.

If u use SVS, it does fire the event. I know, for such long list of countries it may not appropriate.

Former Member
0 Kudos

...meaning the user has to press the ENTER key after selecting a country. If (s)he does, the action handler is called which in turn calls the BAPI method in the backend.

Are you calling invalidate() on the output node after the BAPI is executed?

Armin

Former Member
0 Kudos

No i am not calling invalidate after excution of Bapi

here is the stack

java.lang.NullPointerException

at com.sap.bunge.VendorSetupCustomController.setRegionvalues(VendorSetupCustomController.java:340)

at com.sap.bunge.wdp.InternalVendorSetupCustomController.setRegionvalues(InternalVendorSetupCustomController.java:529)

at com.sap.bunge.VW_CRMVendorSetupView.onActionselectExcuteRegionBapi(VW_CRMVendorSetupView.java:285)

at com.sap.bunge.wdp.InternalVW_CRMVendorSetupView.wdInvokeEventHandler(InternalVW_CRMVendorSetupView.java:597)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)

Former Member
0 Kudos

What's in line 340?

Armin

Former Member
0 Kudos

List regionList = inputRegion.getOutput().getT_T005U();

int regionSize = regionList.size();

Former Member
0 Kudos

Can you please post the stacktrace?

Armin