cancel
Showing results for 
Search instead for 
Did you mean: 

How set default value in field of new infotype

Former Member
0 Kudos

Hi experts!!

We have created a new infotype 9002. This infotype has two mandatories fields, one with the amount and another with the currency.

The currency always will be 'EUR', for this reason we would like to assign the default value for this field and the user only should fill the amount field.

How we should assing the default value to the field we have created in a new infotype 9002?

Kind regards,

Julian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You can default the value either using User exit ZXPADU01 or by dynamic actions. If you feel the user should never change the value, may be you can make the field disabled using view V_T588M.

Regards

Ranganath

Former Member
0 Kudos

Thanks Ranganath!

How can I find this user exit?

With transaction SE38?

Exists other transaction to edit the user exits?

Thanks in advance,

Julian.

antoine_foucault
Active Contributor
0 Kudos

Badi access tcode is SE19.

Former Member
0 Kudos

Yes, you can use SE38 to edit the include ZXPADU01. But you need to create and activate a project for the exit in CMOD transaction, only then this exit will be triggered. If you have a ABAP developer, it should not be more than couple of hours work.

Regards

Ranganath

Former Member
0 Kudos

Hi!

I have checked the SE19 Transaction, but I can't find the user exit ZXPADU01 you told me.

Kind regards,

Julian.

Former Member
0 Kudos

Sorry, but I'm cofuse.

I don't have a program to edit with SE38. I have create a new infotype with PM01 transaction and with this transaction I have created the modulpool MP900200 too, and the dympro 2000.

What should I do?

Search in SE19 the user exit ZXPADU01, but I can't find it.

Edit with SE38 the modulpool MP900200?

Kind regards,

Julian

antoine_foucault
Active Contributor
0 Kudos

Don't be confused... infotype badi and XPAD customer exit are two different concepts aiming at achiving the same goal which is either to default data (before screen output/PBO) and provide extended data consistency check (after sceen output/PAI).

Badis are accessed thru tcode se19, but you need to activate it for any infotypes you wishes to further control. Guru

Ranganath Ramesh already explained how to activate and access XPAD.

Edit with SE38 the user exit ZXPADU01. - this is the easiest way. Have a chat with your techies.

Former Member
0 Kudos

Hi

To explain in more detail,

1) Go to SMOD tcode and give the enhancement name as PBAS0001. There in the components options you'll find all the user exits related to PA30 defaulting and checks.

2) Function Exit EXIT_SAPFP50M_001 will suit the need to default a screen field.

3) Go to CMOD, create a new Z project with the enhancement name as PBAS0001. And activate the project.

4) Go to transaction SE37 give the FM name as EXIT_SAPFP50M_001 as go in display mode. There will be statement INCLUDE ZXPADU01. Double click on the statement, if it is not present it is ask to create a new one, click Yes. Save the entries to a package.

5) Inside the include ZXPADU01 in tcode SE38 write your code to default the field you need from infotype 9002.

Regards

Ranganath

antoine_foucault
Active Contributor
0 Kudos

Hawk,

Another option here will be to enhance infotype 9002 screen 2000 PBO logic. Add a PBO module with the following logic:

  • Begda hat sich vielleicht geändert.

PERFORM re500c(sapfp50m) USING psyst-land p9002-begda. "K35729

IF p9002-waers IS INITIAL. "QNUK110803

  • IF t500c-waers IS INITIAL. "QNOK034099

  • MOVE t001-waers TO p0015-waers. "QNOK034099

  • ELSE. "QNOK034099

MOVE t500c-waers TO p9002-waers. "QNOK129756

  • ENDIF. "QNOK034099

ENDIF.

This is standard code extracted from infotype 0015 PBO logic. It default currency according to your country.

Former Member
0 Kudos

Thank you very much!!

Answers (1)

Answers (1)

PedroGuarita
Active Contributor

Am i just seeing this the wrong way or there isn't a need to use any exit for a custom infotype ? Since it's a custom infotype, why not just change the value in the PAI module of screen 2000 of the infotype ? Something like :


IF P9202-currency is initial.
  P9202-currency = 'EUR'.
ENDIF.