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

Equipment record address creation via function module

Former Member
0 Likes
1,655

How can I populate an Equipment record's address via a function module? I'm referrring to the Address area of the Location tab in tcode IE02. BAPI_EQUI_CREATE works fine for the base data but has no address capabilities.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,310

>

> BAPI_EQUI_CREATE works fine for the base data but has no address capabilities.

I think you populate DATA_GENERAL-READ_ADRNR witht the address number of the address you create with an address BAPI or FM.

Rob

7 REPLIES 7
Read only

Former Member
0 Likes
1,311

>

> BAPI_EQUI_CREATE works fine for the base data but has no address capabilities.

I think you populate DATA_GENERAL-READ_ADRNR witht the address number of the address you create with an address BAPI or FM.

Rob

Read only

0 Likes
1,310

Rob

Do you have an address FM that you've had luck with?

Thanks

Lenny

Read only

0 Likes
1,310

Hi Len,

you can use function EQUIPMENT_MODIFY for this, but it's a quite tricky task!

To provide the parameter OLD_VEQUI you can read the current timeslice data of the equipment from view V_EQUI. Afterwards you can copy it for using it as parameter NEW_VEQUI and modify it. To assign a location address you have to fill field ADRNR with the respective address number and set field ADRNRI to 'D' (= "Field maintained directly. No data transfer").

Please note, that the function module can only be used for existing equipments! As a work around to call it on equipment creation we have successfully copied the function into the customer namespace and flagged it as "Update Module" / "Start Delayed" to allow calling it with IN UPDATE TASK.

Good luck! 🐵

Read only

0 Likes
1,310

Alejiandro

I'm testing EQUIPMENT_MODIFY via a local program but keep receiving the message that my equipment "...cannot be blocked." Not locked, blocked. I can't seem to get around this. Did you have a similar issue?

Read only

0 Likes
1,310

Hello Len,

please always provide the message class and number for such problems in the (technical) ABAP forums! With a quick search I found message 410(ITOB) with the suspicious text.

In German it says "Equipment & konnte nicht gesperrt werden" which indicates a lock problem. Looks like a typo in the English translation ... Have you tried to set parameter LOCK_OLD of EQUIPMENT_MODIFY to abap_false (or similar alternatives) to check this out?

Read only

0 Likes
1,310

Alejiandro

Yes it was ITOB410. I tried the lock_old parm without luck but was able to get around that problem with an explicit calll to FM EQUIPMENT_LOCK. However, I have a new problem with the FM.

The LOCK FM got rid of the BLOCKED issue. However, now an internal call from EQUIPMENT_MODIFY to EQUI_GET_SAVE_DATA is causing a short dump in include LITOBBUFEQF70 on:

120 IF NOT SY-SUBRC IS INITIAL.

121 * try to read lock table by matnr/sernr

122 READ TABLE I_WA-LOCK ASSIGNING <L_WA_LOCK_REC>

123 WITH TABLE KEY EQUNR = SPACE

124 MATNR = <L_WA_EQUI_REC_WBUF>-EQUI

125 SERNR = <L_WA_EQUI_REC_WBUF>-EQUI

126 IF NOT SY-SUBRC IS INITIAL.

>>>> MESSAGE X003.

128 ENDIF.

129 ENDIF.

Have you seen this?

Read only

0 Likes
1,310

Unfortunately I can't help you anymore... We didn't have neither lock problems nor dumps using this function. We used it on multiple projects without any trouble and simply providing only the parameters mentioned in my first posting. Sorry!