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: 

Problem with table maintanance generator Event

Former Member
0 Kudos

i have the requirement to create the table with 3 fields as manditory EBELN,EBELP and Matnr.in the table maintanance generator if the user enter the EBELN AND EBELP data the correspondiong MATNR has to be dispalyed automatically from the EKPO table.

For this requirement i have created the table maintanance generator Event with '05 create entry 'option.but iam not able to get the EBELN AND EBELP data through 'EXTRACT' statement in the EVENT.it is giving some junk value except MANDT field.

Kindly provide me the solution to get the data entered in the table maintanace into event and to update back from event to table maintanace .

Thanks in Avance.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Don't use EXTRACT (or TOTAL) structure in event 05, use <file/view name>-<field name> fields, read [Event 05: When Creating a New Entry|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f1aa9d111d1a5690000e82deaaa/frameset.htm] (The table or view is defined via a TABLES statement in TOP part of the function group)

The table/view fields can be used for the realization of the user routine.

*&---------------------------------------------------------------------*
*&      Form  z_event_05
*&---------------------------------------------------------------------*
*       If no material number input, get it from purchase order item
*----------------------------------------------------------------------*
FORM z_event_05.
  IF ztable-matnr IS INITIAL.
    SELECT SINGLE matnr INTO ztable-matnr
      FROM ekpo
      WHERE ebeln = ztable-ebeln AND ebelp = ztable-ebelp.
  ENDIF.
ENDFORM.

Regards,

Raymond

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

Don't use EXTRACT (or TOTAL) structure in event 05, use <file/view name>-<field name> fields, read [Event 05: When Creating a New Entry|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f1aa9d111d1a5690000e82deaaa/frameset.htm] (The table or view is defined via a TABLES statement in TOP part of the function group)

The table/view fields can be used for the realization of the user routine.

*&---------------------------------------------------------------------*
*&      Form  z_event_05
*&---------------------------------------------------------------------*
*       If no material number input, get it from purchase order item
*----------------------------------------------------------------------*
FORM z_event_05.
  IF ztable-matnr IS INITIAL.
    SELECT SINGLE matnr INTO ztable-matnr
      FROM ekpo
      WHERE ebeln = ztable-ebeln AND ebelp = ztable-ebelp.
  ENDIF.
ENDFORM.

Regards,

Raymond

Former Member
0 Kudos

Why do you want to use TMG events? Why not just a view combining your table with EKPO?

Rob

Former Member
0 Kudos

The problem solved