Create draft document of stock transferences

I created a draft document of transferences of stock with SDK.
Code header:
Dim sboTransferDraft As SAPbobsCOM.Documents             sboTransferDraft = SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
sboTransferDraft.DocObjectCodeEx = "67"
sboTransferDraft.CardCode = "C00001"
sboTransferDraft.DocDate = Now
sboTransferDraft.TaxDate = Now
sboTransferDraft.Comments = "Comments"
Line code
sboTransferDraft.Add
But I do not obtain to modify the warehouse origin.
somebody can help me?
thanks

Hi Sérgio ,
I have tried your problem and also couln't solve it. It looks like the Warehouse value is written to the Filler field in the drafts table (ODRF), but that field does not seem to be exposed via the documents object.
Hope it helps,
Adele

Similar Messages

  • How to create Draft Document in CR

    Hi all,
    I try to create draft document in CR using store procedure script.
    So i can preview the document if it's in draft mode and non draft mode.
    When i preview it in draft mode , every thing is ok
    But when i preview it in non draft mode, the draft and non draft data combine together.
    Here is my code
    Create Procedure PO
    @Dockey numeric(19,6)
    @ObjectId numeric(19,6)
    as
    begin
    select PO.* from
      select 'DR' as tipedoc,ODRF.DocNum ,ODRF.DocEntry ,ODRF.CardCode,ODRF.CardName,ODRF.ObjType ,
          ODRF.DocDate,TaxDate, DRF1.ItemCode as itemcode, DRF1.Quantity ,DRF1.unitMsr ,
         OITM.ItemName ,OITM.CodeBars
              from          ODRF
              inner join  DRF1 on ODRF.DocEntry = DRF1.DocEntry
              inner join     OITM on DRF1.ItemCode = OITM.ItemCode
         where ODRF.ObjType = 22
    union all
       select 'ND' as tipedoc,OPOR.DocNum ,OPOR.DocEntry ,OPOR.CardCode,OPOR.CardName,OPOR.ObjType ,
          OPOR.DocDate,TaxDate, POR1.ItemCode as Itemcode, POR1.Quantity ,POR1.unitMsr ,
         OITM.ItemName ,OITM.CodeBars
              from          OPOR
              inner join  POR1 on OPOR.DocEntry = POR1.DocEntry
              inner join     OITM on POR1.ItemCode = OITM.ItemCode
    )PO
    where PO.docentry = @Dockey
    and PO.Objtype = @ObjectId
    end
    Do i miss some thing in my code
    Thanks in advance
    Regards
    Kahkian

    Hello, I think something more efficent could be like this: (ignore the RFQ calculation as it is for integration with an external database other than SAP Business ONE)
    create
    procedure SP_PO_FORMAT
    @DOCKEY
    INTEGER,
    @OBJECTID
    INTEGER
    AS
    if
    @OBJECTID = 112 begin
    select
    t0.docentry,T0.docnum,T0.lictradnum,T0.address,T0.address2, T0.CardCode, T0.CardName, T0.DocDate, T0.DocDueDate, T0.comments,T2.slpname,T3.officetel,T3.email,T4.pymntgroup,T5.firstname, T5.lastname, T5.E_MailL, T5.tel1,
    case
    when T0.doccur = 'USD' THEN T0.DocTotalFC ELSE T0.DocTotal END AS DOCTOTAL, case when T0.doccur = 'USD' THEN T0.vatsumfc ELSE T0.vatsum END AS vatsum,T0.DocCur,
    case
    when T0.Comments like 'Basada en Cotizacion a Proveedores%' then
    case when ISNUMERIC(SUBSTRING(T0.comments,36,CHARINDEX('.',T0.comments,1)-36)) = 1
    then convert(int,SUBSTRING(T0.comments,36,CHARINDEX('.',T0.comments,1)-36))
    else
    case when T0.Comments like 'Basada en solucitud de eProcurement%'
    then
    case when ISNUMERIC(SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37)) = 1
    then convert(int,SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37))
    else 0
    end
    else 0
    end
    end
    else
    case
    when T0.Comments like 'Basada en solucitud de eProcurement%'
    then
    case when ISNUMERIC(SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37)) = 1
    then convert(int,SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37))
    else 0
    end
    else 0
    end
    end
    as rfq,
    T1
    .LineNum,
    T1
    .ItemCode, T1.Dscription, T1.freetxt,T1.unitmsr,T1.Quantity,T1.packqty, T1.Price, T1.vatprcnt,case when T0.doccur = 'USD' THEN T1.totalfrgn else T1.linetotal end as linetotal from sbo_mno.dbo.ODRF T0
    inner
    join sbo_mno.dbo.DRF1 T1 on T0.DocEntry = T1.DocEntry
    left
    join OSLP T2 on T0.slpcode = T2.slpcode
    left
    join OHEM T3 on T2.slpcode = T3.salesprson
    left
    join OCTG T4 on T0.groupnum= T4.groupnum
    left
    join OCPR T5 on T0.cntctcode = T5.cntctcode
    where
    T0.Docentry = @DOCKEY
    END
    ELSE
    select
    t0.docentry,T0.docnum,T0.lictradnum,T0.address,T0.address2, T0.CardCode, T0.CardName, T0.DocDate, T0.DocDueDate, T0.comments,T2.slpname,T3.officetel,T3.email,T4.pymntgroup,T5.firstname, T5.lastname, T5.E_MailL, T5.tel1,
    case
    when T0.doccur = 'USD' THEN T0.DocTotalFC ELSE T0.DocTotal END AS DOCTOTAL, case when T0.doccur = 'USD' THEN T0.vatsumfc ELSE T0.vatsum END AS vatsum,T0.DocCur,
    case
    when T0.Comments like 'Basada en Cotizacion a Proveedores%' then
    case when ISNUMERIC(SUBSTRING(T0.comments,36,CHARINDEX('.',T0.comments,1)-36)) = 1
    then convert(int,SUBSTRING(T0.comments,36,CHARINDEX('.',T0.comments,1)-36))
    else
    case when T0.Comments like 'Basada en solucitud de eProcurement%'
    then
    case when ISNUMERIC(SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37)) = 1
    then convert(int,SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37))
    else 0
    end
    else 0
    end
    end
    else
    case
    when T0.Comments like 'Basada en solucitud de eProcurement%'
    then
    case when ISNUMERIC(SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37)) = 1
    then convert(int,SUBSTRING(T0.comments,37,CHARINDEX('.',T0.comments,1)-37))
    else 0
    end
    else 0
    end
    end
    as rfq,
    T1
    .LineNum,
    T1
    .ItemCode, T1.Dscription, T1.freetxt,T1.unitmsr,T1.Quantity,T1.packqty, T1.Price, T1.vatprcnt,case when T0.doccur = 'USD' THEN T1.totalfrgn else T1.linetotal end as linetotal from sbo_mno.dbo.OPOR T0
    inner
    join sbo_mno.dbo.POR1 T1 on T0.DocEntry = T1.DocEntry
    left
    join OSLP T2 on T0.slpcode = T2.slpcode
    left
    join OHEM T3 on T2.slpcode = T3.salesprson
    left
    join OCTG T4 on T0.groupnum= T4.groupnum
    left
    join OCPR T5 on T0.cntctcode = T5.cntctcode
    where
    T0.Docentry = @DOCKEY

  • Adding Period Indicator to New Year after creating draft documents in New Y

    Hi,
    I want to restart the the numbering from 1 in the New Year and so want to attach a new Period Indicator to the New Year. But i am unable to Add Period Indicator to New Year. It was created with Default Period Indicator and is not allowing any change.
    I am in SBO 2005 PL38. Also pleas note, some drafts have been created in the New Year.
    What i tried:
    - I tried deleting the draft documents. No use.
    - I changed server date to March 31(previous Accounting Year). No use.
    Anybody can help?
    Regards
    Manish

    Hi Manish,
    Let me see if i understood your issue;
    You are unable to creat a new period indicator for the new numbering series, did you already creat a new posting period for the new year ?
    The drafts created in the new year are with the default period indicator ? if so can you change it and try to delet those drafts ?
    if you have opportunity please provide more information.
    Regards
    Emanuel

  • Error in creating delivery document from stock transport order

    hi sd gurus plz help i m nt able to create delivery in vl10b from stock transport order me21n after giving shipping point and  po number also. can u help me out and can u tell me how to maintain copy control from stock tarnsport to delivery docu.

    Hi Debesh,
    The settings for Delivery type for STO is maintained using the following path:
    Materials Management>Purchasing>Purchase Order>Set up Stock Transport Order>Assign Delivery Type and Checking Rule . Here you assign the Delivery type to Stock Transport order (with reference of Suplying Plant)
    For creation of STO for delivery creation use T-code- VL04. Enter the Relevant Shipping Point and the Delivery Creation Date. Also tick mark the option Purchase order. If you already have a Purchase order enter the no.
    System will show the details of the STO here by using the Main Menu > Delivery> Create Deliveries you can create the Delivery against the STO. Then by using the VL02n option you can do the Picking / PGI for the Delivery.
    Hope the above helps you.
    REWARD if it helps you!!
    Regards,
    Ajinkya

  • Intercompany stock transfer: IV billing documents creates FI document with

    Hi,
    Intercompany stock transfer: IV billing documents creates FI document with wrong vendor.
    How can I make sure that the correct vendor is posted in the selling company code?
    Best regards,
    Eric.

    Hi Jürgen,
    I also tried this option but then the following error appeared:
    "Message no. F5598: Posting keys for account determination for transaction BUV do not exist".
    Some point is forcing the PGI to ask for BUV operation (Tx. OBYA).
    Thank you for your contribution.

  • Identify the source of Creating a Draft Document

    Hi Everybody,
                        Anybody know how to identify a Draft generated by the wizard than other generated by the user (creating a document as a Draft) in the ODRF table, property DATASOURCE???
    Thanks!!

    Datasource field only identifies whether an  entry made through user interface or by some add on etc, since you are using the user interface, i dont' think any field exactly identifies, if the record was created by user or through some wizard.
    Though in some particular transactions, it does stores that the record was created by a wizard. For example, in production order, it does identifies that the record was created by MRP wizard.
    If you can be more elaborate regarding which documents you're trying to check, perhaps some exact way could be find out.
    Rahul

  • Print Draft Document using Crystal Report in SAP 8.8

    I created a Crystal Report Layout using SQL View as data source for AR Invoice which prints out fine. (everthing on 1 page)
    To print Draft Invoice, I copied the view to use ODRF/RDF1 instead of OINV/INV1, copied the Crystal report and updated the data source to the new view. When print Draft Invoice, it prints 3 pages - page 1 blank, page 2 just the "DRAFT" watermark, page 3 the crystal report without watermark.
    Steps to print Draft Invoice: Sales-A/R > Sales Report > Document Drafts Report > Open selected Draft Invoice document > File > Select Layout and Print...
    What is happening behind the scene when printing Draft documents? What is the correct way to print Drafts (e.g. special settings designing Crystal Reports)?
    Thanks,
    Grace

    Thank you for your reply. It works in this specific report.
    But we have both PLD and Crystal Report in the system, changing the settings means the PLD will lose their watermark...
    Also, I don't know how the Draft is displayed, but when select Print Preview for Draft, it's asking for parameter (DocEntry), which I have setup a DocKey@ in Crystal Report and set it in the Selection Manager. Does SAP provide DocEntry in Draft Invoice (ODRF) the same way as in Invoice (OINV)?
    Thanks,
    Grace

  • Error while creating purchasing documents

    Hi,
    Iam a new user to Material Management unable to create any Purchasing docments (PR,RFQ,P.o..etc).
    As Iam trying to procure a material for stock, selected the Accountassignment as Unknown.
    got following two errors
    1.Unknown account assignment not defined for use here
    2.Source not included in list despite sorce list requirement
    pls suggest me something to avoid these errors and create P.Os.
    Thanks

    Hi,
    I got some clue ,
    1. As I have specified it is a stock material, It should not ask for any account assignment.
    It is asking because I have not updated the material quantity,value updations in IMG settings for the material type
    2.The issue was I have checked the source list for plant in the sorce list configuration settings (SPRO> Materials management>Purchasing>Sourcelist>Define source list requirement at plant level)
    And I have not maintained the source list.
    If you check the above setting, you need to maintain source list for the material
    As you specified I have checked the configuration for combination item category-account assignment for item category that was used when creating purchasing document.
    for standard itemcategory,unknown account assignment type has been defined.
    Now I could able to create P.Os for stock material by updating qty,value updation in material type, and if I don't update this, and use account assingment as unknown I'm getting the saemerror as "unknown account assignment not defind for use here"
    pls let me know how to avoid this error, hep me what are the required settings for making a P.O for accountassignment categories
    Thanks

  • Draft documents for Sales return and Goods return

    Morning, Exports,
    I got two questions, pls kindly help!
    1) The draft documents regually if not with approval process, can be removed from draft list, but once it's with approved process, the "approved" draft document can't be removed. How to have it deleted from the list of draft documents?  As there are two many drafts and we need to take them out once its data was adding into system....
    2) Where we can see the serial# that picked for the draft document?
    Thanks!
    Emily

    Here are the answers ---
    1) The draft documents regually if not with approval process, can be removed from draft list, but once it's with approved process, the "approved" draft document can't be removed. --> TRUE
    How to have it deleted from the list of draft documents? --> NOT POSSIBLE FOR DRAFT DOCUMENTS
    As there are two many drafts and we need to take them out once its data was adding into system.... --> USE THE "OPEN ONLY" OPTION TO AVOID THE CLOSED / UNNECESSARY DRAFT DOCS.
    2) Where we can see the serial# that picked for the draft document? -->  GO TO ANY MODULE -> REPORTS -> "Document Drafts Report" --> Document No. [BUT THIS NO. WILL NOT TAKEN IF ANY DOCUMENT IS CREATED AFTER THIS DRAFT OF THE SAME DOCUMENT TYPE. THE FINAL NO. WILL BE THE LAST NO. + 1 OF A PARTICULAR DOCUMENT TYPE]

  • Create draft incoming payments

    Hi all,
    i am having great difficulty in creating draft incoming payments through the DI, whatever I seem to do I cannot see the sort of properties that the help files say are there e.g. .cashsum .transferaccount etc. The only propoerties that are shown are the ones for marketing documents. I have tried all combinations of the two sets of code below but nothing seems to work,
      Dim DraftPay As SAPbobsCOM.Documents = GetDIConnection.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)
      DraftPay.DocObjectCode = SAPbobsCOM.BoObjectTypes.oIncomingPayments
    Dim DraftPay As SAPbobsCOM.Documents = GetDIConnection.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPaymentsDrafts)
      DraftPay.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPaymentsDrafts
    In trying to fix this issue i have given up on the idea of creating a draft and tried to create a simple incoming payment but i hit the same issue. Whatever I seem to do I only get the option to use marketing document properties.
    Am I missing something obvious or has someone else hit this issue (I am using V2007 by the way)
    Any help would be appreciated as we begin training on this system in two weeks!
    Gordon

    Hi,
    you create payments like
    vb6 samples:
    Dim oPay As SAPbobsCOM.Payments
    Set oPay = vCompany.GetBusinessObject(oIncomingPayments)
    Set oPay = vCompany.GetBusinessObject(oVendorPayments)
    Set oPay = vCompany.GetBusinessObject(oPaymentsDrafts)
    for drafts you also have to set:
    oPay.DocObjectCode = bopot_IncomingPayments
    or
    oPay.DocObjectCode = bopot_OutgoingPayments 
    i hope it helps
    lg David

  • DropDown Actions within Action "Create Draft" (SRM 7.0)

    Hi,
    within Soucing Cockpit exists the button (Step2)
    Create DRAFT
    While pushing the button, a drop down list appears with the possible follow on documents:
    Auction
    Contract
    Purchase Order
    RFQ
    I just want to use (show)Contract and Purchase Order.
    Question:
    How can I change the possible values within this dropw down list?
    I cant find a feeder, SE80 configurator for the respective Web dynpro application does not help either.
    Any hints how I can choose the possible values within the drop down list (for example the relevant method, function module)?
    Thanks and regards
    Andreas

    You could enhance webdynpro component /SAPSRM/WDC_DO_SOCO_GAF_2.

  • Can pending draft document edit by approvals?

    Hi all expert,
    I would like to ask your about the pending draft document. Can it be allow edit by approvals(The person who allow approve the document)?
    Example:
    new Purchase Order create by originator, when the approvals received the message & want to revised the amount in the purchase order. Can he/she amend the document amount or quantity?
    It doesn't make sense where the manager cannot revise the document created by users. Right?
    Regards,
    Eric Tan

    Hi
    I think so .He can take a look from alert window and make necessary change and post it .
    I think in alert window ,you need to dbl click on the message and you will see the doocument number and you can link to document and make some changes and post it .
    I donot have test environment to test but i think it should be fine .
    Originator cannot make changes in the document while it is in process . That's for sure.
    Thank you
    Bishal
    Hi Bishal,
    I had test before. It doesn't work.
    Regards,
    Eric Tan
    Edited by: Eric Tan Yan Liang on Apr 13, 2009 4:42 AM

  • How to create accounting document in customer consignment process?

    Hi,
        We have one kind of business like customer consignment process. We want to use sales document KB + KE to achieve. But we need to create one accounting document like below when we transfer goods from our stock to customer consignment stock, i.e. movement type 631
    Dr: Consigned finished goods
        Cr: Goods sold in stock
    and when using movement type 633, we want to create accounting document like below,
    Dr: Operation costs
        Cr: Consigned finished goods
        How can i manage to configure it?
    Thanks,
    Wesley

    Hi Wesley
    Consignment having 4 steps which includes
    Consignment Fill up - Order , Delivery Only
    Consignment Issue - Order , Delivery , Billing & Accounting Document
    Consignment Pickup - Order , Delivery only
    Consignment Return - Return Order , Return Delivery & P.G.R., Credit Memo Request, Credit Note & A/C Doc.
    So in Consignment Issue & Consignment Returns Accounting document are generated.
    When you transfer the goods it comes in Consignment Issue so accounting documents are also been generated.
    I thik so it will be helpful for you.
    Thanks
    Shobhit Gautam

  • How to remove options under Create Draft in SOCO SRM 7.13 SP01

    Hi All,
    We have a requirement to remove the option like Rfx,Contract and Auctions under Create Draft on the below screen.We checked the WD component /SAPSRM/WDC_DO_SOCO_GAF_2 for it but did not get much to delete these options.,Kindly provide your expert help to resolve this issue.
    Let me know if you need any other details.
    Thanks,
    Ankur

    Hello,
    do not know if it also works with SRM 7.13, but check this below blog:
    Restricting draft document types in SRM 7 sourcing cockpit
    Regards.
    Laurent.

  • Save as draft - Document Number

    hi experts,
    Can we reserve a document number for draft document?
    I added a Purchase Order (draft) and then i created another PO but for this PO i want its number to auto-start with 2.
    Document No 1 is reserved for Draft PO.
    Is that possible?
    I do not want to use Manual Numbering.
    Thank you.
    Regards,
    Lim

    Hi
    Its not possible.if u have post one more doc. then system will increment the no. from the last post doc. no. only..
    for ex: last doc no is 100.
    u r saving a doc. as draft it no. will be 101.
    then when u r posting one more doc. the no will be 101 only ...
    now if u posted the draft doc. then no will be 102..
    Giri

Maybe you are looking for

  • I2C interface (Sensor Data Acquisition) LabVIEW

    Hi all! Hope you are doing great! Well I have a question which is more about asking all you for an idea! The Situation: I have a circuit board which has an On-Off Valve, Digital pressure sensors (manufacturer AMD) and Humidity/Temperature Sensors (ma

  • How to use macbook air reinstall drive

    What keys do I need to hit when computer is starting up w/ reinstall drive?

  • Is Credit Check Per Line Item in Sales Order  Possible?

    Dear All, Hope you all are doing well !!! Infact i am currently implementing OPM and SCM modules for a CSD (carbonated soft drinks) industry. They have a specific requirement on Credit Management. Please look at the Requirement Below. Credit Manageme

  • Error while loading period dimension in planning through DIM

    Hi, I am trying to load the metadata extracted from DRM into Period dimension in Hyperion Planning through Informatica using DIM. But I am getting the following error: Record [[YearTotal, Period, Total Year, Dynamic Calc, 0, null, null, null, null, U

  • IPhoto library-file deleted - and originals missing in Aperture....

    Just moved my Aperture-library to my new iMac. Unfortunately almost all pics came from my old iPhoto-library which is gone now. I can't do anything but look at the pictures. Can't edit, export, share etc. When trying to e.g. export a file Aperture sa