2009 Jul 06 6:56 AM
hi,
i have written f4 help for mtart,lifnr as below......in development system i m getting f4 values for both mtart and lifnr whereas in quality for lifnr the system is hanging.............can anyone help me in this.
MODULE f4_mtart INPUT.
SELECT mtart
FROM ekpo
INTO TABLE it_mtart.
IF sy-subrc EQ 0.
SORT it_mtart BY mtart.
DELETE ADJACENT DUPLICATES FROM it_mtart COMPARING mtart.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MTART'
dynpprog = c_prog
dynpnr = sy-dynnr
dynprofield = 'WA_SHPHD-MTART'
value_org = 'S'
TABLES
value_tab = it_mtart
return_tab = it_return
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.
ENDIF.
ENDMODULE. " F4_MTART INPUT
MODULE f4_lifnr INPUT.
IF it_mtart[] IS NOT INITIAL.
SELECT ebeln
mtart
FROM ekpo
INTO TABLE it_ekpo
FOR ALL ENTRIES IN it_mtart
WHERE mtart = it_mtart-mtart.
IF sy-subrc EQ 0.
SELECT lifnr
FROM ekko
INTO TABLE it_lfa1
FOR ALL ENTRIES IN it_ekpo
WHERE ebeln = it_ekpo-ebeln.
IF sy-subrc EQ 0.
SORT it_lfa1 BY lifnr.
DELETE ADJACENT DUPLICATES FROM it_lfa1 COMPARING lifnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'LIFNR'
dynpprog = c_prog
dynpnr = sy-dynnr
dynprofield = 'WA_SHPHD-LIFNR'
value_org = 'S'
TABLES
value_tab = it_lfa1
return_tab = it_return
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.
ENDIF.
ENDIF.
ENDIF.
ENDMODULE. " F4_LIFNR INPUT
hi,
i have written f4 help for mtart,lifnr as below......in development system i m getting f4 values for both mtart and lifnr whereas in quality for lifnr the system is hanging.............can anyone help me in this.
MODULE f4_mtart INPUT.
SELECT mtart
FROM ekpo
INTO TABLE it_mtart.
IF sy-subrc EQ 0.
SORT it_mtart BY mtart.
DELETE ADJACENT DUPLICATES FROM it_mtart COMPARING mtart.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MTART'
dynpprog = c_prog
dynpnr = sy-dynnr
dynprofield = 'WA_SHPHD-MTART'
value_org = 'S'
TABLES
value_tab = it_mtart
return_tab = it_return
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.
ENDIF.
ENDMODULE. " F4_MTART INPUT
MODULE f4_lifnr INPUT.
IF it_mtart[] IS NOT INITIAL.
SELECT ebeln
mtart
FROM ekpo
INTO TABLE it_ekpo
FOR ALL ENTRIES IN it_mtart
WHERE mtart = it_mtart-mtart.
IF sy-subrc EQ 0.
SELECT lifnr
FROM ekko
INTO TABLE it_lfa1
FOR ALL ENTRIES IN it_ekpo
WHERE ebeln = it_ekpo-ebeln.
IF sy-subrc EQ 0.
SORT it_lfa1 BY lifnr.
DELETE ADJACENT DUPLICATES FROM it_lfa1 COMPARING lifnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'LIFNR'
dynpprog = c_prog
dynpnr = sy-dynnr
dynprofield = 'WA_SHPHD-LIFNR'
value_org = 'S'
TABLES
value_tab = it_lfa1
return_tab = it_return
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.
ENDIF.
ENDIF.
ENDIF.
ENDMODULE. " F4_LIFNR INPUT
2009 Jul 06 7:04 AM
I suppose there are many more data available in Quality system than in development.
Try to optimize your [SELECT|http://help.sap.com/abapdocu/en/ABAPSELECT.htm], use [DISTINCT|http://help.sap.com/abapdocu/en/ABAPSELECT_CLAUSE_LINES.htm#!ABAP_ALTERNATIVE_2@2@] and check existence of indexes. (use tools like [SE30|http://help.sap.com/saphelp_nw70/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/frameset.htm] or[ ST05|http://help.sap.com/saphelp_nw70/helpdata/en/d1/801f7c454211d189710000e8322d00/frameset.htm] to analyze SQL execution)
Regards,
Raymond
2009 Jul 06 7:04 AM
Hi,
It will be very simple if you give parameter names as below;
PARAMETERS p_mtart TYPE ekpo-mtart.
PARAMETERS p_lifnr TYPE ekko-lifnr.The above code will give you the default search help.
why are you using F4IF_INT_TABLE_VALUE_REQUEST FM ?
Regards
Karthik D
2009 Jul 06 7:13 AM
2009 Jul 06 7:35 AM
Hi,
If you declare the variable with the exact type you can have the standard F4 help by default in the module pool.
Regards
Karthik D
2009 Jul 28 12:16 PM
hi,
i have written select on view as below the issue is it is taking time to get records of 37 and among those records 8 are correct and others are duplicate.....how to reduce the time and how to get non duplicate records in it_ekko...even i used select distinct ,but i am getting onli 8 correct records but the time is not reduced.....please help me in solving this issue..........
SELECT ebeln
lifnr
mtart_i
FROM wb2_v_ekko_ekpo2
INTO TABLE it_ekko
WHERE mtart_i = v_fieldval."wa_shphd-mtart.
2009 Jul 28 12:27 PM
Hi,
After SELECT statement use DELETE ADJACENT DUPLICATES statement for ur internal table.
Regards,
lakshman.
2009 Jul 28 12:31 PM
after that i did as below........but the problem is with the select statement it is taking time.........how to reduce that time?
IF sy-subrc EQ 0.
SELECT ebeln
lifnr
mtart_i
FROM wb2_v_ekko_ekpo2
INTO TABLE it_ekko
WHERE mtart_i = v_fieldval."wa_shphd-mtart.
IF sy-subrc EQ 0.
SORT it_ekko BY ebeln lifnr mtart.
DELETE ADJACENT DUPLICATES FROM it_ekko COMPARING ebeln lifnr mtart.
ENDIF.
ENDIF.
Edited by: NEED HELP on Jul 28, 2009 5:01 PM
2009 Jul 06 7:33 AM
Hi,
Your problem can be solved this way. first select the values you want inside an internal table(you can limit tha values being selected here to prevent your system from hanging) and then pass that internal table to the FM for diplaying F4 help.
This FM is used to dsiplay values stored in an internal table as input help.This FM is used to program our own custom help if no such input help exists in ABAP dictionary for a particular field. The parameter VALUE_TAB is used to pass the internal table containing input values.The parameter RETFIELD is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB. If DYNPNR,DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = field from int table whose value will be returned
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'screen field'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = internal table whose values will be shown.
RETURN_TAB = internal table of type DDSHRETVAL
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.Regards,
Amit.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |