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

Need help...

Former Member
0 Likes
655

Hi experts,

Please help me in the following code.

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when 'DISP'.

read table it_alv index rs_selfield-tabindex.

if sy-subrc = 0.

if rs_selfield-fieldname = 'AUFNR'.

set parameter id 'ANR' field rs_selfield-value.

call transaction 'CO03' and skip first screen.

elseif rs_selfield-fieldname = 'AUART'.

set parameter id 'AAT' field rs_selfield-value.

call transaction 'IW33' and skip first screen.

endif.

endif.

endcase.

endform. "user_command

when i click on AUFNR field it should go to transaction 'CO03' and if i click on field

'AUART' it should go to the transaction 'IW33'. But i am not getting please help me.

Thanks

Raj

6 REPLIES 6
Read only

Former Member
0 Likes
629

Put a break point in the Case statement and check the value of R_UCOMM in debugger. I think double click in not DISP.

Aman

Read only

Former Member
0 Likes
629

Hi raj,

1. when double-clicking, the r_ucomm

will be &IC1

(and not DISP)

2. so change your code

3

case r_ucomm.

<b>when '&IC1'.</b>

regards,

amit m.

Read only

Former Member
0 Likes
629

Change the code like this:

FORM user_command USING ws_ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

CASE ws_ucomm.

WHEN '&IC1'.

CASE selfield-tabname.

WHEN 'AUFNR'.

set parameter id 'ANR' field rs_selfield-value.

call transaction 'CO03' and skip first screen.

WHEN 'AUART'.

set parameter id 'AAT' field rs_selfield-value.

call transaction 'IW33' and skip first screen.

ENDCASE.

ENDCASE.

endform. "user_command

Regards,

Prakash.

Read only

0 Likes
629

Hi Prakash,

Thank u for ur reply.

I have taken two values for order number. ie from

813217 to 813218.

But when i clicking on the order type 'PM01' for the order number '813217' it is showing values for '813218' in 'iw33'.

Please help me..

Thanks

Raj

Read only

Former Member
0 Likes
629

Hi,

in debug mode check sy-ucomm value when you double

click and replace your case statement with

sy-ucomm value.

Regards

amole

Read only

Former Member
0 Likes
629

Hi,

problem may be with your

<b> read table it_alv index rs_selfield-tabindex</b>Regards

amole