Populate values in f4 dialog screen based on the values in selction screen

10-11  Source: Network gathering  Views:1 

Advertisement
hi,
i have done a module program where i would enter the details like ssales org ,division,distribution channel in the selection screen and would enter the screen having the table control... in that table control i have a field for customer code.. when i press f4 for cus code.,dialog box appears for the cus code and in that , sales group tab should be selected and the divsion ,dist channel and sales organisation i gave in the slection screen should be displayed as default...how can i do this ..
since there is no screen no as such i am finding it difficult to crack.
with thanks in advance ,
syed
if you do not give a specific number to selection-screen, its dynpro number is 1000.
So in POV (AT SELECTION-SCREEN ON VALUE-REQUEST) use the classical DYNP_VALUES_READ with dynumb  = '1000' to get current values from screen, then you can
- Fill yourself an internal table and call F4IF_INT_TABLE_VALUE_REQUEST
- Call F4IF_FIELD_VALUE_REQUEST using CALLBACK_PROGRAM and CALLBACK_FORM to call a form in your report that will be executed by the search-help and there (look at online documentation) will change the default values of subfiled (itab) SELOPT of  SHLP parameter (type SHLP_DESCR_T)
Sample of the second case (there are already too many samples for the first on sdn)
.* POV
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_umskz.
  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
       EXPORTING
            tabname          = 'BSID'
            fieldname        = 'UMSKZ'
            callback_program = g_repid " copy of sy-repid
            callback_form    = 'CGS_DEBITOR'
       TABLES
            return_tab       = return_tab
       EXCEPTIONS
            OTHERS           = 1.
* Form for callback
FORM cgs_debitor TABLES   record_tab STRUCTURE seahlpres
                 CHANGING shlp TYPE shlp_descr_t
                          callcontrol LIKE ddshf4ctrl.
* Local data
  DATA: ddshiface TYPE ddshiface,
        worklist LIKE lumskz,
        dynpfields TYPE TABLE OF dynpread WITH HEADER LINE.
* Only D-ebitor
  LOOP AT shlp-interface INTO ddshiface WHERE shlpfield = 'KOART'.
    ddshiface-valtabname = 'BSID'.
    ddshiface-valfield   = 'KOART'.
    ddshiface-value      = 'D'.
    MODIFY shlp-interface FROM ddshiface.
  ENDLOOP.
ENDFORM.
.Regards,
Raymond
Related articles