Fm To Update Adrc Table

Introduction

Sometimes there is a requirement where we need to make some changes in delivery header through custom program but we need to update the change log of delivery for those changes.

Update table ADRC Hi All I have to update table ADRC from another internal table of type ADRC. My question is by which Function Module i can put a lock on ADRC and then release after update. Regards Jai Lock table CALL FUNCTION 'ENQUEUEETABLE' EXP.

Like here we are discussing a case where we need to update the LIKP table of delivery header through ABAP code like deleting or changing some header field’s value. LIKP is a standard Sales and Distribution table available within R/3 SAP systems depending on the version and release level.

A project from Rajdhani Unnayan Kartripakkha, Bangladesh. I used the FM MEUPDATEDOCUMENT to update the table ekes like i want to update the quotation status as 'A'. But it's not getting updated in the table. While creating the quotation using me47 the status is updated in the table, but using the FM it's not getting updated. Expecting a reply asap. SAP standard provides FM: SDADDRESSGET to provide details of an address form the address number. For the test pick up an address number form the table ADRC. Test the FM in SE37 and provide the address number and execute. Here we have address details All address information. The second edition of Principles of Business Information Systems has been fully updated to reflect the latest developmen.

As changes done directly in delivery header get reflected in Changes option of Environment tab of header. Our requirement is to achieve similar thing when changes are done through program code not in the delivery directly.

Fm To Update Adrc Table 2019

STEPS:

How updation of change log is done in SAP:

The change log of delivery header is updated through CDHDR and CDPOS tables.

  1. e.g.Let’s take an outbound delivery 82342514 and make changes in it’s header.

Go to header in change mode.

UpdateTable

Currently, the shipment reason maintained is ‘Complete Delevery Bl’.

Let’s remove it.

And save the delivery.

After saving the delivery, shipment reason (TRSPG) gets removed in LIKP.

Also, the updation in LIKP is followed by CDHDR and CDPOS tables updation.

Following entries appear in tables CDHDR and CDPOS.

As we can see from above tables, all the data regarding the change we did is recorded in CDHDR table along with a ‘change number’ which is used for searching in CDPOS table for that particular change .The new value and old value are also specified in the CDPOS table.

Fm To Update Adrc TableFm To Update Adrc Table

Since, these tables got updated , changes are also reflected in Change log of delivery.

Go to Environment -> Changes in delivery’s header.

This thing we need to remember regarding changes done in master data that they get recorded in these two tables and can be used in custom reports or functionalities based on transactional change and master data change.

Update

As in this case, we have made change direct in delivery , so it’s getting reflected in these tables but in case we update it through custom code we need to update CDHDR and CDPOS tables also through our code.

STEPS for updating CDHDR and CDPOS tables through custom program.

1. Before updating LIKP table in custom code, extract the old values of LIKP in a work area.

2. After updating LIKP, take the new values of LIKP for that particular vbeln in a work area.

3. Call Function module ‘CHANGEDOCUMENT_OPEN’ passing vbeln as object id, object class as ‘LIEFERUNG’. Please note that proper object class needs to be specified. In this case it is ‘LIEFERUNG’ , since the object being discussed is delivery data.

Fm To Update Adrc Tables

4. Call function module ‘CHANGEDOCUMENT_SINGLE_CASE‘ passing tablename as LIKP, workarea_new as new values work area and workarea_old as old LIKP values work area.

5. Call function module ‘CHANGEDOCUMENT_CLOSE’ passing the values given below .This FM will provide a change number LIKE CDHDRCHANGENR. This indicates that CDHDR and CDPOS tables are getting updated through these function modules along with change number.

Fm To Update Adrc Tablet

Summary: As we have updated these tables, we are able to update the change log of delivery through this.Reference code can be found in attached document.