# Primavera / MS Project Schedule Import to Network Activities Interface

> A custom interface program that transfers activity duration, work and constraint dates updated in the scheduling tool (Primavera P6, MS Project or Excel) to SAP network activities via a file. Project planners keep the schedule in one place, and cost planning, capacity and material requirement dates in SAP stay current.

- Type: Program, Custom development, Interface
- Module: PS
- Estimated effort: M (5–7 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/primavera-ms-project-schedule-import-to-network-activities/


## Why is the standard not enough?

CN22 and CJ20N change network activities one by one; there is no standard transaction that takes updates from an external scheduling tool from a file in a scheduled and controlled way. As a result the dates in the two systems quickly drift apart. The custom interface matches the activities, writes only changed values and keeps a log of every transfer.

### Closest standard alternatives

- CN22: Changes network activities one by one; no scheduled transfer from a file.
- CJ20N: Dates and durations are updated manually in the Project Builder; no comparison with the external plan and no log.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| AFVV | Activity quantities and dates: duration, work, constraint types and constraint dates | Write | AFVV-AUFPL = AFVC-AUFPL AND AFVV-APLZL = AFVC-APLZL | ECC + S/4 |
| AFVC | Network activity: activity number, description, WBS assignment | Read | AFVC-AUFPL = AFKO-AUFPL | ECC + S/4 |
| AFKO | Network header: routing number | Read | - | ECC + S/4 |
| PRPS | WBS element shown in the log | Read | PRPS-PSPNR = AFVC-PROJN | ECC + S/4 |

## BAPIs and functions used

- BAPI_PS_INITIALIZATION: Initializes the PS BAPI buffer for each network
- BAPI_BUS2002_ACT_CHANGE_MULTI: Updates duration, work and constraint dates of the changed activities
- BAPI_PS_PRECOMMIT: Runs the PS consistency checks before saving
- BAPI_TRANSACTION_COMMIT: Saves successful networks permanently
- BAPI_TRANSACTION_ROLLBACK: Rolls back changes in test mode or on error

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | File or server folder | Single value | - | Yes |
| P_SERVER | Read from application server | Checkbox | - | No |
| P_ONLYCH | Write changed values only | Checkbox | - | No |
| P_TEST | Test mode (check without saving) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Network | AFKO-AUFNR | Yes |
| Activity | AFVC-VORNR | Yes |
| Activity description (for checking) | AFVC-LTXA1 | No |
| Normal duration | AFVV-DAUNO | No |
| Duration unit | AFVV-DAUNE | No |
| Work | AFVV-ARBEI | No |
| Work unit | AFVV-ARBEH | No |
| Start constraint type | AFVV-EINSA | No |
| Constrained start date | AFVV-NTANF | No |
| Finish constraint type | AFVV-EINSE | No |
| Constrained finish date | AFVV-NTEND | No |

## Result list columns

| Column | Source |
|---|---|
| Row | Calculated: Row number in the file |
| Network | AFKO-AUFNR |
| Activity | AFVC-VORNR |
| Activity description | AFVC-LTXA1 |
| New duration | AFVV-DAUNO |
| Constrained start | AFVV-NTANF |
| Changed fields | Calculated: List of the fields that differ between file and AFVV |
| Status | Calculated: Updated, no change or error |
| Message | Calculated: First error or success message from the BAPI return table |

## How does the program work?

1. The file is read from the local PC or a folder on the application server; network and activity number are the mandatory key fields.
2. The routing number (AUFPL) of the network is found in AFKO; the activity (VORNR) is matched in AFVC. Rows without a match become errors.
3. The current duration (DAUNO/DAUNE), work (ARBEI/ARBEH), constraint types (EINSA/EINSE) and constraint dates (NTANF/NTEND) in AFVV are compared with the file; with "changed only" selected, rows without differences are skipped.
4. For each network BAPI_PS_INITIALIZATION is called, changed activities are updated with BAPI_BUS2002_ACT_CHANGE_MULTI and BAPI_PS_PRECOMMIT is run.
5. Without errors the changes are saved with BAPI_TRANSACTION_COMMIT; in test mode or on error BAPI_TRANSACTION_ROLLBACK runs. Old and new values are written to the log; a server file is moved to an archive folder after processing.

## Authorization objects

- C_AFKO_AWK: Change authorization by network type
- C_PROJ_KOK: Project authorization by controlling area

## Frequently asked questions

### How are activity codes in the scheduling tool matched to SAP?

The simplest way is to use a code field in the scheduling tool that holds the SAP network and activity number. If that is not possible, a mapping table is kept and the program translates the code in the file through it.

### Is the network rescheduled after the transfer?

If scheduling on save is set in the network profile, SAP recalculates the dates when saving. If not, a separate scheduling job can be planned after the transfer; this step is optional.

### Does it work on S/4HANA?

Yes. BAPI_BUS2002_ACT_CHANGE_MULTI and the network tables are supported in S/4HANA. For the read side, the CDS view I_NetworkActivityByInternalKey can be used for a clean core approach.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=ps-schedule-import-network-activities
