Ansicht
Dokumentation

DDIF_VIEW_PUT - DD: Interface for writing a view in the ABAP Dictionary

DDIF_VIEW_PUT - DD: Interface for writing a view in the ABAP Dictionary

ABAP Short Reference   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module writes the sources of a view in the ABAP Dictionary. The new or revised version of the view is written. If there is an active version of the view, it is not affected.

Before the view is written, there is first a check whether the action is allowed for the specific object. If this is not the case, for example because the selected name violates the naming convention or because the name of the object collides with the name of another object in the ABAP Dictionary, the exception PUT_REFUSED is triggered. In this case the system variables contain a message which describes the reason why this action is rejected.

If only certain parts (e.g. the fields) of the view are to be changed, only the corresponding parameters of the function module should be defined. For IMPORT parameters DD25V_WA, DD09L_WA, "defined" here means that a value other than SPACE is passed in field VIEWNAME or TABNAME. For the TABLES parameters (DD26V_TAB, DD27P_TAB, DD28J_TAB, DD28V_TAB), "defined" means that they are named at all in the call.
Caution: A TABLES parameter is also considered to be defined if a table without lines is passed to it. The effect in this case is completely different to that when this parameter is not defined in the call. In particular, when DD26V_TAB or DD27P_TAB are defined with empty tables, the exception VIEW_INCONSISTENT is triggered.

Example

The projection view VTEST with Basis table TEST is in active state in the ABAP Dictionary. Its only field is field TEST-F1, which should also have the name F1 as view field. Field TEST-F2 should now be added to this field and be given the name VF. The following coding is used here:

DATA DD27P_TAB LIKE DD27P OCCURS 2 WITH HEADER LINE.
DD27P_TAB-VIEWNAME = 'VTEST'. DD27P_TAB-TABNAME = 'TEST'.
DD27P_TAB-FIELDNAME = 'F1'. DD27P_TAB-VIEWFIELD = 'F1'.
DD27P_TAB-OBJPOS = '1'. APPEND DD27P_TAB.
DD27P_TAB-VIEWNAME = 'VTEST'. DD27P_TAB-TABNAME = 'TEST'.
DD27P_TAB-FIELDNAME = 'F2'. DD27P_TAB-VIEWFIELD = 'VF'.
DD27P_TAB-OBJPOS = '2'. APPEND DD27P_TAB.
COMMIT WORK.
CALL FUNCTION 'DDIF_VIEW_PUT'
EXPORTING
NAME = 'VTEST'
TABLES
DD27P_TAB = DD27P_TAB
EXCEPTIONS
PUT_FAILURE = 01
OTHERS = 02.
IF SY-SUBRC = 1.
ROLLBACK WORK.
ENDIF.
IF SY-SUBRC = 0.
COMMIT WORK.
WRITE / 'View VTEST is now revised with two fields.'.
WRITE / 'The active version is unchanged.'.
ELSE.
WRITE / 'View VTEST is still active in the old state.'.
ENDIF.

Notes

1. This function module does not perform any authorization check and does not write any correction entry.

2. If the write operation fails, the exception PUT_FAILURE is activated. In this case, part of the sources might already be written. A ROLLBACK should therefore be performed at a suitable time.

3. The module does not perform any COMMITs or ROLLBACKs. After writing, the caller should therefore perform a COMMIT.

  1. If a parameter is defined but has a value other than NAME in field VIEWNAME (or in field CONDNAME for DD28V_TAB), the exception NAME_INCONSISTENT is triggered.
  2. If parameter DD25V_WA is not defined and there is no version of the view in the ABAP Dictionary, the exception VIEW_NOT_FOUND is triggered.
  3. The tables from DD26V_TAB are stored in the order defined by TABPOS. If a TABPOS entry occurs more than once, the exception VIEW_INCONSISTENT is triggered. Only positive entries are allowed in field TABPOS. Accordingly, the fields from DD27P_TAB are stored in the order given by OBJPOS and the selection conditions are stored in DD28V_TAB in the order defined by POSITION.
  4. The entries in DD28J_TAB, which have the entry 'F' in the field SOURCE, are ignored during writing since they represent the expansion of the foreign key relationships kept in DD26V_TAB.
  5. The revised (or new) version of the view which was written can be activated by calling the function module DDIF_VIEW_ACTIVATE.

Further information





Parameters

DD09L_WA
DD25V_WA
DD26V_TAB
DD27P_TAB
DD28J_TAB
DD28V_TAB
DD35V_TAB
DD36M_TAB
NAME

Exceptions

NAME_INCONSISTENT
PUT_FAILURE
PUT_REFUSED
VIEW_INCONSISTENT
VIEW_NOT_FOUND

Function Group

SDIF

ROGBILLS - Synchronize billing plans   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 5003 Date: 20240523 Time: 090524     sap01-206 ( 103 ms )