cancel
Showing results for 
Search instead for 
Did you mean: 

Custom field in Infotype via custom table

Former Member
0 Kudos

Hi experts,

I have the following scenario:

1.I have added a new custom field to the standard PA infotype through PM01.

2.The field is a code(e.g contract code) and the contract desciption is to be strored in a separate custom table.

My question is:

How/where to write the code to insert values into the custom table ,when such infotype is created?Is there a standard function module for this?Any sample/pseudo code would be highly helpful.

thanks in advance,

KC

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Kiran

Why dont you create a field using PM01. Then go to screen programming and write an exit there to enter your code

Best Regards

Former Member
0 Kudos

Hi kiran,

your question sound pretty easy and simple. if u have added custom field to a infotype , it would have created a ZP module pool. Go to se38 do ZP* then f4 , you will find your custom module pool.

THis is similar to std module pool of any infotype , it has includes for PBO and PAI , just write down the code in PAI to create entry in your custom table

Thanks

jimmy

Former Member
0 Kudos

I suggest the following method, which we implemeted here:

1. Create a master table(ZHR_CONTRACT_CODE) for storing the contract code and its description. This is your custom table and you can create maintenace view for adding new records.

2. In the CI include( Infotype extension), add the master table ZHR_CONTRACT_CODE as check table against the contract_code field. This will establish the foreign key relationship and validates the data we are entering the Infotype screen.

3. Goto SE51(you can go from PM01 also) and add code in the PBO part to select the text from the master table and display it on the infotype screen.

module module_pbo_0001 output.

data: w_stext like ZHR_CONTRACT_CODE-stext.

  • Select Object Description in to Detailed Job

select single stext into w_stext

from ZHR_CONTRACT_CODE

where contract_code = pxxxx-concract_code.

if sy-subrc = 0.

d100-stext = w_stext.

clear: w_stext.

endif.

endmodule.

***********************************

This way you do not need to store the text on every record on the infotype. You only store the code and display the text from master table. Please let me know if you have futher questions.

Former Member
0 Kudos

Hi Raj,

thanks a lot for the detailed and hopeful answer.That was really helpful.I have a few questions though:

1.This one relates to pont 2 of your reply:How and where to declare the custom table as a check table in the CI?in SE11?when I open the infotype table in SE11 and try to declare the 'contract code' as a check field,I am being asked the access key.Please let me know if there is a correct way of doing so.

2.In the infotype entry screen,If I want to show the only those values of the 'contract code' which are present in the custom table,what is the best advised solution?

thanks,

Kiran

Former Member
0 Kudos

Pleae see my comments to your questions:

1.This one relates to pont 2 of your reply:How and where to declare the custom table as a check table in the CI?in SE11?when I open the infotype table in SE11 and try to declare the 'contract code' as a check field,I am being asked the access key.Please let me know if there is a correct way of doing so.

  • Go to SE11. Give the main table name associated to the Infotype(PANNNN). Click display. Scroll to the bottom and you see te CI include associated with it. Double click on it. It shows you the details of the fleds and in the include. Go to Change mode here. It does not ask for the access key as this is your custom extension. Scroll to the right and you can assoicate the master table as check table against the field.

PS:You can go to CI include directly in edit mode also from SE11.

2.In the infotype entry screen,If I want to show the only those values of the 'contract code' which are present in the custom table,what is the best advised solution?

  • I implemented this also on our extension. You add the value help in the module pool and add custom search help code there.

This way you can display the code and its description in the search help.

Edited by: Raj Julakanti on Oct 12, 2008 7:49 PM