10-12-2006 5:00 PM
In CC01 transaction , Using screen exit i have provided a field for input in the screen . the fields added are in the table AENR .
But when I Save the transaction, the customised fields are cleared.
How do I get these fields to be updated in the table ?
How to use the function exit(provided with the screen exit) in order to update the fields in the table .
Thanks,
Amit
10-12-2006 5:02 PM
Hi
Which structure have you used to create the screen-exit?
You should use AENR table.
Max
10-12-2006 5:15 PM
hi Max,
i have appended structure to AENR table but what logic is to be written in the function exit provided with the screen exit.
Thanks
Amit
10-12-2006 5:17 PM
Hi,
you can move contents of screen field to table fields in the exit.Or check in the program code what internal table is being used for AENR field values.Use the same internal table to transfer values from custom fields.
( Not sure but is it AENRB ?)
Thanks.
-
10-12-2006 5:18 PM
YOu need to use the badi :ECM_UPDATE method:
CHANGE_AT_SAVE.
Regards,
ravi
10-12-2006 5:31 PM
Thanks Rushali.
You are correct the table is AENRB .
But it does not work .
Lemme tell you what we are doing .
Say I have added a date field. I am moving the field entry from AENR to AENRB internal table in the PAI.
But as soon as the control leaves PAI both the tables are empty . Later the AENRB table is filled with the data from the standard fields and the Custom fields are missed.
10-12-2006 5:36 PM
Hi,
Can you specify the exit which you are using ?
Thanks.
10-12-2006 5:43 PM
SAPLXCCA with screen number 1000
Exit : PCCD0001
thanks,
amit
10-12-2006 5:47 PM
Hi
You have to insert your new field in the structure CI_AENR.
So you have to create that structure and insert your new fields there.
Max
10-12-2006 5:52 PM
Hi,
Are you using this component for development ?
EXIT_SAPMC29C_001
Thanks.
10-12-2006 5:56 PM
Rushali,
We are not using this component . Do we have to use it ?
Thanks,
Amit
10-12-2006 5:58 PM
Hi Max,
this structure does not exist.
How can we create a structure starting with SAp name space
Thanks,
Amit
10-12-2006 6:02 PM
Infact you have to create it:
- Trx SE11 show table AENR
- Go to the end of the structure of AENR you should see the structure CI_AENR, do a doubleclick and create it;
- After creating it, insert your new fields
In enhancement:
- Create the screen 100 using structure AENR
- You have to implement 2 user-exit:
1) To import the data from std to screen-exit
EXIT_SAPMC29C_001
Here insert the code:
MOVE USERDATA TO AENR
2) To export the data from screen-exit to std program:
EXIT_SAPMC29C_002
Here insert the code:
MOVE AENR TO USERDATA.
Max
10-12-2006 6:03 PM
Hi,
Just as you mentioned once program control moves from PAI values disappear,you need to check after this control where AENRB is getting filled in std program ,is the component I mentioned appears after this then you can use it with update indicator on & with correct screen field to database table field trasnfer.
Not sure whether this will work or not.,But you can give it a try.
Thanks.
Mark points if helpful.
10-12-2006 6:05 PM
Thanks Max.
But we have added those new fields in Append Structure. Will this not work ??
10-12-2006 6:12 PM
No!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You have to delete the append structure and insert the new fields in CI_AENR.
If you see the fms to import/export the data they have the parameters USERDATA, this parameters is like structure CCCI_AENR, this structure contains the include CI_AENR. The table AENR has this include too, so you can't use an append structure.
So you have to insert the new fields only there.
Max
10-12-2006 6:56 PM
Hi Max,
i have done whatever you have mentioned in the case. but still the data does not pass to the USERDATA field.
How do i go about fetching that data ?
10-13-2006 11:55 AM
Hi,
Can you paste your code here to analyse .
Thanks.
10-13-2006 12:16 PM
Hi
Excuse me but the correct code should be:
1) To import the data from std to screen-exit
EXIT_SAPMC29C_001
Here insert the code:
MOVE-CORRESPONDING USERDATA TO AENR
2) To export the data from screen-exit to std program:
EXIT_SAPMC29C_002
Here insert the code:
MOVE-CORREPSPONDING AENR TO USERDATA.
USERDATA has only the fields insert in CI_AENR
Max