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: 

set parameter, call transaction

Former Member
0 Kudos

Hi all,

By using the following code I can send the vendor no into tcode 'XK02' by placing the cursor on 'vendor no' and pressing 'VENDOR' push button. can send more than one value to the tcode.

Report zabc.

tables lfa1.

**Design selection screen with select options

select-options: vendor for lfa1-lifnr.

*Defining an internal table according to output requirement

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

ort01 like lfa1-ort01,

end of itab.

*Define variables fnam, fval.

data : fnam(10), fval(10).

*Provide the even initialization

initialization.

vendor-low = 21000.

vendor-high = 50000.

vendor-sign = 'I'.

vendor-option = 'BT'.

append vendor.

*Apply the even AT SELECTION SCREEN for validating input values which we define in INITIALIZATION

at selection-screen on vendor.

if vendor-low lt 21000 or vendor-high gt 50000.

message e000(0) with 'Enter between 21000 and 50000'.

endif.

start-of-selection.

*Provide the even start of selection for displaying output

select lifnr land1 name1 from lfa1 into table itab where lifnr in vendor.

Loop at itab.

write : / itab-lifnr, itab-land1, itab-name1.

endloop.

*For providing vedor and back option in tool bar

set pf-status 'ZRANJITH' excluding 'PICK'.

*AT LINE-SELECTION.

at user-command.

case sy-ucomm.

when 'VENDOR'.

get cursor field fnam value fval.

*with this logic to suppl the memory for respective field

set parameter id 'LIF' field fval.

*Apply call transaction logic to move cursor to abap transaction

call transaction 'XK02' and skip first screen.

endcase.

*Back will work automatically

top-of-page.

write : 'Vendor Details'.

Thanks in advance

4 REPLIES 4

Former Member
0 Kudos

Hi

you can also give the value of the company code

<b>bukrs and the parameter id is BUK</b>

<b>EKORG is the purchasing organisation and the parameter id is EKO</b>

thanks & regards,

Venkatesh

Former Member
0 Kudos

Hi Ranjith..

What is your issue here? This will not work as XK02 transaction first screen has two other mandatory fields Bukrs (company code) and Ekorg(purchasing org.)

Thanks and Best Regards,

Vikas Bittera.

0 Kudos

Hi Vikas,

Thanks for your response, can you please give the sample program which can send more than one value into tcode.

Thanks in Advance.

Former Member
0 Kudos

I have found the answer myself, Thanks to SDN and all the people who supported me.