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

Module Pool Input/Output Field Issue

Former Member
0 Likes
2,558

Dear All,

I have a custom Module Pool screen wherein i have an input field with name as ekko-aedat.

And suppose i pass ekko-aedat  = sy-datum.

When I go to flow logic and declare in top module as ekko-aedat type erdat and debug the program, then ekko-aedat is blank i.e. no value

however, if i declare tables: ekko

and then debug the program... this time i am getting value in ekko-aedat.

but by decalring tables: ekko is not a good coding practice since i am not using whole ekko table in my program.

Can anyone tell me a work around for this issue.

i also dont want to use dynp_read_values

4 REPLIES 4
Read only

former_member209120
Active Contributor
0 Likes
980

Hi Suruchi Razdaz,

You are referring 

like this ekko-aedat type erdat you are referring EKKO table 

use like this data : aedat type erdat.

in screen also maintain filed name like aedat instead of ekko-aedat.

Need not to use Tables : EKKO.

You can try like this for example

*TABLES : YVTABLE.

Types : begin of ty_itab,
         mandt   type mandt,
         carrid type YVTABLE-carrid,
         connid type YVTABLE-connid,
         fldate type YVTABLE-fldate,
         PRICE type  YVTABLE-PRICE,
         end of ty_itab.
   
data : YVTABLE TYPE ty_itab.

DATA : WA_YVTABLE TYPE YVTABLE,
        IT_YVTABLE TYPE TABLE OF YVTABLE.

data : fldate type YVTABLE-fldate.

CONTROLS TSC TYPE TABLEVIEW USING SCREEN 100.
CALL SCREEN 101.

*&---------------------------------------------------------------------*
*&      Module  STATUS_0101  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_0101 OUTPUT.
   SET PF-STATUS 'PF_101'.
*  SET TITLEBAR 'TITLE101'.
ENDMODULE.                 " STATUS_0101  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0101  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0101 INPUT.
   CASE SY-UCOMM.

     WHEN 'BACK'.
       LEAVE TO SCREEN 0.
     WHEN  'GET'.
       SELECT * INTO TABLE IT_YVTABLE FROM YVTABLE
                WHERE FLDATE = FLDATE.
       CALL SCREEN 100.
   ENDCASE.
ENDMODULE.                 " USER_COMMAND_0101  INPUT


*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
   SET PF-STATUS 'PF_100'.
* SET TITLEBAR 'TITLE_100'.
ENDMODULE.                 " STATUS_0100  OUTPUT


*&---------------------------------------------------------------------*
*&      Module  REFRESH_IT_YVTABLE  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE REFRESH_IT_YVTABLE INPUT.
   REFRESH IT_YVTABLE.
ENDMODULE.                 " REFRESH_IT_YVTABLE  INPUT

*&---------------------------------------------------------------------*
*&      Module  MOVE_TSC_TO_IT_YVTABLE  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE MOVE_TSC_TO_IT_YVTABLE INPUT.
  
   APPEND YVTABLE to IT_YVTABLE.
ENDMODULE.                 " MOVE_TSC_TO_IT_YVTABLE  INPUT

*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
   CASE SY-UCOMM.
     WHEN 'BACK'.
       LEAVE TO SCREEN 101.

     WHEN 'SAVE'.
       INSERT YVTABLE FROM YVTABLE.
*      IF SY-SUBRC = 0.
*        MESSAGE 'SUCCESSFULLY ADDED'(001) TYPE 'DATS' WITH YVTABLE-FLDATE.
         COMMIT WORK.
         CLEAR YVTABLE.
         CALL SCREEN 101.
*ENDIF.


   ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT

Please refer this link

http://help.sap.com/saphelp_40b/helpdata/en/9f/db9d0335c111d1829f0000e829fbfe/content.htm

Read only

Former Member
0 Likes
980

Hi Suruchi,

In PBO event you can default your variable with sy-datum.

In your screen you would have created a field on the layout with a name say 'GV_DATE' of type EKKO-AEDAT right? In PBO, default sy-datum like this GV_DATE = SY-DATUM.

Hope this works. Let us know if you have any issues

Read only

Former Member
0 Likes
980

Hi Suruchi

Instead of using ekko table structure, use variable or any other local defined types structure in your program.

Types : begin of it_temp,

             v_date type erdat,

              ...

             end of it_temp.

Read only

Former Member
0 Likes
980

Hi,

define screen field name 'AEDAT'.

define data : aedat type aedat. in your program.

specify AEDAT = sy-datum. in your PBO module.

You will get your desired output.

Regards,

RAvi pratap Singh