How change screen field value after back from start-of-selec

Question:
In initial screen ,there are screen field DM and parameter BH.After excute the start-of-selection statement, when user push the back button, i wish refresh the selection screen, and initializate the DM and BH value.
I write code in Initialization and At selection-screen output, in debug, the DM and BH are already Changed to Zero, but in screen field ,it shows the last value?
What can i do ? I'm crazy now!
_________________
I Like SAP
Answer:
So you are saying that you have a report that runs and when it is finished it comes back to the selection-screen, or the user clicks the back arrow to return to the selection-screen and the values are not reset on the selection screen. Is that right?
I don't think you can reset the values like you want without restarting the transaction.
One way you could do it is to write a bdc against the transaction doing a /n to start a new transaction.
For example:
  PERFORM DYNPRO USING:
    'X'   'YYYYYYYY'            '1000',
    ' '   'BDC_OKCODE'       '/NXXXX'.
  CALL TRANSACTION 'XXXX' USING ITAB_BDC
                            MODE 'N'
                            MESSAGES INTO ITAB_MESSAGES1.
where DYNPRO is a routine to fill an internal table with your BDC and XXXX is your transaction and YYYYYYYY your program.
This will start the transaction over again and so you will have a clear screen with default values, and the initialization event will fire again.
_________________
MajorCats
Answer:
parameters: p_name(20) type c.
at selection-screen output.
  clear: p_name.
start-of-selection.
  move: 'Sudhir/Mohit' to p_name.
end-of-selection.
  write:/ p_name.
works perfect here.
Regards
Sudhir/Mohit
Answer:
Thank you both.
TwoABAPers, your way is perfect,but if user press enter in selection-screen, the field value will be cleared.
MajorCats, i used to try using BDC fill zero value to screen field,but it is not work well. I think your maybe right,let me try it.
_________________
I Like SAP
Answer:
   PERFORM DYNPRO USING 'X' 'ZBH'         '1000',
                        ' ' 'BDC_OKCODE'  '/NZBH'.
There is a error report "Comma without preceding colon (after PERFORM ?)".
Where is "DYNPRO"?Do i need include a program ?
_________________
I Like SAP
Answer:
You are issuing a chained statement.
Add a colon like it is telling you to (after USING).
PERFORM DYNPRO USING: 'X' 'ZBH'         '1000',
                      ' ' 'BDC_OKCODE'  '/NZBH'.
Or you can longhand the thing if it makes it easier:
PERFORM DYNPRO USING 'X' 'ZBH'         '1000'.
PERFORM DYNPRO USING ' ' 'BDC_OKCODE' '/NZBH'.
As to where the code for the form lives.. where did you get this code from?
If you need to create it yourself, it will need to look something like this:
FORM DYNPRO USING DYNBEGIN NAME VALUE.
  IF  DYNBEGIN = 'X'.
    CLEAR BDCDATA.
    MOVE: 'X'   TO BDCDATA-DYNBEGIN,
          NAME  TO BDCDATA-PROGRAM,
          VALUE TO BDCDATA-DYNPRO.
    APPEND BDCDATA.
  ELSE.
    CLEAR BDCDATA.
    MOVE: NAME  TO BDCDATA-FNAM,
          VALUE TO BDCDATA-FVAL.
    APPEND BDCDATA.
  ENDIF.
ENDFORM.
Answer:
Thanks,aussie fatboy.I think I know how to use BDC programing now.
You are really a good guy.
_________________
I Like SAP
Answer:
Submit your program back to itself using the 'WITH' clause to set the parameters but without using the 'AND RETURN' clause:
     Submit ZS_HR_PAYROLL_INF
            with P_2010 = True
            with TextFile = pu_file
            with p_batch  = True.
Regards
R
_________________
Regards
R
Abap KC

SFMDR

More Articles:

Trouble with 'SUBMIT AND RETURN'?
sy-subrc?
Dialog Program?
field symbols?
IDoC and ABAP?
BAPI_EMPLOYEE_DEQUEUE?