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: 

Steps for adding custom field in Co11n

former_member143179
Participant
0 Kudos

Dear Sir,

We have a requirement to add a custom filed "location" in CO11n transaction . I have searched the relevant content in sdn and based upon this following steps have been done by me .

a) Using SE11, added a custom filed zlocation in table AFRU. For this I added an Append Structure "zloc" in table AFRU and in this structure defined the field zlocation .

b) Using SE80 , opened functional group XCOF and created a screen 0900 . In the screen Layout created filed  AFRU-zlocation

After this , I am not aware as how to proceed further .

I request sap gurus to kindly guide me with all the detail steps as how can we add a custom filed in Co11n and  also able to save the entered data .

With thanks and regards

B Mittal

1 ACCEPTED SOLUTION

former_member188827
Active Contributor
0 Kudos
18 REPLIES 18

Former Member
0 Kudos

Hi,

Please have a look at the following Threads Hope you will fine the answer,

[add field to Va01,va02    |add field to Va01,va02]

[Custom field in VA01|Custom field in VA01 at item level in Additional Data B Tab]

[Changing the atributes of a field in VA01|Changing the atributes of a field in VA01]

Kind Regards,

Abdul.

former_member188827
Active Contributor
0 Kudos

0 Kudos

Dear Netweaver Developer

Thanks for post .

I have gone thru the suggested link , but following steps are not clear in this link.

a) Create a module under PAI of the screen 0900 .

b) capture the values entered in the custom fields and export them to memory id.

c) Use the userexit CONFPP05 (PP order conf.: Customer specific enhancements when saving) for updating custom fields into data base table AFRUD(Dialog table for completion confirmations)

I request to kindly guide with detail steps to be used and also the code to be written in exit CONFPP05.

With thanks and regards

B Mittal

0 Kudos
  • Go to cmod and implement enhancement CONFPP07.
  • Double click on first screen exit with screen 900. It will take you to screen painter.
  • In the flow logic tab, under "PROCESS AFTER INPUT", un comment line

        MODULE USER_COMMAND_0900.

  • Double click on  USER_COMMAND_0900.
  • move the values entered on screen using statement:

          EXPORT <field1> to memory ID 'ZFIELD1'.

  • Then go to cmod again and implement enhancement CONFPP05. Double click on include "ZXCOFU15" and import the values:

          IMPORT <field1> from  memory ID 'ZFIELD1'.

Dont forget to activate the project.

Regards

0 Kudos

Dear Netweaver Developer

Thanks for a vary informative and useful reply .

As suggested , I had followed all the mentioned steps by you .

In ZXOFU15,  I had given following statement :

IMPORT ZZEMP from memory ID 'ZFIELD1'.

but it is giving error :  Field "ZZEMP" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. .

Just to mention , that in screen painter we had created field  ZZEMP .  In AFRU table also we had appended a structure and this structure has a field ZZEMP .

Request you to kindly help us pl .

With thanks and regards

B Mittal

0 Kudos

Declare a variable ZZEMP in ZXOFU15.

Data ZZEMP type afru-zzemp.

Regards

0 Kudos

Dear  Netweaver Developer

Thanks for reply .

As per the guidance given , I followed the steps . But now after typing value in for zzemp in Co11n , on pressing the return key the entered value goes away and on saving the transaction there is no value saved in zzemp field of table AFRU .

I have just activated User-Exit : exit_saplcoru_s_100 and it's include zxcofu23 has no code written into it.

I request you to kindly help me to resolve the issue related to saving of custom field entered data

With Regards

B Mittal

--------------------------------------------------------------------------------------------------------------------------

The screen shot of the steps followed by me are as below :

a) Created screen 0900

        

2) User Exit : exit_saplcoru_s_100  --> Include zxcofu23

3) On Double click on first screen exit with screen 900

On double click user_command_0900

4) User Exit point CONFPP05,  User Exit : EXIT_SAPLCORF_105 --> Include 
zxcofu15

5) Se11 for table AFRU

0 Kudos

Please refer to dictionary field on screen. That is name your field AFRU-ZZEMP instead of ZZEMP on screen and use the same field in import statement.

Regards

0 Kudos

Dear  Netweaver Developer

Thanks for nice reply .

As suggested , I have changed the field to AFRU-ZZEMP as per following screen-shot . Now in CO11n on pressing enter , value typed in zzemp is not getting lost . However on saving the posted transaction in AFRU still  having blank value in ZZEMP . It means the entered value is not getting saved .

Request you to kindly guide us pl .

With Regards

B Mittal

==========

0 Kudos

Try as follows:

data: zzemp type AFRU-ZZEMP,wa type afrud.

import afru-zzemp to zzemp from memory id 'ZFIELD1'.

loop at AFRUD_TAB into wa.

wa-zzemp = zzemp.

modify afrud_tab transporting zzemp

endloop.

Regards

0 Kudos

Dear Netweaver Developer

Thanks for reply.

As suggested , I added the statements in ZXCOFU15 . But still data is not getting saved in AFRU .

On debugging , I found that statement

IMPORT AFRU-ZZEMP from MEMORY ID 'ZFIELD1'

is not populating any value in AFRU-ZZEMP and it remains blank .

Kindly help us pl .

With Regards

B Mittal

0 Kudos

Have you changed the code of import statement as follows?

data: zzemp type AFRU-ZZEMP,wa type afrud.

import afru-zzemp to zzemp from memory id 'ZFIELD1'.

loop at AFRUD_TAB into wa.

wa-zzemp = zzemp.

modify afrud_tab transporting zzemp

endloop.


Regards

0 Kudos

Dear Netweaver Developer

Thanks for reply.

Yes , we have defined the data in  ZXCOFU15 and the written code is as below.

DATA: ZZEMP TYPE AFRU-ZZEMP.
DATA: wa TYPE AFRU.

import afru-zzemp to zzemp from memory id 'ZFIELD1'.
loop at AFRUD_TAB into wa.
   wa-zzemp = zzemp.
   modify afrud_tab transporting zzemp.
endloop.

We also request to kindly check that whether the following code written in Include ZXCOFI01 is correct.

MODULE USER_COMMAND_0900 INPUT.
   data: afru-zzemp type afru-zzemp.
   EXPORT AFRU-ZZEMP to memory ID 'ZFIELD1'.
ENDMODULE.    

In the screen 0900 , the created field name is AFRU-ZZEMP .

With thanks and Regards

B Mittal

0 Kudos

Can you debug and confirm if AFRU-ZZEMP contains value in MODULE USER_COMMAND_0900.

Regards

0 Kudos

Dear Netweaver Developer

Thanks for providing valuable guidance and helping me to resolve the problem .

With Regards

B Mittal

0 Kudos

Hi Mittal,

Could you please tell me how did you resolve the issue?

I dint use any EXPORT and IMPORT statements...Instead in Exit CONFPP05 using ASSIGN statement got the custom fields values from screen.

AFRU table is not getting updated even if AFRUD_TAB is updated with custom field values...

can u update me how did you achieve the same?

Regards,

Hari

0 Kudos

Hi,

Please ignore the post...I just figured out the issue...Its working now...Exit EXIT_SAPLCORU_S_101 solved the issue...

Former Member
0 Kudos

I added in CMOD

this enhancements only and it works well

after adding screen field AFRU-USR00 in screen 0900

enhancements CONFPP01 PP order conf.: Determine customer specific default values

--- EXIT_SAPLCORF_101 ----

Code:

TABLES : AFRU .

AFRU-USR00 = AFVGD_IMP-usr00 . "this to default value of user defined screen field usr00

And

enhancement: CONFPP07 Single Screen Entry: Inclusion of User-Defined Subscreens

----- EXIT_SAPLCORU_S_101 ------

Code:

ES_AFRUD-usr00 = AFRU-usr00 . "this to update the database field from the screen field values