2010 Nov 05 8:43 PM
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.
2010 Nov 05 9:05 PM
>
> 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
2010 Nov 05 9:05 PM
>
> 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
2010 Nov 06 7:12 PM
Rob
Do you have an address FM that you've had luck with?
Thanks
Lenny
2010 Nov 07 9:50 AM
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! 🐵
2010 Nov 08 3:28 PM
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?
2010 Nov 08 6:53 PM
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?
2010 Nov 08 7:01 PM
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?
2010 Nov 08 7:07 PM
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!