01-22-2007 10:32 AM
i am using below program but its going to dump would any body help me
REPORT zsab1.
TABLES:crhd,afru,zsabpce,zpces.
PARAMETER:p_arbpl type crhd-arbpl," MATCHCODE OBJECT zpces,
p_werks type crhd-werks." MATCHCODE OBJECT zpces.
DATA:begin of itab occurs 0,
arbpl LIKE crhd-arbpl,
werks LIKE crhd-werks,
end of itab.
.
DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
DATA: return like ddshretval occurs 0 WITH HEADER LINE.
data: dynmap TYPE TABLE OF DSELC WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl.
select arbpl werks from zpces into corresponding fields of table
itab .
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'CRHD'
retfield ='ARBPL'
PVALKEY = ' '
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'P_ARBPL'
STEPL = 0
WINDOW_TITLE = 'title'
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = 'F'
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = 'FNAME'
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = itab
FIELD_TAB = dynfields
RETURN_TAB = return
DYNPFLD_MAPPING = dynmap
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
read table return with key fieldname = 'P_ARBPL'.
dynfields-fieldname = return-retfield.
dynfields-fieldvalue = return-fieldval.
append dynfields.
.
read table itab with key arbpl = return-fieldval.
dynfields-fieldname = 'P_WERKS'.
dynfields-fieldvalue = itab-werks.
append dynfields.
Update the dynpro values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
FORM FNAME
TABLES RECORD_TAB STRUCTURE itab
CHANGING SHLP TYPE SHLP_DESCR
CALLCONTROL LIKE DDSHF4CTRL.
DATA: FIELDPROP LIKE LINE OF SHLP-FIELDPROP.
FIELDPROP-SHLPOUTPUT = 'X'. "Suppress in the hit list
FIELDPROP-SHLPOUTPUT = 'X'. "Suppress in the selection popup
MODIFY SHLP-FIELDPROP FROM FIELDPROP
TRANSPORTING SHLPoutput
WHERE FIELDNAME = 'ARBPL'.
ENDFORM.
01-22-2007 11:07 AM
Hello Chaitanya
If you are using an itab that is not directly typed to a DDIC structure then it becomes a bit more complicated to return multiple values from the search help. Here is a solution based on your report.
*&---------------------------------------------------------------------*
*& Report ZUS_SDN_F4_USERDEFINED *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZUS_SDN_F4_USERDEFINED.
TABLES:crhd,afru. "zsabpce,zpces.
PARAMETER:
p_arbpl TYPE crhd-arbpl," MATCHCODE OBJECT zpces,
p_werks TYPE crhd-werks." MATCHCODE OBJECT zpces.
DATA:BEGIN OF itab OCCURS 0,
arbpl LIKE crhd-arbpl,
werks LIKE crhd-werks,
END OF itab.
.
DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
DATA: return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA: dynmap TYPE TABLE OF dselc WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl.
* SELECT arbpl werks FROM zpces INTO CORRESPONDING FIELDS OF TABLE
* itab .
itab-arbpl = 'Y'. itab-werks = '2'. APPEND itab.
itab-arbpl = 'X'. itab-werks = '1'. APPEND itab.
itab-arbpl = 'X'. itab-werks = '2'. APPEND itab.
itab-arbpl = 'X'. itab-werks = '3'. APPEND itab.
itab-arbpl = 'Z'. itab-werks = '1'. APPEND itab.
* NOTE: simulating the result of your selection
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'ARBPL'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
callback_program = syst-repid " !!!!
callback_form = 'FNAME'
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = itab
* FIELD_TAB =
return_tab = return
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE return INDEX 1.
dynfields-fieldname = 'P_ARBPL'.
dynfields-fieldvalue = return-fieldval.
APPEND dynfields.
READ TABLE return INDEX 2.
dynfields-fieldname = 'P_WERKS'.
dynfields-fieldvalue = return-fieldval.
APPEND dynfields.
* Update the dynpro values.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dynfields
EXCEPTIONS
OTHERS = 8.
*&---------------------------------------------------------------------*
*& Form FNAME
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->RECORD_TAB text
* -->SHLP text
* -->CALLCONTROL text
*----------------------------------------------------------------------*
FORM fname
TABLES record_tab STRUCTURE itab
CHANGING shlp TYPE shlp_descr
callcontrol LIKE ddshf4ctrl.
DATA:
ls_iface LIKE LINE OF shlp-interface,
ls_prop LIKE LINE OF shlp-fieldprop.
BREAK-POINT.
* NOTE: The interface description of the search help has only
* field ARBPL which is named F0001. Therefore, add the
* second field using this naming convention (F0002).
READ TABLE shlp-interface INTO ls_iface INDEX 1.
ls_iface-shlpfield = 'F0002'.
APPEND ls_iface TO shlp-interface.
* NOTE: Obsolete
* LOOP AT shlp-fieldprop INTO ls_prop.
** WHERE ( fieldname = 'ARBPL' OR
** fieldname = 'WERKS' ).
** NOTE: field names are F0001 and F0002
* ls_prop-shlpoutput = 'X'.
* MODIFY shlp-fieldprop FROM ls_prop INDEX syst-tabix.
* ENDLOOP.
ENDFORM. "FNAME
Regards
Uwe
01-22-2007 11:50 AM
Hello Uwe,
Thank you for your replay,I tried with your code which you sent me its working .
thank you.
Regards,
Chaitanay
01-22-2007 12:46 PM
Hello Chaitanay
That's great. Please do not forget to close your other thread in this forum dealing with the same topic.
Regards
Uwe