Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10548

Re: updating table equi

$
0
0

Hi Raymond,

 

Thank you for the response.

BAPI_EQUI_CHANGE does not have a field named kunde for CurCustomer that is why i didn't used it, then i search in the net and saw a code and tried it. But in my program it returns me a "Not Successful" output.

 

 

   SELECT objnr

     INTO gt_fxihpa-objnr

     FROM equi

     WHERE equnr EQ p_equnr.

   ENDSELECT.

 

   SELECT parvw

     INTO gt_fxihpa-parvw

     FROM ihpa

     WHERE objnr EQ gt_fxihpa-objnr.

   ENDSELECT.

 

   IF r_emp EQ 'X'.

     gt_fxihpa-parvw_ext = 'VW'. "'Assigned to Employee'.

   ELSEIF r_third EQ 'X'.

     gt_fxihpa-parvw_ext = 'VN'. " 'Assigned to Vendor'.

   ENDIF.

 

   gt_fxihpa-mandt  = sy-mandt.

   gt_fxihpa-erdat  = sy-datum.

   gt_fxihpa-erzeit = sy-uzeit.

   gt_fxihpa-ernam  = sy-uname.

   gt_fxihpa-aedat = sy-datum.

   gt_fxihpa-aezeit = sy-uzeit.

   gt_fxihpa-aenam = sy-uname.

   gt_fxihpa-obtyp  = 'IEQ'.

 

 

   gt_fxihpa-parnr = p_kunnr.

   gt_fxihpa-updkz = 'U'.

   APPEND gt_fxihpa.

   IF NOT gt_fxihpa IS INITIAL.

   CALL FUNCTION 'PM_PARTNER_UPDATE'

     TABLES

       fxihpa = gt_fxihpa.

 

     IF sy-subrc = 0.

         COMMIT WORK.

     ENDIF.

   ENDIF.

 

 

 

DATA: l_valid_equi LIKE itob,

       l_itob_old LIKE itob,

       l_itob_new  LIKE itob,

       l_valid_equi_new LIKE itob,

       l_itob_rec LIKE itob,

       gt_equipment LIKE bapi_itob_parms-equipment.

 

       gt_equipment = p_equnr.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

         EXPORTING

           input = p_equnr

         IMPORTING

           output = gt_equipment.

 

 

  CALL FUNCTION 'ITOB_EQUIPMENT_READ_SINGLE'

     exporting

       i_lock         = 'X'

       i_objnr        = gt_equipment

     importing

       e_object_rec   = l_valid_equi

     exceptions

       not_successful = 1

       others         = 2.

 

   IF sy-subrc = 0.

     l_valid_equi_new        = l_valid_equi.

     l_valid_equi_new-kunde  = p_kunnr.

 

     move: l_valid_equi       to l_itob_old,

           l_valid_equi_new   to l_itob_new.

 

 

 

     CLEAR l_itob_rec.

*   Function module to udate equipment data

     call function 'ITOB_EQUIPMENT_MODIFY_SINGLE'

       exporting

*        i_auth_tcode     = 'IE02'

         i_filter_data    = space

         i_write_buffer   = 'X'

         i_post_buffer    = 'X'

         i_commit_work    = 'X'

         i_object_rec     = l_itob_new

         i_object_rec_old = l_itob_old

       importing

         e_object_rec     = l_itob_rec

       exceptions

         not_successful   = 1

         others           = 2.

     IF sy-subrc = 0.

       ENDIF.

 

   ENDIF.


Viewing all articles
Browse latest Browse all 10548

Trending Articles