10-14-2011 12:21 PM
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.
10-14-2011 12:36 PM
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
10-14-2011 12:36 PM
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
10-14-2011 5:25 PM
Why do you want to use TMG events? Why not just a view combining your table with EKPO?
Rob
10-17-2011 7:50 AM