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

FM Material_maintain_dark

Former Member
0 Likes
955

Hi all,

i'm trying to create a new material copy from the template material using FM. i have written an FM to implement this function, and it does work, the plant and storage location data is correct, but sale data is missing.

this FM's main idea:

first, read the template material record from mara, marc, makt, mvke, etc.

second, using MOVE-CORRESPONDING pass data to mara_ueb, marc_ueb, makt_ueb, mvke_ueb, etc.

finally, call FM:MATERIAL_MAINTAIN_DARK to create the new material.

everything is OK, except the sale data, the template material have one sale org, after executing FM, when open the new material sale view, the system prompt that: Sales organizations/distribution channels do not exist for this material.

WHERE iam doing the mistake.

am i missing something while create the sales view?.

Thanks in advance.

Joe

PS.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

FLAG_MUSS_PRUEFEN = ' '

P_KZ_NO_WARN = 'E'

KZ_PRF = 'I'

IMPORTING

MATNR_LAST = matnr

NUMBER_ERRORS_TRANSACTION = materr

TABLES

AMARA_UEB = tmara

AMAKT_UEB = tmakt

AMARC_UEB = tmarc

AMARD_UEB = tmard

AMBEW_UEB = tmbew

ASTEU_UEB = tsteu

AMLGN_UEB = tmlgn

AMLGT_UEB = tmlgt

AMPGD_UEB = tmpgd

AMPOP_UEB = tmpop

AMVKE_UEB = tmvke

AMERRDAT = terror

EXCEPTIONS

KSTATUS_EMPTY = 1

TKSTATUS_EMPTY = 2

T130M_ERROR = 3

INTERNAL_ERROR = 4

TOO_MANY_ERRORS = 5

UPDATE_ERROR = 6

OTHERS = 7

Hi all,

i'm trying to create a new material copy from the template material using FM. i have written an FM to implement this function, and it does work, the plant and storage location data is correct, but sale data is missing.

this FM's main idea:

first, read the template material record from mara, marc, makt, mvke, etc.

second, using MOVE-CORRESPONDING pass data to mara_ueb, marc_ueb, makt_ueb, mvke_ueb, etc.

finally, call FM:MATERIAL_MAINTAIN_DARK to create the new material.

everything is OK, except the sale data, the template material have one sale org, after executing FM, when open the new material sale view, the system prompt that: Sales organizations/distribution channels do not exist for this material.

WHERE iam doing the mistake.

am i missing something while create the sales view?.

Thanks in advance.

Joe

PS.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

FLAG_MUSS_PRUEFEN = ' '

P_KZ_NO_WARN = 'E'

KZ_PRF = 'I'

IMPORTING

MATNR_LAST = matnr

NUMBER_ERRORS_TRANSACTION = materr

TABLES

AMARA_UEB = tmara

AMAKT_UEB = tmakt

AMARC_UEB = tmarc

AMARD_UEB = tmard

AMBEW_UEB = tmbew

ASTEU_UEB = tsteu

AMLGN_UEB = tmlgn

AMLGT_UEB = tmlgt

AMPGD_UEB = tmpgd

AMPOP_UEB = tmpop

AMVKE_UEB = tmvke

AMERRDAT = terror

EXCEPTIONS

KSTATUS_EMPTY = 1

TKSTATUS_EMPTY = 2

T130M_ERROR = 3

INTERNAL_ERROR = 4

TOO_MANY_ERRORS = 5

UPDATE_ERROR = 6

OTHERS = 7

2 REPLIES 2
Read only

Former Member
0 Likes
642

hi

good

go through this link

http://www.logosworld.de/ftp/cook_destiller.pdf

thanks

mrutyun^

Read only

Former Member
0 Likes
642

Hi,

For passing the values into any particular field you can also use 'field-symbols', which can be the most effective tool, which in turn directly points to the memory and substitues the values. For your MVKE update, have a look at the table tmvke while debugging, i.e., after passing it through the function module. If you happen to see any entries which have not been passed into the function module, check for field 'TRANC' in 'AMFIELDRES' int table. The tranc value must be unique for each entry, if you have gone wrong in assigning unique values for TRANC field then that particular field will not get updated.

Reward points if helpful.

Archana.