on 08-15-2012 6:58 PM
Hello..I am having issues in using the BADI "SDP_SELECTOR" for filtering data based on "Planner_PPS" field on MATLOC table. I did implement two methods, "INIT_OBJECT_LIST" and "F4" to make "Planner PPS" to show-up as selection criteria on shuffler and also to get F4 help for thsi field value, now the problem is that I am not able to filter the data based on selected "Planner_PPS" value from F4 help list. please advise me on this.
I already tried implementing the method "LOC_PROD_VALUE_LIST" to filter the data based on production supervisor that I added to shuffler, but the issue is that I am not able to see the "Production Supervisor" in import parameter "CT_VALUE_LIST" of method LOC_PROD_VALUE_LIST",
I am able to see the one table entry in ct_value _list but it does not have production supervisor on it, so I can not validate this record for output.
Do you think any config is necessary for production supervisor (PLANNER_PPS) attribute to show up in CT_VALUE _LIST, kindly advise.
Please advise if you have any info, requirement is to add additional filter criteria to shufller (sdp94), I added the new attribute (PLANNER_PPS) to drop-up down selection and also added F4 help for this field, I am stuck at filtering the data when the user chooses new field I added, not able to see the new filed "PLANNER_PPS" in BADI parameters to validate, please advise
Thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here are the std examples on how to implement the BAdI methods.
method /SAPAPO/IF_EX_SDP_SELECTOR~INIT_OBJECT_LIST.
data:
ls_dd40v TYPE dd40v,
dd40v_wa TYPE dd04v,
lv_alv_rowtype TYPE tabname,
ls_fieldcatalog TYPE LVC_S_FCAT,
lt_fieldcatalog TYPE LVC_T_FCAT,
ls_sel_criteria TYPE /sapapo/sh_obj_sel_str.
field-symbols:
<LS_SEL_OBJECTS> Type /SAPAPO/SH_OBJ_STR,
<ls_fieldcatalog> TYPE LVC_S_FCAT,
<LS_SEL_CRITERIA> TYPE /SAPAPO/SH_OBJ_SEL_STR.
INCLUDE: /SAPAPO/TS_CONSTANTS.
* SAMPLE 1 Add additional selection field in Shuffler
* only for snp
check not iv_snp_flag is initial.
Read Table CT_SEL_OBJECTS with key object = gs_c_iobjnm-lok_prod
assigning <LS_SEL_OBJECTS>.
if sy-subrc = 0.
CALL FUNCTION 'DDIF_DTEL_GET'
EXPORTING
name = '/SAPAPO/BESKZ'
STATE = 'A'
LANGU = sy-langu
IMPORTING
DD04V_WA = dd40v_wa
EXCEPTIONS
ILLEGAL_INPUT = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Add as selection criterion
LS_SEL_CRITERIA-OBJECT = 'BESKZ'.
LS_SEL_CRITERIA-TXTSH = dd40v_wa-ddtext.
LS_SEL_CRITERIA-TXTMD = dd40v_wa-scrtext_m.
LS_SEL_CRITERIA-TXTLG = dd40v_wa-scrtext_l.
LS_SEL_CRITERIA-MULTIPLE_SEL = 'X'.
append LS_SEL_CRITERIA to <LS_SEL_OBJECTS>-SEL_CRITERIA.
sort <LS_SEL_OBJECTS>-SEL_CRITERIA by TXTSH.
* * Add as output field
CALL FUNCTION 'DDIF_TTYP_GET'
EXPORTING
name = <LS_SEL_OBJECTS>-alv_tab_type
IMPORTING
dd40v_wa = ls_dd40v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
exit.
ENDIF.
lv_alv_rowtype = ls_dd40v-rowtype.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = lv_alv_rowtype
CHANGING
ct_fieldcat = <LS_SEL_OBJECTS>-ALV_FIELD_CAT
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
exit.
ELSE.
clear <ls_sel_objects>-alv_tab_type.
ENDIF.
* Append Column for Beskz
describe table <LS_SEL_OBJECTS>-ALV_FIELD_CAT.
ls_fieldcatalog-COL_POS = sy-tfill + 1.
ls_fieldcatalog-FIELDNAME = 'BESKZ'.
* ls_fieldcatalog-TOOLTIP = dd40v_wa-ddtext.
ls_fieldcatalog-INTTYPE = 'C'.
ls_fieldcatalog-INTLEN = 1.
ls_fieldcatalog-COLTEXT = dd40v_wa-ddtext.
ls_fieldcatalog-SELTEXT = dd40v_wa-ddtext.
append ls_fieldcatalog to <LS_SEL_OBJECTS>-ALV_FIELD_CAT.
endif.
* SAMPLE 2 ( set default values for the Shufflers Characteristics)
Loop at ct_sel_objects assigning <ls_sel_objects>.
loop at <ls_sel_objects>-SEL_criteria into ls_sel_criteria .
if ls_sel_criteria-object = gs_c_iobjnm-produkt.
ls_sel_criteria-default_value = 'AAAA'.
modify <ls_sel_objects>-SEL_criteria from ls_sel_criteria.
endif.
endloop.
endloop.
endmethod.
2. Implement conditions to filter the location products
method /SAPAPO/IF_EX_SDP_SELECTOR~LOC_PROD_VALUE_LIST.
data:
LT_MATLOC TYPE TABLE OF /SAPAPO/MATLOC,
LS_VALUE_LIST_REF TYPE REF TO DATA,
BEGIN OF ls_beskz,
SIGN(1),
OPTION(2),
LOW type /SAPAPO/BESKZ,
HIGH type /SAPAPO/BESKZ,
END OF ls_beskz,
lt_beskz like table of ls_beskz.
field-symbols:
<LS_VALUE_LIST> TYPE ANY,
<LS_MATLOC> TYPE /SAPAPO/MATloc,
<LV_MATLOCID> TYPE ANY,
<LV_BESKZ> TYPE ANY,
<ls_selection> TYPE /SAPAPO/SH_SEL_RANGE_STR.
* check for selection conditions
loop at it_selection assigning <ls_selection> where IOBJNM = 'BESKZ'.
move-corresponding <ls_selection> to ls_beskz.
append ls_beskz to lt_beskz.
endloop.
CREATE DATA LS_VALUE_LIST_REF LIKE LINE OF CT_VALUE_LIST.
ASSIGN LS_VALUE_LIST_REF->* TO <LS_VALUE_LIST>.
* IT_MATLOC
LT_MATLOC = IT_MATLOC.
describe table lt_beskz.
if sy-tfill > 0.
delete LT_MATLOC where not beskz in lt_beskz.
endif.
SORT LT_MATLOC BY MATLOCID.
loop at CT_VALUE_LIST assigning <LS_VALUE_LIST>.
assign component 'MATLOCID' of structure <LS_VALUE_LIST>
to <LV_MATLOCID>.
assign component 'BESKZ' of structure <LS_VALUE_LIST> to <LV_BESKZ>.
check <LV_MATLOCID> is assigned and <LV_BESKZ> is assigned.
read table LT_MATLOC
with key MATLOCID = <LV_MATLOCID>
binary search assigning <LS_MATLOC>.
if sy-subrc = 0.
<LV_BESKZ> = <ls_matloc>-beskz.
else.
* to do
delete CT_VALUE_LIST.
endif.
endloop.
endmethod.
I hope it will be useful to you.
Thanks,
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh...I did implement method "LOC_PROD_VALUE_LIST" with following logic, so far tests are okay, thank you very much for your guidance.
reading it_selection table parameter using IOBJNM as "PLANNER_PPS", to get the low field value.
loop ct_value_list.
read /sapapo/matloc tabe with matlocid (ct_value_list+0(22) and planner_pps (it_selection-low where iobjnm eq 'planner_pps).
if return code is zero
else.
delete ct_value_list using index key.
endif.
endloop.
User | Count |
---|---|
7 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.