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

CRS_MATERIAL_READ_ALL

Former Member
0 Likes
871

Hi,

I have a problem with this function, I have an internal table with many materials, I make a loop calling this function with each material inside the loop.

The problem is that inside this function there are many global variables that in the second loop adquires the value 'X', so that the function doesn't return anything about the material.

Why these variable adquires the value X?

Thanks so mucho for your help.

Hi,

I have a problem with this function, I have an internal table with many materials, I make a loop calling this function with each material inside the loop.

The problem is that inside this function there are many global variables that in the second loop adquires the value 'X', so that the function doesn't return anything about the material.

Why these variable adquires the value X?

Thanks so mucho for your help.

2 REPLIES 2
Read only

Former Member
0 Likes
693

Try calling FM  BUFFER_REFRESH_ALL after the FM  CRS_MATERIAL_READ_ALL  

is called, so that global data is refreshed and you get desired results...

Read only

0 Likes
693

it doesn't work.

  

CALL FUNCTION 'CRS_MATERIAL_READ_ALL'
   EXPORTING
     iv_matnr           = pmatnr
   TABLES
     et_mvke            = lt_mvke
     et_mbew            = lt_mbew
     et_marc            = lt_marc
     et_mard            = lt_mard
     et_makt            = lt_makt
     et_marm            = lt_marm
     et_mean            = lt_mean
     et_mlan            = lt_mlan
     et_icdtxt_material = lt_cdtxt.

CALL FUNCTION 'BUFFER_REFRESH_ALL'.

I also use this function to know if the material exists, and when this is true the function above doesn't return anything. Because of the global variable inside the function CRS_MATERIAL_READ_ALL than change its value to 'X'

   CALL FUNCTION 'BAPI_MATERIAL_EXISTENCECHECK'
  EXPORTING
    material = pmatnr
  IMPORTING
    deletion_flag = bapimatall-del_flag
    return = bapireturn1.