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

Code to extract MM data...

Former Member
0 Likes
1,200

hello all,

can anybody provide me with a sample code that extracts data from mara, makt, marc and outputs the abap report in a csv format. Then i need to upload it to the App. Server.

Also, how can i get long description(Detailed Description of the Item), this I need in regards to the purchase order text. I think I need to use Func. module Read_text, but I don't really know how to do it.

any help is appreciated.

thanks in advance.

eddie.

P.S: helpful answers will be rewarded.

1 ACCEPTED SOLUTION
Read only

vinod_gunaware2
Active Contributor
0 Likes
1,159

Use

BAPI_MATERIAL_DISPLAY

BAPI_MATERIAL_GET_DETAIL

BAPI_MATERIAL_GETLIST

BAPI_PO_GETDETAIL

BAPI_PO_GETITEMS

It will give u all details including long text.

regards

vinod

9 REPLIES 9
Read only

Former Member
0 Likes
1,159

This weblog may be useful

/people/ted.teng/blog/2005/12/29/use-sql2005-to-connect-and-present-sap-on-sharepoint-business-scorecard-manager-150-part-iii

Read only

vinod_gunaware2
Active Contributor
0 Likes
1,160

Use

BAPI_MATERIAL_DISPLAY

BAPI_MATERIAL_GET_DETAIL

BAPI_MATERIAL_GETLIST

BAPI_PO_GETDETAIL

BAPI_PO_GETITEMS

It will give u all details including long text.

regards

vinod

Read only

0 Likes
1,159

hello all,

Here is what I need to do in terms of extracting MM data.

I recently got an enhancement which deals with Catalog Options. This enhancement deals with an extraction report that will sit on the App. Server so that it can be taken from there and transferred to SRM.

I need to create a CSV file. I got a list of the following fields:

/CCM/ORDER_UNIT,

/CCM/PRICE,

/CCM/PRODUCT_GROUP,

/CCM/PRODUCT_ID,

/CCM/SHORT DESCRIPTION,

/CCM/BASE_UOM,

/CCM/LEAD_TIME,

/CCM/LONG_DESCRIPTION,

/CCM/MNFCTR_ID,

/CCM/MNFCTR_PART_NO

I am told to get these fields out of Material Master tables. <b>I need to do an extract from R/3.</b> The material types used are: <b>HAWA and NLAG</b> and <b>I'll be loading the deltas.</b>Plus I need to set flags like deletion flags, update and create as well to keep track of materials.

In addition to these fields, I also need a few where the values will be generated programatically. For example, there should be a PICTURE field where the value is a fixed URL, followed by the material ID, followed by a ".jpg" something like this: <b>www.yahoo.com/pictures/xyzpdq.jpg</b>

And the Category ID which will be of the form material ID followed by a "#" and a string: <b>xyzpdq#abcd06</b>

All this data needs to be output in CSV format and this report needs to sit on the App. Server.

Can someone please help me out? I urgently need to know the process flow.

I will really appreciate it.

Thanks in advance.

Regards,

Eddie

P.S: Helpful answers will be rewarded.

Read only

0 Likes
1,159

hi EDDIE

Once you got finished getting the details from the tables and store it in internal table. then

parameter: v_data(132) like dataset.

perform open_group.

open dataset v_data for output.

loop at itab.

move itab to v_data.

endloop.

close dataset v_data.

perform close_group.

regards

kishore

Read only

0 Likes
1,159

Hi Harikishore,

Thanks for the reply, the process makes sense. But my question is: How would I generate the fields programatically, meaning, the URL and Category ID. They would have no source where the data would be coming from. AND should I make another internal table for them?

Also, should I use BAPIs to get all this data or selection statements to extract this data? What would you recommend?

Thanks.

Regards,

Eddie.

Read only

0 Likes
1,159

Hi eddie

I suggest you to use BAPI which are listed by vinod which will give you the details of the material.

then for the url and category you have to do it programarically.

create a internal table with material if , url and category id. then loop through the material detaisl internal tables.

loop at mat_detail.

new_table-matnr = mat-detail-matnr.

concatenate url_string '/' mat_detail-matnr '.jpg' into new_table-url.

concatenate mat_detail '#' 'abcded' into new_table-catid.

append new_table.

endloop.

now you use this internal table.

regards

kishore

Read only

0 Likes
1,159

Hi Harikishore,

i just wanted to recall the process to make it all clear for me.

So i'll be getting all the material details from the BAPI and storing it in an internal table matl_detail. Then I will make another internal table new_table which will include mara-matnr also. i kinda don't get the part where u say "if url and category id". url and category is not coming from matl_detail right? and how should i declare url and category id in new_table?

Thanks in advance. I really appreciate ur help.

Regards,

Eddie.

Read only

0 Likes
1,159

data: url(1000) ,

catid(50) ,

temp_dat(3000) .

open dataset v_data for output.

loop at itab.

clear temp_data .

concatenate 'http://yahoo.com/pictures/' itab-materialid '.jpg' into url .

concatenate itab-materialid '#' 'xyzpdq#abcd06' into catid .

concatenate itab-field1 itab-field2 itab-field url catid into temp_data separated by ',' .

transfer temp_data to v_data.

endloop.

close dataset v_data.

i guess this is what you are looking for.

Regards

Raja

Read only

0 Likes
1,159

Thank you all. yes raja, thats what i was looking for.

Once again, thank you all for your help. Appreciate it.

Regards,

Eddie.