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

Document number generated from function module K_COSTS_PLAN_INTERFACE_TOTAL

Former Member
0 Likes
1,874

Dear friends,

I am using function module K_COSTS_PLAN_INTERFACE_TOTAL to upload the Planning costs, After this function module call I need the document number generated for that item, but there is no return parameter from this function module which would give me the document number generated. Please let me know how to get the document number after this function module call.

2 REPLIES 2
Read only

Former Member
0 Likes
740

Hi...

Try this function module..


CALL FUNCTION 'BAPI_DOCUMENT_GETLATEST2' "
  EXPORTING
    documenttype =              " bapi_doc_aux-doctype  Document type
    documentnumber =            " bapi_doc_aux-docnumber  Document number
    documentpart =              " bapi_doc_aux-docpart  Documentation - text lines
    documentversion =           " bapi_doc_aux-docversion  Document version
    multilevelexplosion = 'X'   " bapi_doc_aux-flag  Document management indicator
*   docbomchangenumber = SPACE  " bapi_doc_draw2-ecnumber  Change number
*   docbomvalidfrom = SY-DATUM  " bapi_doc_draw2-validfromdate  Valid-From Date
*   docbomrevisionlevel = SPACE  " bapi_doc_draw2-revlevel  Revision level
*   loadlatest = 'X'            " bapi_doc_aux-flag  Document management indicator
*   loadlatestreleased = 'X'    " bapi_doc_aux-flag  Document management indicator
*   search_new_maindoc = SPACE  " bapi_doc_aux-flag  Document management indicator
*   getdocdata = SPACE          " bapi_doc_aux-flag  Document management indicator
*   getobjectlinks = SPACE      " bapi_doc_aux-flag  Document management indicator
*   getdocdescriptions = SPACE  " bapi_doc_aux-flag  Document management indicator
*   getlongtexts = SPACE        " bapi_doc_aux-flag  Document management indicator
*   getstatuslog = SPACE        " bapi_doc_aux-flag  Document management indicator
*   getdocfiles = SPACE         " bapi_doc_aux-flag  Document management indicator
*   getcomponents = SPACE       " bapi_doc_aux-flag  Document management indicator
*   getclassification =         " bapi_doc_aux-flag  Document Management Indicator
*   getstructures =             " bapi_doc_aux-flag  Document Management Indicator
*   getwhereused =              " bapi_doc_aux-flag  Document Management Indicator
*   sortf_exclude = SPACE       " stpox-sortf   Sort string
*   sortf_stop_expl = SPACE     " stpox-sortf   Sort string
*   expl_docs_only_once = 'X'   " bapi_doc_aux-flag  Document management indicator
*   stop_on_first_error = SPACE  " bapi_doc_aux-flag  Document Management Indicator
  IMPORTING
    return =                    " bapiret2      Return parameter
    newversion =                " bapi_doc_aux-docversion  Document version
  TABLES
    docstructure =              " stpox         BOM Items (Extended for List Displays)
*   changedversions =           " tchg_vers     Table for Transferring Changed Document Versions
*   statuslist =                " tstate_order  Sequence of Status Check
*   documentdata =              " bapi_doc_draw2  BAPIS DMS: document data
*   objectlinks =               " bapi_doc_drad_keys  BAPIS DMS: document data
*   documentdescriptions =      " bapi_doc_drat_keys  BAPIS DMS: document data
*   longtexts =                 " bapi_doc_text_keys  BAPIS DMS: document data
*   statuslog =                 " bapi_doc_drap_keys  BAPIS DMS: document data
*   documentfiles =             " bapi_doc_files2_keys  BAPIS DMS: document data
*   components =                " bapi_doc_comp_keys  BAPIS DMS: document data
*   all_returns =               " bapiret2      Return Parameters
*   characteristicvalues =      " bapi_char_values_keys  BAPI Structure for Characteristic Value Assignment (Docs)
*   classallocations =          " bapi_class_allocation_keys  BAPI Structure for the Assignment of Classes to Several Objects
*   documentstructures =        " bapi_doc_structure_keys  BAPIs DMS: Structure Data for Several Documents
*   whereusedlists =            " bapi_doc_structure_keys  BAPIs DMS: Structure Data for Several Documents
    .  "  BAPI_DOCUMENT_GETLATEST2

And also check this link..

Hope this will help you..

Regards,

Jhings

Read only

0 Likes
740

Hi Jhings,

Thanks for your reply, but i am not looking for the DMS document number, instead I am looking for the CO document number which gets generated after posting the planning cost.