Application Development and Automation 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: 
Read only

How to refresh (initialize) a Dynpro

Former Member
0 Likes
4,036

Hello experts,

i´am very new in developing SAP Dynpros, before i develeoped BSP, WebDynpro.

But now i have to develope a "normal" SAP application.

I´ve a Dynpro 0100 with 4 fields on it. These 4 fields have their types from dictinonary because of the automatic search help. My problem is: If i leave the window by an exit (leave programm) and jump in the application again, the values in the fields are still there. How can i refresh the values?

Thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,462

Hi,

Write the code in the PBO to Clear the screenname-fields.

Sample code:

MODULE pbo100_status OUTPUT.

  • When transaction is refreshed set the default values

loop at screen.

if screen-name = 'FIELD1'.

IF myscreen-field1 IS NOT INITIAL.

CLEAR myscreen-field1.

ENDIF.

ENDIF.

endloop.

regards,

rama.

7 REPLIES 7
Read only

Former Member
0 Likes
2,463

Hi,

Write the code in the PBO to Clear the screenname-fields.

Sample code:

MODULE pbo100_status OUTPUT.

  • When transaction is refreshed set the default values

loop at screen.

if screen-name = 'FIELD1'.

IF myscreen-field1 IS NOT INITIAL.

CLEAR myscreen-field1.

ENDIF.

ENDIF.

endloop.

regards,

rama.

Read only

prasanth_kasturi
Active Contributor
0 Likes
2,462

Hi,

You can do in two ways.

In the PBO of the screen

you can clear all the fields using CLEAR statemmnt

( OR )

In the PAI of the screen

Under case sy-ucomm

when 'BACK'.

clear all the fields

leave program.

endcase.

regards

prasanth

Read only

0 Likes
2,462

OK that works so far.

Thank you.

You both got points... hope this is ok

Read only

Former Member
0 Likes
2,462

I am sorry i was too fast.

I clear the window by exiting and on loading.

In debugger the value is empty after clearing both times.

In PBO the value of the field is emtpy the whole time i call the application (F5 steps), but when the screen appears the ole value is in the field. How can that be?

Read only

0 Likes
2,462

Hi,

Check which field you are clearing,

Is it the screen fields or the work area in your programs

reagards

prasanth

Read only

0 Likes
2,462

hey,

Just check ifyou are clearing the same fields as that are there on the screen if yes then check if you have written any select query or if you are populating those fields again some where later, to solve your problem it would be best for you to write the clear statement in the last PBO module just before the screen is called.

Hope this helps,

Regards,

RK

Read only

Former Member
0 Likes
2,462

Read following blogs you will get clear idea about flow of program

/people/horst.keller/blog/2004/10/27/abap-geek-4-150-the-mystery-of-submit-unveiled