Skip to Content
author's profile photo Former Member
Former Member

interative report using call transatcion

Hai Experts,

i got problem with my report, im using three lists, lfa1,ekko and call trensation me23,

in this the first 2 r excuting according my requirement but in call transaction 'me23' im getting the output but required ,so,i'll sjow my code, plz correct n halp me out

TABLES : LFA1,EKKO.

SELECT-OPTIONS : S_LIFNR FOR LFA1-LIFNR.

TYPES : BEGIN OF TY_LFA1,

LIFNR TYPE LFA1-LIFNR,

NAME1 TYPE LFA1-NAME1,

END OF TY_LFA1.

TYPES : BEGIN OF TY_EKKO,

LIFNR TYPE LFA1-LIFNR,

EBELN TYPE EKKO-EBELN,

AEDAT TYPE EKKO-AEDAT,

END OF TY_EKKO.

DATA : V_FNAM TYPE N,

V_FVAL TYPE N.

*V_FNAM = EKKO-EBELN.

*RESERVE V_FNAM LINES.

*

*V_FVAL = EKKO-LIFNR.

*RESERVE V_FVAL LINES.

DATA : W_LFA1 TYPE TY_LFA1,

W_EKKO TYPE TY_EKKO.

DATA : T_LFA1 TYPE STANDARD TABLE OF TY_LFA1 INITIAL SIZE 1.

DATA : T_EKKO TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 1.

TOP-OF-PAGE.

WRITE : /02 'VENDOR MASTER' COLOR 6 INVERSE ON.

WRITE : /01 SY-ULINE(60).

WRITE : /01 SY-VLINE,

05 'VENDOR NO',

20 SY-VLINE,

21 'VENDOR NAME',

60 SY-VLINE.

WRITE : /01 SY-ULINE(60).

END-OF-PAGE.

ULINE.

WRITE : /50'END OF PAGE :',SY-PAGNO.

ULINE.

START-OF-SELECTION.

SELECT LIFNR

NAME1

FROM LFA1 INTO TABLE T_LFA1 WHERE LFA1~LIFNR IN S_LIFNR.

LOOP AT T_LFA1 INTO W_LFA1.

WRITE : /01 SY-VLINE,

05 W_LFA1-LIFNR,

20 SY-VLINE,

21 W_LFA1-NAME1,

60 SY-VLINE.

WRITE : /01 SY-ULINE(60).

HIDE : W_LFA1-LIFNR.

ENDLOOP.

AT LINE-SELECTION.

CASE SY-LSIND. "DETAIL LIST

WHEN '1'.

WRITE : /20 'PURCHASE ORDER DETAILS' COLOR 6 INVERSE ON.

WRITE : /01 SY-ULINE(60).

FORMAT COLOR 2.

WRITE : /01 SY-VLINE,

05 'VENDOR NO',

25 W_LFA1-LIFNR,

60 SY-VLINE.

WRITE : /01 SY-ULINE(60).

FORMAT COLOR OFF.

WRITE : /01 SY-VLINE,

05'VENDOR NO',

24 SY-VLINE,

25'PUR ORD NO',

41 SY-VLINE,

42'DATE',

60 SY-VLINE.

WRITE : /01 SY-ULINE(60).

SELECT LIFNR

EBELN

AEDAT

FROM EKKO INTO TABLE T_EKKO WHERE LIFNR = W_LFA1-LIFNR.

LOOP AT T_EKKO INTO W_EKKO.

WRITE : /01 SY-VLINE,

05 W_LFA1-LIFNR,

24 SY-VLINE,

25 W_EKKO-EBELN,

41 SY-VLINE,

42 W_EKKO-AEDAT,

60 SY-VLINE.

WRITE : /01 SY-ULINE(60).

HIDE : W_EKKO-EBELN.

ENDLOOP.

WHEN '2'.

GET CURSOR FIELD V_FNAM VALUE V_FVAL.

*GET PARAMETER ID 'BES' FIELD EKKO-EBELN.

CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN .

ENDCASE.

*SELECT * FROM EKPO WHERE EBELN = EKKO-EBELN.

*ENDSELECT.

thanks in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 10:21 AM

    hi ,

    try this code...

    Here i have change sequence of HIDE statements....and type of v_fval...

    And Have Set parameter ID in case '2'.....

    TABLES : lfa1,ekko.

    SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr.

    TYPES : BEGIN OF ty_lfa1,

    lifnr TYPE lfa1-lifnr,

    name1 TYPE lfa1-name1,

    END OF ty_lfa1.

    TYPES : BEGIN OF ty_ekko,

    lifnr TYPE lfa1-lifnr,

    ebeln TYPE ekko-ebeln,

    aedat TYPE ekko-aedat,

    END OF ty_ekko.

    DATA : v_fnam TYPE n,

    <b>v_fval LIKE ekko-ebeln. "TYPE n.</b>

    *V_FNAM = EKKO-EBELN.

    *RESERVE V_FNAM LINES.

    *

    *V_FVAL = EKKO-LIFNR.

    *RESERVE V_FVAL LINES.

    DATA : w_lfa1 TYPE ty_lfa1,

    w_ekko TYPE ty_ekko.

    DATA : t_lfa1 TYPE STANDARD TABLE OF ty_lfa1 INITIAL SIZE 1.

    DATA : t_ekko TYPE STANDARD TABLE OF ty_ekko INITIAL SIZE 1.

    TOP-OF-PAGE.

    WRITE : /02 'VENDOR MASTER' COLOR 6 INVERSE ON.

    WRITE : /01 sy-uline(60).

    WRITE : /01 sy-vline,

    05 'VENDOR NO',

    20 sy-vline,

    21 'VENDOR NAME',

    60 sy-vline.

    WRITE : /01 sy-uline(60).

    END-OF-PAGE.

    ULINE.

    WRITE : /50'END OF PAGE :',sy-pagno.

    ULINE.

    START-OF-SELECTION.

    SELECT lifnr

    name1

    INTO TABLE t_lfa1 FROM lfa1 WHERE lfa1~lifnr IN s_lifnr.

    LOOP AT t_lfa1 INTO w_lfa1.

    WRITE : /01 sy-vline,

    05 w_lfa1-lifnr,

    20 sy-vline,

    21 w_lfa1-name1,

    60 sy-vline.

    <b> HIDE w_lfa1-lifnr.

    WRITE : /01 sy-uline(60).</b>

    ENDLOOP.

    AT LINE-SELECTION.

    CASE sy-lsind. "DETAIL LIST

    WHEN '1'.

    WRITE : /20 'PURCHASE ORDER DETAILS' COLOR 6 INVERSE ON.

    WRITE : /01 sy-uline(60).

    FORMAT COLOR 2.

    WRITE : /01 sy-vline,

    05 'VENDOR NO',

    25 w_lfa1-lifnr,

    60 sy-vline.

    WRITE : /01 sy-uline(60).

    FORMAT COLOR OFF.

    WRITE : /01 sy-vline,

    05'VENDOR NO',

    24 sy-vline,

    25'PUR ORD NO',

    41 sy-vline,

    42'DATE',

    60 sy-vline.

    WRITE : /01 sy-uline(60).

    SELECT lifnr

    ebeln

    aedat

    FROM ekko INTO TABLE t_ekko WHERE lifnr = w_lfa1-lifnr.

    LOOP AT t_ekko INTO w_ekko.

    WRITE : /01 sy-vline,

    05 w_lfa1-lifnr,

    24 sy-vline,

    25 w_ekko-ebeln,

    41 sy-vline,

    42 w_ekko-aedat,

    60 sy-vline.

    <b> HIDE : w_ekko-ebeln.

    WRITE : /01 sy-uline(60).</b>

    ENDLOOP.

    WHEN '2'.

    <b>SET PARAMETER ID 'BES' FIELD w_ekko-ebeln.</b>

    CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN .

    ENDCASE.

    reward if useful....

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.