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: 

default value for a field

Former Member
0 Kudos

Hi experts,

I need to set a default value for a field, when creating entries for the table via SM30.

Also, that i want avoid using option modification->events for this.

Please let me know.

Thanks,

Bharadwaj

3 REPLIES 3

Former Member
0 Kudos

Hi Raju,

As you don't want to use EVENTS what you can do is go to the table maintenance generated program and fill the required field in PBO of the corresponding screen.

Thanks and Regards,

Bharat Kumar Reddy.V

Former Member
0 Kudos

go to PBO screen of table maintanence , write one module and in that maodule assign the defult value to that filed.

see the example ....

in PBO we commented and insterted our own modules...

FYI

PROCESS BEFORE OUTPUT.

MODULE LISTE_INITIALISIEREN.

LOOP AT EXTRACT WITH CONTROL

TCTRL_ZFISCH23 CURSOR NEXTLINE.

MODULE LISTE_SHOW_LISTE.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.

MODULE LISTE_BEFORE_LOOP.

LOOP AT EXTRACT.

MODULE LISTE_INIT_WORKAREA.

CHAIN.

FIELD ZFISCH23-BUKRS .

module get_Controlling_Area.

  • FIELD ZFISCH23-KOKRS .

FIELD ZFISCH23-KSTAR module KSTAR_check.

  • FIELD ZFISCH23-KSTAR .

FIELD ZFISCH23-KOSTL module KOSTL_check.

  • FIELD ZFISCH23-KOSTL .

module get_Chart_of_accounts.

  • FIELD ZFISCH23-KTOPL .

*Start of changes by SAB_VGOPAL on 13.04.2006

  • FIELD ZFISCH23-SAKNR1 .

  • FIELD ZFISCH23-SAKNR2 .

FIELD ZFISCH23-SAKNR1 module SAKNR1_check. " G/L account check

FIELD ZFISCH23-SAKNR2 module SAKNR2_check. " Sch23 account check

*End of changes by SAB_VGOPAL on 13.04.2006

module get_system_fields.

  • FIELD ZFISCH23-UNAM .

  • FIELD ZFISCH23-DATUM .

  • FIELD ZFISCH23-TIME .

MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.

ENDCHAIN.

FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.

CHAIN.

FIELD ZFISCH23-BUKRS .

FIELD ZFISCH23-KOKRS .

FIELD ZFISCH23-KSTAR .

FIELD ZFISCH23-KOSTL .

FIELD ZFISCH23-KTOPL .

FIELD ZFISCH23-SAKNR1 .

MODULE LISTE_UPDATE_LISTE.

ENDCHAIN.

ENDLOOP.

MODULE LISTE_AFTER_LOOP.

-


and in module asigned default value like this----


MODULE get_system_fields INPUT.

CASE x_header-maintview.

WHEN 'ZXXXXXX'.

zfisch23-unam = sy-uname.

zfisch23-datum = sy-datum.

zfisch23-time = sy-uzeit .

ENDCASE.

-


Ramesh.

Former Member
0 Kudos

Hi

If you don't want to use the EVENT you should manage it directly updating the PBO of the dynpro generated for SM30.

But you should consider all these modifications can be deleted while re-generating the maitenance program so are you sure not to use the EVENTS?

Max