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 double click in ALV

Former Member
0 Likes
2,397

In the ALV GRID , I have used the following code to go to VA02 and VA22 .

WHEN c_ic1.

  • Retrieve the vbeln value of the record selected and use it to open tcode VA02.

CLEAR wa_outtab.

READ TABLE i_outtab INTO wa_outtab with key p_rs_selfield-fieldname.

SET PARAMETER ID c_pid FIELD wa_outtab-vbeln.

if wa_outtab-auart eq C_ZQT .

CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.

ELSEIF wa_outtab-auart eq C_ZQR .

CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.

ELSE.

CALL TRANSACTION c_tcode1 AND SKIP FIRST SCREEN.

ENDIF .

IF sy-subrc <> 0.

  • no requirement to display error message in case error

  • in opening tcode va02.

ENDIF.

Now My problem is that when the user clicks on a particular sales order in ALV GRID , that particular sales order should be displayed in VA02 .I,e instead of user entering the value of sales order manualy in VA02 . It has to automatically take from the ALV GRID tht particular sales order whic he has double clicked in the ALV .

Please tell me how to achieve this functionality ..

Regards

pavan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,793

Hi,

For VA22 / VA02 I think you should set parameter as follow:

SET PARAMETER ID 'AUN' FIELD wa_outtab-vbeln.

Before using CALL TRANSACTION .

BR,

Thien

In the ALV GRID , I have used the following code to go to VA02 and VA22 .

WHEN c_ic1.

  • Retrieve the vbeln value of the record selected and use it to open tcode VA02.

CLEAR wa_outtab.

READ TABLE i_outtab INTO wa_outtab with key p_rs_selfield-fieldname.

SET PARAMETER ID c_pid FIELD wa_outtab-vbeln.

if wa_outtab-auart eq C_ZQT .

CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.

ELSEIF wa_outtab-auart eq C_ZQR .

CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.

ELSE.

CALL TRANSACTION c_tcode1 AND SKIP FIRST SCREEN.

ENDIF .

IF sy-subrc <> 0.

  • no requirement to display error message in case error

  • in opening tcode va02.

ENDIF.

Now My problem is that when the user clicks on a particular sales order in ALV GRID , that particular sales order should be displayed in VA02 .I,e instead of user entering the value of sales order manualy in VA02 . It has to automatically take from the ALV GRID tht particular sales order whic he has double clicked in the ALV .

Please tell me how to achieve this functionality ..

Regards

pavan

7 REPLIES 7
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,793

Did you pass the Sales Order number to the transaction? Or, do you expect SAP to have an AI & do that automatically for you ?

Anyways to answer your question to need to pass the Sales Order number you have captured through double click & pass that to the CALL TRANSACTION.

You can do so by SET PARAMETER ID (if Param ID defined against the field) or pass a BDC structure.

BR,

Suhas

Read only

Former Member
0 Likes
1,793

This message was moderated.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,793

>

> Can u please tell me how to pass the sales order value to that call transaction

Now this is a generic question. Google with the search string "Call Transaction VA02".

Read only

Former Member
0 Likes
1,793

refer this code.....

pass USER_COMMAND IN ALV AND THEN

ADD THE CODE LIKE THIS..

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

*break mtabap.

data : lv_vbeln TYPE vbeln_va.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-fieldname = 'VBELN' .

Read table IT_FINAL into wa_FINAL index rs_selfield-tabindex.

if sy-subrc = 0.

lv_vbeln = wa_FINAL-vbeln.

SET PARAMETER ID 'AUN' FIELD lv_vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN .

  • clear lv_vbeln.

endif.

ENDIF.

clear wa_final.

ENDCASE.

ENDFORM. "user_command

Read only

Former Member
0 Likes
1,794

Hi,

For VA22 / VA02 I think you should set parameter as follow:

SET PARAMETER ID 'AUN' FIELD wa_outtab-vbeln.

Before using CALL TRANSACTION .

BR,

Thien

Read only

Former Member
0 Likes
1,793

Hi,

You need to set the STANDARD SET PARAMETER ID for the Sales Document and then call transaction.

Regards,

Satish

Read only

Former Member
0 Likes
1,793

HI,

In the user command read the internal table into a work area.

So in that work area u will have the sales order number.

and after that

below is the example .

SET PARAMETER ID 'AUN' FIELD 'ur work area Sales order number '.

call TRANSACTION 'VA02 AND SKIP FIRST SCREEN.

With Regards,

Sumodh.P