cancel
Showing results for 
Search instead for 
Did you mean: 

ALV LINK TO ACTION

ananth_anni
Participant
0 Kudos

Hi all,

IM having simple alv table ( SALE DOCUMENT ) .i need when i click the vbeln column i need to navigate the second alv table .

for second alv table i need describtion for vbeln.( the concept is same has normal table( LIKE LINK TO ACTION ) .HOW TO DO LINK TO ACTION IN ALV AND PLEASE GIVE CLEAR EXPLANATION.

1.VBAK----vbeln,some more fields im taken ,the cardinality has o.n......

first alv table as executed but how to do second alv while clik the vbeln field.......

thanking you,

A.S.ANANTH.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In that view, when you have used the ALV as component usage...then

In teh METHODS tab,

on_click_vbeln <<EVENT HANDLER>> F4help select teh onclikc event of that alv...

By ths you can have the clickhandler for that ALV..

And you can have data in R_PARAM of that action handler..

ananth_anni
Participant
0 Kudos

hi,

please give the clear explanation . and coding .

Former Member
0 Kudos

Have you added the ALV as compoenent usage or not...

Have you created teh linktoaction button for the column of ALV or not...

If yes, you can follow the thread which AMIT has posted..for my reply in that thread..

Where you require the help.

ananth_anni
Participant
0 Kudos

hi,

please give brief explanation were i want to give alv link to action button for perticular field.im created a simple table but i need for particular field to link to action ,can u give the coding and clear explanation to crte the link to action for alv,.

Former Member
0 Kudos

Hi,

Have you used the Normal TABLE UI or ALV element for the table display..

This is for ALV, where BEGDA is a column that has linktoaction..At runtime you can see it..

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
 
  lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
 
  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
 
  DATA lv_value TYPE REF TO cl_salv_wd_config_table.
  lv_value = lo_interfacecontroller->get_model(
  ).
 
data: lr_col type ref to cl_salv_wd_column,
      lr_colH type ref to cl_salv_wd_column_header,
lr_link1    TYPE REF TO cl_salv_wd_uie_link_to_action.  "Link to action type
 
CALL METHOD lv_value->if_salv_wd_column_settings~get_column
  EXPORTING
    id     = 'BEGDA'
  receiving
    value  = lr_col.
 
          CREATE OBJECT lr_link1.
          lr_link1->set_text_fieldname( 'BEGDA' ).
          CALL METHOD lr_col->set_cell_editor
            EXPORTING
              value = lr_link1.

For ALV, if want to haev an action to this then refer my earlier post in the same thread..

For NORMAL TABLE UI ellement, while creating the binding option you can specify the LINKTOACTION as UI element for that column..

For that column, once you attach teh LinkToAction, properties->action-create an action for this..

Please try this out..

Regards,

Lekha.

ananth_anni
Participant
0 Kudos

hi u given the code but tell were want to inset the code whether init r want to use any onaction.than im taken vbak struc inthatt

im taken theree fields with car o.n than after inserting u r code want to write the code for vbak strucure r what to do...

Former Member
0 Kudos

have u created the node for ALV right..

if this ALV is the first view to be displayed then, write in WDDOINIT of this view...

otherwise if this ALV is 2nd view then write the code in the inoundplug handler of this 2nd view...

is this clear..

how many views are there..in which view is this ALV displayed...

ananth_anni
Participant
0 Kudos

HI ,

Yes u given the code ,s its working but im created only one view in that view in init the code written u given and than i need when im click the link need to navigate to 2 window ( that is second view ) now im creted second alv table foe the link action first than give code to second table .; and were to insert the code

thank you for u r response

Former Member
0 Kudos

Hi,

Are the Two ALVS structure same...or you fecthcing from different tables..

If you have created the 2nd view and aslo had the ALV as component usage...

Create the Inbound plugs ie carete a navigation link from 1st to 2nd view, from 2nd to 1st view...

After doing this,

In the LINKTOACTION, handler fire the plug to the 2nd view..

In teh 2nd view...

Get the table contents and bind to the node...

Instantiate the ALV if this is different.. and display in view..

If you have previous/back button then fire the plug to 1st view...

Which code are you taling about...

Do you have 2 views with ALVs in both of them..If yes, are the ALVs display different sets of data of same structure...

Is this clear..

ananth_anni
Participant
0 Kudos

HI IM CLEAR ABOUT U R REPLAY but im done as u told last theard but when im click the first view o/p by link to action field i need to get second view table.here in the to view im taken same struc( vbak ).but in the the first alv table im taken three fields and in the second view im taken another 3 fields in the same structure i need when im clik the vbeln field i need to navigate to second three field table.

NOW im got up to first view o/p by link to action field also im having now.BUt WHAT CODE want to write for getting link to action to second view and were to write in the second view to get link to get the values iwhen i click the first link to action vbeln field.im written u r code previouse u posted im get sucessfully link to action but i need to navigate to seconary view were have to write the code.

Former Member
0 Kudos

Now,

First view -

In the METHODS tab,

name type name

on_click_vbeln <<EVENT HANDLER>> F4help select teh onclikc event of that alv...You will get the ONCLIKC action event..

Save it..

Then doubleclick in this method, write the code to fire 2nd view plug...

Is this clear..

ananth_anni
Participant
0 Kudos

hi lekha,

THANK YOU My problem as solved............

ANANTH.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I think below link will help you a lot in solving the roblem:

http://wiki.sdn.sap.com/wiki/display/Snippets/Web%20Dynpro%20ABAP%20-%20Using%20UI%20elements%20in%2...

PS:You have to write the code in the method of type event handler ont he action OnClick.

Pooja

Former Member
0 Kudos

hi

try this


DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
 
  lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
 
  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
 
  DATA lv_value TYPE REF TO cl_salv_wd_config_table.
  lv_value = lo_interfacecontroller->get_model(
  ).
 
data: lr_col type ref to cl_salv_wd_column,
      lr_colH type ref to cl_salv_wd_column_header,
lr_link1    TYPE REF TO cl_salv_wd_uie_link_to_action.  "Link to action type
 
CALL METHOD lv_value->if_salv_wd_column_settings~get_column
  EXPORTING
    id     = 'BEGDA'
  receiving
    value  = lr_col.
 
          CREATE OBJECT lr_link1.
          lr_link1->set_text_fieldname( 'BEGDA' ).
          CALL METHOD lr_col->set_cell_editor
            EXPORTING
              value = lr_link1.

regards,

amit

ananth_anni
Participant
0 Kudos

hi,

hi u given the code but tell were want to inset the code whether init r want to use any onaction.than im taken vbak struc inthatt

im taken theree fields with car o.n than after inserting u r code want to write the code for vbak strucure r what to do...