Application Development 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: 

Can anybody help me with this

Former Member
0 Kudos
90

can anybody provide me sample code that i can refer

my requirement is if the material is created or changed I need to send it on to a file on application server using EXIT_SAPLMGMU_001

6 REPLIES 6

Former Member
0 Kudos
58

Hi,

if you want to create/update a file on Application server

follow below steps

1. Open dataset

2. Transfer data

3. close dataset

if you want any eg: program or more details press f1 help.

Regards

Ganesh

Former Member
0 Kudos
58

Hi ,

Try this,

DATA: g_epath LIKE rlgrap-filename, " error file

---> Define file fields as internatable( like it_file).

---> Defind work area ( like wa_file)

if sy-tcode = 'MM01' OR

sy-tcode = 'MM02'.

OPEN DATASET g_path IN TEXT MODE ENCODING DEFAULT FOR OUTPUT.

IF sy-subrc NE 0.

CLOSE DATASET g_hpath.

MESSAGE e001 WITH 'Error in Opening the Error File'.

ELSE.

LOOP AT it_file INTO wa_file.

TRANSFER wa_file TO g_path .

ENDLOOP.

CLOSE DATASET g_path.

ENDIF.

Endif.

let me know, if u need any info.

Regards,

Vishvesh

if helpful, rewards it

Former Member
0 Kudos
58

Hi Vishwesh

Thanx I am using the same format as u told

but the prob is bit different.

I will be so thankful to u if u provide the select query for the followind data

SELECT a~matnr -


>> this is table wmara

b~maktx -


>> this is table makt

c~msehi -


> this is table t006a

a~brgew -


>> this is table mara

a~volum----


>> this is table mara

a~wheel_width----


>> this is table mara

a~wheel_diam----


>> this is table mara

INTO CORRESPONDING FIELDS OF TABLE x_mtfile

FROM ( ( mara as a INNER JOIN makt ON matnr = matnr

this is half done.

I need to fetch the material according to one plant code which is there in ztable.

mara is not having werks fields so how can i get material as per the plant code.

In this querry how I will make use of marc table.

I am writing this query in include of EXIT_SAPLMGMU_001 that means in ZXMG0U02

Plz help.

0 Kudos
58

Hi Mona,

You can have any number of joins in a query. So you can add another JOIN to table MARC joining the fields MARAMATNR = MARCMATNR. So the query would change to:

SELECT a~matnr -


>> this is table wmara

b~maktx -


>> this is table makt

c~msehi -


> this is table t006a

a~brgew -


>> this is table mara

a~volum----


>> this is table mara

a~wheel_width----


>> this is table mara

a~wheel_diam----


>> this is table mara

INTO CORRESPONDING FIELDS OF TABLE x_mtfile

FROM mara as a INNER JOIN makt as b ON amatnr = bmatnr

INNER JOIN MARC as C on amatnr = cmatnr

Hope this helps.

Regards,

Aravinda Sarma M.

0 Kudos
58

HI,

select a~matnr

b~maktx

a~brgew

a~volum

a~wheel_width

a~wheel_diam

c~werks

INTO CORRESPONDING FIELDS OF TABLE x_mtfile

FROM

mara as a INNER JOIN makt as b ON matnr = matnr

inner join marc as c on matnr = matnr.

I think it help full

By

Gupta

Former Member
0 Kudos
58

Hi Friends

thank so much

but doubt is not yet clear

I need to fetch data from t006a-meshi for which i m not have any primary key to join the tables

how do u I do this.