FM  BAPI To Create Service Confirmation

Hi Friends,
Kindly suggest me FM \ BAPI to create Service Confirmation.
Regards,
Narendra Goyal

Hi,
Find the code below:
        creation of header guid for service confirmation
          CLEAR v_head_ref_guid.
          CALL FUNCTION 'GUID_CREATE'
            IMPORTING
              ev_guid_16 = v_head_ref_guid.
          CREATION OF THE ITEM GUID
            CLEAR v_item_ref_guid.
            CALL FUNCTION 'GUID_CREATE'
              IMPORTING
                ev_guid_16 = v_item_ref_guid.
          CREATION OF SCHEDULING LOGICAL GUID.
            CLEAR v_sched_logical.
            CALL FUNCTION 'GUID_CREATE'
              IMPORTING
                ev_guid_16 = v_sched_logical.
          values for it_pricing
            CLEAR wa_pricing.
            CLEAR it_pricing.
            wa_pricing-ref_handle = c_ref_handle2.
            wa_pricing-ref_guid   = v_item_ref_guid.
            wa_pricing-ref_kind   = c_b_kind.
            INSERT wa_pricing INTO TABLE it_pricing.
          values for product_i-UOM
            CLEAR wa_product.
            READ TABLE it_product INTO wa_product INDEX 1.
            IF sy-subrc = 0.
              CLEAR wa_fieldname.
              CLEAR it_fields.
              wa_fieldname-fieldname = c_process_qty_unit_field.
              INSERT  wa_fieldname INTO TABLE  it_fields.
              CLEAR wa_input_field.
              wa_input_field-ref_handle   = c_ref_handle2.
              wa_input_field-ref_guid     = v_item_ref_guid.
              wa_input_field-ref_kind     = c_b_kind.
              wa_input_field-objectname   = c_product_i_input.
              wa_input_field-field_names  = it_fields.
              INSERT wa_input_field INTO TABLE it_input_field.
              CLEAR wa_product_i.
              wa_product_i-ref_guid         = v_item_ref_guid.
              wa_product_i-ref_handle       = c_ref_handle2.
              wa_product_i-process_qty_unit = wa_product-process_qty_unit.
              INSERT  wa_product_i INTO TABLE it_product_i.
            ENDIF.
          values for service_i
            CLEAR wa_input_field.
            wa_input_field-ref_handle   = c_ref_handle2.
            wa_input_field-ref_guid     = v_item_ref_guid.
            wa_input_field-ref_kind     = c_b_kind.
            wa_input_field-objectname   = c_service_i.
            wa_input_field-field_names  = it_fields.
            INSERT wa_input_field INTO TABLE it_input_field.
            CLEAR wa_service_i.
            wa_service_i-ref_guid   = v_item_ref_guid.
            wa_service_i-ref_handle = c_ref_handle2.
            INSERT wa_service_i INTO TABLE it_service_i.
          fieldnames for quantity
            CLEAR wa_schedul.
            READ TABLE it_schedul INTO wa_schedul INDEX 1.
            IF sy-subrc = 0.
              CLEAR wa_fieldname.
              CLEAR it_fields.
              wa_fieldname-fieldname = c_logical_key.
              INSERT  wa_fieldname INTO TABLE  it_fields.
              CLEAR wa_fieldname.
              wa_fieldname-fieldname = c_quantity.
              INSERT  wa_fieldname INTO TABLE  it_fields.
              CLEAR wa_input_field.
              wa_input_field-ref_handle   = c_ref_handle2.
              wa_input_field-ref_guid     = v_item_ref_guid.
              wa_input_field-ref_kind     = c_b_kind.
              wa_input_field-objectname   = c_schedlin_input.
              wa_input_field-logical_key  = c_log_key_item.
              wa_input_field-field_names  = it_fields.
              INSERT wa_input_field INTO TABLE it_input_field.
              CLEAR wa_quantity.
              CLEAR it_quantity.
              wa_quantity-guid          = v_sched_logical.
              wa_quantity-item_guid     = v_item_ref_guid.
              wa_quantity-quantity      = wa_schedul-quantity.
              wa_quantity-logical_key   = c_log_key_item.
              wa_quantity-handle        = c_ref_handle0.
              INSERT wa_quantity INTO TABLE it_quantity.
            valus for quantity
              CLEAR wa_schedulin.
              wa_schedulin-ref_guid   = v_item_ref_guid.
              wa_schedulin-ref_handle = c_ref_handle2.
              wa_schedulin-schedlines = it_quantity.
              INSERT wa_schedulin INTO TABLE it_schedulin.
            ENDIF.
          fieldnames for product
            CLEAR wa_orderadm.
            READ TABLE it_orderadm INTO wa_orderadm INDEX 1.
            IF sy-subrc = 0.
              CLEAR wa_fieldname.
              CLEAR it_fields.
              wa_fieldname-fieldname = c_itm_proc_ident.
              INSERT  wa_fieldname INTO TABLE  it_fields.
              CLEAR wa_fieldname.
              wa_fieldname-fieldname = c_mode_input.
              INSERT  wa_fieldname INTO TABLE  it_fields.
              CLEAR wa_fieldname.
              wa_fieldname-fieldname = c_ordered_prod.
              INSERT  wa_fieldname INTO TABLE  it_fields.
              CLEAR wa_fieldname.
              wa_fieldname-fieldname = c_number_int.
              INSERT  wa_fieldname INTO TABLE  it_fields.
              CLEAR wa_fieldname.
              wa_fieldname-fieldname = c_prog_id.
              INSERT wa_fieldname INTO TABLE it_fields.
              CLEAR wa_input_field.
              wa_input_field-ref_handle   = c_ref_handle2.
              wa_input_field-ref_guid     = v_item_ref_guid.
              wa_input_field-objectname   = c_orderadm_i_input.
              wa_input_field-field_names  = it_fields.
              INSERT wa_input_field INTO TABLE it_input_field.
            values for product
              CLEAR wa_orderprp_i.
              CLEAR v_itemno.
              v_itemno = v_itemno + v_line_incr.
              wa_orderprp_i-guid          = v_item_ref_guid.
              wa_orderprp_i-header        = v_head_ref_guid.
              wa_orderprp_i-number_int    = v_itemno.
              wa_orderprp_i-ordered_prod  = wa_orderadm-ordered_prod.
              wa_orderprp_i-description   = wa_orderadm-description.
              wa_orderprp_i-handle        = c_ref_handle2.
              wa_orderprp_i-number_int    = wa_orderadm-number_int .
              wa_orderprp_i-zzprogram_id  = wa_orderadm-zzprogram_id.
              INSERT wa_orderprp_i INTO TABLE it_orderprp_i.
            ENDIF.
          ENDIF.
        field names for header
          CLEAR wa_fieldname.
          CLEAR it_fields.
          wa_fieldname-fieldname = c_mode.
          INSERT  wa_fieldname INTO TABLE  it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_process_type_field.
          INSERT  wa_fieldname INTO TABLE  it_fields.
        input field values for header
          CLEAR wa_input_field.
          wa_input_field-ref_guid     = v_head_ref_guid.
          wa_input_field-ref_kind     = c_a_input.
          wa_input_field-objectname   = c_orderadmh_input.
          wa_input_field-field_names  = it_fields.
          INSERT wa_input_field INTO TABLE it_input_field.
        Clearing buffer
          CALL FUNCTION 'CRM_ORDER_INITIALIZE'
            EXPORTING
              iv_initialize_whole_buffer = c_x
            EXCEPTIONS
              error_occurred             = 1
              OTHERS                     = 2.
          CHECK sy-subrc = 0.
        values for header
          CLEAR wa_orderadm_h.
          wa_orderadm_h-guid          = v_head_ref_guid.
          wa_orderadm_h-mode          = c_a_mode.
          wa_orderadm_h-process_type  = c_process_type.
          INSERT wa_orderadm_h INTO TABLE it_orderadm_h.
        values for comp _date
          CLEAR it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_dominant_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_duration_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_rule_name_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_show_local_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_timestamp_from_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_timestamp_to_fiel.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_timezone_from_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_timezone_to_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_fieldname.
          wa_fieldname-fieldname = c_time_unit_field.
          INSERT wa_fieldname INTO TABLE it_fields.
          CLEAR wa_input_field.
          wa_input_field-ref_handle   =   c_ref_handle0.
          wa_input_field-ref_guid     =    v_head_ref_guid.
          wa_input_field-field_names  =    it_fields.
          wa_input_field-ref_kind     =    c_a_input.
          wa_input_field-objectname   =   c_appointment.
          wa_input_field-logical_key  =    c_log_key_appointment.
          INSERT  wa_input_field INTO TABLE  it_input_field.
          CLEAR v_time.
          v_time = sy-uzeit.
          CLEAR v_timestamp.
          CLEAR wa_appointment.
          CONCATENATE wa_record-comp_date v_time INTO v_timestamp.
          wa_appointment-ref_guid       = v_head_ref_guid.
          wa_appointment-ref_kind       = c_a_input.
          wa_appointment-appt_type      = c_appt_type.
          wa_appointment-timestamp_from = v_timestamp.
          wa_appointment-timezone_from  = c_timezone.
          wa_appointment-timezone_to    = c_timezone.
          wa_appointment-ref_handle     = c_ref_handle0.
          INSERT wa_appointment INTO TABLE it_appointment.
          to create a service confirmation as a follow up document
            CALL FUNCTION 'CRM_ORDER_MAINTAIN'
              EXPORTING
                it_product_i      = it_product_i
                it_service_i      = it_service_i
                it_pricing        = it_pricing
                it_schedlin_i     = it_schedulin
                it_appointment    = it_appointment
              CHANGING
                ct_orderadm_h     = it_orderadm_h
                ct_orderadm_i     = it_orderprp_i
                ct_input_fields   = it_input_field
              EXCEPTIONS
                error_occurred    = 1
                document_locked   = 2
                no_change_allowed = 3
                no_authority      = 4
                OTHERS            = 5.
            IF sy-subrc = 0.
              CLEAR it_objects_to_save.
              CLEAR it_saved_objects.
              INSERT v_head_ref_guid INTO TABLE it_objects_to_save.
            fm to save the service confirmation
              CALL FUNCTION 'CRM_ORDER_SAVE'
                EXPORTING
                  it_objects_to_save = it_objects_to_save
                  iv_no_bdoc_send    = c_x
                IMPORTING
                  et_saved_objects   = it_saved_objects
                EXCEPTIONS
                  document_not_saved = 1
                  OTHERS             = 2.
              CHECK sy-subrc = 0.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                EXPORTING
                  wait = c_x.

Similar Messages

  • Problem using BAPI to create Service Confirmation in CRM

    Good afternoon all.
    I have raised this is CRM forum too, just thought it best to ask the broader ABAP community the question too.
    We are encountering a problem using a BAPI to create a transaction in CRM, specifically:
    I am trying to create a Service Confirmation (BUS2000117) in a CRM system using the BAPI BAPI_BUSPROCESSND_CREATEMULTI.
    The BAPI succeeds in creating the header of the transaction, but I cannot make the BAPI create any other data in the transaction such as partners or items.
    Just want to be sure that I am not being foolish...has anyone succeeded in using this BAPI to create an error-free Service Confirmation?
    Regards
    Nick

    I am going to pop this thread into General ABAP forum too.
    Nick

  • How to create 'service confirm order' through bapi?

    I want to create service confirm order,
    pls help me some bapi

    Yudomg
       Try this BAPI: <b>BAPI_BUSPROCESSND_CREATEMULTI</b>
    Thanks
    Jack
    <b>Allot points if mys post helps !!!!!</b>

  • FM/Class for creating service confirmation from service order

    Hello Gurus,
    Does anyone know a FM/BAPI/Class to create service confirmation from service order ?
    With warm regards,
    Kallol Bhowmick

    Hello Kallol
    You can trigger a confirmation from service order using action profile.
    Here is how to define action profile:
    IMG > CRM > Basic Functions > Actions > Actions in Transaction
    Dialog Stucture> Action profile:
    Object type = BUS2000116
    Context class = CL_DOC_CONTEXT_CRM_ORDER
    Dialog Stucture> Action Definition:
    Processing time: Processing using selection report
    Check box schedule automatically, Changeable in dialog and executable in dialog.
    Dialog Stucture> Processing types
    Permitted processing types of actions: Select - Method Call
    Settings method call: Method - COPY_DOCUMENT (you can also try COPY_DEF_ITEMS)
    Processing Parameter:
    -Select change icon a new window opens - container editor
    -select create icon another window opens - display container editor
    Here enter following:
    Element = PROCESS_TYPE
    Name = PROCESS_TYPE
    short desp = PROCESS_TYPE
    Tab > Dtype:
    Structure = CRMC_PROC_TYPE
    Field = PROCESS_TYPE
    Tab> initial value
    Here maintain the transaction type of your confirmation.
    save your action profile. Now assign action profile to Service oder transaction type.
    I hope this info helps.
    Regards
    Rupesh Patil

  • Bapi for CRM service confirmation

    Hi All,
      Is there any bapi for CRm service confirmation which done trhough the transaction - CRMD_BUS2000117.
    Its urgent.
    Points will be awarded.
    Reagrds,
    vinoth.

    Hello Vinoth,
    please ask that kind of questions in the SAP CRM: Webclient UI - Framework Forum.
    What's about using CRM_ORDER_MAINTAIN? You can find many examples of it's use using the SDN search.
    Regards
    Gregor

  • Bapi for Process service confirmation in transaction - CRMD_BUS2000117

    Hi All,
       Is there any bapi for process service confirmation in CRM system.
       Tcode for service confirmation - CRMD_BUS2000117.
    Points will be awarded.
    Regards,
    Vinoth.

    Hello Vinoth,
    please ask that kind of questions in the SAP CRM: Webclient UI - Framework Forum.
    What's about using CRM_ORDER_MAINTAIN? You can find many examples of it's use using the SDN search.
    Regards
    Gregor

  • BAPI  for Creating Service Purchase Order

    Hi All,
      I am not able to create service po using bapi, after passing the parameters
      ls_polimits-LIMIT     = '30'.
      ls_polimits-EXP_VALUE = '20'.
      APPEND : ls_polimits TO gt_polimits.
        ls_poserv-quantity = '10'.
        ls_poserv-base_uom = 'AU'.
        ls_poserv-short_text = 'AAAAAAAA'..
        ls_poserv-price_unit = '1'.
        ls_poserv-GR_PRICE = '25'.
        ls_poserv-TAX_CODE = 'V0'.
        ls_poserv-MATL_GROUP = '6AD'.
        APPEND : ls_poserv TO gt_poserv,
               ls_poservx TO gt_poservtxt.
    message getting is
    500000280 00010 Purchase order still contains faulty items
    500000280 00010 No instance of object type PurchaseOrder has been created. External reference:
    500000280 00010 Please maintain services or limits
    please help me
    Appropriate points will be rewarded.
    Arun

    Dear Seshu,
    This is not the problem with data, coz, i am able to create the PO (Service) Manually.
    please let me know what all tabeles, i need to pass for this BAPI_PO_CREATE1
    presently I am passing
    CALL FUNCTION 'BAPI_PO_CREATE1'
           EXPORTING
                poheader          = g_pohdr
                poheaderx         = g_pohdrx
               testrun           = 'X'
           IMPORTING
                exppurchaseorder  = l_ponum
           TABLES
                return            = lt_return
                poitem            = gt_poitem
                poitemx           = gt_poitemx
                poaccount         = gt_poacct
                poaccountx        = gt_poacctx
                POSERVICES        = gt_poserv
                POSRVACCESSVALUES = gt_poservacc
    Regards
    Arun

  • Any Function module/BAPI to create Service Notification wrf to Contract

    Hi Experts,
    Is there any BAPI/FM to create service notification with reference to Contract.
    Thanks & Regards,
    Vishnu Priya

    .

  • A function module to create service confirmation

    Hello,everyone
    I need your help.
    I'm looking for a function module to create crm service confirmation.
    Can you give me some help.
    Thanks.

    Hi,
    You can find a very simple example of function module CRM_ORDER_MAINTAIN at SDN WIKI:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/crm/creation%252bof%252bquatation%252bsample%252bcode
    Cheers,

  • BAPI for creating service entry

    Hi all,
    Please let me know if there is a BAPI for creatuing service entry. Please provicde sample code.
    Thanks,
    Rajan

    Hi,
    Try this BAPI " BAPI_SERVICE_CREATE ".
    Regards
    Milan

  • How to create Service Order using bapi BAPI_ALM_ORDER_MAINTAIN

    Hi,
    I want to create the Service Order with multiple Operations & Components.
    I am using this bapi BAPI_ALM_ORDER_MAINTAIN.
    But this BAPI creates the service order with only one Operation at a time. Can multiple operations be created using this bapi.
    If not could any one please guide to use this or other BAPI to create Service Order with multiple Operations & Components?
    Thank's in advance,
    Chetan

    Read the Documentation of the BAPI.
    Operations and Components are table parameters, you can pass multiple data. did you check that....

  • Problem in Pricing Condition Type : In Service Confirmation

    Hi,
    I am trying to create Service Confirmation from Sevice Order. I am tring to edit service Item details.
    I assigned valuation type as "Saturday". As per the actual result, one condition type(ZS13) for surcharge should get added in Item Pricing details. But, it is not getting added.
    Can you plesse tell me, what configuration I need to do to add ZS13(condition type) automatically, when I select, valuation type.
    Thanks,
    Sandeep

    hi,
    Please check whether the condition type ZS13 has access sequence assigned having the condition table with Valuation Type as one of the fields.
    Also check whether the accessses above this condition table are not exclusive.
    The pricing trace may help you to analyse why this condition is not determined.
    regards,
    Chait

  • Function Module to Create Service Order (IW31)

    Hi All
    Kindly let me is there any function Module or BAPI to create Service order (Transaction IW31).
    Thanks

    Found Solution

  • Create Service Contract using BAPI_SLSTRANSACT_CREATEMULTI

    Hi,
    In my requirement, I have to create a Service Contract from flat file by using BAPI - BAPI_SLSTRANSACT_CREATEMULTI and data which are comming from flat files are, <b>Serial number, Sold-to party, Ship-to party, Installation date, Contract start date, Contract end date, Service profile, Response profile.</b>
    Please suggest me what are the Import parameters should I pass in this BAPI to create Service Contract?
    Thanks in Advance,
    Deepesh

    Hi Deepesh ,
    Please use BAPI_BUSPROCESSND_CREATEMULTI for creating the service contract.This is better in terms of functionality and usage , though very similar to BAPI_SLSTRANSACT_CREATEMULTI in terms of its interface.
    You need to call :
    1. BAPI_BUSPROCESSND_CREATEMULTI
    2. BAPI_BUSPROCESSND_SAVE
    3. BAPI_TRANSACTION_COMMIT 
    in succession.
    As far as filling the import parameters is concerned,
    1.All your dates would go to APPOINTMENT_H or APPOINTMENT_I ( Header or Item)
    2.Sold-to Party, Ship-to Party would go to PARTNER.
    Regards,
    Rishi.

  • How to creating Service Contract using BAPI_SLSTRANSACT_CREATEMULTI

    Hi,
    In my requirement, I have to create a Service Contract from flat file by using BAPI - BAPI_SLSTRANSACT_CREATEMULTI  and data which are comming from flat files are, Serial number, Sold-to party, Ship-to party, Installation date, Contract start date, Contract end date, Service profile, Response profile.
    Please suggest me what are the Import parameters should I pass in this BAPI to create Service Contract?
    Thanks in Advance,
    Deepesh

    Hi All,
    for everybody's benefit (and to avoid you the time I've spent to work this out...), here is a working example on how to create an sales order (TA) via the BAPI_SLSTRANSACT_CREATEMULTI.
    Not really a Service Contract, but it tells you how to call the BAPI.
    Points appreciated, if you find this helpful...
    I use the convention entryField for the values that should be set based on your system.
    Cheers
    G
    *& Report  ZZGVBAPISALESORDER
    REPORT  ZZGVBAPISALESORDER.
    include constants
    include crm_direct.
    // GUIDs
    data: lv_guid_h       type GUID_32,
          lv_guid_i       type GUID_32,
          lv_guid_sl      type GUID_32,
          lv_guid_p       type GUID_32.
    // Handles
    data: lv_current_handle type crmt_handle,
          lv_handle_h      type crmt_handle,
          lv_handle_i      type crmt_handle,
          lv_handle_sl     type crmt_handle,
          lv_handle_p      type crmt_handle.
    // Administration header + item + etc
    data: lt_salesorder_header type table of bapibus20001_header_ins,
          ls_salesorder_header type bapibus20001_header_ins,
          lt_salesorder_item   type table of bapibus20001_item,
          ls_salesorder_item   type bapibus20001_item,
          lt_scheduleline      type table of BAPIBUS20001_SCHEDLIN,
          ls_scheduleline      type BAPIBUS20001_SCHEDLIN,
          lt_partner           type table of BAPIBUS20001_PARTNER_INS,
          ls_partner           type BAPIBUS20001_PARTNER_INS,
          ls_logical_key       TYPE crmt_partner_logic_partner_key,
          lt_organisation      type table of BAPIBUS20001_ORGMAN_INS,
          ls_organisation      type BAPIBUS20001_ORGMAN_INS.
    // Saved sales orders
    data: lt_saved_process type table of bapibus20001_object_id,
          ls_saved_process type bapibus20001_object_id,
          ls_salesorder    type CRMT_RETURN_OBJECTS_STRUC.
    data: lt_input_fields type table of bapibus20001_input_fields,
          ls_input_fields type bapibus20001_input_fields,
          lt_return type table of bapiret2,
          ls_return type bapiret2.
    // Macro definition to populate structure and input field
    This, called as
    setfield 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, I haven't used the macro,
    to show how the code should look.
    I've used the macro 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  = 'TA'.
    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 (I needed this, you 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 salesOrgResp(input).
    setfield ls_organisation SALES_ORG salesOrg(input).
    setfield ls_organisation DIS_CHANNEL disChannel(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).
    *_set_field ls_salesorder_item ITM_TYPE 'TAN'.
    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 '1.000'.
    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 bpNumber(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.
    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 'B'.            "manual entry...
    setfield ls_partner PARTNER_FCT customFct(input).
    setfield ls_partner PARTNER_NO bpNumber(input).
    setfield ls_partner NO_TYPE 'BP'.
    setfield ls_partner DISPLAY_TYPE 'BP'.
    setfield ls_partner TITLE 'Mr.'.
    setfield ls_partner FIRSTNAME 'John'.
    setfield ls_partner LASTNAME 'Smith'.
    setfield ls_partner STR_SUPPL1 'John Smith and Co'.
    setfield ls_partner STREET 'Street1'.
    setfield ls_partner STR_SUPPL3 'Street4'.
    setfield ls_partner HOUSE_NO '42'.
    setfield ls_partner CITY 'Townville'.
    setfield ls_partner DISTRICT 'Districtshire'.
    setfield 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'.
    INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01.
    The include contains only this:
    ***INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01 .
    *&      Form  get_guid
          text
         <--guid  text
    FORM get_guid  CHANGING GUID.
      CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
          IMPORTING
               UUID    = GUID.
    ENDFORM.                    " get_guid

Maybe you are looking for