SAP Database - The Unofficial SAP Knowledge Base

Free Business and Tech Magazines and eBooks

CREATE : ABAP Keyword a day

Print This Post Email This Post Written by admin on Dec 3rd, 2007 | Filed under: ABAP Keywords

CREATE
Basic form
CREATE OBJECT obj class.
Addition
… LANGUAGE langu
Effect
Generates an object of the class class .


To address an OLE automation server (e.g. EXCEL) from ABAP/4 , the server must be registered with SAP. The transaction SOLE allows you to assign an automation server to a class.
The CREATE statement generates the initial object and this can be processed further with the relevant key words.
The return code value of SY-SUBRC indicates the result of the generation:

The return code value is set as follows:

SY-SUBRC = 0 Object successfully generated.
SY-SUBRC = 1 SAPGUI communication error.
SY-SUBRC = 2 SAPGUI function call error. The OLE function modules are implemented only under Windows.
SY-SUBRC = 3 The OLE API call resulted in an error; this is possibly a storage space problem.
SY_SUBRC = 4 The object is not registered with SAP.
Addition
… LANGUAGE langu
Effect
Determines the language chosen for method and attribute names of the object class.
If no specification is made, English is the default.

CREATE OBJECT
Example
Generate an EXCEL object.

INCLUDE OLE2INCL.
DATA EXCEL TYPE OLE2_OBJECT.
CREATE OBJECT EXCEL ‘Excel.Application’.

Related
SET PROPERTY
GET PROPERTY
CALL METHOD
FREE OBJECT
———————
ABAPer, mail: abap.community@gmail.com http://abaplearner.blogspot.com

If you like this post, you may as well like these too:

  1. ABAP Keyword a day : ADD ADD Variants: 1. ADD n TO m. 2. ADD n1 THEN n2 UNTIL nz GIVING m. [...]...
  2. ADD-CORRESPONDING : ABAP Keyword a day ADD-CORRESPONDING Basic form ADD-CORRESPONDING rec1 TO rec2. Effect Interprets rec1 and rec2 as field strings. If, for example, rec1 and rec2 are tables, executes the statement for their header...
  3. AT : ABAP Keyword a day AT Events in lists- AT LINE-SELECTION.- AT USER-COMMAND.- AT PFn.Events on selection screens- AT SELECTION-SCREEN.Control break with extracts- AT NEW f.- AT END OF f.- AT FIRST.- AT LAST.- AT...
  4. CNT : ABAP Keyword a day CNT Basic form… CNT(h) …EffectCNT(h) is not a statement, but a field which is automatically created and filled by the system if f is a sub-field of an extract dataset...
  5. DO : ABAP Keyword a day DO Variants 1. DO. 2. DO n TIMES. Variant 1 DO. Addition … VARYING f FROM f1 NEXT f2 Effect Repeats the processing enclosed by the DO and ENDDO statements...



This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Reply

  • Subscribe to RSS

  • Free Ebooks