BAPI to retrieve ship to party for a given sold to party

Hi All,
I have a requirement to get the ship to party details for a sold to party. The scenario is that we are using an excel sheet for order loading at the client's place.
The CSR enters the sold to party in the excel sheet and there is a funcationality developed which will call RFC and connect to SAP. Now for the sold to party entered in the excel sheet, I need to have all the ship to party details for the sold to party entered. Now I need to know if there is a standard BAPI to retrieve all the ship to party.
Kindly let me know if anybody is aware of the standard BAPI for the above requirement.

Hi,
I am not sure of any BAPI here.But I will give you the ogic to retrieve all Ship-to-parties for your customer.
Goto T.Code SE11/SE16/SE16n T.Code.
Enter the table name as KNVP.
Enter your sold-to-party here for customer field.Execute or press F8.
Retrieve all the partners and get the ship-to-parties having the partner function "WE".
If you click on display by selecting that line all details will appaear here.
Hope this helps you.
Regards,
Krishna.

Similar Messages

  • Proper value of ship to party not geting picked up for a given sold toparty

    Hello,
    We have a   bdc program which passes data to the VA01 transaction. We are passing partner values like sold to party and ship to party using this program. However when we open our order, the value of ship to party is getting replaced by the value of sold to party. We debugged the program but could not find out the reason. This problem is there only for one sold to party value. It is working fine with other values of sold to party. We feel it is some master data setting for this particular sold to party that is responsible for this behaviour.
    Please let us know incase you have any possible suggestion.
    Thanks in advance.

    Harsh is right, need to check your partner functions tab in the sales area view of the customer master. There should at a bare minimum be one reference to function SH and a number. If there is more than one ship-to then your program must have logic to derive what is right ship-to to be used. I am wondering if this is the case and your program is defaulting to first SH available, that being the sold-to number. Please review and advise.
    Thanks,
    Jay

  • BAPI to extract from MBEW/MBEWH for a given period

    Hi ABAPpers,
                We have two tables MBEW and MBEWH for Material Valuation. Based on the changes in few fields like VERPR, the record in MBEW will be transferred to MBEWH. Is there any BAPI that helps me to extract the data for a given period of a given fiscal year without asking me to probe from which table we need to fetch data from and which record in MBEWH is valid for that period of that year. Please suggest possible ways to do it.
    Thanks.
    Edited by: VKUPPILI on Dec 19, 2011 2:53 PM

    Hi
    Although it's not your question, see SAP Note 193554 - Stock/valuation data of previous periods, I think that it helps you to understand how to understand how to work the history tables.
    I hope this helps you
    Regards
    Eduardo

  • Ship-to-party,sold-to-party,bill-to-party

    Hi all,
        I want to retrieve ship-to-party,sold-to-part and bill-to-party for a given Document number. From which table these fields can be retieved. Kindly help me.
    Thanks in advance,
    Praveena

    Hi SRI
    The table VBPA ( partner table) stores data about all parties of each document.
    Give the document key here, and give PARVW = SH and you will get ship to party for that doc.
    Hope this helps.
    Note : The value SH is internally stored as WE. There is a conversion exit. But in queries you can give SH.
    please reward points for helpful ans's
    kiran.M

  • Table store relationship of sold to party with ship to party

    Dear Master,
    Please show me table store relationship of Sold to with Ship to party,
    Thanks
    HieuLM

    Hi,
    If you want the ship-to-party for the given sold-to-party in Sales order,we have use the T.Code "VBPA".
    If you want that relation from the customer master,you have to use the table "KNVP".
    Regards,
    Krishna.

  • Retrieve Multiple Serial Numbers for given Delivery Document and Item

    Hello Experts,
                          I am currently working on a 2Lis datasource to extract Delivery information.Now it is required to append the
    datasource with field (say ZZSERNO) which should extract ALL Serial Numbers from OBJK table for a given Delivery Item.
    I know that there is a link between table SER01 and OBJK to retrieve the same.However, my concern is- C_T_Data table is
    already providing the Delivery Information and along with that I want to display ALL Serial numbers for a given Delivery Item.
    A delivery Item can have more that one serial number linked to it as what I see in VL03N for a Delivery document.
    So currently in RSA3, I retrieve say 1 record for a given Delivery Document and Item .Now an Item has say 10 Serial Numbers
    associated with it, so i should see 10 Records for that Delivery Document and Item, after executing RSA3.
    Please provide me with the CMOD logic to do so.

    Hi,
    You can Link LIPS and OBJK tables with Delivery and Del Item.........refer below for the code.
    1) Declare an Internal table of type OBJK with fields DEL DOC, DEL ITEM and ZZSERNO .
    2) Declare another Internal Table ITAB_LIPS of type LIPS with required fields say in your case *DEL DOC, DEL ITEM and ZZSERNO....etc.
    3) Use below select statement to extract records from LIPS into ITAB_LIPS that you have declared for to fetch LIPS data.
    Select DEL DOC, DEL ITEM ( here i have included only few fields but as per requirement please add fields here)   from
    LIPS into corresponding fields of Table ITAB_LIPS.
    4) write one more select statement to fetch Serial number data.
    Select DEL DOC, DEL ITEM ZZSERNO  from OBJK into corresponding fields of TABLE ITAB_OBJK for all entries in ITAB_LIPS
    where DEL DOC = ITAB_LIPS-DEL DOC and
                DEL ITEM = ITAB_LIPS-DEL ITEM.
    Loop at ITAB_OBJK.
    Read table ITAB_OBJK into ITAB_LIPS with keys DEL DOC    DEL ITEM.
    ITAB_LIPS-DEL DOC = ITAB_LIPS-DEL DOC
    ITAB_LIPS-DEL ITEM = ITAB_OBJK-DEL ITEM.
    IF SY-SUBRC = 0.
    ITAB_LIPS-ZZSERNO = ITAB_OBJK-ZZSERNO.
    ENDIF
    ENDLOOP.
    Hope the above code helps
    Sujan

  • Any BAPI to retreive sales area for the given BP Number in CRM

    HI, I am looking for a BAPI which can retreive sales area for the given BP number.
    I appreciate for the quick response and points are awarded.
    Thanks,
    Kumar.
    Edited by: Kumar on Jun 5, 2008 6:40 PM

    Hi Kumar,
    This is not exactly a Bapi but you can use the following 2 functions.
    The function below will get a list of sales areas assigned to the BP.
    call function 'CRM_BUPA_FRG0010_GET_LIST'
        exporting
          iv_partner_guid = lv_partner_guid
        importing
          et_sales_areas  = lt_areas.
    You can then use CRM_BUPA_FRG0030_GET_DETAIL to get the detail of the sales area.
    Hope it helps.
    Johan

  • Any BAPI to retreive salease area for the given BP Number in CRM

    Hi, I am looking for a BAPI to retreive sales area information for the given BP number in CRM.
    I appreicate for quick response and points are awarded.
    Thanks,
    Kumar

    Hi Kumar,
    This is not exactly a Bapi but you can use the following 2 functions.
    The function below will get a list of sales areas assigned to the BP.
    call function 'CRM_BUPA_FRG0010_GET_LIST'
        exporting
          iv_partner_guid = lv_partner_guid
        importing
          et_sales_areas  = lt_areas.
    You can then use CRM_BUPA_FRG0030_GET_DETAIL to get the detail of the sales area.
    Hope it helps.
    Johan

  • Query to retrieve list of ledgers accessible for a given Applications User

    We've a requirement to find the list of the accessible ledgers for a given Oracle Apps User.I'm from Oracle ATG team,not familiar with GL terminologies. Can someone help with the query to retrieve the ledgers accessible for a given user.In our code flow, we may not have the complete applications context. Is it possible to retrieve that list only with the username. If so, how to do that? Do i need to access some profile values?
    Thanks,
    Senthil

    select * from usr where usr.usr_key not in (
    select usr.usr_key from oiu, usr, obi, obj, ost
    where oiu.usr_key=usr.usr_key
    and oiu.obi_key=obi.obi_key
    and obi.obj_key=obj.obj_key
    and obj.obj_name = :obj_name
    and oiu.ost_key=ost.ost_key
    and ost.ost_status not in ('Revoked'))
    -Kevin

  • BAPI for Assigning multiple ship to party for customer

    Hi experts,
    I need a bapi to assign different ship to party for a customer.
    I have tried SD_CUSTOMER_MAINTAIN_ALL but not working properly.
    Kindly suggest the solution.
    Regards,
    Nitin.

    Hi,
    For the maintenance of customers, there is NO BAPI and NO direct function module.
    There are some functions modules like the one above where the name is looking nice. But these should not be used.
    Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See [note 384462|https://service.sap.com/sap/support/notes/384462]
    Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduce. See class CMD_EI_API and VMD_EI_API
    Hope this helps
    BR
    Alain

  • Assign different ship to party for each material in a sales order in CRM?

    Hi all,
    I need to create a sales order in CRM, such that the sales order contains more than 100 materials at item level and each material should be shipped to a different ship to party.
    That is for 100 materials in sales order I need to ship to 100 different customers.
    The 100 ship to partyu2019s are maintained for the business partner in relation ships tab in /nBP.
    The CRM configuration is done in such a way that when we enter a material while creating a sales order in CRM,u2026u2026.a window pops up asking us to select the ship to party for that material.
    No I need to replicate this programmatically. I generated a sales order in CRM programmatically using BAPI_SLSTRANSACT_CREATEMULTI. u2026 Now I need to make changes such that I have a provision to assign ship to party for each materialu2026
    How can I do this? Can any one tell me if there is a BAPI or Function Module available so that I can assign a different ship to party for each material in sales order?
    Regards,
    Jessica Sam

    Here is sample code. In that highlighted portion is different. check this out
    DATA: ls_partner TYPE crmt_partner_com,
            ls_input_fields TYPE crmt_input_field,
            lt_fieldname TYPE crmt_input_field_names_tab,
            ls_fieldname LIKE LINE OF lt_fieldname.
      ls_partner-ref_handle = p_iv_handle.
      ls_partner-ref_partner_handle = 1.
      ls_partner-ref_kind = 'A'.
      ls_partner-display_type = 'BP'.
      ls_partner-no_type = 'BP'.
      ls_partner-kind_of_entry = 'C'.
    licensee
      ls_partner-partner_fct = '00000069'.
      ls_partner-partner_no = w_but000-partner.
      INSERT ls_partner INTO TABLE gt_partner.
    Bill to party
      IF NOT w_con_header-billtoparty IS INITIAL.
        ls_partner-partner_fct = '00000003'.
        ls_partner-partner_no = w_but001-partner.
        INSERT ls_partner INTO TABLE gt_partner.
      ENDIF.
      IF w_con_header-billtoparty IS INITIAL.
        ls_partner-partner_fct = '00000003'.
        ls_partner-partner_no = w_but000-partner.
        INSERT ls_partner INTO TABLE gt_partner.
      ENDIF.
    Employee
      ls_partner-partner_fct = '00000014'.
      ls_partner-partner_no = w_con_header-empresp.
      INSERT ls_partner INTO TABLE gt_partner.
      +*lsinput_fields-ref_handle = p_iv_handle.*+_
      +*lsinput_fields-ref_kind = 'A'.*+_
      ls_input_fields-logical_key = ls_partner-ref_partner_handle.
      ls_input_fields-objectname = 'PARTNER'.
      ls_fieldname-fieldname = 'DISPLAY_TYPE'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'KIND_OF_ENTRY'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'NO_TYPE'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'PARTNER_FCT'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'PARTNER_NO'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_input_fields-field_names = lt_fieldname.
      INSERT ls_input_fields INTO TABLE gt_input_fields.

  • Ship to party for each material using BAPI_SLSTRANSACT_CREATEMULTI

    i am able to generate sales order for in CRM. I am inputting the sold to party, ship to party, bill to party and payer at the header level...
    CRM is currently configured in such a way that , there is a provision to assign ship to party at item level for each material.
    How can i programatically replicate this? I need to assign a diiferent ship to party for each material in the sales order.*
    how can i programatically replicate this?...
    this is  my code for cresating a sales order in CRM with sold to party, ship to party, bill to party and payer at the header level...
    *************include constants
      include crm_direct.
    ************// GUIDs
      data:         lv_guid_h type GUID_32,              "HEADER GUIDE
                    lv_guid_i type GUID_32,              "ITEM GUIDE
                    lv_guid_sl type GUID_32,             "SCHEDULE LINE GUIDE
                    lv_guid_p type GUID_32.              "PARTNER GUIDE
    ***********// Handles
      data:        lv_current_handle type crmt_handle,    "CURRENT HANDLE
                   lv_handle_h type crmt_handle,          "HEADER HANDLE
                   lv_handle_i type crmt_handle,          "ITEM HANDLE
                   lv_handle_sl type crmt_handle,         "SCHEDULE LINE HANDLE
                   lv_handle_p type crmt_handle.          "PARTNER HANDLE
    ***********// Administration header + item + etc
      data:        lt_salesorder_header type table of bapibus20001_header_ins,        "LT_SALESORDER_HEADER
                   ls_salesorder_header type bapibus20001_header_ins,                 "LS_SALESORDER_HEADER
                   lt_salesorder_item type table of bapibus20001_item,                "LT_SALESORDER_ITEM
                   ls_salesorder_item type bapibus20001_item,                         "LS_SALESORDER_ITEM
                   lt_scheduleline type table of BAPIBUS20001_SCHEDLIN,               "LT_SCHEDULELINE
                   ls_scheduleline type BAPIBUS20001_SCHEDLIN,                        "LS_SCHEDULELINE
                   lt_partner type table of BAPIBUS20001_PARTNER_INS,                 "LT_PARTNER
                   ls_partner type BAPIBUS20001_PARTNER_INS,                          "LS_PARTNER
                   ls_logical_key TYPE crmt_partner_logic_partner_key,                "LS_LOGICAL_KEY
                   lt_organisation type table of BAPIBUS20001_ORGMAN_INS,             "LT_ORGANISATION
                   ls_organisation type BAPIBUS20001_ORGMAN_INS.                      "LS_ORGANISATION
    *********// Saved sales orders
    data: lt_saved_process type table of bapibus20001_object_id,                   "LT_SAVED_PROCESS
      data:
            ls_saved_process type bapibus20001_object_id,                             "LS_SAVED_PROCESS
            ls_salesorder type CRMT_RETURN_OBJECTS_STRUC.                             "LS_SALESORDER
      data: lt_input_fields type table of bapibus20001_input_fields,                  "LT_INPUT_FIELDS
            ls_input_fields type bapibus20001_input_fields,                           "LS_INPUT_FIELDS
            ls_return type bapiret2.                                                  "LS_RETURN
    data: lt_return type table of bapiret2.                                        "LT_RETURN
    ***********// Macro definition to populate structure and input field This, called as
    *_set_field ls_salesorder_header GUID lv_guid_h
    *is exploded as
          ls_salesorder_header-GUID            =        lv_guid_h.
          ls_input_fields-fieldname            =        'GUID'.
          append ls_input_fields to lt_input_fields.
    *Note 1: &2 (field name) MUST be uppercase
    *Note 2: for the salesorder header, Macro has not been used to show how the code should look like.
    *except for that the macro has been used everywhere else.
         define setfield.
              &1-&2 = &3.
              ls_input_fields-fieldname = '&2'.
              append ls_input_fields to lt_input_fields.
        end-of-definition.
    *****// end of macro definition
    ******// fill order administration header
        perform get_guid changing lv_guid_h.
        add 1 to lv_handle_h.
        ls_salesorder_header-guid = lv_guid_h.
        ls_salesorder_header-handle = lv_handle_h.
        ls_salesorder_header-process_type = 'ZWEB'.
        clear ls_input_fields.
        ls_input_fields-ref_handle = lv_handle_h.
        ls_input_fields-ref_guid = lv_guid_h.
    *ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
        ls_input_fields-objectname = gc_object_name-orderadm_h.
        ls_input_fields-fieldname = 'GUID'.
        append ls_input_fields to lt_input_fields.
        ls_input_fields-fieldname = 'HANDLE'.
        append ls_input_fields to lt_input_fields.
        ls_input_fields-fieldname = 'PROCESS_TYPE'.
        append ls_input_fields to lt_input_fields.
        append ls_salesorder_header to lt_salesorder_header.
    **********// fill organisation data (Interface needs this, some times may rely on sales org determination instead...
        clear ls_input_fields.
        ls_input_fields-ref_handle          =      lv_handle_h.
        ls_input_fields-ref_guid            =      lv_guid_h.
        ls_input_fields-ref_kind            =      gc_object_ref_kind-orderadm_h.
        ls_input_fields-objectname          =      gc_object_name-orgman.
        setfield      ls_organisation    REF_GUID         lv_guid_h.
        setfield      ls_organisation    REF_HANDLE       lv_handle_h.
        setfield      ls_organisation    REF_KIND         gc_object_ref_kind-orderadm_h.
        setfield      ls_organisation    SALES_ORG_RESP   SO_RESP .                                 "(input).
        setfield      ls_organisation    SALES_ORG        SALES_ORG.                                "(input).
        setfield      ls_organisation    DIS_CHANNEL      DIS_CHNL.                                 "(input).
        setfield      ls_organisation    DIVISION         DIVISION.                                 "(input).
        append ls_organisation to lt_organisation.
    **********// fill order administration item
      perform get_guid changing lv_guid_i.
      lv_handle_i = lv_handle_h.
      add 1 to lv_handle_i.
      clear ls_input_fields.
      ls_input_fields-ref_guid            =        lv_guid_i.
      ls_input_fields-ref_handle          =        lv_handle_i.
    *ls_input_fields-ref_kind             =        gc_object_ref_kind-orderadm_i.
      ls_input_fields-objectname          =        gc_object_name-orderadm_i.
      setfield      ls_salesorder_item      GUID               lv_guid_i.
      setfield      ls_salesorder_item      HEADER             lv_guid_h.
      setfield      ls_salesorder_item      HANDLE             lv_handle_i.
      setfield      ls_salesorder_item      HEADER_HANDLE      lv_handle_h.
      setfield      ls_salesorder_item      ORDERED_PROD       PRODUCT .                           "(input).
      setfield      ls_salesorder_item      ITM_TYPE           'ZTAN'.
      setfield      ls_salesorder_item      MODE               'A'.
    *adjustment taken from standard include LCMS_MAPPERF04
    *(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
      delete lt_input_fields where fieldname = 'HANDLE'
      OR
      fieldname      =    'HEADER_HANDLE'.
      append ls_salesorder_item to lt_salesorder_item.
    ********// fill schedule line for item
      perform get_guid changing lv_guid_sl.
      add 1 to lv_handle_sl.
      clear ls_input_fields.
      ls_input_fields-ref_guid          =        lv_guid_i.
      ls_input_fields-ref_handle        =        lv_handle_i.
      ls_input_fields-ref_kind          =        gc_object_ref_kind-orderadm_i.
      ls_input_fields-objectname        =        gc_object_name-schedlin.
      setfield       ls_scheduleline       ITEM_GUID       lv_guid_i.
      setfield       ls_scheduleline       GUID            lv_guid_sl.
      setfield       ls_scheduleline       HANDLE          lv_handle_sl.
      setfield       ls_scheduleline       ITEM_HANDLE     lv_handle_i.
      setfield       ls_scheduleline       QUANTITY        quantity.                        "(input).
      append ls_scheduleline to lt_scheduleline.
    ********// fill partner line
    *perform get_guid changing lv_guid_p.
    *the partner use the logical key as well
      ls_logical_key-ref_partner_handle = '0001'.
      clear ls_input_fields.
      ls_input_fields-ref_guid       =       lv_guid_h.
      ls_input_fields-ref_handle     =       lv_handle_h.
      ls_input_fields-ref_kind       =       gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname     =       gc_object_name-partner.
      ls_input_fields-logical_key    =       ls_logical_key.
      setfield       ls_partner       REF_GUID                   lv_guid_h.
      setfield       ls_partner       REF_HANDLE                 lv_handle_h.
      setfield       ls_partner       REF_KIND                   gc_object_ref_kind-orderadm_h.
      setfield       ls_partner       REF_PARTNER_HANDLE         '0001'.
      setfield       ls_partner       KIND_OF_ENTRY              'C'.
      setfield       ls_partner       PARTNER_FCT                '00000001'.
      setfield       ls_partner       PARTNER_NO                 SOLD_TO.                                "(input).
      setfield       ls_partner       NO_TYPE                    'BP'.
      setfield       ls_partner       DISPLAY_TYPE               'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
      ls_logical_key-ref_partner_handle        =       '0002'.
      clear ls_input_fields.
      ls_input_fields-ref_guid                 =         lv_guid_h.
      ls_input_fields-ref_handle               =         lv_handle_h.
      ls_input_fields-ref_kind                 =         gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname               =         gc_object_name-partner.
      ls_input_fields-logical_key              =         ls_logical_key.
      setfield          ls_partner           REF_GUID                   lv_guid_h.
      setfield          ls_partner           REF_HANDLE                 lv_handle_h.
      setfield          ls_partner           REF_KIND                   gc_object_ref_kind-orderadm_h.
      setfield          ls_partner           REF_PARTNER_HANDLE         '0002'.
      setfield          ls_partner           KIND_OF_ENTRY              'C'.
      setfield          ls_partner           PARTNER_FCT                '00000002'.
      setfield          ls_partner           PARTNER_NO                 SHIP_TO .                                "(input).
      setfield          ls_partner           NO_TYPE                    'BP'.
      setfield          ls_partner           DISPLAY_TYPE               'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
      ls_logical_key-ref_partner_handle = '0003'.
      clear ls_input_fields.
      ls_input_fields-ref_guid             =           lv_guid_h.
      ls_input_fields-ref_handle           =           lv_handle_h.
      ls_input_fields-ref_kind             =           gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname           =           gc_object_name-partner.
      ls_input_fields-logical_key          =           ls_logical_key.
      setfield         ls_partner            REF_GUID                   lv_guid_h.
      setfield         ls_partner            REF_HANDLE                 lv_handle_h.
      setfield         ls_partner            REF_KIND gc_object_ref_kind-orderadm_h.
      setfield ls_partner REF_PARTNER_HANDLE '0003'.
      setfield ls_partner KIND_OF_ENTRY 'C'.
      setfield ls_partner PARTNER_FCT '00000003'.
      setfield ls_partner PARTNER_NO BILL_TO ."(input).
      setfield ls_partner NO_TYPE 'BP'.
      setfield ls_partner DISPLAY_TYPE 'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
      ls_logical_key-ref_partner_handle = '0004'.
      clear ls_input_fields.
      ls_input_fields-ref_guid = lv_guid_h.
      ls_input_fields-ref_handle = lv_handle_h.
      ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname = gc_object_name-partner.
      ls_input_fields-logical_key = ls_logical_key.
      setfield ls_partner REF_GUID lv_guid_h.
      setfield ls_partner REF_HANDLE lv_handle_h.
      setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
      setfield ls_partner REF_PARTNER_HANDLE '0004'.
      setfield ls_partner KIND_OF_ENTRY 'C'.
      setfield ls_partner PARTNER_FCT '00000004'.
      setfield ls_partner PARTNER_NO PAYER ."(input).
      setfield ls_partner NO_TYPE 'BP'.
      setfield ls_partner DISPLAY_TYPE 'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
    *******// example of a second partner function (custom) with data override
    *ls_logical_key-ref_partner_handle = '0002'.
    *clear ls_input_fields.
    *ls_input_fields-ref_guid = lv_guid_h.
    *ls_input_fields-ref_handle = lv_handle_h.
    *ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
    *ls_input_fields-objectname = gc_object_name-partner.
    *ls_input_fields-logical_key = ls_logical_key.
    *_set_field ls_partner REF_GUID lv_guid_h.
    *_set_field ls_partner REF_HANDLE lv_handle_h.
    *_set_field ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
    *_set_field ls_partner REF_PARTNER_HANDLE '0002'.
    *_set_field ls_partner KIND_OF_ENTRY 'B'. "manual entry...
    *_set_field ls_partner PARTNER_FCT customFct(input).
    *_set_field ls_partner PARTNER_NO bpNumber(input).
    *_set_field ls_partner NO_TYPE 'BP'.
    *_set_field ls_partner DISPLAY_TYPE 'BP'.
    *_set_field ls_partner TITLE 'Mr.'.
    *_set_field ls_partner FIRSTNAME 'John'.
    *_set_field ls_partner LASTNAME 'Smith'.
    *_set_field ls_partner STR_SUPPL1 'John Smith and Co'.
    *_set_field ls_partner STREET 'Street1'.
    *_set_field ls_partner STR_SUPPL3 'Street4'.
    *_set_field ls_partner HOUSE_NO '42'.
    *_set_field ls_partner CITY 'Townville'.
    *_set_field ls_partner DISTRICT 'Districtshire'.
    *_set_field ls_partner POSTL_COD1 'AA1 2BB'.
    *note now ...
    *adjustment taken from standard include LCMS_MAPPERF04
    *(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
    *I don't use macro because name of the field in input_table is different
    *_set_field ls_partner COUNTRYISO 'GB'.
    *instead
      ls_partner-COUNTRYISO = 'GB'.
      ls_input_fields-fieldname = 'COUNTRY'.
      append ls_input_fields to lt_input_fields.
    *_set_field ls_partner LANGU_ISO 'EN'.
      ls_partner-LANGU_ISO = 'EN'.
      ls_input_fields-fieldname = 'LANGU'.
      append ls_input_fields to lt_input_fields.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
    *Create sales orders *
      call function 'BAPI_SLSTRANSACT_CREATEMULTI'
        EXPORTING
          testrun       = false
        TABLES
          header        = lt_salesorder_header[]
          item          = lt_salesorder_item[]
          partner       = lt_partner[]
          organisation  = lt_organisation[]
          input_fields  = lt_input_fields[]
          scheduleline  = lt_scheduleline[]
          saved_process = lt_saved_process[]
          return        = lt_return[].
    *************// get the GUID of the created object
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT          = 'X'
    IMPORTING
        RETURN        = lt_return1.
    INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01.
    Edited by: jessica sam on Dec 22, 2008 4:25 PM
    Edited by: jessica sam on Dec 22, 2008 4:27 PM
    Edited by: jessica sam on Dec 22, 2008 7:05 PM
    Edited by: jessica sam on Dec 23, 2008 5:18 AM

    I know how to trace the Ship to party at line item. When i create an order manually on CRM then the table CRMD_PARTNER has the required entries and the Ship to party at line item is getting populated correctly. Also if i open the order in CRMD_ORDER the ship pto party are being populated correctly at line item..
    But if i am trying to replicate this programatcally using the BAPI, i see that the ship to at header is being copied to each line item and this is not what is expected.
    If i go and check in the CRMD_PARTNER the data is not filled
    correctly as I dont have any ship to party at line item
    So finally I even tried to insert the data manually in the CRMD_PARTNER table using an
    INSERT statement and even that doesnt work...
    https://www.sdn.sap.com/irj/scn/forums
    So i am unable to ficgure out what is going wrong
    Any body if they have any idea on poulating ship to party programatically in
    sales order for each line item please help
    I am unable to figure out how to fill PArtner table of this BAPI to populate ship to at line item level
    Kindly Help..
    Regards,
    Jessica Sam

  • Sold to Party and Ship to Party Function module or BAPI

    Hi Experts,
       1) I need to create customer data,So i need to Function module or BAPI.
       2) Address create data Function module or BAPI.
       3) Sold to Party and Ship to Party Function module or BAPI relation ship.
    Thank you ,
    Dinesh Reddy
    Moderator message: anything else? please search for available information before asking.
    Edited by: Thomas Zloch on Oct 14, 2011 3:19 PM

    Hi,
      Try these Bapis
    BAPI_BUS2001_PARTNER_GETDETAIL Get Detail Data for Partner Data
    BAPI_BUS2001_PARTNER_GETLIST   Get Overview List for Partner Data
    Regards,
    Prashant

  • To Retrieve the sold to party ,ship to party data

    I have to retrieve the sold to party ,ship to party and payer along with there description i.e. name from a billing doc number and populate in the corresponding fields of the final internal table.
    Can somebody me with a sample code.
    Regards
    Jitendra

    hi,
    bill to party....
    SELECT SINGLE kunnr FROM vbpa
                        INTO v_scustno
                        WHERE vbeln = is_bil_invoice-hd_gen-bil_number
                        AND parvw = 'RE'.
    IF sy-subrc <> 0.
      CLEAR v_scustno.
    ENDIF.
    CLEAR gs_hd_adr.
    get customer adress number
    READ TABLE is_bil_invoice-hd_adr INTO gs_hd_adr
    WITH KEY bil_number = is_bil_invoice-hd_gen-bil_number
    partn_role = 'RE'.
    adrnr = gs_hd_adr-addr_no.
    ship to party address
    CLEAR GS_HD_ADR.
    get customer adress number
    READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
    WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
    PARTN_ROLE = 'WE'.
    ADRNR = GS_HD_ADR-ADDR_NO.
    CLEAR GS_HD_ADR.
    READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
    WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
    PARTN_ROLE = 'RE'.
    IF  GS_HD_ADR-ADDR_NO EQ ADRNR.
    CLEAR ADRNR.
    ENDIF.
    *Getting customer number
    *for Ship to party
    break njain.
    CLEAR v_custno.
    SELECT SINGLE kunnr FROM vbpa
                        INTO v_custno
                        WHERE vbeln = is_bil_invoice-hd_gen-bil_number
                        AND parvw = c_we.
    IF sy-subrc <> 0.
      CLEAR v_custno.
    ENDIF.
    **End of HDT XXXX-XXX
    Thanks
    Ashu

  • How to associate Ship-To-Party to a Sold-To-Party using BAPI

    I am looking for a BAPI that will allow me to associate existing Ship-To-Party to an existing Sold-To-Party. I tried to search for the BAPI that might do this job but could not find one. Any help is greatly appreciated.
    System: SAP R/3 4.7
    Edited by: Jignesh Jethva on Nov 19, 2009 12:11 AM

    Hi,
    Check table CRMM_BUT_LNK0141 to obtain the sales area of a BP (by BP Guid).
    If you need the sales office and sales group, read GuidSet of that table and check table CRMM_BUT_SET0140 to list the sales office and sales group by that Guid set.
    There are some function modules too:
    CMS_BUPA_ORGDATA_GET_BL among others.
    Regards,
    Susana Messias

Maybe you are looking for