2013 May 17 12:31 PM
Hello Experts,
I have a requirement where i am uploading documents using BAPI_DOCUMENT_CREATE2.
Here I have to upload Characteristics value which is there in tcode CV01N > Additional Tab. Following are the fields i need to update in transaction CV01N:
1. Department Name
2. Drawing Type
3. Region Name
4. Sub Station
5. Voltage Rating
6. Current Rating
7. Fault Current Value
For this i am trying to pass value in BAPI_CHARACTERISTIC_VALUES structure . But not able to achive the result.
BAPI_CHARACTERISTIC_VALUES-CHARVALUE = wa_data-atwrt_Dept.
append BAPI_CHARACTERISTIC_VALUES.
Please guide me on this.
Thanks.
2013 May 17 2:00 PM
Hi Prachi ,
Pass these two parameter values for Classification in above BAPI.
CHARACTERISTICVALUES
CLASSALLOCATIONS
Like ..
DATA : S_CHARA LIKE BAPI_CHARACTERISTIC_VALUES OCCURS 0 WITH HEADER LINE,
S_CLASSA LIKE BAPI_CLASS_ALLOCATION OCCURS 0 WITH HEADER LINE .
S_CHARA-CLASSTYPE = '017' . " Pass Class Type this sample data
S_CHARA-CLASSNAME = ' PROE_ELECTRIC' . " Class Name
S_CHARA-CHARNAME = 'Capacitance' . " Characteristics Name
S_CHARA-CHARVALUE = ' abc ' . " Characteristics Value
APPEND S_CHARA.
Same as in S_CLASSA for Respective field's Value .
S_CLASSA- CLASSTYPE = ' '
S_CLASSA- CLASSNAME = ' '
S_CLASSA- STATUS = ' '
S_CLASSA- STANDARDCLASS = ' '
APPEND S_CLASSA .
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
DOCUMENTDATA =
..................................................................
.................................................................
TABLES
CHARACTERISTICVALUES = S_CHARA
CLASSALLOCATIONS = S_CLASSA .
call BAPI_TRANSACTION_COMMIT .
Regard's
Smruti
Hello Experts,
I have a requirement where i am uploading documents using BAPI_DOCUMENT_CREATE2.
Here I have to upload Characteristics value which is there in tcode CV01N > Additional Tab. Following are the fields i need to update in transaction CV01N:
1. Department Name
2. Drawing Type
3. Region Name
4. Sub Station
5. Voltage Rating
6. Current Rating
7. Fault Current Value
For this i am trying to pass value in BAPI_CHARACTERISTIC_VALUES structure . But not able to achive the result.
BAPI_CHARACTERISTIC_VALUES-CHARVALUE = wa_data-atwrt_Dept.
append BAPI_CHARACTERISTIC_VALUES.
Please guide me on this.
Thanks.
2013 May 17 1:09 PM
Hi,
Please refer the FM Documentation and see whether you are passing all the parameters correctly.
Dokument anlegen
You can use this function module to create documents and all data that belongs to it.
You can create a document info record with the following data:
You can also check in the original application files into the SAP database, vault, or archive.
The objects of engineering change management (DOC_BOM_CHANGE_NUMBER DOC_BOM_VALID_FROM oder DOC_BOM_REVISON_LEVEL) relate only to the processing of the document structure. If no additional information for the change object is given, the items in the table document structure apply as the new status of the structure for the current date........... Restrictions: The document key fields are equally keys for the BOM items, which means that a document may not be used for several items.
Restrictions:
**..... Document data
DATA: ls_doc LIKE bapi_doc_draw2.
**..... Bapi-Returnstruktur
ls_return LIKE bapiret2.
**.... Key feilds of the document
DATA: lf_doctype LIKE bapi_doc_draw2-documenttype,
lf_docnumber LIKE bapi_doc_draw2-documentnumber,
lf_docpart LIKE bapi_doc_draw2-documenttype,
lf_docversion LIKE bapi_doc_draw2-documenttype.
**.... Originals that are checked in simultaneously
DATA: lt_files LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
**.... Short texts
lt_drat LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE,
**.... Object links
lt_drad LIKE bapi_doc_drad OCCURS 0 WITH HEADER LINE.
**----------------------------------------------------------------------
** Allcoate document data
ls_doc-documenttype = 'DRW'.
ls_doc-documentnumber = '4711'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-statusextern = 'AF'.
ls_doc-laboratory = '001'.
** Check in original 1 simultaneously in the SAP Database
REFRESH lt_files.
CLEAR lt_files.
lt_files-storagecategory = 'SAP-SYSTEM'.
lt_files-docfile = 'c:\temp\drawing.txt'.
lt_wsapplication = 'TXT'.
APPEND lt_files.
lt_files-storagecategory = 'VAULT'.
lt_files-docfile = 'c:\temp\drawing.dwg'.
lt_wsapplication = 'DWG'.
APPEND lt_files.
lt_files-storagecategory = 'SAP-SYSTEM'.
lt_files-docfile = 'c:\temp\drawing.ppt'.
lt_wsapplication = 'PPT'.
APPEND lt_files.
** Short texts
CLEAR lt_drat.
REFRESH lt_drat.
** German short text
lt_drat-language = 'DE'.
lt_drat-description = 'Getriebe'.
APPEND lt_drat.
** English short text
lt_drat-language = 'EN'.
lt_drat-description = 'gear'.
APPEND lt_drat.
** Object link to material master
CLEAR lt_drad.
REFRESH lt_drad.
lt_drad-objecttype = 'MARA'.
lt_drad-objectkey = 'M4711'.
APPEND lt_drad.
* ---------------------------------------------------------------------
* Create document
* ---------------------------------------------------------------------
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING: documentdata = ls_doc
IMPORTING: documenttype = lf_doctype
documentnumber = lf_docnumber
documentpart = lf_docpart
documentversion = lf_docversion
return = ls_return
TABLES: documentdescriptions = lt_drat
objectlinks = lt_drad
documentfiles = lt_files.
** Did an error occur ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
You can insert the following data in addition to document data:
Regards,
Amit
2013 May 17 2:00 PM
Hi Prachi ,
Pass these two parameter values for Classification in above BAPI.
CHARACTERISTICVALUES
CLASSALLOCATIONS
Like ..
DATA : S_CHARA LIKE BAPI_CHARACTERISTIC_VALUES OCCURS 0 WITH HEADER LINE,
S_CLASSA LIKE BAPI_CLASS_ALLOCATION OCCURS 0 WITH HEADER LINE .
S_CHARA-CLASSTYPE = '017' . " Pass Class Type this sample data
S_CHARA-CLASSNAME = ' PROE_ELECTRIC' . " Class Name
S_CHARA-CHARNAME = 'Capacitance' . " Characteristics Name
S_CHARA-CHARVALUE = ' abc ' . " Characteristics Value
APPEND S_CHARA.
Same as in S_CLASSA for Respective field's Value .
S_CLASSA- CLASSTYPE = ' '
S_CLASSA- CLASSNAME = ' '
S_CLASSA- STATUS = ' '
S_CLASSA- STANDARDCLASS = ' '
APPEND S_CLASSA .
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
DOCUMENTDATA =
..................................................................
.................................................................
TABLES
CHARACTERISTICVALUES = S_CHARA
CLASSALLOCATIONS = S_CLASSA .
call BAPI_TRANSACTION_COMMIT .
Regard's
Smruti
2013 May 22 6:59 AM
2015 Feb 02 2:32 PM
Hi All,
I am trying to update class chararestics using BAPI_DOCUMENT_CREAT2. Document is getting generated but the class characteristics are not getting update in the document.
I have passed the below parameters.
*- Class type-017
ls_charvalues-classtype = lc_017.
*- Class name-DIR_REG_CLASS
ls_charvalues-classname = lc_dir_reg_class.
APPEND ls_charvalues TO t_charvalues.
CLEAR ls_charvalues.
*- Reg model
IF NOT <ls_final>-reg_model IS INITIAL.
ls_charvalues-charname = lc_reg_model.
ls_charvalues-charvalue = <ls_final>-reg_model.
APPEND ls_charvalues TO t_charvalues.
CLEAR ls_charvalues.
ENDIF.
*- Class allocation classtype
ls_classalloc-classtype = lc_017.
*- Class allocation classname
ls_classalloc-classname = lc_dir_reg_class.
**- Class allocation status
* ls_classalloc-status = lc_1.
**- Class allocation standard class
* ls_classalloc-standardclass = 'X'.
APPEND ls_classalloc TO t_classalloc.
CLEAR ls_classalloc.
*- Original type
ls_docfiles-originaltype = lc_1.
*- Storage category
ls_docfiles-storagecategory = lc_zemc_hrc.
*- Application
ls_docfiles-wsapplication = <ls_final>-att_type.
*- Original of the document
ls_docfiles-docfile = <ls_final>-file_path.
ls_docfiles-CHECKEDIN = 'X'.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = iv_documentdata
pf_http_dest = lc_saphttpa
pf_ftp_dest = 'SAPFTPA'
defaultclass = 'X'
IMPORTING
DOCUMENTTYPE = ev_documenttype
documentnumber = ev_documentnumber
DOCUMENTPART = ev_documentpart
DOCUMENTVERSION = ev_documentversion
return = ev_return
TABLES
characteristicvalues = t_charvalues
classallocations = t_classalloc
* DOCUMENTDESCRIPTIONS =
objectlinks = t_objectlinks
* DOCUMENTSTRUCTURE =
documentfiles = t_docfiles.
I am getting the below error.
Class type 017, object type DRAW, object ZRG000000000000001000000005500000
Please guide me what parameters to be passed to resolve this error.
Thanks,
Praveen
2020 Jun 23 8:10 PM
Hi All,
I have a small question on DMS.
While creating the document via FM ‘BAPI_DOCUMENT_CREATE2’ its goes into error “document category and documetn discpline required, we have customize the DMS as these two are always to be put as manadtory , how to handle this in progrm.
Please suggest.
Thanks & Regards,
Raj Singh
2024 Dec 21 4:30 AM
I'm having the same problem.
Did you found a solution for this please?
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |