Sales Order BAPI Extension

Hi,
    We would like to pass custom fields data to Custom screens in VA01 Standard Sales Order. For that we are extending standard BAPI BAPI_SALESORDER_CREATEFROMDAT2 using EXTENSION parameter. We have appended custom structures to VBAKKOZ. VBAKKOZX, BAPE_VBAK,BAPE_VBAKX and able to pass information from portal upto 480 characters using
valuepart1 and valuepart2.
But when we are trying to extend it further, standard sales order BAPI
BAPI_SALESORDER_CREATEFROMDAT2 is going to dump at :
         CALL METHOD cl_abap_container_utilities=>fill_container_c
                        EXPORTING
                           im_value     = da_bape_vbap
                        IMPORTING
                           ex_container =
ch_parex+lenstruc(da_length_bape_vbap)
                        EXCEPTIONS
                           illegal_parameter_type = 1
                           OTHERS                 = 2.
We need to extend it up to 900 chars.
Any help on this will be greatly apprecited.
Thanks
Kalyan

I found shortly after posting my message that the notes had not been correctly applied as the Notes Assistant ended with an error, and the error that resulted in this failure had not been corrected.  The basis folks failed to inform me that this error had occured in applying the notes.  I discovered it through testing.  Had you applied the notes and run into the same error?
When we subsequently corrected for this, the issue with lenstruc went away and everything appears to be OK.  The real problem was that due to the error in the Notes Assistant the updated version of LVBAKTOP with the definition of lenstruc did not get activated.  It was left in a state where it needed an SSCR key to be applied manually, which should all have been handled automatically with SNOTE.
Once this was done and the source was activated, the original error went away.  The two notes seem to have solved the original Unicode issue as well.
We still have this update in the development area only since the CRM enhancements that caused the original problem with an append to the VBAK structure are also still in development.   We will be testing those changes together before moving everything up.  If there are any further issues that come up, I'll let you know.
What I am wondering is if you had a similar problem applying the above notes, since the problem went away for us when the notes to handle the Unicode conversion were properly applied.
Brian
Edited by: Brian Sammond on Jul 24, 2008 10:55 AM

Similar Messages

  • How to change pricing Conditions in Sales order in change sales order bapi

    Hi Experts,
    How to change pricing Conditions in Sales order in change sales order bapi.
    I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
    Thanks in Advance .
    NLN

    HI NLN
      I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
      <b>Import Paramters:</b>
         SALESDOCUMENT - Sales Document Number
         ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
         LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
      <b>Tables:</b>
         CONDITIONS_IN - ITM_NUMBER,
                         COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
                         COND_TYPE,
                         COND_VALUE,
                         CURRENCY.
         CONDITIONS_INX - ITM_NUMBER,
                          COND_COUNT,
                          COND_TYPE,
                          UPDATEFLAG as <b>'U'</b>,
                          CURRENCY.
       Hope i have clarified your query.
    Kind Regards
    Eswar

  • Problem in Sales Order BAPI

    Hi All,
    M using BAPI_SALESORDER_CREATEFROMDAT2 to create Sales Order. It is working fine & creating sales order. But i also want to give Order Quantity in sales order. What is the field name for that in BAPI.
    Thanks in advance....
    Regards
    AK

    Hi AK....
    You  can assign the quantity in table  
    ORDER_SCHEDULES_IN
    you have to assign REQ_QTY in this table for material....
    Here For each material you have to assign Item no....
    like
    010
    020
    with ref to that material gets identified in this table.......
    eg.
    in item table
    item 010 and material no is 0000000001
    and if u wan to give quantity then
    ORDER_SCHEDULES_IN
    itme no 010 and   REQ_QTY = 10
    That will solve your problem
    Regards
    Ashish

  • Return SALES Order BAPI

    Hi,
    I'm passing following values in  BAPI_SALESORDER_CREATEFROMDAT2  bapi for Return sales Order
    it_header-ref_doc = '0090000047'. " Invice Billing Number
    it_header-REFDOC_CAT = 'M'.     " M for Invoice
    it_header-ORD_REASON = '101'.   " 101 stand for Poor Quility
    headerx-ref_doc = 'X'.
    headerx-REFDOC_CAT = 'X'.
    headerx-ORD_REASON = 'X'.
    But it showing below msg why.
    Error  V1  Message No = 761
    'Unpermitted combination of business object BUS2032 and sales doc. category H'
    anything missing or Wrong ?

    the error is coming because the BAPI BAPI_SALESORDER_CREATEFROMDAT2  is meant for only Sales orders(i.e for BUS2032) since in the code it is hardcoded .
    call function 'SD_SALESDOCUMENT_CREATE'
           exporting
                salesdocument           = salesdocumentin
                sales_header_in         = order_header_in
                sales_header_inx        = order_header_inx
                sender                  = sender
                binary_relationshiptype = binary_relationshiptype
                int_number_assignment   = int_number_assignment
                behave_when_error       = behave_when_error
                logic_switch            = logic_switch
                business_object         = 'BUS2032'  "<----hardcoded
                testrun                 = testrun
    if you want to avoid the error. copy the BAPI to ZBAPI and change the Business object to Return order's business object.
    For Return order BUS2102 . so replace that with BUS2102.
    Edited by: Vijay Babu Dudla on Oct 15, 2008 10:22 AM

  • Problem with Sales Order BAPI  Update...Very Very Urgent....Pls Help me out

    I am trying to update the sales order text using "BAPI_SALESORDER_CHANGE" But i am getting an error as " Sold-to party E455 not maintained for sales area E901 C1"
        I passed the sales order no, and the text to be upated and the Update flag is set to "U".
        When i try giving the same values in se37 it updates the sales order text successfully but when i use the same BAPI in the report i am getting the above error. Can anyone pls help me out.

    hi
    the message is very clear that the sold to party ur refering is not from the same sales area. if u have the customer already then extend the same to the said sales area, by common division and distribution channel
    <b>reward points</b>
    Regards

  • AFS Return sales orders BAPI

    Hi ,
          Please help me in the issue . I want a bapi for return sales orders specific to AFS as i am not able to use the normal returns orders bapi BAPI_CUSTOMERRETURN_CREATE.  Can anyone please let me know how to proceed for the same.
    Thanks in advance,

    Hi...
    try by using FM " BAPI_SALESDOCUMENT_CREATE".
    Regards,
    Lokeswari.

  • ISSUE REGARDING SALES ORDER BAPI

    Is "ISM_SALESORDER_CREATEFROMDAT2" function module and
    "BAPI_SALESORDER_CREATEFROMDAT2" function module same for creation of sales order for bapi.
    srinivas

    This is because you are still missing some segments or data.
    Maybe this thread will be helpful:
    BAPI_SALESORDER_CREATEFROMDAT2 to replace VA01, KBETR and NETWR
    You should also check the documentation from transaction BAPI.

  • LSMW Sales Order BAPI : Header & Item Text

    Hi frenz,
           I'm migrating Sales Order data using LSMW with BAPI method. We got four files...
    one for header, one for item, one for header text, one for item text.
    Now my problem is how do i update both header and item text.
    B'cos while assigning structural relations we got only one text structure(E1BPSDTEXT) common for both header and item. So which source structure(whether header_text or item_text) should be assigned to this segment(E1BPSDTEXT)?
    Else is there any other way to update both header and item texts?
    With regards,
    praveen.

    Unfortunately, you cannot assign more than one source structure to a target structure. But you can still manipulate the code. Here is how.
    Let us say your source structure defined for item texts is ITEM_TEXTS. In your field mapping section for E1BPSDTEXT, double click the '__BEGIN_OF_RECORD__' in change mode. It will pop-up a warning message, say 'yes' and proceed. Remove all the coding that is there in this section, but copy the lines to somewhere(say x buffer) before you do that. You will need those lines below. Just add the following lines there.
    if v_transferred_texts = 'X'.
    *-- all the texts are transferred, don't need to process again.
      skip_record.
    endif.
    You need to define 'v_transferred_texts' in the
    '__GLOBAL_DATA__' section as follows.
    data: v_transferred_texts type c.
    Now double click on '_END_OF_RECORD_' in change mode. It will pop-up a warning, but you can say 'yes' and proceed. This will open up the coding window with one line of code in it 'transfer_record.'. Here you need to add your coding as follows.
    *-- move the header texts
    LOOP AT HEADER_TEXTS.
    *-- This should <b>ALWAYS</b> be there
      g_edidd_segnam = 'E2BPSDTEXT000'.
      g_edidd_segnum = '0021'.         
      g_edidd_psgnum = '000001'.       
      g_edidd_hlevel = '02'.           
      clear E1BPSDTEXT.                
    *-- fill each field of the following fields
      E1BPSDTEXT-DOC_NUMBER = SALESHEADER-ORDERNUMBER.
      E1BPSDTEXT-ITM_NUMBER = '000000'.
      E1BPSDTEXT-TEXT_ID    = HEADER_TEXTS-TEXTID.
      E1BPSDTEXT-LANGU      = SY-LANGU.
      E1BPSDTEXT-LANGU_ISO 
      E1BPSDTEXT-FORMAT_COL
      E1BPSDTEXT-TEXT_LINE  = HEADER_TEXTS-TEXT.
      E1BPSDTEXT-FUNCTION   = '005'.
      transfer_record.
    ENDLOOP.
    *-- Now move the item texts
    LOOP AT ITEM_TEXTS.
    *-- This should <b>ALWAYS</b> be there
      g_edidd_segnam = 'E2BPSDTEXT000'.
      g_edidd_segnum = '0021'.         
      g_edidd_psgnum = '000001'.       
      g_edidd_hlevel = '02'.           
      clear E1BPSDTEXT.                
    *-- fill each field of the following fields
      E1BPSDTEXT-DOC_NUMBER = SALESHEADER-ORDERNUMBER.
      E1BPSDTEXT-ITM_NUMBER = ITEM_TEXTS-ITM_NUMBER.
      E1BPSDTEXT-TEXT_ID    = ITEM_TEXTS-TEXTID.
      E1BPSDTEXT-LANGU      = SY-LANGU.
    *  E1BPSDTEXT-LANGU_ISO  =
    *  E1BPSDTEXT-FORMAT_COL
      E1BPSDTEXT-TEXT_LINE  = ITEM_TEXTS-TEXT.
      E1BPSDTEXT-FUNCTION   = '005'.
      transfer_record.
    ENDLOOP.
    *-- set the flag that the texts have been transferred
    v_transferred_texts = 'X'.
    Please let me know how it goes.
    Srinivas

  • Regarding Sales Order Bapi

    Hi Friends,
    I am trying to upload the sales order history from the legacy side using Bapi BAPI_SALESORDER_CREATEFROMDAT2. I am passing all the mandatory values but I am getting an error message "please select sold-to or ship-to party".
    What is that I am missing? Can anybody guide me in this issue.
    Thanks,
    Raj

    Raj,  when calling the BAPI are you passing values in the following table which is in BOLD.  If not, I'm pretty sure that you need to pass the SOLDto and the SHIPto partners in this table.  Please see Srinivas's previous reply also.
    FUNCTION BAPI_SALESORDER_CREATEFROMDAT2.
    **Lokale Schnittstelle:
    *  IMPORTING
    *     VALUE(SALESDOCUMENTIN) LIKE  BAPIVBELN-VBELN OPTIONAL
    *     VALUE(ORDER_HEADER_IN) LIKE  BAPISDHD1 STRUCTURE  BAPISDHD1
    *     VALUE(ORDER_HEADER_INX) LIKE  BAPISDHD1X STRUCTURE  BAPISDHD1X
    *       OPTIONAL
    *     VALUE(SENDER) LIKE  BAPI_SENDER STRUCTURE  BAPI_SENDER OPTIONAL
    *     VALUE(BINARY_RELATIONSHIPTYPE) LIKE  BAPIRELTYPE-RELTYPE
    *       OPTIONAL
    *     VALUE(INT_NUMBER_ASSIGNMENT) LIKE  BAPIFLAG-BAPIFLAG OPTIONAL
    *   VALUE(BEHAVE_WHEN_ERROR) LIKE  BAPIFLAG-BAPIFLAG OPTIONAL
    *    VALUE(LOGIC_SWITCH) LIKE  BAPISDLS STRUCTURE  BAPISDLS OPTIONAL
    *    VALUE(TESTRUN) LIKE  BAPIFLAG-BAPIFLAG OPTIONAL
    *    VALUE(CONVERT) LIKE  BAPIFLAG-BAPIFLAG DEFAULT SPACE
    *  EXPORTING
    *     VALUE(SALESDOCUMENT) LIKE  BAPIVBELN-VBELN
    * TABLES
    *      RETURN STRUCTURE  BAPIRET2 OPTIONAL
    *      ORDER_ITEMS_IN STRUCTURE  BAPISDITM OPTIONAL
    *      ORDER_ITEMS_INX STRUCTURE  BAPISDITMX OPTIONAL
    *      <b>ORDER_PARTNERS STRUCTURE  BAPIPARNR</b>
    *      ORDER_SCHEDULES_IN STRUCTURE  BAPISCHDL OPTIONAL
    *      ORDER_SCHEDULES_INX STRUCTURE  BAPISCHDLX OPTIONAL
    *      ORDER_CONDITIONS_IN STRUCTURE  BAPICOND OPTIONAL
    *      ORDER_CFGS_REF STRUCTURE  BAPICUCFG OPTIONAL
    *      ORDER_CFGS_INST STRUCTURE  BAPICUINS OPTIONAL
    *      ORDER_CFGS_PART_OF STRUCTURE  BAPICUPRT OPTIONAL
    *      ORDER_CFGS_VALUE STRUCTURE  BAPICUVAL OPTIONAL
    *      ORDER_CFGS_BLOB STRUCTURE  BAPICUBLB OPTIONAL
    *      ORDER_CFGS_VK STRUCTURE  BAPICUVK OPTIONAL
    *      ORDER_CFGS_REFINST STRUCTURE  BAPICUREF OPTIONAL
    *      ORDER_CCARD STRUCTURE  BAPICCARD OPTIONAL
    *      ORDER_TEXT STRUCTURE  BAPISDTEXT OPTIONAL
    *      ORDER_KEYS STRUCTURE  BAPISDKEY OPTIONAL
    *      EXTENSIONIN STRUCTURE  BAPIPAREX OPTIONAL
    *      PARTNERADDRESSES STRUCTURE  BAPIADDR1 OPTIONAL
    Regards,
    Rich Heilman

  • Bapi For Blocked sales orders & Bapi for Releasing those orders

    Hi All,
        Can anybody help me regarding <b>Bapi</b> for getting <b>Blocked sales orders</b> and bapi for <b>releasing</b> those sales orders..
    Any help will be rewarded...
    Thanks..
    Regards,
    Srinivas.

    Use bapi:
    BAPI_SALESORDER_GETLIST to get the list of all sales orders based on Parameters
    CUSTOMER_NUMBER
    SALES_ORGANIZATION
    MATERIAL
    DOCUMENT_DATE
    DOCUMENT_DATE_TO
    PURCHASE_ORDER
    Then,
    loop at the internal table
    and use the bapi BAPI_SALESORDER_GETSTATUS to get the status of each sales order.
    choose only which are blocked.
    Regards,
    ravi

  • Sales order BAPI giving error - No item category available (Table T184 ...

    I am trying to create a sales order from a portal application using BAPI_SALESORDER_CREATEFROMDAT2. For certain type of materials, an error message is coming like: 
    No item category available (Table T184 ZOR NORM PSA1 ZSME) ZOR
    Error
    in VBAPKOM 000020 VBAPKOM
    Item 000030 does not exist 000030
    Sales
    document was not changed
    I have checked in vov4 and consulted SD consultant. The vov4 settings are set as below and our SD consultant says they are ok and need not be changed, as when we are creating this order in SAP, it is a success.
    ZOR NORM PSA1 ZSME
    ZOR NORM PSA2 ZSME ZSHP
    ZOR NORM PSHP ZTAX
    Now, the standard code where this error is coming is calling a function module "RV_VBAP_PSTYV_DETERMINE" which checks for the higher level item category. The material at item 10 meets the criteria, but material at item 20 fails as PSA1 does not have any such row (above) indicating higher level iteam.
    Interesting thing is when I try to create the order in SAP with these materials, it creates the order. There is also a material substitution rule in place, which also seems to be working fine.
    Debugging the standard code has not yet given any result.

    Since you had indicated the VOV4 settings, I presume, the item category ZSME is maintained under the tab "DfItC".
    On your comments,
    For certain type of materials, an error message is coming like:
    I feel, the root cause of the issue is Item Category Group in material master.  Check for those which creates an issue with the one which is running successfully.
    thanks
    G. Lakshmipathi

  • Reg: Department no in Sales Order Bapi BAPI_SALESDOCU_CREATEFROMDATA1

    Hi ALL
    i passing Department no at item level
    For example...
      item-DEPARTMENT_NO = 0563.
      itemx-DEPARTMENT_NO = 'X'.
    i am passing header level ..partner level data to Bapi BAPI_SALESDOCU_CREATEFROMDATA1
    After executing the bapi i am getting error...
    S   |V4                  |233   |VBAKKOM has been processed successfully  <
    E   |V1                  |640   |Department 563 is not available          <
    E   |V4                  |248   |Error in VBAPKOM 000010                  <
    E   |V1                  |331   |Item 000010 does not exist               <
    E   |V4                  |219   |Sales document  was not changed          <
    E   |V4                  |219   |Sales document  was not changed          <
    i am getting Department no is invalid...
    Any thing i am missing here??
    RR

    our is SAP AFS Industry...
    Department number willbe passed to below ...
    Table Name       J_3ASZDID
    Field Name       J_3ADEPM
    Data Element     J_3ADEPM
    in VA01....
    and
    Mso department is stored in  table J_3ADEP (MSO Department)
    RR

  • Populate Batch characteristic values in create sales order BAPI

    Can anybody help me in populating the batch characteristic values using BAPI_SALESORDER_CREATEFROMDAT2?
    I have checked the related notes provided by SAP, like, 567348 but it will be great if someone can send some code snippet on this.

      Subramanian, Brad and Raja.
      Thanks for your suggestions its were useful, with
      these i can resolve my problem.
       !!! Best Regards !!!
    Raja
      I used the se37 to test bapis, is more easy and fast !!
      and you can save data like variant, and you can simulate the real execution without write any code abap,
    and re-process the times that you need,
    when you know what fields you need you write your abap code faster.
       Thanks !!!
    Message was edited by: Noemi Huerta

  • How to change the manual condition type value in change sales order BAPI

    Hi All,
    My scenario here is, i want to either add/change the manual condition type value during change of SO.
    When i'm trying to pass the  order_conditions_in and  order_conditions_inx tables in  'BAPI_SALESORDER_CHANGE'.
    Condition type is coming at item level but the value is setting to zero. Pls. help if anyone has any idea how to handle this.

    Siva,
       I guess you posted in Wrong Thread. You need to post in WAS section.
       check for any BAPI's available in CRM.
    Nagesh Ganisetti.

  • Sales order bapi using lsmw

    Hi,
       in LSMW i am using BAPI:SALESORDER_CREATEFROMDAT2
    and in the mapping, i have assigned : E1BPPARNR-PARTN_ROLE = 'SP'.
                                                           E1BPPARNR-PARTN_NUMB = '1000005'.
                                                           E1BPPARNR-ITM_NUMBER = '000000'
    I am getting an error:
    <b>Please enter sold-to party or ship-to party.</b>
    Any ideas?

    Hi,
    Please use FM CONVERSION_EXIT_ALPHA_INPUT to do the customer number conversion.
    The customer number is stored '0001005000'  in the database.
    DATA: WA_KUNAG LIKE KNA1-KUNNR.
    WA_KUNAG = '1005000'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT =  WA_KUNAG
      IMPORTING
        OUTPUT = WA_KUNAG.
    E1BPPARNR-PARTN_NUMB = WA_KUNAG.
    E1BPPARNR-PARTN_ROLE = 'AG'.
    E1BPPARNR-ITM_NUMBER = '000000'.
    Regards,
    Ferry Lianto

Maybe you are looking for

  • Unable to send emails to multiple recipients through oracle storedprocedure

    I have the email code working with single email in the To address but I am looping through the table and getting a semicolon separated emails and assining to_mail and I am unabl to send any emails to any users in To address but works for cc_address u

  • 2lis_02_itm setup table successfull but rsa 3 no data

    Hi @all, we have an problem with one R3 source system. Following Issue. The system connection is okay we get data from some FI extractors. But the 2lis_02_itm extractor sends no data to bw: Following is done: 1. we have datas (ekko,ekpo) 2. 2lis_02_i

  • Command Prompt Questions

    Hi I have a question on command prompt coding, Can someone please tell me where can i find it?It would be great if you guys can move my below question to that location. Hi All, I have the following Copy Command which copies files from one location to

  • Do I need to download Adobe Acrobat XI Pro again after using the software on a 30-day trial basis?

    Do I need to download Adobe Acrobat XI Pro again after using the software on a 30-day trial basis?

  • Exception in JRE1.6

    Hello, In my own application i can see my applications through browsers using JRE1.5 and it was working fine. And now for the new version of my application i upgrad from JRE1.5 to JRE1.6 And now i am getting the following application in Java console