cancel
Showing results for 
Search instead for 
Did you mean: 

Not able get Result data

Former Member
0 Kudos

Hello Experts,

I have developed on report by using BAPI,When I am run the report its not displaying any result, and more details I have attached screen shot.

Kindly suggest where its missing.

Thanks and Regards,

M.Reddy.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member197472
Active Participant
0 Kudos

Hi,

I cant see initialization code in screenshot. Have you written it somewhere ?

Following is the way to write it -

Zcrm_...._Input input = new Zcrm_...._Input();

wdContext.nodeZcrm_...._Input().bind(input);

<then your code>

Also you have set same current elements' values in same node (first line of code)? why?

Whereas Division is set properly.. shouldnt date values also come from your context node ?

Regards,

Amey

Former Member
0 Kudos

Dear Amy,

My NWDS version is 7.0, in 7.0 is it required to add below code,

Zcrm_...._Input input = new Zcrm_...._Input();

wdContext.nodeZcrm_...._Input().bind(input);

<then your code>

and Iam trying to set default values "from date", "to date" and division value "all" and in component controller I have define exicution of Bapi, see in attachment, kindly suggest where it gets missing.

Regards,

M.Reddy.

former_member197472
Active Participant
0 Kudos

Yes MReddY B,

It is required. first line will initialize your BAPI/RFC's model node.

In onActionButton() add these two lines on top and test.

Also I will suggest to set date values using date type attributes separately created in Context node, NOT using model node attributes..

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

Really appreciate your inputs.

As you mentioned in earlier reply I have added the same, but still iam getting the same.

when Iam trying to execute from date its showing null value.. see attached screen shot.

Regards,

M Reddy.

former_member197472
Active Participant
0 Kudos

Correct me if I am wrong.. Your inputs for BAPI are these date values and division right ?

If you keep them blank on screen it will pass Null only.. Feed date values on screen and then click on Show data button..

In output node you will get desired values.*Provided that BAPI works at back-end too.

--

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

We are passing parameters from

date , To date & division value and Iam trying print there , it is showing null value & from ECC end able to execute the same and result data is shown.

Regards,

M Reddy.

former_member197472
Active Participant
0 Kudos

Can you send snapshot of code where you are passing values of date fields to rfc and reciving back values after execution from Output node?

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

I have defined on action method, see attached screen shot and suggest.

Regards,

M.reddy.

Former Member
0 Kudos

Dear Amey,

When submit, I'm getting error java.lang.NullPointerException ,

kindly suggest.

Regards,

M.Reddy.

former_member191044
Active Contributor
0 Kudos

This is because your from date is null and you try to set this to the calander. You should only do that if a value is entered.

former_member197472
Active Participant
0 Kudos

Hi,

Try to set values to input instead of current element of model node.

e.g  input.setDivision();

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

Now I have set the values as you suggested, Iam able to print same values, but still Iam not getting out put.

see attached screen shots.

and when Iam adding below code, its not getting save.

WDWebResourceType webResType = WDWebResourceType.PDF;

   IWDWebResource webResource   = WDWebResource.getWebResource(wdContext.nodeZcrm_Customer_Sales_Output().currentZcrm_Customer_Sales_OutputElement().getEt_Pdfdata(), webResType);

   String url = "";

   try {

    url = webResource.getURL();

    wdContext.currentContextElement().setPdf_url(url);

    } catch (WDURLException e) {

    e.printStackTrace();

   }//Pdf generation end

Please suggest.

thanks and regards,

M.Reddy

former_member197472
Active Participant
0 Kudos

Can you expand rfc model node and send screenshot ?

Try changing Zcrm_Customer_Sales_Output node's singleton property  false.

And then you will have to go through element of Zcrm_Customer_Sales_Output node.

e.g. wdContext.currentZcrm_Customer_Sales_OutputElement().currentZcrm_Customer_Sales_OutputElement().getEt_Pdfdata();

if this also doesn't work

Try getResourcePath()



Regards,

Amey



Former Member
0 Kudos

Dear Amey,

Iam sharing model node screen shot and kindly suggest.

Regards,

M.Reddy

former_member197472
Active Participant
0 Kudos

Hi,

Delete selected node in left image. 'Output' node in Input node is required.

wdContext.currentOutputElement().getEt_Pdfdata().toString();

This will do.

You can print this value and check.

--

Regards,

Amey


Former Member
0 Kudos

Dear Amey,

I have deleted same node, now code getting save, but its not printed, see attached screenshot.

Kindly help on the same.

Regards,

M Reddy.

former_member197472
Active Participant
0 Kudos

Hi,

Highlighted line after "Data"+ should be

wdContext.currentOutputElement().getEt_Pdfdata().toString();

NOT

wdcontext.CurrentZcrm_..._OutputElement().getEt_Pdfdata().toString();

Also it should give error because you have deleted Zcrm_Customer_Sales_Output node right ?

--

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

Thanks lot for your great replies..

I have added which you would suggested, but its not printed..

Regards,

M.Reddy.

former_member197472
Active Participant
0 Kudos

Something wrong in code.

I can also see there is code after @end too..

Correct that and rebuild+deploy.

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

In below code is there any thing need to add, please check and suggest.

WDWebResourceType webResType = WDWebResourceType.PDF;

   IWDWebResource webResource   = WDWebResource.getWebResource(wdContext.currentOutputElement().getEt_Pdfdata(), webResType);

   String url = "";

   try {

    url = webResource.getURL();

    wdContext.currentContextElement().setPdf_url(url);

    } catch (WDURLException e) {

    e.printStackTrace();

   }//

Regards,

M.Reddy.

former_member197472
Active Participant
0 Kudos

I think this is enough.

We will have to test step by step. Is it working ?

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

I am able to print values, not result data. would you please let me know how we can cross check.

we will start from ECC end able to execute the bapi, same I have attached, kindly suggest.

when we execute, result value is..

from wdj app result:

Regards,

M.reddy

former_member197472
Active Participant
0 Kudos

I think you are getting data. just need to check how to display it.

Instead of using toSting() while printing 'Data', use something else and try to print.

Also try to Print other output data too(e.g CURR , NET_SALE).

--

Regards,

Amey

former_member197472
Active Participant
0 Kudos

Have you found how to print the data?

--

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

Still not getting other options..if you have please share.

Regards,

M.Reddy.

former_member197472
Active Participant
0 Kudos

What is type of ET_PDFData attribute here ?

In RFC do you get pdf data in blob or something ?

--

Regards,

Amey

vijay_kumar49
Active Contributor
0 Kudos

Please check this

blog

Former Member
0 Kudos

Dear Amey,

Now I am able to display data with one of drop down option,I have used I frame ui element & created two value attributes mapped the same,If we select one of the option it will display the data, but when I select all and other options , process showing running..I have cross checked in backend system to execute with other options, here data is showing,see more details below screeshots.

kindly suggest any thing need to be add in code..

Regards,

M.Reddy

former_member197472
Active Participant
0 Kudos

Great..

How much time it takes in ECC for option 'ALL' ?

Check size(no of elements created) of Output node of model node..

And if it is more than 1 loop over output node and use display node accordingly(node with 0..n cardinality).

OR else

Bind Output node to UI Table and check.

Regards,

Amey

Former Member
0 Kudos

Thanks Amey..

There is not much to display the result.

Thing is displaying result data for some of the option which is having the data in backened system, issue is for all divisions (having the data)and other options(which is not having the data).

I have already binded, see below screen.

Regards,

M.Reddy.

former_member197472
Active Participant
0 Kudos

Ho does it give output in ECC for ALL option ?

can you send screenshot of it ?

Also attributes which you have mapped to view from controller can contain only one value at a time

Yous should bind a  node having these attributes and make node's collection cardinality 0..n

Attach that node to UI Table in webdynpro view. and check if it comes properly ?

OR

If you can bind Output Node itself to  UI Table in view, will give you proper data

Later on that can be exported to PDF.

Regards,

Amey

Former Member
0 Kudos

Dear Amey,

Issue occurs when Net_Sale value is "0", then its showing  running status..

And Iam attaching Out put from ECC and front end.

Kindly suggest..

Regards,

M.Reddy

former_member197472
Active Participant
0 Kudos

Hi M.Reddy,


Does ECC gives you PDF in output when division is 'ALL' ? I need that screenshot.

Also can you print value of attribute used  for PdfData  in WD?


If Whole report is generated in PDF for Division 'ALL' in ECC,  then it should display same in WD too.

Seems PDF is not generated.



Regards,

Amey

Former Member
0 Kudos

Dear Amy,

Now we are able to display the data,earlier issue with bapi only.

Now issue is while executing bapi, if net sale is 0 , then its not generating url. in this case from front end (wdj) how we can display message like " No value found " , can you please suggest, I have tried below code, but its not succeed ..

Regards,

M.Reddy

former_member197472
Active Participant
0 Kudos

Hi,

Don't check for null with current element of Output. Go for node.size()==0

OR

In current code also you have catch block. It must be Throwing exception.

Print your line in catch Block.

Regards,

Amey

vijay_kumar49
Active Contributor
0 Kudos

Hello,

It seems after execution of the BAPI, directly you are going to display the data into the PDF format.

After execution of the BAPI, write the

int netSale = wdContent.----.getnetSale()

print the netsalevalue

if (netSale ==0  ) {

“Display data is not found”


}else

{

// write the code for display the data into PDF


}


Hope this is helpful


Regards

Vijay

former_member191044
Active Contributor
0 Kudos

Hi M.Reddy,

first of all, your setFrom_Date and setTo_Date won't do anything because you assigne it to itself.

Now to your issue. Have you tryed log some information after BAPI execution to see if any values are returned from there? That would be the first thing to check.

Regards,

Tobias