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

Time out when running program in Foreground

Former Member
0 Likes
879

Hi Friends ,

I am doing BOM explosion on 4911 materials with one material at a time .After the BOM explosion I need to make sure that I get the correct component by getting the MRP controllers for those components and comparing them with the one on selection screen .

This is the code below. Please advise and your thoughts on this .

Thanks !

Teresa.

LOOP AT t_mattmp.

SELECT matnr

stlan

stlal

INTO (mkal-matnr,

mkal-stlan,

mkal-stlal)

FROM mkal

WHERE werks = p_pwwrk AND

verid IN s_veri1 AND

matnr = t_mattmp-nrmit.

ENDSELECT.

IF syst-subrc = 0 .

REFRESH: xstpox,

xmatcat.

CLEAR: xstpox,

xmatcat.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

ftrel = ftrel

altvo = pm_altvo

aufsw = ' '

auskz = pm_ausch

bagrp = pm_bagrp

beikz = pm_beikz

bessl = pm_bessl

bgixo = ' '

brems = ' '

capid = 'PP01'

datuv = syst-datum

emeng = qty

erskz = pm_erskz

erssl = pm_erssl

mbwls = ' '

mtnrv = t_mattmp-nrmit

mktls = 'X'

mehrs = ' '

mmory = ' '

postp = pm_postp

sanko = pm_sanko

sanfr = pm_sanfe

sanka = pm_sanka

sanin = pm_sanin

sanvs = pm_sanvs

svwvo = 'X'

rndkz = ' '

rvrel = pm_rvrel

schgt = pm_schgt

stkkz = pm_stkkz

stlal = mkal-stlal

stlan = mkal-stlan

werks = p_pwwrk

vrsvo = 'X'

IMPORTING

topmat = xcstmat

dstst = xfeld

TABLES

stb = xstpox

matcat = xmatcat

EXCEPTIONS

alt_not_found = 1

call_invalid = 2

material_not_found = 3

missing_authorization = 4

no_bom_found = 5

no_plant_data = 6

no_suitable_bom_found = 7

OTHERS = 8.

LOOP AT xstpox.

CLEAR marc-dispo.

SELECT SINGLE dispo

INTO marc-dispo

FROM marc

WHERE werks = p_pwwrk

AND matnr = xstpox-idnrk

AND dispo IN s_disp.

IF syst-subrc = 0 .

MOVE xstpox-idnrk TO t_matc-matc.

MOVE t_mattmp-nrmit TO t_matc-nrmit.

APPEND t_matc.

EXIT.

ENDIF.

ENDLOOP.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
837

Teresa,

Can you please run a trace on your program using ST05 to find out which segment in your code is taking more time. Is it the select/call function/loop....endloop?

The you can try to optimize that section.

Thanks,

Read only

former_member156446
Active Contributor
0 Likes
837
select matnr werks dispo
       into table itab
for all entries in xstpox
 where  matnr in xstpox-idnrk
 and werks = p_pwwrk
AND dispo IN s_disp.


loop at ur table ...
read table  itab with key ...
IF syst-subrc = 0 .
MOVE xstpox-idnrk TO t_matc-matc.
MOVE t_mattmp-nrmit TO t_matc-nrmit.
APPEND t_matc. 
EXIT.
ENDIF.
ENDLOOP.
Read only

former_member189420
Active Participant
0 Likes
837

Hi,

In my opinion you can break the code in two programs. One which contains the FM where BOM is exploded in background. After the BOM explosion, call the second program and pass the exploded materials to it and check for the materials with the selection screen parameters.

Just a thought. Let me know once u try it out.

All the best,

Anand Patil

Read only

Former Member
0 Likes
837

I don't see much that you can do other than run it in the background.

Rob

Read only

former_member214498
Contributor
0 Likes
837

Hi

I experianced similar problem with one of the transaction in HR Payroll. There is a setting in Basis through which the interval for time out can be increased.

Basis guys should be asked to increase the time out interval for foreground tasks.

Regards

Waz