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: 

HOW TO GIVE DEFAULT VALUES IN DIALOG PROGRAMMING

former_member1242340
Participant
0 Kudos

Hai Experts,

i got a problem plz help me out,

my problem is i have created a screen in dialog programming in my screen

i i have fields like START_GALLONS,FILL DATE,CALLYEAR

SO MY PROBLEM IS iwant to give the default values in this fields like in

start_gallons it should '1' by default n if enter any it should the '1' with enterd value, and again entered value should sum with sumed value,but when resatrt the system the default value should again '1'.

and in callyear it sholud have present by default

and in fill date it should have system date by default

Plz help me out

thank you all

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Rajesh,

To give default values in a dialog programming you should just define a module for the PBO found in the screen your working with. In the module just set to the dynpro fields START_GALLONS, FILL DATE, and CALLYEAR with the values you want. For example:



MODULE SET_INICIAL_VALUES OUTPUT.

   START_GALLONS = '1'.
   FILL_DATE = sy-datum.
   ...

ENDMODULE.

Hope it helps.

Regards,

Gilberto Li

4 REPLIES 4

Former Member
0 Kudos

Hi Rajesh,

To give default values in a dialog programming you should just define a module for the PBO found in the screen your working with. In the module just set to the dynpro fields START_GALLONS, FILL DATE, and CALLYEAR with the values you want. For example:



MODULE SET_INICIAL_VALUES OUTPUT.

   START_GALLONS = '1'.
   FILL_DATE = sy-datum.
   ...

ENDMODULE.

Hope it helps.

Regards,

Gilberto Li

Former Member
0 Kudos

Hi,

Use Process before output event.

Because program calls the PBO event before screen displays to the user.

write some module under pbo of the flowlogic for that screen.

MODULE initialize_1200 OUTPUT.

IF START_GALLONS IS INITIAL.

START_GALLONS = '1' .

ENDIF.

ENDMODULE. " initialize_1200 OUTPUT

If you used this in table control or steploop use that structure also before fieldname separated by hyphen.

Please reward points if helpful.

Thanks

Sivaparvathi

former_member1242340
Participant
0 Kudos

hai thank u for reply its a help ful answer but i need my date format in mm/dd/yy

but its giving by default as yyyymmdd so plz me

Former Member
0 Kudos

hi,

try this..

module initialize pbo.

data :

mm(2) type n,

dd(2) type n,

yy(4) type n,

date(11) type c,

delimiter type c value '/'.

start_gallons = '1'.

mm = sy-datum+4(2).

dd = sy-datum+6(2).

yy = sy-datum(4).

concatenate mm dd yy into date separated by delimiter.

fill_date = date.

callyear = year.

endmodule.

hope this helps.