2008 Jan 31 3:07 PM
Hi,
I have created a table maintenance generator and want to populate sy-uname and sy-datum into two fields during SAVE. So I went to Environment -> Modification -> Events and selected "01" event i.e. "Before saving the data in the database" and entered Form routine as "F_UPDATE_UNAME_UDATE". Then if I go to SM30 transaction it goes to dump.
Could you please tell whether I am missing any point?
Regards,
Balaji Viswanath.
2008 Jan 31 3:23 PM
Look in the main program of the function group defined for the maintenance dialog.
(SAPLZTEST321)
Do you see the include which contains your form, if yes, did you activate include and function group after inserting the form, did you leave the screen where you develop before calling the test?
When you create the event, then click on edit, the program asks you the name of an include to insert the form, create a new include, and confirm inclusion in the Function Group main program of an include statement. Give a name like LZTEST321F01. You may have to activate the Function Group manually, especially if you test on one session and edit on another one
Regards
Look in the main program of the function group defined for the maintenance dialog.
(SAPLZTEST321)
Do you see the include which contains your form, if yes, did you activate include and function group after inserting the form, did you leave the screen where you develop before calling the test?
When you create the event, then click on edit, the program asks you the name of an include to insert the form, create a new include, and confirm inclusion in the Function Group main program of an include statement. Give a name like LZTEST321F01. You may have to activate the Function Group manually, especially if you test on one session and edit on another one
Regards
2008 Jan 31 3:09 PM
2008 Jan 31 3:20 PM
Hi,
Pasted it below.
-
Runtime Error PERFORM_NOT_FOUND
Except. CX_SY_DYN_CALL_ILLEGAL_FORM
Date and Time 01/31/2008 09:26:52
ShrtText
Call (PERFORM) to a non-existent routine.
What happened?
The current program attempted to call an externally defined routine
that does not exist.
Error in ABAP application program.
The current ABAP program "SAPLZTEST321" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
The current ABAP program had to be terminated because the
ABAP processor detected an internal system error.
The current ABAP program "SAPLZTEST321" had to be terminated because the ABAP
processor discovered an invalid system state.
What can you do?
Print out the error message (using the "Print" function)
and make a note of the actions and input that caused the
error.
To resolve the problem, contact your SAP system administrator.
You can use transaction ST22 (ABAP Dump Analysis) to view and administer
termination messages, especially those beyond their normal deletion
date.
is especially useful if you want to keep a particular message.
Error analysis
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_FORM',
was neither
caught nor passed along using a RAISING clause, in the procedure
"PREPARE_SAVING" "(FORM)"
.
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
The program "SAPLZTEST321" is meant to execute an external PERFORM,
namely the routine "F_UPDATE_UNAME_UDATE " of the program "SAPLZTEST321 ", but
this routine does not exist.
This may be due to any of the following reasons:
1. One of the programs "SAPLZTEST321" or "SAPLZTEST321 " is currently being
developed.
The name "F_UPDATE_UNAME_UDATE " of the called routine may be incorrect, or
the routine "F_UPDATE_UNAME_UDATE " is not yet implemented in the program
"SAPLZTEST321 ".
-
2. If the program SAPMSSY1 is involved in the runtime error, one of
the function modules called via RFC is not flagged as remote-capable.
(see Transaction SE37 Goto->Administration->RFC flag)
3. There is an inconsistency in the system. The versions of the
programs "SAPLZTEST321" and "SAPLZTEST321 " do not match.
How to correct the error
- Check that transports to the system are complete.
- Conclude any developments already begun ("SAPLZTEST321" and/or "SAPLZTEST321
").
- Check routine names
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
use the following search criteria:
-
"PERFORM_NOT_FOUND" CX_SY_DYN_CALL_ILLEGAL_FORMC
"SAPLZTEST321" or "LSVIMF14"
"PREPARE_SAVING"
-
If you cannot solve the problem yourself and you wish to send
an error message to SAP, include the following documents:
1. A printout of the problem description (short dump)
To obtain this, select in the current display "System->List->
Save->Local File (unconverted)".
2. A suitable printout of the system log
To obtain this, call the system log through transaction SM21.
Limit the time interval to 10 minutes before and 5 minutes
after the short dump. In the display, then select the function
"System->List->Save->Local File (unconverted)".
2008 Jan 31 3:23 PM
Look in the main program of the function group defined for the maintenance dialog.
(SAPLZTEST321)
Do you see the include which contains your form, if yes, did you activate include and function group after inserting the form, did you leave the screen where you develop before calling the test?
When you create the event, then click on edit, the program asks you the name of an include to insert the form, create a new include, and confirm inclusion in the Function Group main program of an include statement. Give a name like LZTEST321F01. You may have to activate the Function Group manually, especially if you test on one session and edit on another one
Regards
2008 Jan 31 3:57 PM
Hi Raymond,
Thanks, Previously I was not given the "FORM f_update_uname_udate." and "ENDFORM." inside the LZTEST321F01 include. Now it's not going for dump but my objective is still not achieved. Now I have given
ztest321-uname = sy-uname. ztest321-udate = sy-datum.
But the two fields are empty even after save.
Should I need to use TOTAL or EXTRACT.... I know these are internal table and workarea but it's having only LINE field. It's mandatory that I should update these tables to achieve my objective?
Regards,
Balaji Viswanath.
2008 Jan 31 4:05 PM
Yes look at the documentation on event (there is an information icon on the screen which displays list of events)
Look for 01 event, there is a little example :
FORM abc.
DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
LOOP AT TOTAL.
IF <ACTION> = desired constant.
READ TABLE EXTRACT WITH KEY TOTAL.
IF SY-SUBRC EQ 0.
F_INDEX = SY-TABIX.
ELSE.
CLEAR F_INDX.
ENDIF.
* Make desired changes to the line TOTAL
TOTAL-uname = sy-uname.
TOTAL-udate = sy-datum
MODIFY TOTAL.
CHECK F_INDX GT 0.
EXTRACT = TOTAL.
MODIFY EXTRACT INDEX F_INDX.
ENDIF.
ENDLOOP.
SY-SUBRC = 0.
ENDFORM.So you have to change the data of the record TOTAL where written, the change will overwrite table EXTRACT too.
Regards
2008 Feb 02 3:02 PM
Thank you. My problem is solved now - I also refered https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20im...
Regards,
Balaji Viswanath.
2008 Feb 04 1:05 PM
Hi,
I am trying to extract data from table maintenance generator -line is containing some junk characters if field is integer or decimals... how to overcome this issue?
Sample:
LINE
30ZTEST7 test7 VË#####CHGTGW
30ZTEST8 test8 sìp####CHGTGW
30ZTEST9 sdafa #U°####CHGTGW
Regards,
Balaji Viswanath.
2008 Feb 04 1:17 PM
Hello,
There is a standard field that is updated if you loop at an extract.
If you do
LOOP AT EXTRACT.
:
ENDLOOP.
Within the loop the field symbol <vim_extract_struc> is assigned automatically. This field symbol has the same structure as your table.
e.g. Your table has
field1 (char10)
field2 (tims)
field3 (dats)
Then you can access the field values within the loop through:
<vim_extract_struc>-field1
<vim_extract_struc>-field2
<vim_extract_struc>-field3
The same is true for the total table
<vim_total_struc>
Hope that helps,
Michael
2008 Feb 04 1:29 PM
Hi,
Thanks for the reply... actually my requirement is, whenever user changes data through table maintenance generator, I need to update the user name and date. So I am reading the data from extract and assigning it to ZTEST321 and modifying it. Now when I try to extract any interger field i.e. extract+61(10) it's coming as junk value. I am unable to use <vim_extract_struc> field symbol also, it says "The data object "<VIM_EXTRACT_STRUC>" has no structure and therefore no component called "MANDT". called "MANDT"."
FORM f_update.
ztest321-mandt = extract+0(3).
ztest321-matnr = extract+3(18).
ztest321-maktx = extract+21(40).
ztest321-zunit = extract+61(10).
ztest321-uname = sy-uname.
ztest321-udate = sy-datum.
MODIFY ztest321.
ENDFORM.
Regards,
Balaji Viswanath.
2008 Feb 04 1:46 PM
Sorry,
It has been a while since I did that, you have to add an additional step in event 01:
data: ls_wa type ztest321.
LOOP AT total.
CHECK <action> EQ 'N'.
ls_wa = <vim_total_struc>.
ls_wa-uname = sy-uname.
ls_wa-date = sy-datum.
<vim_total_struc> = ls_wa.
MODIFY total.
ENDLOOP.
If you want to do that for extract, just replace 'total' with 'extract'.
I am checking if that entry is a new one (<action> = 'N') and then add user name and date. LS_WA needs to have the same structure as your table, the field sysmbol does have a structure, but only at runtime, hence you can't access an individual component in the coding.
That should do it,
Michael
2008 Feb 04 2:08 PM
Thanks a lot... As per your hint I have written the below code and it's working fine now.
DATA: wa_ztest321 TYPE ztest321.
wa_ztest321 = <vim_extract_struc>.
IF <vim_extract_struc> IS ASSIGNED.
ztest321-mandt = wa_ztest321-mandt.
ztest321-matnr = wa_ztest321-matnr.
ztest321-maktx = wa_ztest321-maktx.
ztest321-zunit = wa_ztest321-zunit.
ztest321-uname = sy-uname.
ztest321-udate = sy-datum.
MODIFY ztest321.
ENDIF.
Regards,
Balaji Viswanath.
2014 Apr 01 8:15 AM
This anwer works for me. This other one below is there in order not to forget 'IS ASSIGNED'.
Thanks.
bye, MP.
2014 Apr 02 7:17 AM
hi ,
use event 05 create new entry
like tabname-username = sy-uname
tablename- date = sy-datum.
2014 Apr 02 2:06 PM
Hi Balaji,
If the two fields for date & uname are visible to the outside world, then you can use the event 05. If you are hiding these from the enduser then you must use event 21.
The dump may be coming because you may not properly activated the TMG. So first you activate the include that you had created for the 01 event and then the entire function group.
Regards,
Abijith
2015 Oct 27 12:12 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |