cancel
Showing results for 
Search instead for 
Did you mean: 

Reg ALV Hyperlink event handling in WDA

former_member186491
Contributor
0 Kudos

Hi,

I am using one ALV for Invoice in WDA. There in that ALV, column containing VBELN has been defined as Hyperlink. On clicking of VBELN, detail about that should be opened up as PDF.

So far, this is working. But, my problem is, if once VBELN has been selected, next clicking does not pass diff VBELN.

I need to know how can I handle clicking on diff VBELN in my Invoice ALV?

If there is anything like clear or refresh, that need to be invoked in Afteraction or Beforeaction or WdModifyView...?

Or is there a syntax like

wdContext.currentContextElement().setSpace(" ");

for getElement( ) also...?

Thanks.

Kumar Saurav.

Edited by: Kumar Saurav on Feb 5, 2010 8:55 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

arjun_thakur
Active Contributor
0 Kudos

Hi Saurav,

I assume that you have created an ON_CLICK eventer handler to handle the click on the hyperlinks. Now this event handlers has as importing parameter R_PARAM. You can use this parameter to get the value which is clicked by the user. Refer the following code:


field-symbols: <l_value> type any.
assign r_param->value->* to <l_value>. " now <l_value> will contain the value of VBELN which the user has clicked
" same can be used in further processing now.

I hope it helps.

Regards

Arjun

former_member186491
Contributor
0 Kudos

Hi Arjun,

Yes you are right, I'm using ON_CLICK event.

You have given me an idea but, I need more clarifications on following points --

1) R_PARAM is only defined as Parameter so, you are saying that I should add in the code - as you have given - there in ON_CLICK method?

2) Now, I'm calling VBELN in the Method named as DISPLAYPDF in ComponentController - Method Tab. So, I need to fetch that L_VALUE in this Method? If yes, how can I navigate to that, because VBELN is being passed to this Method for the processing of Smartforms?

Thanks.

Kumar Saurav.

arjun_thakur
Active Contributor
0 Kudos

Hi Saurav,

R_PARAM is only defined as Parameter so, you are saying that I should add in the code - as you have given - there in ON_CLICK method?

Yes, add the lines of code which I used in my previous post and you'll get the value of the clicked VBELN

Now, I'm calling VBELN in the Method named as DISPLAYPDF in ComponentController - Method Tab. So, I need to fetch that L_VALUE in this Method? If yes, how can I navigate to that, because VBELN is being passed to this Method for the processing of Smartforms?

In the On_click event handler, get the value of clicked VBELN in <l_value> and the call the DISPLAYPDF method. Make an importing parameter in DISPLAYPDF method and call the value of <l_value> in that importing paramter while calling the DISPLAYPDF method.

I hope it helps.

Regards

Arjun

former_member186491
Contributor
0 Kudos

Hi Arjun,

I added the code supplied by you in ON_CLICK event-handler.

Now, for second part,

Make an importing parameter in DISPLAYPDF method and call the value of <l_value> in that importing paramter while calling the DISPLAYPDF method.

Will you please elaborate that. Like say, if there is need to define new Importing Parameter, its Associated Type should be of which type? And, should that new variable be placed wherever, call to LS_VBRKTAB_2-VBELN been made.

Then, what to do with L_VALUE?

I'm unable to employ this strategy. Please guide me further.

Thanks.

Kumar Saurav.

arjun_thakur
Active Contributor
0 Kudos

Hi Saurav,

In the DISPLAYPDF method, create a parameter ln_vbeln ref to vbeln.

Now when you call this method in the ON_CLICK event handler (use the help of code wizard to call the method), just pass the value of <l_value> (which contains the clicked vbeln ) to the parameter ln_vbeln.

In the DISPLAYPDF method, use the paramter ln_vbeln to generate the PDF.

I hope it helps.

Regards

Arjun

former_member186491
Contributor
0 Kudos

Hi Arjun,

I followed and implemented this line --

In the DISPLAYPDF method, create a parameter ln_vbeln ref to vbeln.

Now,

Now when you call this method in the ON_CLICK event handler (use the help of code wizard to call the method),

So, why should I call this method in ON_CLICK Event Handler?

In ON_CLICK Method, this is my code that is being generated using Wizard --

LO_EL_VBRKTAB_2->GET_ATTRIBUTE(
      EXPORTING
        NAME =  `VBELN`
      IMPORTING
        VALUE = LV_VBELN ).

In addition, I am just firing the Plug to call View that has PDF Container - InteractiveForm Element.

And, DISPLAYPDF is a Method defined in ComponentController Method Tab. There, I am employing the logic to fetch the data using Wizard from diff nodes and processing those to give the output from Smartforms as PDF.

There, I've defined ln_vbeln, but, an error comes stating - ln_vbeln cannot be a table, a reference, a string, or contain any of these objects

Here, my question is I've defined my steps. Let me do it in numbers--

1) View for Input defined

2) View to contain output ALV defined

3) View to contain PDF defined

4) Method ON_CLICK defined in second View

5) Method DISPLAYPDF defined in COMPONENTCONTROLLER's Method Tab

Now, suggest me what to do and where?

Thanks.

Kumar Saurav.

former_member186491
Contributor
0 Kudos

Hi Arjun,

I guess, from my this line you have thought that I am not following your suggestion --

So, why should I call this method in ON_CLICK Event Handler?

But, this is not the case.

I did as accordingly and still got the error message --

ln_vbeln cannot be a table, a reference, a string, or contain any of these objects

please guide me as to where I'm missing any link in between the steps.

Thanks.

Kumar Saurav.

former_member186491
Contributor
0 Kudos

Hi Arjun,

Thanks for helping me.

I've employed your suggestion and finally its done.

Thanks again.

Kumar Saurav.