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

write a function to read_text for material and write to a different material

Former Member
0 Likes
670

Hi,

I am trying to create a function that can be passed a plant, old material #, and new material #. 

The program will execute a read_text with the material # and plant and get the purchase order text. I will then want to write that text to the new material # as purchase order text.

I know what I want to do, but need a little direction as to how to begin, and how to write the text to the new material #.

Should this be done as a function? Can it be done as an executable program? 

Thanks to anyone who can help. 

Tony.

Hi,

I am trying to create a function that can be passed a plant, old material #, and new material #. 

The program will execute a read_text with the material # and plant and get the purchase order text. I will then want to write that text to the new material # as purchase order text.

I know what I want to do, but need a little direction as to how to begin, and how to write the text to the new material #.

Should this be done as a function? Can it be done as an executable program? 

Thanks to anyone who can help. 

Tony.

3 REPLIES 3
Read only

Juwin
Active Contributor
0 Likes
626

Looking at the requirement, it seems like for a one time conversion/ data load program. Hence, I would suggest to write this as a standalone report.

Thanks,

Juwin

Read only

rosenberg_eitan
Active Contributor
0 Likes
626

Dear Tony,

This requirement can be done using a function an executable report or a class  .

The decision is based how this code will be used .

If this code will be called from multiple location then a class or a function is the way to go .

Using a function or a class depends if you will need screen interaction .

Regards.

Eitan.

Read only

Former Member
0 Likes
626

The app will be used more than once, and this was my logic. 

I was going to have in my select, the original material #.

Also ask for a material prefix that will be added to the material number, thus providing me with the new material #.

I will check MARA to see if it is a valid material, and if so, I will get the Purch Order text from the original material# and write to the new material # with the prefix.

I am leaning towards a report because the output can be saved and looked at to see what the new data looks like.

It will also come in handy in the event that one of the new material# is not in MARA.

My biggest hurdle now is how to write the text to the new material #'s.

Tony