Skip to Content
0
Former Member
Sep 01, 2007 at 10:19 AM

set parameter, call transaction

311 Views

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