Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

External document Number using BAPI_DOCUMENT_CREATE2

Former Member
0 Likes
850

Hi Experts,

I have a requirement where in some cases i need to give external document number while uploading the data through BAPI_DOCUMENT_CREATE2, But it is still generating internal document number, Could anyone suggest what mistake i am doing in code.

I have written code like dis.

BAPI_DOC_DRAW2-DOCUMENTNUMBER = wa_finaldata-doknr.
BAPI_DOC_DRAW2-DOCUMENTTYPE = wa_finaldata-dokar.
BAPI_DOC_DRAW2-DOCUMENTVERSION = wa_finaldata-dokvr.
BAPI_DOC_DRAW2-DOCUMENTPART = wa_finaldata-doktl.
BAPI_DOC_DRAW2-DESCRIPTION = wa_finaldata-dktxt.
BAPI_DOC_DRAW2-LABORATORY = wa_finaldata-labor.
BAPI_DOC_DRAW2-AUTHORITYGROUP = wa_finaldata-begru.
BAPI_DOC_DRAW2-STATUSEXTERN = wa_finaldata-stabk.
BAPI_DOC_DRAW2-WSAPPLICATION1 = wa_finaldata-dappl.
BAPI_DOC_FILES2-DOCPATH = wa_finaldata-filep1. 
CONCATENATE wa_finaldata-FILEP1 wa_finaldata-DESCRIPTION '

BAPI_DOC_FILES2-DOCFILE = FILE_PATH. 
BAPI_DOC_FILES2-DESCRIPTION = wa_finaldata-description.
BAPI_DOC_FILES2-STORAGECATEGORY = wa_finaldata-storage_cat.
BAPI_CHARACTERISTIC_VALUES-CHARVALUE = wa_finaldata-atwrt_Dept.

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'

  EXPORTING

    documentdata               = BAPI_DOC_DRAW2

*   HOSTNAME                   =

*   DOCBOMCHANGENUMBER         =

*   DOCBOMVALIDFROM            =

*   DOCBOMREVISIONLEVEL        =

*   CAD_MODE                   = ' '

   PF_FTP_DEST                = 'SAPFTPA '

   PF_HTTP_DEST               = 'SAPHTTPA '

   DEFAULTCLASS               = 'X'

IMPORTING

   DOCUMENTTYPE               = doctype

   DOCUMENTNUMBER             = docno

   DOCUMENTPART               = docpart

   DOCUMENTVERSION            = docver

   RETURN                     = BAPI_RETURN

TABLES

   CHARACTERISTICVALUES       = BAPI_CHARACTERISTIC_VALUES

*   CLASSALLOCATIONS           =

*   DOCUMENTDESCRIPTIONS       =

*   OBJECTLINKS                =

*   DOCUMENTSTRUCTURE          =

   DOCUMENTFILES              = BAPI_DOC_FILES2

*   LONGTEXTS                  =

  COMPONENTS                 = BAPI_DOC_COMP

Thanks,

Prachi

3 REPLIES 3
Read only

Former Member
0 Likes
684

Hi,

     Just check with your Functional Consultant and find whether there are only internal assignments or even external assignments are defined for that particular documents in the number ranges.

Thanks & Regards,

Vinay

Read only

0 Likes
684

Hi Vinay,

Thanks for the prompt reply.  I have checked with Functional Consultant. They have done config for external assigmnets , for that particular documents in the number range.

Do let me know any other solution you can suggest.

Thanks,

Prachi.

Read only

Former Member
0 Likes
684

hi

I had check with my functional consultant ,

check once with ur account group/Document type .here they need to give proper settings , like aa external number xx internal number ,so that while u r giving document type and u need external number u need to give aa in document type then system will create external number

this is configaration problem

for better check with ur functional consultant