SAP® Documentation

Single view

/SCWM/R_PS_DATA_LOAD - Upload of Packaging Specifications

General Material Data   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book


You use this report to load the initial data of packaging specifications. This is accomplished by calling function module /SCWM/API_PACKSPEC_CREATE.


An input file must be generated from the legacy system or data source system. This file can be either a CSV file (recommended) or a text file.

1. Setup of the input file in CSV format

The columns of the CSV file correspond to the components of structure /SCWM/S_PS_DL_PS_CSV. This is a composite structure that includes all the necessary data to create a packaging specification. It contains several includes for the different parts of a packaging specification: Key, Header, Content, Level, Element, Condition.

Let us briefly illustrate how to maintain the CSV file. The first step is to fill the mandatory key fields, which identify the purpose of each row. The key consists of the fields of the included structure /SCWM/S_PS_DL_KEY: Record Type (DL_RECTYPE), Sequence Number for Packaging Specification (DL_PS_SEQ), Level Sequence (DL_LEVEL_SEQ), Record Sequence (DL_REC_SEQ) and a separator column (DL_FILLER, only a visual aid).

'Record Type' is the letter indicating what the line specifies: 'H' = header, 'C' = content, 'L' = level, 'E' = level element, 'R' = condition record, '*' or SPACE = comment (see note below).

'Sequence Number for Packaging Specification' must contain a different, consecutive number for each packaging specification in the file. All lines belonging to the first packaging specification in the file should have a '1' in this field, all lines for the second should have '2', etc. This is only a temporary number to distinguish the different packaging specifications in the file.

'Level Sequence' is only relevant for lines of record type 'L' (levels) and 'E' (elements), in all other cases it is recommended to set it to '1'. So the line for the first level should have '1', for the second level '2', for the third level '3'. The lines for the elements of the first level should all have the value '1' here, the lines for the elements of the second level should all have '2', etc.

'Record Sequence' is only relevant for lines of record type 'C' (content) or 'E' (elements), in all other cases it is recommended to set it to '1'. Content lines must have consecutive numbers. For each level, the elements must have consecutive record sequence numbers. Example: If level 5 has three different elements, then the first element should have a record sequence number equal to '1', the second equal to '2' and the third equal to '3'.

The separator column (DL_FILLER) serves only as a visual separator and can be left empty.

For example, you want to create a packspec that has two contents, three levels (with one, three, and two elements respectively) and two condition records. Let's say that this packspec is the fifth packaging specification in the file. Then you would have to create 14 rows with keys like this:

H 5 1 1

C 5 1 1

C 5 1 2

L 5 1 1

L 5 2 1

L 5 3 1

E 5 1 1

E 5 2 1

E 5 2 2

E 5 2 3

E 5 3 1

E 5 3 2

R 5 1 1

R 5 1 1

Depending on the record type, different fields have to be filled in addition to the key fields:

  • header: only the fields from include /SCWM/S_PS_DL_HEADER_DATA filled
  • content: only the fields from include /SCWM/S_PS_DL_CONTENT_DATA filled
  • levels: only the fields from include /SCWM/S_PS_DL_LEVEL_DATA filled
  • elements: only the fields from include /SCWM/S_PS_DL_LEVEL_ELEM_DATA filled
  • condition records: only the fields from include /SCWM/S_PS_DL_CONDITION_DATA filled

So the rows for our example packaging specification would look somewhat like this (where A,B,C,D,E are placeholders for valid, non-initial values):


C 5 1 1            BBBBBBBBB    

C 5 1 2            BBBBBBBBB        

L 5 1 1                     CCCCCCCCCC

L 5 2 1                     CCCCCCCCCC

L 5 3 1                     CCCCCCCCCC

E 5 1 1                               DDDDDDDDDDDD

E 5 2 1                               DDDDDDDDDDDD,,

E 5 2 2                               DDDDDDDDDDDD

E 5 2 3                               DDDDDDDDDDDD

E 5 3 1                               DDDDDDDDDDDD

E 5 3 2                               DDDDDDDDDDDD

R 5 1 1                                           RRRRRRRRRR

R 5 1 1                                           RRRRRRRRRR,,

2. Setup of the input file in text format

The text data file can contain the following types of records. Each record type is identified by a single character in the first position:

  • " " - the system ignores records with a "blank" in the first position
  • "*" - contains a comment that will be printed on the output
  • "H" - header data - structure /SCWM/S_PS_DL_HEADER
  • "C" - content data - structure /SCWM/S_PS_DL_CONTENT
  • "L" - level data - structure /SCWM/S_PS_DL_LEVEL
  • "E" - level element data - structure /SCWM/S_PS_DL_LEVEL_ELEMENT
  • "R" - condition technique record - structure /SCWM/S_PS_DL_CONDITION

The elements belonging to one packaging specification must be consecutive and sequentially numbered as defined in the structure /SCWM/S_PS_DL_KEY, which is included at the beginning of each structure.



Source File Information:

  • File Name
This can be a logical or a physical file name. Select the appropriate radio buttons to specify the file type, and whether the system is to upload the file (from the work station or network server) or use the data transfer method (for files stored on the SAP host).
Note that you must use the transfer method if you run the program in background processing mode.

Log Display Options:

  • Resubmit Input File
You can use this option if a file has already been processed and errors were reported. The system only processes the records that were not successfully processed previously.
  • List Objects (Detail)
If you select this option, the system identifies all objects from the file (by sequence number PS_SEQ) that have not been correctly created. Messages generated by function module /SCWM/API_PACKSPEC_CREATE are logged regardless of whether this parameter is set.
  • Display All Objects (History)
If you select this option, the system displays all existing logs for the given input file after the processing is complete. If this parameter is not set, only the log generated by the current program run is displayed.
  • Display Log Only (No DB Update)
If you select this option, the system displays all existing logs for the given input file. It will NOT process the given input file.
If no file name is supplied, all logs related to this upload program are displayed.

The system reads the input file and prepares the data before calling function module /SCWM/API_PACKSPEC_CREATE.


The system issues an application log containing records of whether the data load was successful or not.

  • Dialog mode
If you are working in dialog mode, the system automatically branches to the interactive application log display.
  • Background processing
If you use background processing, the system displays a simple list containing all messages generated.

(Note: Logical/physical file name mappings are accomplished with transactions FILE (cross-client) and SF01 (client-specific). )

General Material Data   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 12209 Date: 20191014 Time: 210434     sap01-206 ( 35 ms )

Our Service

Looking for Support? Questions?




Leave us your contact details and we will call you back. Panels marked with * are mandatory.