Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

system hanging

Former Member
0 Likes
996

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

8 REPLIES 8
Read only

RaymondGiuseppi
Active Contributor
0 Likes
964

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

Read only

Former Member
0 Likes
964

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

Read only

0 Likes
964

this is module pool program so i used that function module

Read only

0 Likes
964

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

Read only

0 Likes
964

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.

Read only

0 Likes
964

Hi,

After SELECT statement use DELETE ADJACENT DUPLICATES statement for ur internal table.

Regards,

lakshman.

Read only

0 Likes
964

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

Read only

Former Member
0 Likes
964

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.