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

Going to a tcode at line selection

Former Member
0 Likes
1,041

Hello Gurus.

I am writing a program which displays the list of sales org and the status of the material (obsoleted or active) by giving the material name in the selection screen.

Now the program displays a list of 3 columns - material, sales org, material status.

<b>Now if I select one of the row, then a particular tcode (CO09) screen should appear with the data taken from the line selection and some other default data required for the tcode.</b>

Can someone help me out to write the code for the bold part.

Thanks in advance.

Regards,

Balu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
976

Hi,

Use Hide statement only in specific conditions..

LOOP AT it_mara.

IF it_mara-mtart = '1234'.

  • Hide only in specific conditions..

HIDE it_mara-matnr.

ENDIF.

ENDLOOP.

Thanks

Naren

8 REPLIES 8
Read only

Former Member
0 Likes
976

May be something like this:

report test.

data: ivbak type table of vbak with header line.
 
data : cursor_field(30),
       field_value(30) .
 
select-options: s_vbeln for ivbak-vbeln.
 
start-of-selection.
 
  select * into corresponding fields of table ivbak
      from vbak
          where vbeln in s_vbeln.
 
  loop at ivbak.
    format hotspot on.
    write:/ ivbak-vbeln.
    hide ivbak-vbeln.
    format hotspot off.
  endloop.
 
at line-selection.
 
  set parameter id 'AUN' field ivbak-vbeln.
  call transaction 'VA03' and skip first screen.

Sri

Read only

0 Likes
976

Thanks Sri...

Assigned points.

I have one more question. In the first I get an output of material, sales org and material status.

Is there a way that I proceed to line selection and go to tcode only if the material status is a specific value.

Regards,

Balu.

Read only

0 Likes
976

Try this:

report test.

data: ivbak type table of vbak with header line.

data : cursor_field(30),

field_value(30) .

select-options: s_vbeln for ivbak-vbeln.

start-of-selection.

select * into corresponding fields of table ivbak

from vbak

where vbeln in s_vbeln.

loop at ivbak.

format hotspot on.

write:/ ivbak-vbeln.

hide ivbak-vbeln.

format hotspot off.

endloop.

at line-selection.

                    • Cond to check if material status is a particular value

GET CURSOR FIELD field1. "Use GET CURSOR

CHECK field1(4) EQ 'JTAB'. "CHECK HERE

set parameter id 'AUN' field ivbak-vbeln.

call transaction 'VA03' and skip first screen.

Sri

Read only

0 Likes
976

Thanks Sri.

Regards,

Balu

Read only

0 Likes
976

Thanks Narendran and Rob.

Points assigned to you.

Regards,

Balu

Read only

Former Member
0 Likes
977

Hi,

Use Hide statement only in specific conditions..

LOOP AT it_mara.

IF it_mara-mtart = '1234'.

  • Hide only in specific conditions..

HIDE it_mara-matnr.

ENDIF.

ENDLOOP.

Thanks

Naren

Read only

Former Member
0 Likes
976

You'll also need the plant for CO09.

Rob

Read only

0 Likes
976

Start with:

REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

TABLES marc.

START-OF-SELECTION.
  SELECT * FROM marc UP TO 10 ROWS.

    WRITE: /001 marc-matnr, marc-werks.
    HIDE :      marc-matnr, marc-werks.

  ENDSELECT.

AT LINE-SELECTION.
  SET PARAMETER ID 'MAR' FIELD marc-matnr.
  SET PARAMETER ID 'WRK' FIELD marc-werks.

  CALL TRANSACTION 'CO09' AND SKIP FIRST SCREEN.

Rob