2011 Oct 22 6:53 PM
hi experts,
my project is HR based.
i developed an initial screen with 3 fields(i.e.company code,personnel area and personnel subarea)
i have explained my requirement with an example:
if i give company code as 1000,the input help for personnel area should only be related to 1000 company code and so for subarea.
sap provides combined search help.i need the filterd input help for each i/o field.
pls tel me how to do it.
thanks,
charu
2011 Oct 22 8:07 PM
Hi
To do that, you need to create a Z copy of the standard search hellp H_T500P and just mark the Import Parameter in the field BUKRS (Company Code) so you can now use the Search Help to filter the values entered in the C.Code field.
http://img829.imageshack.us/img829/9427/samplejb.jpg
Then your code would be something similar to this:
REPORT ztest .
TYPE-POOLS: shlp.
DATA: l_shlp TYPE shlp_descr_t,
l_wa TYPE ddshiface,
l_bukrs TYPE char50,
l_repid TYPE syrepid,
L_DYNNR TYPE SYDYNNR,
l_ret_val LIKE ddshretval OCCURS 0 WITH HEADER LINE,
l_t_fields TYPE dynpread OCCURS 0 WITH HEADER LINE.
PARAMETERS: p_bukrs TYPE pa0001-bukrs,
p_werks TYPE pa0001-werks,
p_btrtl TYPE pa0001-btrtl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
FIELD-SYMBOLS <fs> TYPE ddshiface.
l_repid = sy-repid.
L_DYNNR = SY-DYNNR.
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname = 'ZH_T500P'
* SHLPTYPE = 'SH'
IMPORTING
shlp = l_shlp
.
CALL FUNCTION 'DYNPRO_STRING_READ'
EXPORTING
i_fieldname = 'P_BUKRS'
i_repid = l_repid
IMPORTING
e_string = l_bukrs.
LOOP AT l_shlp-interface INTO l_wa.
IF l_wa-shlpfield EQ 'BUKRS'.
l_wa-value = l_bukrs.
l_wa-valtabname = 'PA0001'.
l_wa-valfield = 'BUKRS'.
ELSEIF l_wa-shlpfield EQ 'PERSA'.
l_wa-valtabname = 'PA0001'.
l_wa-valfield = 'WERKS'.
ENDIF.
MODIFY l_shlp-interface FROM l_wa.
ENDLOOP.
* Process standard searchhelp
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = l_shlp
TABLES
return_values = l_ret_val.
LOOP AT l_ret_val.
IF l_ret_val-fieldname EQ 'BUKRS'.
l_t_fields-fieldname = 'P_BUKRS'.
l_t_fields-fieldvalue = l_ret_val-fieldval.
APPEND l_t_fields.
ELSEIF l_ret_val-fieldname EQ 'PERSA'.
l_t_fields-fieldname = 'P_WERKS'.
l_t_fields-fieldvalue = l_ret_val-fieldval.
APPEND l_t_fields.
ENDIF.
ENDLOOP.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = l_repid
dynumb = l_dynnr
TABLES
dynpfields = l_t_fields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
hi experts,
my project is HR based.
i developed an initial screen with 3 fields(i.e.company code,personnel area and personnel subarea)
i have explained my requirement with an example:
if i give company code as 1000,the input help for personnel area should only be related to 1000 company code and so for subarea.
sap provides combined search help.i need the filterd input help for each i/o field.
pls tel me how to do it.
thanks,
charu
2011 Oct 22 8:07 PM
Hi
To do that, you need to create a Z copy of the standard search hellp H_T500P and just mark the Import Parameter in the field BUKRS (Company Code) so you can now use the Search Help to filter the values entered in the C.Code field.
http://img829.imageshack.us/img829/9427/samplejb.jpg
Then your code would be something similar to this:
REPORT ztest .
TYPE-POOLS: shlp.
DATA: l_shlp TYPE shlp_descr_t,
l_wa TYPE ddshiface,
l_bukrs TYPE char50,
l_repid TYPE syrepid,
L_DYNNR TYPE SYDYNNR,
l_ret_val LIKE ddshretval OCCURS 0 WITH HEADER LINE,
l_t_fields TYPE dynpread OCCURS 0 WITH HEADER LINE.
PARAMETERS: p_bukrs TYPE pa0001-bukrs,
p_werks TYPE pa0001-werks,
p_btrtl TYPE pa0001-btrtl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
FIELD-SYMBOLS <fs> TYPE ddshiface.
l_repid = sy-repid.
L_DYNNR = SY-DYNNR.
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname = 'ZH_T500P'
* SHLPTYPE = 'SH'
IMPORTING
shlp = l_shlp
.
CALL FUNCTION 'DYNPRO_STRING_READ'
EXPORTING
i_fieldname = 'P_BUKRS'
i_repid = l_repid
IMPORTING
e_string = l_bukrs.
LOOP AT l_shlp-interface INTO l_wa.
IF l_wa-shlpfield EQ 'BUKRS'.
l_wa-value = l_bukrs.
l_wa-valtabname = 'PA0001'.
l_wa-valfield = 'BUKRS'.
ELSEIF l_wa-shlpfield EQ 'PERSA'.
l_wa-valtabname = 'PA0001'.
l_wa-valfield = 'WERKS'.
ENDIF.
MODIFY l_shlp-interface FROM l_wa.
ENDLOOP.
* Process standard searchhelp
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = l_shlp
TABLES
return_values = l_ret_val.
LOOP AT l_ret_val.
IF l_ret_val-fieldname EQ 'BUKRS'.
l_t_fields-fieldname = 'P_BUKRS'.
l_t_fields-fieldvalue = l_ret_val-fieldval.
APPEND l_t_fields.
ELSEIF l_ret_val-fieldname EQ 'PERSA'.
l_t_fields-fieldname = 'P_WERKS'.
l_t_fields-fieldvalue = l_ret_val-fieldval.
APPEND l_t_fields.
ENDIF.
ENDLOOP.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = l_repid
dynumb = l_dynnr
TABLES
dynpfields = l_t_fields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
2011 Oct 28 8:17 AM
hi jose,
ur solution works....thanks a lot.
can u tell me how to do same for personnel subarea.
example:
after entering company code, respective personnel area input help is displayed.after this step,on choosing P Area, respective subarea is displayed. hw to do this.
thanks.
2011 Oct 28 10:11 AM
Hi charudevrani
Actually it should be working by now, if you define the parameters as follows:
PARAMETERS: p_bukrs TYPE pa0001-bukrs,
p_werks TYPE pa0001-werks,
p_btrtl TYPE pa0001-btrtl.
Personal subarea values will be filtered automatically after you have entered Company Code and Pers. Area. there's no need to do anything in this case since it is using the standard search help H_T001P defined in table PA0001 to filter the values.
PS: If your question is solved pleas mark it as solved problem.
Best Regards
2011 Oct 28 11:21 AM
HI,
INPUT HELP FOR PERSONNEL AREA IS BEEN DISPLAYED.BUT WHEN I SELECT A VALUE FROM THE LIST , THE SELECTED VALUE DOESNT GET DISPLAYED ON I/O FIELD.FIELD GOES BLANK.WHAT SHOULD I DO.
THANKS.
2011 Oct 28 11:29 AM
Are you testing with the exact code sample? I'm testing it and i don't have that issue you're talking about.
If you have done something different paste the code over here, so we can help you.
2011 Nov 01 3:15 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |