12-13-2007 2:47 PM
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
12-13-2007 3:01 PM
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
12-13-2007 3:01 PM
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
12-13-2007 3:08 PM
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
12-14-2007 10:13 AM
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
12-14-2007 12:09 PM
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.