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

Refresh program cache

Former Member
0 Likes
1,929

Hi,

i need to refresh program cache.

My problem is:

- run the program

- call a FM

- change data

- call the FM (again) to refresh data.

The fm gets the old data.

How can I solve?

9 REPLIES 9
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,606

hi Salvatore,

which FM do you call? I would check in the function group of that FM, if there is any other FM in that group which clears all buffered data.

hope this helps

ec

Read only

Former Member
0 Likes
1,606

loop the internal table pass the values to the parameters is one option

Read only

Former Member
0 Likes
1,606

Is it a Custom Function, if so Did you clear the Global data in the Function module..if not use CLEAR and REFRESH the global data.

Read only

0 Likes
1,606

I'm using FM CS_BOM_EXPL_MAT_V2 (get BOM data).

take a look to source code:

FORM bom_carica_modello USING par_matnr

par_stlal

par_stlan

par_werks

CHANGING par_tab LIKE it_tab[]

par_wa LIKE wa_tab.

DATA: it_bom_item OCCURS 0 WITH HEADER LINE.

REFRESH it_bom_item.

DATA: BEGIN OF it_diba OCCURS 0.

INCLUDE STRUCTURE stpox.

DATA: END OF it_diba.

REFRESH it_diba.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'*

EXPORTING

datuv = p_datuv

    • capid = 'PP01'*

mehrs = ' '

mtnrv = par_matnr

stlal = par_stlal

stlan = par_stlan

werks = par_werks

TABLES

stb = it_diba

    • MATCAT =*

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

conversion_error = 8

OTHERS = 9

.

IF sy-subrc <> 0.

MESSAGE ID 'ZM' TYPE 'S' NUMBER 099

WITH 'Alternativa richiesta come modello non valida'.

ENDIF.

ENDFORM. " carica_modello

Edited by: Salvatore Volpe on Aug 25, 2008 10:47 AM

Read only

0 Likes
1,606

I'm changing the BOM via batch input.

Read only

0 Likes
1,606

The code you posted is fine. and how are you telling that you are getting the olddata.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'*

EXPORTING

datuv = p_datuv

  • capid = 'PP01'

mehrs = ' '

mtnrv = par_matnr

stlal = par_stlal

stlan = par_stlan

werks = par_werks

TABLES

stb = it_diba

after the population you are not passing the it_diba to any where .

what is the use of this

CHANGING par_tab LIKE it_tab[]

par_wa LIKE wa_tab.

why are you using par_tab , i mean what purose you are using the parameter.

Read only

0 Likes
1,606

I would check if the importing parameter MMORY of the FM has any effect (values could be 1 and 0)

Read only

0 Likes
1,606

I changed that parameters... but any effects...

Read only

0 Likes
1,606

This is the full source code...

FORM bom_carica_modello USING par_matnr

par_stlal

par_stlan

par_werks

CHANGING par_tab LIKE it_tab[]

par_wa LIKE wa_tab.

DATA: it_bom_item OCCURS 0 WITH HEADER LINE.

REFRESH it_bom_item.

DATA: BEGIN OF it_diba OCCURS 0.

INCLUDE STRUCTURE stpox.

DATA: END OF it_diba.

REFRESH it_diba.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

datuv = p_datuv

  • capid = 'PP01'

mehrs = ' '

mtnrv = par_matnr

stlal = par_stlal

stlan = par_stlan

werks = par_werks

TABLES

stb = it_diba

  • MATCAT =

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

conversion_error = 8

OTHERS = 9

.

IF sy-subrc <> 0.

MESSAGE ID 'ZM' TYPE 'S' NUMBER 099

WITH 'Alternativa richiesta come modello non valida'.

ENDIF.

REFRESH par_tab.

CLEAR par_wa.

LOOP AT it_diba.

IF it_diba-datub GE p_datub.

  • Cancella le posizioni scadute

CLEAR: par_wa.

MOVE-CORRESPONDING it_diba TO par_wa.

MOVE it_diba-meins TO par_wa-meins.

  • Conversione UM

CALL FUNCTION 'CONVERSION_EXIT_RUNIT_OUTPUT'

EXPORTING

input = it_diba-meins

  • LANGUAGE = SY-LANGU

IMPORTING

output = par_wa-meins.

.

APPEND par_wa TO par_tab.

ENDIF.

ENDLOOP.

ENDFORM. " carica_modello

I have also added a wait command, a commit work... but the problem still the same...