‎2008 Jun 26 6:27 PM
Hi Experts,
I'm facing a little problem of improvement. Currently I'm using the BAPI_MATERIAL_GET_ALL on my program code.
What I actually need, is to dynamically say to the program to give me,
for example
CALL FUNCTION 'BAPI_MATERIAL_GET_ALL'
EXPORTING
material = material
plant = plant
IMPORTING
plantdata = plantdetail
TABLES
return = return.
if the plantFLAG is set, elseif storagelocationdataFLAG set
CALL FUNCTION 'BAPI_MATERIAL_GET_ALL'
EXPORTING
material = material
plant = plant
stge_loc = stgeloc
IMPORTING
storagelocationdata = storagedetails
TABLES
return = return.
How can I say it with a minimum of code and a maximum of performance.
I don't want repeat the BAPI Function Call all the time, at least if it's in an other function that I can call.
Ps. Goal: Performance throughput and no redandance.
Best Regards.
‎2008 Jun 26 6:43 PM
why can't you just make one FM call and get back both the Importing Parameters.
Use the required parameter based on the FLAG after the FM call
Regards,
Aj
‎2008 Jun 26 6:43 PM
why can't you just make one FM call and get back both the Importing Parameters.
Use the required parameter based on the FLAG after the FM call
Regards,
Aj
‎2008 Jun 27 2:40 PM
Hi,
It's related to the fact that it could be that we have for example 10000 materials and this gone a take a very long time.
Also, I have used this technique for exporting material description, unitsofmeasure, longtext, extension.
Get from the bapi all of this and return only those where there flags are set.
But, this technique appear to be less effective when using 2000, 5000 or maybe 10000, 1million materials.
It's taking to long.
Hint: I'm using a range table for Material, I can have something like (I CP *) so get everything.
I just want something like
IMPORTING
plantdata = plantdetails (IF plantFLAG was set)
storagelocationdata = locationdetails (IF sglocFLAG is set)
....
It's not possible I know, but who knows?
Another Hint:
the import parameters of the BAPI_MATERIAL_GET_ALL are set by me.
This's done by getting the needed import parameters from the specified materials. (automatically)
Imagine if the user or program said:
Get plantdata, storagelocationdata
So, I used an itab to get the werks(plant) FROM MARC and sg_loc FROM MARAD, just for one time.
But this didn't actually speed up the program very much.
Because, the program said every time import from the bapi plantdata and after that import from the bapi a second time storagelocationdata.
Image now if I'll get everything and the program must find the appropriate parameters alone, this will take approximately a half a seconde for just one material, it's very very slow.
Regards,
Kais