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: 

Re: Selection-screen

Former Member
0 Kudos
126

Hi all ,

Actually i have selction-screen ,

in selection-screen there is a vendor no,

If i execute the selection-screen , the vendor no shoul be populate into 'Mk01; tcode,

I have written some code below,

pls help me I wil give u full points.

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

data : vendor(10) type c.

parameters : vendorno like vendor.

get cursor field fname value fval.

if fname = vendor.

fval = vendor.

set parameter id 'LIF' field fname on selection-screen.

call transaction 'MK01'.

endif.

regards

Sashi

4 REPLIES 4

Former Member
0 Kudos
79

Hi Sashi,

Check the below code , the logic in it is the same as what you want :

&----


*& Report Z_INTERACTIVEREPORT1 *

*& *

&----


*& OBJECTIVE: The objective of this report is to display one basic list

*& from which we can access two secondary lists.The user can move to

*& transaction 'MM02' by clicking on matnr value in the second

*& secondary list. *

&----


REPORT z_interactivereport1 NO STANDARD PAGE HEADING LINE-SIZE 255.

  • PROVIDE TABLES WORK AREA IN THE APPLICATION SERVER.

TABLES: lfa1,ekko,ekpo,mara.

  • DESIGN SELECTION SCREEN WITH SELECT-OPTIONS.

SELECT-OPTIONS: vendor FOR lfa1-lifnr.

  • DEFINE STRUCTURE FOR BASIC LIST.

TYPES: BEGIN OF s_lfa1,

vendor TYPE lfa1-lifnr,

name1 TYPE lfa1-name1,

END OF s_lfa1.

  • DEFINE AN INTERNAL TABLE BASED ON S_KNA1 STRUCTURE.

DATA: it_lfa1 TYPE STANDARD TABLE OF s_lfa1 WITH HEADER LINE WITH

DEFAULT

KEY.

  • DEFINE STRUCTURE FOR FIRST SECONDARY LIST.

TYPES: BEGIN OF s_ekko,

ebeln TYPE ekko-ebeln,

aedat TYPE ekko-aedat,

END OF s_ekko.

  • DEFINE AN INTERNAL TABLE BASED ON S_EKKO STRUCTURE.

DATA: it_ekko TYPE STANDARD TABLE OF s_ekko WITH HEADER LINE WITH

DEFAULT KEY.

  • DEFINE STRUCTURE FOR SECOND SECONDARY LIST.

TYPES: BEGIN OF s_ktab,

ebelp TYPE ekpo-ebelp,

matnr TYPE mara-matnr,

END OF s_ktab.

  • DEFINE AN INTERNAL TABLE BASED ON S_KTAB STRUCTURE.

DATA: it_ktab TYPE STANDARD TABLE OF s_ktab WITH HEADER LINE WITH

DEFAULT KEY.

  • DEFINE VARIABLES FOR GET CURSOR LOGIC.

DATA: fname(10), fval(10).

  • PROVIDE LOGIC TO PASS DEFAULT VALUES TO SELECTION-SCREEN.

INITIALIZATION.

vendor-low = 1000.

vendor-high = 1007.

vendor-sign = 'I'.

vendor-option = 'BT'.

APPEND vendor.

  • PROVIDE LOGIC REQUIRED FOR BASIC LIST.

START-OF-SELECTION.

SELECT lifnr name1 FROM lfa1 INTO TABLE it_lfa1 WHERE

lifnr IN vendor.

  • PROCESSING SCREEN LOGIC FOR BASIC LIST.

LOOP AT it_lfa1.

WRITE:/ it_lfa1-vendor HOTSPOT, it_lfa1-name1.

HIDE it_lfa1-vendor.

ENDLOOP.

  • PROVIDE logic for first secondary list.

AT LINE-SELECTION.

CASE sy-lsind.

WHEN 1.

SELECT ebeln aedat FROM ekko INTO TABLE it_ekko WHERE lifnr =

it_lfa1-vendor.

  • PROCESSING SCREEN LOGIC FOR first secondary list.

LOOP AT it_ekko.

WRITE:/ it_ekko-ebeln HOTSPOT, it_ekko-aedat.

HIDE it_ekko-ebeln.

ENDLOOP.

  • PROVIDE LOGIC REQUIRED FOR SECOND SECONDARY LIST.

WHEN 2.

SELECT ekpoebelp maramatnr INTO it_ktab FROM ekpo INNER JOIN mara ON

ekpomatnr = maramatnr.

APPEND it_ktab.

ENDSELECT.

  • PROCESSING SCREEN LOGIC FOR SECOND SECONDARY LIST.

LOOP AT it_ktab.

WRITE:/ it_ktab-ebelp, it_ktab-matnr HOTSPOT.

HIDE it_ktab-matnr.

ENDLOOP.

  • PROVIDE LOGIC TO MOVE THE CURSOR FROM REPORT TO TRANSACTION.

WHEN 3.

GET CURSOR FIELD fname VALUE fval.

  • PROVIDE THE MEMORY ID OF THE FIELD.

SET PARAMETER ID 'MAT' FIELD fval.

  • PROVIDE LOGIC TO MOVE TO SCREEN.

CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.

ENDCASE.

  • PROVIDE THE LOGIC TO MAINTAIN HEADERS.

TOP-OF-PAGE.

WRITE:/ 'VENDOR DETAILS'.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE sy-lsind.

WHEN 1.

WRITE:/ 'First Secondary List'.

WHEN 2.

WRITE:/ 'Second Secondary List'.

ENDCASE.

<b>Kindly Reward points if you found the reply usefull</b>.

Cheers,

Chaitanya.

Former Member
0 Kudos
79

Try this

DATA : fname(10),fval(10).

DATA : vendor(10) TYPE c.

PARAMETERS : vendorno LIKE vendor.

SET PARAMETER ID 'LIF' FIELD vendorno.

CALL TRANSACTION 'MK01'.

Former Member
0 Kudos
79

Hi,

Please reward points if helpful..........

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

data : vendor(10) type c.

parameters : vendorno like lfa1-lifnr.

set parameter id 'LIF' field vendorno.

call transaction 'XK03'. "'MK01'.

It directly goes to vendor display tcode in display mode from selection screen.

thanks

Sivaparvathi

Former Member
0 Kudos
79

Thhanks sudeer ,

Thank u very much.