cancel
Showing results for 
Search instead for 
Did you mean: 

How to change a Production Resource/Tool

Former Member
0 Kudos

Hi!

Does anybody know how I can change a Production Resource/Tool with an ABAP function? I found the function 'CF_ST_FHM_UPDATE' to create one and I think it is also possible to change it but I don't know how...

Thanks in advance,

Joerg

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!

There I can find the following information:

Function: CF_VB_CRFH_POST

Status: Update was terminated

Report: LCFVBU03

Line: 62

Text: CF 887: Error function CF_VB_CRFH_POST & & &

Does this help?

Thanks,

Joerg

Former Member
0 Kudos

The dump is for the following code.

<i> READ TABLE CRFHD_IMP INDEX 1.

IF SY-SUBRC = 0.

CASE CRFHD_IMP-FHMAR.

WHEN MATERIAL.

OBJECTID = CRFHD_IMP-MATNR.

WHEN SONSTIGE.

OBJECTID = CRFHD_IMP-SFHNR.

WHEN DOKUMENT.

OBJECTID = CRFHD_IMP-DOKNR.

WHEN EQUIPMENT.

OBJECTID = CRFHD_IMP-EQUNR.

WHEN OTHERS.

<b> MESSAGE A887

WITH HLP-FNAME.</b>

ENDCASE.

ENDIF.</i>

See if you have the right value in CRFHD_IMP-FHMAR (possible values as follows)

MATERIAL LIKE TCF02-FHMAR VALUE 'M',

CHARGE LIKE TCF02-FHMAR VALUE 'C',

EQUIPMENT LIKE TCF02-FHMAR VALUE 'E',

TECHPLATZ LIKE TCF02-FHMAR VALUE 'T',

DOKUMENT LIKE TCF02-FHMAR VALUE 'D',

SONSTIGE LIKE TCF02-FHMAR VALUE 'S',

This should help.

Rishi

Answers (4)

Answers (4)

Former Member
0 Kudos

I now managed to understand the use of the API.

I must say that this is a really bad designed API.

Anyhow, it works for me now, except that there is a bug in the module:

In CF_ST_FHM_UPDATE beginning from line 177 it says:

LOOP AT CRTXD_IMP.

CRTXD_TAB_TMP = CRTXD_IMP.

CRTXD_TAB_TMP-AEDAT_TEXT = SY-DATUM.

CRTXD_TAB_TMP-AENAM_TEXT = SY-UNAME.

APPEND CRTXD_TMP.

ENDLOOP.

This makes no sense. It should be:

LOOP AT CRTXD_IMP.

CRTXD_TAB_TMP = CRTXD_IMP.

CRTXD_TAB_TMP-AEDAT_TEXT = SY-DATUM.

CRTXD_TAB_TMP-AENAM_TEXT = SY-UNAME.

APPEND CRTXD_TAB_TMP.

ENDLOOP.

I will open a support message. Hopefully I don't get an arrogant or incompetent support agent and SAP fixes this small error!

Former Member
0 Kudos

Hi,

you solved it! I didn't set this value so it couldn't work...

Thanks a lot,

Joerg

Former Member
0 Kudos

Great! Thanks for the points!

Former Member
0 Kudos

Hi!

Still doesn't work.

I've used the following values:

AKTYP: 'V' for change

CRFHD-OBJTY: 'FH'

CRFHD-OBJID: '10000398'

(When u create a prod. resource/tool, you leave this values empty and fill SFHNR, but with change, it is not possible to fill SFHNR again because this value must be unique -> Error message. So I assumed to fill OBJTY and OBJID to specify the Object I wnat to change!)

CRFHD-STATUS: '02' this is the value I want to change (old value: '01')

CRFHD-STOWK: '1000'

CRFHD-BASEH: 'ST'

CFRHD-PLANV: '000'

CFRHD-MODKZ: 'C'

I've also tried it with CRTXD-MODKZ = 'C'...

As return I got the right OBJTY and OBJID and it seems everything is ok, but when I check it with transaction CF03, there is no change??

Another thing: When I try to commit the first function I got the message-box: "express message: update was terminated"?

Any more ideas?

Thanks,

Joerg

Former Member
0 Kudos

a where used on this function returned nothing, so there is no sample code to look at.

Can you check the update termination in SM13 and see where the update failed, your answer could lie there.

seems like the commit is required after the FM. Additionally since you are changing data, you probably are missing other key fields required for the change.

Rishi

Former Member
0 Kudos

set the parameter <b>AKTYP_IMP = 'V'.</b> for change

also set <b>CRFHD_IMP-MODKZ to 'C'.</b> for change (additionally 'N' for new, 'D' for delete)

and changed entries in CRTXD_IMP

<b>CRTXD_IMP-MODKZ = 'C'.</b> for change (additionally 'N' for new, 'D' for delete)

Rishi

Former Member
0 Kudos

Hi Friends,

i am starting my career in sap. i want some basic documents regarding ABAP Programming. if u have plz send to my id <b>suresh_kutamvenkata@yahoo.co.in</b> . i need the basic documents.. plz send me friends

thanx for sending