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: 

Table updation using function exit in CC01

Former Member
0 Kudos

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

18 REPLIES 18

Former Member
0 Kudos

Hi

Which structure have you used to create the screen-exit?

You should use AENR table.

Max

Former Member
0 Kudos

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

0 Kudos

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.

-

0 Kudos

YOu need to use the badi :ECM_UPDATE method:

CHANGE_AT_SAVE.

Regards,

ravi

0 Kudos

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.

0 Kudos

Hi,

Can you specify the exit which you are using ?

Thanks.

0 Kudos

SAPLXCCA with screen number 1000

Exit : PCCD0001

thanks,

amit

0 Kudos

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

0 Kudos

Hi,

Are you using this component for development ?

EXIT_SAPMC29C_001

Thanks.

0 Kudos

Rushali,

We are not using this component . Do we have to use it ?

Thanks,

Amit

0 Kudos

Hi Max,

this structure does not exist.

How can we create a structure starting with SAp name space

Thanks,

Amit

0 Kudos

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

0 Kudos

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.

0 Kudos

Thanks Max.

But we have added those new fields in Append Structure. Will this not work ??

0 Kudos

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

0 Kudos

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 ?

0 Kudos

Hi,

Can you paste your code here to analyse .

Thanks.

0 Kudos

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