Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in alv user command

Former Member
0 Likes
783

Dear Friends,

I am doing an interactive alv report.

In the output i am displaying sal order no, bill no etc..

when i am click sal no it takes me to VA03 and when click on bil no it takes me to VF03.

But what happend is when i am clicking on any one of the above it takes me to second tcode only.

my code is..


form double_click using r_ucomm     like sy-ucomm
                        rs_selfield type slis_selfield.
  clear : wa_final.
  case r_ucomm.
    when '&IC1'.
    read table it_final into wa_final index rs_selfield-tabindex.
     if rs_selfield-sel_tab_field = '1-SAL_NO'.
        set parameter id 'AUN' field wa_final-sal_no.
        call transaction 'VA03' and skip first screen.
     else. rs_selfield-sel_tab_field = '1-BIL_NO'.
          set parameter id 'VF' field wa_final-bil_no.
          call transaction 'VF03' and skip first screen.
        endif.
    endcase.

  endform. " double_click.

4 REPLIES 4
Read only

Former Member
0 Likes
724

Hi,

change rs_selfield-sel_tab_field to rs_selfield-fieldname.

read table it_final into wa_final index rs_selfield-tabindex.

if rs_selfield-fieldname = '1-SAL_NO'.

set parameter id 'AUN' field wa_final-sal_no.

call transaction 'VA03' and skip first screen.

elseif rs_selfield-fieldname = '1-BIL_NO'.

set parameter id 'VF' field wa_final-bil_no.

call transaction 'VF03' and skip first screen.

endif.

Regards,

Madhukar Shetty

Read only

Former Member
0 Likes
724

In place of

if rs_selfield-sel_tab_field = '1-SAL_NO'.

Try to use:

IF rs_selfield-fieldname = '1-SAL_NO'.

For both the condition.

if rs_selfield-fieldname = '1-SAL_NO'.

set parameter id 'AUN' field wa_final-sal_no.

call transaction 'VA03' and skip first screen.

endif.

if rs_selfield-fieldname = '1-BIL_NO'.

set parameter id 'VF' field wa_final-bil_no.

call transaction 'VF03' and skip first screen.

endif.

Regards,

Priyanka

Read only

0 Likes
724

Thank you so much madhu & priyanka.

the correct code is...


  case r_ucomm.
    when '&IC1'.
        clear : wa_final.
    read table it_final into wa_final index rs_selfield-tabindex.

     if rs_selfield-FIELDNAME = 'SAL_NO'.  "here we change from 1_sal_no to sal_no
        set parameter id 'AUN' field wa_final-sal_no.
        call transaction 'VA03' and skip first screen.

     else. rs_selfield-FIELDNAME = 'BIL_NO'.  "here we change from 1_bil_no to bil_no
          set parameter id 'VF' field wa_final-bil_no.
          call transaction 'VF03' and skip first screen.
     endif.
    endcase.

Thnak you so much for giving the idea of FIELDNAME.

Edited by: anurag.radha on Feb 16, 2012 12:36 PM

Edited by: anurag.radha on Feb 23, 2012 1:06 PM

Edited by: anurag.radha on Feb 23, 2012 1:07 PM

Read only

Former Member
0 Likes
724

Answered