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

ABOUT MODULE POOL PROGRAM

Former Member
0 Likes
327

HAI,

I HAVE 3 SCREEN. IN FIRST SCREEN I AM ENTERING MATNR VALUE.

THEN THERE IS ONE DISPLAY BUTTON . WHEN I CLICK THAT IT WILL SHOW THE MATNR ,ERSDA & MEINS VALUE IN SECOND LIST. I AM GETTING THIS OUTPUT.NOW WHEN I CLICK ANY MATNR IT MUST SHOW THE DETAIL OF THAT MATNR LIKE MAKTX IN 3RD SCREEN .HOW ?

THANK YOU

ASHOK KUMAR

2 REPLIES 2
Read only

Former Member
0 Likes
311

Hi u can use the event AT LINE-SELECTION directly if u want to display the output in a list..

at line-selection.

select single

matnr

maktx

from makt

into (w_matnr, w_text)

where matnr eq w_matnr

and spras eq 'EN'.

write : w_matnr, w_text.

If you want to display it on the screen , then create a third screen and

Mention the PICK function code for F2 button in the PF-status.

Now in the Input module ..

case ok.

when 'PICK'.

select single

matnr

maktx

from makt

into (w_matnr, w_text)

where matnr eq w_matnr

and spras eq 'EN'.

LEAVE TO SCREEN <300(THIRD SCREEN NUMBER)>

endcase.

regards,

sai ramesh

Read only

Former Member
0 Likes
311

<b>The following program will solve ur purpose:</b>

REPORT ztest1 .

TABLES: mara, makt.

TYPES: BEGIN OF t_mara,
         matnr TYPE mara-matnr,
         ersda TYPE mara-ersda,
         meins TYPE mara-meins,
       END OF t_mara.

TYPES: BEGIN OF t_makt,
         matnr TYPE makt-matnr,
         maktx TYPE makt-maktx,
       END OF t_makt.

DATA: g_matnr TYPE mara-matnr.

DATA: gt_mara TYPE TABLE OF t_mara,
      wa_mara LIKE LINE OF gt_mara,
      gt_makt TYPE TABLE OF t_makt,
      wa_makt LIKE LINE OF gt_makt..




CALL SCREEN 100.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.


  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = g_matnr
    IMPORTING
      output = g_matnr.

  SELECT matnr ersda meins FROM mara INTO TABLE gt_mara
                                     WHERE matnr = g_matnr.


  CASE sy-ucomm.
    WHEN 'DISPLAY'.
      LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
      SET PF-STATUS space.
      SUPPRESS DIALOG.

      LOOP AT gt_mara INTO wa_mara.

        WRITE:  / wa_mara-matnr, wa_mara-ersda, wa_mara-meins.
        HIDE:  g_matnr.
      ENDLOOP.

  ENDCASE.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

AT LINE-SELECTION.

  SELECT matnr maktx FROM makt INTO TABLE gt_makt
                                     WHERE matnr = g_matnr.

  LOOP AT gt_makt INTO wa_makt.

    WRITE:  / wa_makt-matnr, wa_makt-maktx.
  ENDLOOP.

<b>screen 100</b>

PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_0100.