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

material_maintain_dark

Former Member
0 Likes
2,977

Do any one know how to use FM material_maintain_dark ?

I have problem related to TRANC and D_IND fields passed in tables.

can anyone tell me relation between them?

Also how does different tables are linked?

I will be very thankful if anyone can guide me.

Thanks And Regards,

Kaushal N. Shah.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,290

No thats not what I am looking for.

I want to create materials and change them too.

I have various maintenance level data.

When I pass all this it doesn't always create material and if it does so it sometimes doesn't create maintainance level data.

Now in documentation for material_maintain_dark there is a mention of these two fields : TRANC n D_IND which is req for making this FM work properly.

I don't exactly know how to set this value and how does one table is related to other (like I think MARC n MPOP are related) .

Do anyone know this?

Message was edited by:

Kaushal Shah

4 REPLIES 4
Read only

Former Member
0 Likes
2,290

hi

refer to the code below

REPORT Z_VENDOR_PART_UPLOAD

message-id zkwm

line-count 64

LINE-SIZE 500.

data: tmara_ueb like mara_ueb occurs 100 with header line.

data: tmakt_ueb like makt_ueb occurs 100 with header line.

data: tamerrdat like merrdat occurs 100 with header line.

start-of-selection.

tmara_ueb-mandt = '500'.

tmara_ueb-matnr = 'XISCO2610'.

tmara_ueb-tcode = 'MM02'.

tmara_ueb-tranc = 1.

tmakt_ueb-mandt = '500'.

tmakt_ueb-matnr = 'XISCO2610'.

tmakt_ueb-spras = 'EN'.

tmakt_ueb-maktx = 'test description dark'.

tmakt_ueb-maktg = 'TEST DESCRIPTION DARK'.

tmakt_ueb-tranc = 1.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

FLAG_MUSS_PRUEFEN = 'X'

SPERRMODUS = 'E'

MAX_ERRORS = 0

P_KZ_NO_WARN = 'N'

KZ_PRF = 'S'

KZ_VERW = 'X'

KZ_AEND = 'X'

KZ_DISPO = 'X'

KZ_TEST = ' '

NO_DATABASE_UPDATE = ' '

CALL_MODE = ' '

CALL_MODE2 = ' '

USER = SY-UNAME

SUPPRESS_ARRAY_READ = ' '

FLG_MASS = ' '

TABLES

AMARA_UEB = TMARA_UEB

AMAKT_UEB = TMAKT_UEB

AMERRDAT = TAMERRDAT

EXCEPTIONS

KSTATUS_EMPTY = 1

TKSTATUS_EMPTY = 2

T130M_ERROR = 3

INTERNAL_ERROR = 4

TOO_MANY_ERRORS = 5

UPDATE_ERROR = 6

ERROR_MESSAGE = 8

OTHERS = 7.

*TMERRDAT-TRANC = INIT_TRANC.

  • TMERRDAT-MATNR = HEADDATA-MATERIAL.

  • TMERRDAT-MSGTY = MESSAGE_ERROR.

TAMERRDAT-MSGID = SY-MSGID.

TAMERRDAT-MSGNO = SY-MSGNO.

TAMERRDAT-MSGV1 = SY-MSGV1.

TAMERRDAT-MSGV2 = SY-MSGV2.

TAMERRDAT-MSGV3 = SY-MSGV3.

TAMERRDAT-MSGV4 = SY-MSGV4.

APPEND TAMERRDAT.

IF SY-SUBRC NE 0.

ROLLBACK WORK.

ELSE.

CALL FUNCTION 'DB_COMMIT'.

ENDIF.

regards

ravish

<b>dont forget to reward points if helpful</b>

Read only

Former Member
0 Likes
2,290

hi,

DATA: H_ANZFEHLER LIKE TBIST-NUMERROR.

DATA: BEGIN OF T_MARA_UEB OCCURS 1.

INCLUDE STRUCTURE MARA_UEB.

DATA: END OF T_MARA_UEB.

DATA: BEGIN OF T_MBEW_UEB OCCURS 1.

INCLUDE STRUCTURE MBEW_UEB.

DATA: END OF T_MBEW_UEB.

DATA: T_MERRDAT TYPE MERRDAT OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

p_kz_no_warn = 'N'

kz_prf = 'E'

kz_aend = 'X'

kz_dispo = ' '

IMPORTING

number_errors_transaction = h_anzfehler

TABLES

amara_ueb = t_mara_ueb

ambew_ueb = t_mbew_ueb

amerrdat = t_merrdat.

regards

Read only

Former Member
0 Likes
2,291

No thats not what I am looking for.

I want to create materials and change them too.

I have various maintenance level data.

When I pass all this it doesn't always create material and if it does so it sometimes doesn't create maintainance level data.

Now in documentation for material_maintain_dark there is a mention of these two fields : TRANC n D_IND which is req for making this FM work properly.

I don't exactly know how to set this value and how does one table is related to other (like I think MARC n MPOP are related) .

Do anyone know this?

Message was edited by:

Kaushal Shah

Read only

2,290

Hi,

The fields 'TRANC' and 'D_IND' which appear in the amfieldres table of the function module have a key role to play in updating the material master.

While assigning values to each field make sure that TRANC is incremented for each assignment of a new field. That means TRANC value should be unique for each field update, other wise one of the fields having a common TRANC number would be deleted and henceforth would not be updated.

In brief the combination of 'field-name' and 'TRANC' in the amfieldres table should be unique.

Reward points if helpful.

Archana.