Application Development 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: 

Going to a tcode at line selection

Former Member
0 Kudos

Hello Gurus,

I need to enter a material number in the selection screen. Ans when I execute I get the list from MVKE table as below -

<b>material number - sales org - dist channel - Material status (VMSTA)</b>

And now when I select a line, then the screen should direct to tcode CO09. I wrote the code for this.

But the problem is every time when I enter a new material in the selection screen, and when I select a line from the display, it goes to CO09 tcode with a default material (first material I use in the select screen).

Please help me to avoid this and each time I select a line from the display, it should go to tcode CO09 with th ematerial selected.

Regards,

Balu

22 REPLIES 22

Former Member
0 Kudos

Hi,

Did you used the HIDE comand in final output display ITAB.

loop at itab.

write:/ itab-matnr hotspot,

...........

..........

hide: itab-matnr.

clear itab.

endloop.

Thanks,

Deepak.

Message was edited by:

KDeepak

Former Member
0 Kudos

You asked this question yesterday. I posted code that I tested and does exactly what you want. Please check that thread.

Rob

0 Kudos

Hi Rob,

The program was working fine but only the issue is everytime when I put a different material in my selection screen, it just goes to tcode CO09 with default material (which I used first time) irrespectiove of whatever material I give in the selection screen.

Regards,

balu

0 Kudos

It's really hard to tell without seeing what you actually did. Would you post your code please?

Rob

Former Member
0 Kudos

Hi,

Are you using SET PARAMETER ID 'MAT' for populating the material field??

Thanks

Naren

0 Kudos

I did that.

For the first time its working fine.

Next time when I put a new material in my selection screen and a new list appears with new materials and when I select one of this lines, the tcode is going to CO09 but with old material.

Regards,

Balu

Former Member
0 Kudos

Hi,

Please post your line selection code

Thanks

Naren

0 Kudos

START-OF-SELECTION.

SELECT MATNR VKORG VTWEG VMSTA FROM MVKE INTO TABLE LT_MVKE WHERE MATNR = P_MATNR .

IF SY-SUBRC = 0.

APPEND LT_MVKE.

ELSE.

EXIT.

ENDIF.

LOOP AT LT_MVKE.

FORMAT HOTSPOT ON.

WRITE: /1 LT_MVKE-MATNR, 20 LT_MVKE-VKORG, 26 LT_MVKE-VTWEG, 30 LT_MVKE-VMSTA.

HIDE: LT_MVKE-MATNR.

CLEAR LT_MVKE.

FORMAT HOTSPOT OFF.

ENDLOOP.

AT LINE-SELECTION.

SET PARAMETER ID 'MAT' FIELD CAUFVD-MATNR.

SET PARAMETER ID '1200' FIELD CAUFVD-WERKS.

SET PARAMETER ID 'A' FIELD CAUFVD-PRREG.

CALL TRANSACTION 'CO09'.

Here is my code.

The material number is not populating by default when I select a line.

Regards,

Balu

Message was edited by:

Balu

Message was edited by:

Balu

0 Kudos

SET PARAMETER ID 'MAT' FIELD LT_MVKE-MATNR.

SET PARAMETER ID '1200' FIELD CAUFVD-WERKS.

SET PARAMETER ID 'A' FIELD CAUFVD-PRREG.

CALL TRANSACTION 'CO09'.

You should also hide the other parameters.

You have to hide all the parameters you will be using in the CALL TRANSACTION and then use these hidden parameters in the SET.

Rob

Message was edited by:

Rob Burbank

0 Kudos

Thanks Rob.

Points assigned.

Regards,

Balu

0 Kudos

Hello gurus.

I have a problem with my program again.

After the lsit output, when I click on a line its going to tcode co09.

But the selected line material is not populating in the CO09 tcode. It is getting populated only if we click the line on the material number or else if we click either on sales org or dchannel or status its not updating the material number in CO09 screen.

Any ideas gurus.

Regards,

Balu

Former Member
0 Kudos

Hello gurus.

I have a problem with my program again.

After the list output, when I click on a line its going to tcode co09.

But the selected line material is not populating in the CO09 tcode. It is getting populated only if we click the line on the material number. But when we click either on sales org or dchannel or status on the same line its not updating the material number in CO09 screen.

Please help me out to populate the material and default parameters in the CO09 screen if we click anywhere on the listed row.

Any ideas gurus.

Regards,

Balu

Former Member
0 Kudos

Hi,

Please post your AT LINE-SELECTION code and your HIDE statement

Thanks

Naren

0 Kudos

Naren,

Please find my code below.

LOOP AT LT2_MVKE.

FORMAT HOTSPOT ON.

WRITE: /1 LT2_MVKE-MATNR, 20 LT2_MVKE-VKORG, 35 LT2_MVKE-VTWEG, 65 LT2_MVKE-VMSTA, 85 LT2_MVKE-VMSTB.

HIDE: LT2_MVKE-MATNR. ", LT2_MVKE-VKORG, LT2_MVKE-VTWEG, LT2_MVKE-VMSTA, LT2_MVKE-VMSTB.

CLEAR LT2_MVKE.

FORMAT HOTSPOT OFF.

ENDLOOP.

AT LINE-SELECTION.

IF LT2_MVKE-VMSTA = 'Z4'.

MESSAGE E002.

ELSE.

CALL TRANSACTION 'CO09'.

SET PARAMETER ID 'MAT' FIELD LT2_MVKE-MATNR.

CLEAR LT2_MVKE-MATNR.

DATA WERKS(4) TYPE C VALUE '1200'.

SET PARAMETER ID 'WRK' FIELD WERKS.

DATA RULE(2) TYPE C VALUE 'ZB'.

SET PARAMETER ID 'PRR' FIELD RULE.

SET PARAMETER ID 'X' FIELD CAUFVD-PRMBD.

ENDIF.

Regards,

Balu

0 Kudos

Is this any better:

AT LINE-SELECTION.
  IF LT2_MVKE-VMSTA = 'Z4'.
    MESSAGE E002.
  ELSE.

    SET PARAMETER ID 'MAT' FIELD LT2_MVKE-MATNR.
    CLEAR LT2_MVKE-MATNR.

    DATA WERKS(4) TYPE C VALUE '1200'.
    SET PARAMETER ID 'WRK' FIELD WERKS.

    DATA RULE(2) TYPE C VALUE 'ZB'.
    SET PARAMETER ID 'PRR' FIELD RULE.

    SET PARAMETER ID 'X' FIELD CAUFVD-PRMBD.
  
    CALL TRANSACTION 'CO09'.

  ENDIF

Rob

0 Kudos

Rob,

Thanks for your reply.

Points assigned.

One more question, I see its working now. I will check with more data again.

Regards,

Balu

Former Member
0 Kudos

Rob,

I have a question. Is there anything wrong using the line

SET PARAMETER ID 'X' FIELD CAUFVD-PRMBD.

when there is no parameter ID (I use F1 to find parameter ID) for the check box with requirements in the CO09 screen.

In this case, how can I set the check box enabled.

Please help.

Regards,

Balu

0 Kudos

Hi,

You can't set the parameter ID for check box. In such case you should use SUBMIT.

Regards,

Atish

0 Kudos

Atish,

Can you help me how I can enable the check box after I call the tcode.

Regards,

Balu

0 Kudos

If you wan tto set your checkbox, you need to cal ltransaction CO09 in mode 'E'. Populate data for first screen and call transaction in error mode.

This will open the first screen with checkbox selected.

ashish

0 Kudos

Ashish,

Can you tell me in more detail.

If possible can you give me what steps I need to add.

Regards,

Balu

0 Kudos

If you need to set a checkbox, populate BDC parameters into table IT_BDCTAB. Then CALL TRANSACTION CO09 in mode 'E'.

AT LINE-SELECTION.

Populate screen no and program name for CO09 in IT_BDCTAB.

Populate code for parameter MVKE-MATNR in IT_BDCTAB.

Populate code for parameter WERKS in IT_BDCTAB.

Populate code for parameter CAUFVD-PRMBD in IT_BDCTAB.

CALL TRANSACTION 'CO09' in mode 'E'.

Hope this helps.

ashish