BAPI ISSUE:BAPI_SALESORDER_CREATEFROMDAT2

HI
I want to create Sales Order with BAPI:SALESORDER_CREATEFROMDAT2
have some field i can't be sure!
one question:
Unloading Point field(KUWEV-ABLAD):
in my company one SOLD TO Customer have some Unloading Point's.
so this filed will fill by hand.
i can find Unloading Point field in BAPI_SALESORDER_CREATEFROMDAT2
   of parameter:ORDER_PARTNERS.
so in report i fill Unloading Point value:
Partner data
Sold to
    partner-partn_role = 'AG'.
    partner-partn_numb = IN_DATA-SO_KUNNR.
    partner-UNLOAD_PT  = IN_DATA-ABLAD.
    APPEND partner.
this method is right?
two question:
in the table VBKD (Sales Document: Business Data) have a filed:VBKD-TRATY
   (Means-of-Transport Type).
i can't find reference field in BAPI_SALESORDER_CREATEFROMDAT2.
who can tell me where to fill this field.
help!!!!
thank you!

** プログラムID       : ZBAPI_SALESORDER_CREATE               *
** プログラム名称         : Upload Sales Order Creation                   *
** 処理概要           :                                       *
** 作成者           : Karthik.P                             *
** 作成日           : 2006/08/10                            *
REPORT  ZBAPI_SALESORDER_CREATE LINE-SIZE 132 MESSAGE-ID ZMMBAPI .
       Internal table definition                                     *
****<<<<<Communication Fields: Sales and Distribution Document Header>>>>>>>>
DATA: GT_ORDER_HEADER_IN LIKE BAPISDHD1,
*******<<<Checkbox Fields for Sales and Distribution Document Header>>>>>>>>>
      GT_ORDER_HEADER_INX  LIKE    BAPISDHD1X,
*****<<<<<Return Parameter>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      GT_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,  " Return Messages
*********<<<Communication Fields: Sales and Distribution Document Item<>>>>>
      GT_ORDER_ITEMS_IN LIKE BAPISDITM OCCURS 0 WITH HEADER LINE, " Item Data
*********<<<Communication Fields: Sales and Distribution Document Item>>>>>>>
      GT_ORDER_ITEMS_INX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE, "Item Data Checkbox
*********<<<Communication Fields: Sales and Distribution Document Item>>>>>>>
      GT_SALESDOCUMENT LIKE BAPIVBELN-VBELN , "Number of Generated Document
*********<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
      GT_ORDER_PARTNERS  LIKE BAPIPARNR OCCURS 0 WITH HEADER LINE, "Document Partner
********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
      GT_ORDER_SCHEDULES_IN LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE, "Schedule Line Data
****<<<<<<<<Checkbox List for Maintaining Sales Document Schedule Line>>>>>>>>
      GT_ORDER_SCHEDULES_INX LIKE BAPISCHDLX OCCURS 0 WITH HEADER LINE, " Checkbox Schedule Line Data
*******Communication Fields for Maintaining Conditions in the Order
      GT_ORDER_CONDITIONS_IN  LIKE BAPICOND OCCURS 0 WITH HEADER LINE,
******Communication Fields for Maintaining Conditions in the Order
      GT_ORDER_CONDITIONS_INX LIKE BAPICONDX OCCURS 0 WITH HEADER LINE.
       Data definition                                               *
DATA:  BEGIN OF GT_FT_SALES OCCURS 0,
       DOC_TYPE(4)  ,        "Sales Document Type
       SALES_ORG(4) ,        "Sales Organization
       DISTR_CHAN(2)  ,      "Distribution Channel
       DIVISION(2)   ,       "DIVISION(2)
       SALES_DIST(6)  ,      "Sales district
       INCOTERMS1(3)  ,      "Incoterms (part 1)
       INCOTERMS2(28)  ,     "Incoterms (part 2)
       PMNTTRMS(4)  ,        "Terms of payment key
       PRICE_DATE(8) ,       "Date for pricing and exchange rate
       PURCH_NO_C(35)  ,     "Customer purchase order number
       PURCH_NO_S(35)  ,     "Ship-to Party's Purchase Order Number
       EXCHG_RATE(8)  ,      "Directly quoted exchange rate for pricing and statistics
       CURRENCY(5) ,         "SD document currency
       MATERIAL(18),         "MATERIAL
       TARGET_QTY(13)  ,     "Target quantity in sales units
       ITEM_CATEG(4)  ,      "Sales document item category
       MATL_GROUP(8)  ,      "Material Group
       PURCH_NO_C1(35),      "Customer purchase order number
       SALES_DIST1(6)  ,     "Sales district
       INCOTERMS11(3)  ,     "Incoterms (part 1)
       INCOTERMS21(28),     "Incoterms (part 2)
       PMNTTRMS1(4)  ,     "Terms of payment key
       EXCHG_RATE1(8) ,    "Directly quoted exchange rate for pricing and statistics
       PRICE_DATE1(8) ,    "Date for pricing and exchange rate
       TRG_QTY_NO(5)    , "Factor for converting sales units to base units (target qty)
       DIVISION1(2)     ,                                   "DIVISION1
       SALQTYNUM(5)     , "Numerator (factor) for conversion of sales quantity into SKU
       GROSS_WGHT(3)    , "Gross Weight of the Item
       NET_WEIGHT(15)    , "Net Weight of the Item
       UNTOF_WGHT(3)    ,"Weight Unit
       PARTN_ROLE(2)   ,"Partner function
       PARTN_NUMB(10)   ,"Customer Number 1
********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
       ITM_NUMBER(6) ,"Item number of the SD document
       REQ_QTY(8)  , "Schedule line date
       DLV_DATE(8)  , "Schedule line date
       MS_DATE(8)  , "Material availability date
       LOAD_DATE(8) , "Loading time (local time with reference to a shipping point)
       GI_DATE(8), "Time of goods issue (local DATE, with reference to a plant)
       TP_DATE(8)  , "Transportation planning -time (local w/ref. to shipping pnt)
       ITM_NUMBER2(6) , "Condition item number
END OF GT_FT_SALES,
       MSG(240) TYPE  C,  " Return Message
       E_REC(8) TYPE C,    " Error Records Counter
       REC_NO(8) TYPE C, " Records Number Indicator
       S_REC(8) TYPE C,   " Successful Records Counter
       T_REC(8) TYPE C.   " Total Records Counter
selection block for EXCEL UPLOAD FILE>>>>>>>>>>>>>>>>>>>>>>>>
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
  PARAMETERS FILE TYPE  IBIPPARMS-PATH OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
*<<<<AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .>>>>>>>>>>>>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME  = SYST-CPROG
      DYNPRO_NUMBER = SYST-DYNNR
    IMPORTING
      FILE_NAME     = FILE.
**<<<<<<<<<<<<<<<<<START-OF-SELECTION.>>>>>>>>>>>>>>>>>>>>>>>>>>>
START-OF-SELECTION.
  CALL FUNCTION 'WS_UPLOAD'                                 "#EC *
    EXPORTING
      FILENAME                = FILE
      FILETYPE                = 'DAT'
    TABLES
      DATA_TAB                = GT_FT_SALES
    EXCEPTIONS
      CONVERSION_ERROR        = 1
      FILE_OPEN_ERROR         = 2
      FILE_READ_ERROR         = 3
      INVALID_TYPE            = 4
      NO_BATCH                = 5
      UNKNOWN_ERROR           = 6
      INVALID_TABLE_WIDTH     = 7
      GUI_REFUSE_FILETRANSFER = 8
      CUSTOMER_ERROR          = 9
      NO_AUTHORITY            = 10
      OTHERS                  = 11.
  IF  SY-SUBRC <> 0  .
    MESSAGE E000.
  ENDIF.
  SKIP 3.
  FORMAT COLOR COL_HEADING INVERSE ON.
    WRITE 40 TEXT-001.
  FORMAT COLOR COL_HEADING INVERSE OFF.
  SKIP 1.
  FORMAT COLOR COL_NEGATIVE INVERSE ON.
    WRITE :/ TEXT-002, 13 SY-MANDT , 104 TEXT-003, 111 SY-UNAME,
              / TEXT-004, 13 SY-DATUM , 104 TEXT-005, 111 SY-UZEIT.
  FORMAT COLOR COL_NEGATIVE INVERSE OFF.
  SKIP 3.
  LOOP AT GT_FT_SALES.
      PERFORM SLALE_UPLOAD_DATA.
  ENDLOOP.
  T_REC = E_REC + S_REC.
  SKIP 3.
  FORMAT COLOR COL_TOTAL INVERSE ON.
    WRITE: /38 TEXT-007, T_REC.
  FORMAT COLOR COL_TOTAL INVERSE OFF.
  FORMAT COLOR COL_NEGATIVE INVERSE ON.
    WRITE: /38 TEXT-008, E_REC.
  FORMAT COLOR COL_NEGATIVE INVERSE OFF.
  FORMAT COLOR COL_TOTAL INVERSE ON.
    WRITE: /38 TEXT-009, S_REC.
  FORMAT COLOR COL_TOTAL INVERSE OFF.
*&      Form  SLALE_UPLOAD_DATA
      text
-->  p1        text
<--  p2        text
FORM SLALE_UPLOAD_DATA .
*******<<<<<<<<<<Communication Fields: Sales and Distribution Document Header>>>>>>
    GT_ORDER_HEADER_IN-DOC_TYPE =    'TA'.
    GT_ORDER_HEADER_IN-SALES_ORG =  GT_FT_SALES-SALES_ORG . "'0001'
    GT_ORDER_HEADER_IN-DISTR_CHAN = GT_FT_SALES-DISTR_CHAN. "'01'
    GT_ORDER_HEADER_IN-DIVISION  =   GT_FT_SALES-DIVISION.  " '01'
    GT_ORDER_HEADER_IN-SALES_DIST = GT_FT_SALES-SALES_DIST ."'000001'
    GT_ORDER_HEADER_IN-INCOTERMS1 = GT_FT_SALES-INCOTERMS1.  "'CFR'
    GT_ORDER_HEADER_IN-INCOTERMS2 = GT_FT_SALES-INCOTERMS2 . "'HAMBURG'
    GT_ORDER_HEADER_IN-PMNTTRMS = GT_FT_SALES-PMNTTRMS .    "'0001'
    GT_ORDER_HEADER_IN-PRICE_DATE = GT_FT_SALES-PRICE_DATE ."'20060818'
    GT_ORDER_HEADER_IN-PURCH_NO_C =  '32'.
    GT_ORDER_HEADER_IN-PURCH_NO_S =   '32'.
    GT_ORDER_HEADER_IN-EXCHG_RATE =  GT_FT_SALES-EXCHG_RATE ."'1.00000'
    GT_ORDER_HEADER_IN-CURRENCY = GT_FT_SALES-CURRENCY . " 'EUR'
********<<<Checkbox Fields for Sales and Distribution Document Header>>>>>>>>>
    GT_ORDER_HEADER_INX-DOC_TYPE   = 'X'.
    GT_ORDER_HEADER_INX-SALES_ORG  = 'X'.
    GT_ORDER_HEADER_INX-DISTR_CHAN = 'X'.
    GT_ORDER_HEADER_INX-DIVISION   = 'X'.
    GT_ORDER_HEADER_INX-SALES_DIST = 'X'.
    GT_ORDER_HEADER_INX-INCOTERMS1 = 'X'.
    GT_ORDER_HEADER_INX-INCOTERMS2 = 'X'.
    GT_ORDER_HEADER_INX-PMNTTRMS =   'X'.
    GT_ORDER_HEADER_INX-PRICE_DATE = 'X'.
    GT_ORDER_HEADER_INX-PURCH_NO_C = 'X'.
    GT_ORDER_HEADER_INX-PURCH_NO_S = 'X'.
    GT_ORDER_HEADER_INX-EXCHG_RATE =  'X'.
    GT_ORDER_HEADER_INX-CURRENCY = 'X'.
*****<<<<<<Communication Fields: Sales and Distribution Document Item>>>
    GT_ORDER_ITEMS_IN-ITM_NUMBER = '000010'.
    GT_ORDER_ITEMS_IN-MATERIAL  =  GT_FT_SALES-MATERIAL .
    GT_ORDER_ITEMS_IN-PO_ITM_NO = '32'.
    GT_ORDER_ITEMS_IN-CUST_MAT22 = 'AGNI-IV'.
    GT_ORDER_ITEMS_IN-BILL_DATE = '20060808'.
    GT_ORDER_ITEMS_IN-PLANT = '0001'.
*GT_ORDER_ITEMS_IN-STORE_LOC = '0001'.
    GT_ORDER_ITEMS_IN-TARGET_QTY = GT_FT_SALES-TARGET_QTY . "'1000'
    GT_ORDER_ITEMS_IN-ITEM_CATEG = GT_FT_SALES-ITEM_CATEG . "'TAN'
    GT_ORDER_ITEMS_IN-MATL_GROUP = GT_FT_SALES-MATL_GROUP . "'01'
    GT_ORDER_ITEMS_IN-PURCH_NO_C = GT_FT_SALES-PURCH_NO_C . "'32'
    GT_ORDER_ITEMS_IN-SALES_DIST = GT_FT_SALES-SALES_DIST . "'000001'
    GT_ORDER_ITEMS_IN-INCOTERMS1 = GT_FT_SALES-INCOTERMS1 . "'CFR'
    GT_ORDER_ITEMS_IN-INCOTERMS2 = GT_FT_SALES-INCOTERMS2 . "'HAMBURG'
    GT_ORDER_ITEMS_IN-PMNTTRMS = GT_FT_SALES-PMNTTRMS  .    "'0001'.
    GT_ORDER_ITEMS_IN-EXCHG_RATE = GT_FT_SALES-EXCHG_RATE . "'1.00000'
    GT_ORDER_ITEMS_IN-PRICE_DATE = GT_FT_SALES-PRICE_DATE . "'20060808'
*GT_ORDER_ITEMS_IN-SALES_UNIT = 'DZ'.
    GT_ORDER_ITEMS_IN-TRG_QTY_NO = GT_FT_SALES-TRG_QTY_NO . "'23'
    GT_ORDER_ITEMS_IN-DIVISION = GT_FT_SALES-DIVISION   .   "'01'
    GT_ORDER_ITEMS_IN-SALQTYNUM = GT_FT_SALES-SALQTYNUM .   "'32'
    GT_ORDER_ITEMS_IN-GROSS_WGHT = GT_FT_SALES-GROSS_WGHT.  " ' 25272000'
    GT_ORDER_ITEMS_IN-NET_WEIGHT = GT_FT_SALES-NET_WEIGHT.  "'24464000'
    GT_ORDER_ITEMS_IN-UNTOF_WGHT = GT_FT_SALES-UNTOF_WGHT . " 'KG'
*GT_ORDER_ITEMS_IN-CURRENCY = 'EUR'.
    APPEND  GT_ORDER_ITEMS_IN.
****<<<<<<Communication Fields: Sales and Distribution Document Item>>>
    GT_ORDER_ITEMS_INX-ITM_NUMBER = '000010'.
    GT_ORDER_ITEMS_INX-MATERIAL = 'X'.
*GT_ORDER_ITEMS_INX-PO_ITM_NO = 'X'.
    GT_ORDER_ITEMS_INX-CUST_MAT22 = 'X'.
    GT_ORDER_ITEMS_INX-BILL_DATE = 'X'.
    GT_ORDER_ITEMS_INX-PLANT = 'X'.
*GT_ORDER_ITEMS_INX-STORE_LOC = 'X'.
    GT_ORDER_ITEMS_INX-TARGET_QTY = 'X'.
    GT_ORDER_ITEMS_INX-ITEM_CATEG = 'X'.
    GT_ORDER_ITEMS_INX-MATL_GROUP = 'X'.
    GT_ORDER_ITEMS_INX-PURCH_NO_C = 'X'.
    GT_ORDER_ITEMS_INX-SALES_DIST = 'X'.
    GT_ORDER_ITEMS_INX-INCOTERMS1 = 'X'.
    GT_ORDER_ITEMS_INX-INCOTERMS2 = 'X'.
    GT_ORDER_ITEMS_INX-PMNTTRMS = 'X'.
    GT_ORDER_ITEMS_INX-EXCHG_RATE = 'X'.
    GT_ORDER_ITEMS_INX-PRICE_DATE = 'X'.
*GT_ORDER_ITEMS_INX-SALES_UNIT = 'X'.
    GT_ORDER_ITEMS_INX-TRG_QTY_NO = 'X'.
    GT_ORDER_ITEMS_INX-DIVISION = 'X'.
    GT_ORDER_ITEMS_INX-SALQTYNUM = 'X'.
    GT_ORDER_ITEMS_INX-GROSS_WGHT =  'X'.
    GT_ORDER_ITEMS_INX-NET_WEIGHT = 'X'.
    GT_ORDER_ITEMS_INX-UNTOF_WGHT = 'X'.
*GT_ORDER_ITEMS_IN-CURRENCY = 'x'.
    APPEND  GT_ORDER_ITEMS_INX.
*****<<<<<<Communications Fields: SD Document Partner: WWW
    GT_ORDER_PARTNERS-PARTN_ROLE =   'WE'.
    GT_ORDER_PARTNERS-PARTN_NUMB =  '0000000057'.
***GT_ORDER_PARTNERS-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER . " '000010'.
    APPEND  GT_ORDER_PARTNERS.
*********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
    GT_ORDER_SCHEDULES_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER." '000010'
    GT_ORDER_SCHEDULES_IN-REQ_QTY = GT_FT_SALES-REQ_QTY .   "'234'
    GT_ORDER_SCHEDULES_IN-DLV_DATE = GT_FT_SALES-DLV_DATE  ."  '20060824'.
    GT_ORDER_SCHEDULES_IN-MS_DATE =  GT_FT_SALES-MS_DATE .  "'20060808'
    GT_ORDER_SCHEDULES_IN-LOAD_DATE = GT_FT_SALES-LOAD_DATE.  " '20060822'
    GT_ORDER_SCHEDULES_IN-GI_DATE = GT_FT_SALES-GI_DATE . " '20060823'
    GT_ORDER_SCHEDULES_IN-TP_DATE = GT_FT_SALES-TP_DATE .   "'20060821'
    APPEND  gt_ORDER_SCHEDULES_IN.
*********<<<<Communications Fields: SD Document Partner: WWW FLAG>>>>>>>>>>>>>>>>>>
    GT_ORDER_SCHEDULES_INX-ITM_NUMBER = '000010'.
    GT_ORDER_SCHEDULES_INX-REQ_QTY = 'X'.
    GT_ORDER_SCHEDULES_INX-DLV_DATE = 'X'.
    GT_ORDER_SCHEDULES_INX-MS_DATE = 'X'.
    GT_ORDER_SCHEDULES_INX-LOAD_DATE = 'X'.
    GT_ORDER_SCHEDULES_INX-GI_DATE = 'X'.
    GT_ORDER_SCHEDULES_INX-DLV_DATE = 'X'.
    APPEND  gt_ORDER_SCHEDULES_INX.
********Communication Fields for Maintaining Conditions in the Order
    GT_ORDER_CONDITIONS_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER ." '000010'
    APPEND GT_ORDER_CONDITIONS_IN.
***Communication Fields for Maintaining Conditions in the Order
    GT_ORDER_CONDITIONS_INX-ITM_NUMBER = '000010'.
    APPEND GT_ORDER_CONDITIONS_INX.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
   SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = GT_ORDER_HEADER_IN
        ORDER_HEADER_INX              = GT_ORDER_HEADER_INX
  SENDER                        =
  BINARY_RELATIONSHIPTYPE       =
  INT_NUMBER_ASSIGNMENT         =
  BEHAVE_WHEN_ERROR             =
  LOGIC_SWITCH                  =
  TESTRUN                       =
  CONVERT                       = ' '
     IMPORTING
       SALESDOCUMENT                  = GT_SALESDOCUMENT
      TABLES
       RETURN                         = GT_RETURN
        ORDER_ITEMS_IN                = GT_ORDER_ITEMS_IN
        ORDER_ITEMS_INX               = GT_ORDER_ITEMS_INX
        ORDER_PARTNERS                = GT_ORDER_PARTNERS
       ORDER_SCHEDULES_IN            =  GT_ORDER_SCHEDULES_IN
       ORDER_SCHEDULES_INX           =  GT_ORDER_SCHEDULES_INX
       ORDER_CONDITIONS_IN           =  GT_ORDER_CONDITIONS_IN
       ORDER_CONDITIONS_INX          =  GT_ORDER_CONDITIONS_INX
  ORDER_CFGS_REF                =
  ORDER_CFGS_INST               =
  ORDER_CFGS_PART_OF            =
  ORDER_CFGS_VALUE              =
  ORDER_CFGS_BLOB               =
  ORDER_CFGS_VK                 =
  ORDER_CFGS_REFINST            =
  ORDER_CCARD                   =
  ORDER_TEXT                    =
  ORDER_KEYS                    =
  EXTENSIONIN                   =
  PARTNERADDRESSES              =
    IF GT_RETURN-TYPE EQ 'E' .
      E_REC = E_REC + 1.
      READ TABLE GT_RETURN WITH KEY ID = 'V1'.
      FORMAT COLOR COL_NEGATIVE INVERSE ON.
      REC_NO = E_REC + S_REC.
          CONCATENATE TEXT-006 REC_NO ':'
          GT_RETURN-MESSAGE INTO MSG SEPARATED BY SPACE .
          CONDENSE MSG.
          WRITE: / MSG.
      FORMAT COLOR COL_NEGATIVE INVERSE OFF.
  ELSEIF GT_RETURN-TYPE EQ 'S'.
      S_REC = S_REC + 1.
      FORMAT COLOR COL_POSITIVE INVERSE ON.
          MSG = GT_RETURN-MESSAGE.
          CONDENSE MSG.
          WRITE: / MSG .
      FORMAT COLOR COL_POSITIVE INVERSE OFF.
     PERFORM COMMIT_MM.
ENDIF.
      CLEAR:  GT_RETURN[], MSG.
ENDFORM.                    " SLALE_UPLOAD_DATA
*&      Form  COMMIT_MM
      text
-->  p1        text
<--  p2        text
FORM COMMIT_MM .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT   = 'X'
      IMPORTING
        RETURN = GT_RETURN.
  clear:      GT_ORDER_ITEMS_IN[],GT_ORDER_CONDITIONS_IN[].
ENDFORM.                    " COMMIT_MM

Similar Messages

  • BAPI - Issue in fetching non-cumulative KF for Inventory

    Hello All,
    Would kindly require ur help urgently on the issue mentioned below:
    We require the non-cumulative KF '0TOTALSTOCK' in the BW side for further processing. Now we are using BAPI to get the query executed and store the results in a table, so that we can fetch the value from the table.
    The issue occuring is, if the Reciept Total Stock and the Issue Total Stock are same which means 0TOTALSTOCK will be '0', this gets stored in the table, but when the the values for Reciept Total Stock and Issue Total Stock are not same, the job for query execution fails giving NO ERROR.
    Kindly share ur views on it, since it is critical.
    Thank you.
    PS: Transaction used for BAPI is RSCRM_BAPI, authorization is not an issue, query contains no formulas, and have performed basic checks with respect to BAPI query execution.
    Regards,
    Kunal Gandhi

    Hi Kunal,
    Check this links:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b06c3f96-ed4f-2a10-1693-f2c76a39988f
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90886731-21e4-2a10-2ebf-901c2c2b4e3d
    Basically, what you do is:
    - Define a source: in your case will be a query.
    - Define a target: you'll need to create a transactional DSO to save information.
    - Connect both: you can simply assign fields if the query is just what you need to download, or you can have routines.
    Transaction for creating APD is RSANWB. It's pretty easy and it's a graphical interface, so you should find your way easily.
    Hope this helps.
    Regards,
    Diego

  • SAP Standard BAPI Issue ---BAPI_PROCORDCONF_CREATE_TT

    Hi
    We are using the standard BAPI--  BAPI_PROCORDCONF_CREATE_TT to do Process order confirmations , which is invoked by an MII BLS using data from the MES system.
    Everything worked like a charm ( Partial confirmations, Final Confirmations, Goods Movements ie.101 etc) , but recently we implemented it a new plant. Now in this plant there is a strange Business process i.e they Do a partial confirmation of the full qty of the process order and then do a Final Confirmation with Zero Qty. let me explain
    Process order requires 100 GAL of a perticlar paint .
    First the MES system does a process order confirmation and goods Receipt of 100 Qtys  as  a Partial confirmations and then They do a Final confirmation with Qty as Zero.
    This works fine when i do it in the SAP GUI ( CORK t-code for process order confirmations and GR) but with the BAPI  BAPI_PROCORDCONF_CREATE_TT , the first transaction sets the Status of the process order the to PCNF DLV (which is as expected) .
    Next when they send a Zero Qty with a final Confirmation , the system changes the STATUS of the proces order to CNF (and removes the DLV) which does not happen with SAP GUI and CORK t-Code.
    Is there any parameter that i am missing.
    Please help me. the plant has gone live , they dont want to change the process and i need to resolve this issue.
    Regrads
    Suraj Prabhu

    Hi CKxMII
    Movement Type value i am passing is 101.
    What i am doing in MII is first i Pass the basing parameters of Plant, Order ID, Phase, Yield and Confirmation type (X for Final, Space for partial) to another standard BAPI BAPI_PROCORDCONF_GET_TT_PROP.
    Now this BAPI returns me with all the required parameters for the  actual Process Order Confirmation BAPI i.e BAPI_PROCORDCONF_CREATE_TT .
    See the issue is not that the Final or Partial Confirmation is not happening. They are happening fine. Only in case where i am doing a final confirmation with the Qty = Zero is where i am seeing the  DL Flag is dropped.
    Regards
    Suraj

  • IDOC and BAPI issue

    Hi Experts,
    I am using an idoc which is internally calling a BAPI - BAPI_ACC_DOCUMENT_POST
    I need to pass data custom fields from idoc to bapi BAPI_ACC_DOCUMENT_POST .
    For this in the change method of the BADI BADI_ACC_DOCUMENT, I have written the code.
    The BAPI has extension2 defined in it.
    The inbound idoc has a segment E1BPPAREX which has the contents like this:
    STRUCTURE
    VALUEPART1
    VALUEPART2
    VALUEPART3
    VALUEPART4
    How to fill the data to see whether my Zfields are getting passed?
    The code in the change method of the BADI is:
    DATA: WA_EXTENSION TYPE BAPIPAREX,
               WA_ACCIT TYPE ACCIT,
               EXT_VALUE TYPE C LENGTH 960,
               L_TABIX TYPE SY-TABIX.
      FIELD-SYMBOLS: <L_STRUC>  TYPE ANY,
                                   <L_FIELD> TYPE ANY.
    DATA: L_REF TYPE REF TO TE_STRUC.
      SORT C_EXTENSION2 BY STRUCTURE.
      LOOP AT C_EXTENSION2 INTO WA_EXTENSION.
        AT NEW STRUCTURE.
          CREATE DATA L_REF TYPE (WA_EXTENSION-STRUCTURE).
          ASSIGN L_REF TO <L_STRUC>.
        ENDAT.
        CONCATENATE WA_EXTENSION-VALUEPART1 WA_EXTENSION-VALUEPART2
                    WA_EXTENSION-VALUEPART3 WA_EXTENSION-VALUEPART4
           INTO EXT_VALUE.
        MOVE EXT_VALUE TO <L_STRUC>.
        ASSIGN COMPONENT 'ITEMNO_ACC' OF STRUCTURE <L_STRUC> TO <L_FIELD>.
        CLEAR: WA_ACCIT.
        READ TABLE C_ACCIT WITH KEY POSNR = <L_FIELD> INTO WA_ACCIT.
        IF SY-SUBRC IS INITIAL.
          L_TABIX = SY-TABIX.
          MOVE-CORRESPONDING <L_STRUC> TO WA_ACCIT.
          MODIFY C_ACCIT FROM WA_ACCIT INDEX L_TABIX TRANSPORTING ZZPRDCD
                                                                  ZZXXX
                                                                   ZZXXX.
                                                                     ENDIF.
      ENDLOOP.
    where ZZXXX is my custom fields.
    Regards,
    Sangeeta.

    Hi,
    I donu2019t know , if I understand  ur issue correctly or not.
    You wanna know whether ur zfield in the extension idoc are getting fiiled thru Bapi or not?
    Just go to WE19 and give any Existing idoc number realted to Document posting and fill the Extended segments with your data and execute. Befor this put a break-point in ur badi implemantation and check it.
    Revrt back if any issues.
    regards,
    Naveen

  • Simultaneous background jobs using the same BAPI issue

    I scheduled 2 simultaneous background jobs on a custom program using the same BAPI (closing PM orders).
    Run 1 to CLSD orders created on year 2001
    Run 2 to CLSD orders created on year 2000
    What happened was while run 1 was still active, run 2 encountered a dump and was cancelled.
    Upon checking in ST22, dump was generated in CO_ZV_CONSISTENCY_CHECK.
    Also, Run 2's dump happened when it encountered a data inconsistency for an order number being processed for Run 1.
    Since the BAPI is being accessed at the same time by the two jobs, Is it possible that the commit work on run 1 could affect the processing for the Run 2, hence the data inconsistency?
    Is this a buffer issue?
    Additionally, no dump is encountered when Run 1 or Run 2 is run by itself.
    I also encountered this issue before for creating Project and WBS using BAPI, but the solution we came up with was not to do parallel runs to avoid the error as this was a one time upload only.

    If the second job is dependent on the 1st job, then use following logic which will let you know the status of 1st job. Once 1st job is completed, call JOB_OPEN of 2nd job.
    ENDLESS loop till 1st job is completed
    DO.
    CALL FUNCTION 'BP_JOB_READ'
        EXPORTING
          job_read_jobcount     = w_jobcount
          job_read_jobname      = w_jobname
          job_read_opcode       = '20'
        IMPORTING
          job_read_jobhead      = wa_jobhead
        TABLES
          job_read_steplist     = i_jobsteplist
        EXCEPTIONS
          invalid_opcode        = 1
          job_doesnt_exist      = 2
          job_doesnt_have_steps = 3
          OTHERS                = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    To Display the status text as per the status type
      CASE wa_jobhead-status.
        WHEN 'S'. WRITE: / text-006. "'Scheduled'.
        WHEN 'R'. WRITE: / text-007. "'Released'.
        WHEN 'F'. WRITE: / text-008. "'Completed'.
        WHEN 'A'. WRITE: / text-009. "'Cancelled'.
        WHEN OTHERS.
      ENDCASE.
    IF wa_jobhead-status = 'F'.
    exit.
    ENDIF.
    ENDDO.
    PERFORM OPEN_2nd_JOb.

  • SAVE BAPI Issue in Parallel Processing

    Hello Friends,
    I have used this BAPI  'BAPI_POSRVAPS_SAVEMULTI3' to Save Some Orders in SAP APO. I have given option to run the program both in Normal Mode and Parallel Processing mode..
    In Normal mode it is able to save the data with Class Characteristics, But in Parallel Processing it is unable to save the  Class Characteristics values.
    We are passing same set of data both in Normal and Parallel Processing...
    But we are encountering this issue only in Parallel Processing... During this Save the POSEX in getting cleared in the receipts table t_orders_consolidated after Commit.... due to this it is unable to save the characteristics information stored in t_CFGH, T_CFGI and T_CFGV.
    We have also raised an OSS Message.
    But this is working fine as expected in Normal mode..
    Please advise... Its little critical to close this week...attached is some screen shots of the debug mode values...
    CALL FUNCTION 'BAPI_POSRVAPS_SAVEMULTI3'
                STARTING NEW TASK v_pp_taskname
                DESTINATION IN GROUP as_processing_options-server_group
                CALLING receive_update_orders_parallel ON END OF TASK
                EXPORTING
                  logical_system        = im_v_logsys
                  ext_number_assignment = abap_false
                  plng_version          = im_v_vrsio
                  no_create            = abap_true
                TABLES
                  receipts              = t_orders_consolidated
                  receipts_x            = t_orders_consolidated_x
                  cfg_headers          = t_cfgh
                  cfg_instances        = t_cfgi
                  cfg_values            = t_cfgv
                  return                = t_return
                  extension_in          = t_extension_in
                EXCEPTIONS
                  system_failure        = 1
                  communication_failure = 2
                  resource_failure      = 3.

    Hi Kunal,
    Check this links:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b06c3f96-ed4f-2a10-1693-f2c76a39988f
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90886731-21e4-2a10-2ebf-901c2c2b4e3d
    Basically, what you do is:
    - Define a source: in your case will be a query.
    - Define a target: you'll need to create a transactional DSO to save information.
    - Connect both: you can simply assign fields if the query is just what you need to download, or you can have routines.
    Transaction for creating APD is RSANWB. It's pretty easy and it's a graphical interface, so you should find your way easily.
    Hope this helps.
    Regards,
    Diego

  • SAP FSRI - Insurance : BAPI Issue

    Hi All,
    Has anyone worked on SAP FSRI module and specifically the BAPI  "/MSG/BAPI_RISK_MODIFY_MULTIPLE". If yes could you please share how to execute this?
    Thanks,
    Stephen

    Hi CKxMII
    Movement Type value i am passing is 101.
    What i am doing in MII is first i Pass the basing parameters of Plant, Order ID, Phase, Yield and Confirmation type (X for Final, Space for partial) to another standard BAPI BAPI_PROCORDCONF_GET_TT_PROP.
    Now this BAPI returns me with all the required parameters for the  actual Process Order Confirmation BAPI i.e BAPI_PROCORDCONF_CREATE_TT .
    See the issue is not that the Final or Partial Confirmation is not happening. They are happening fine. Only in case where i am doing a final confirmation with the Qty = Zero is where i am seeing the  DL Flag is dropped.
    Regards
    Suraj

  • How can we solve the bapi issues ???

    Dear Experts ,
    i have created bapi  while activating the function pool  the error would be occurred that is the report doesnot start with function pool.

    Hi,
    BAPI's are just like FM. The major difference being BAPI's are remote enabled. I hope your issue will be resolved but if it doesn't, please do let us know with the screenshot.
    Regards
    Purnand

  • BAPI Issue

    We have a setup wherin an external system( C++ Program running on UNIX) makes a remote call to BAPI_DOCUMENT_CHECKOUTVIEW2 on a dev server(Windows) to get the file originals from DMS vault to a target path. We are able to copy the file to a windows target filepath like //servername/ex/out/ , but it does not work if the target path is unix. Any input is highly appreciated.
    Thanks,
    Rohit

    Hello again,
    there is a FM for uploading data using the ftp server.
    Check this fm: FTP_SERVER_TO_R3 or To FTP using ABAP, you can have a look at the standard program 'RSEPSFTP'.
    Check this code I found on the sdn.
    SAP FTP functions
    This sample program will logged into your Unix Server.
    Issue a Unix dir command
    Store the dir information in the Internal table and display it.
    Make sure you can telnet in to your SAP-UNIX FTP server first.
    Written by : SAP Basis, ABAP Programming and Other IMG Stuff
    http://www.sap-img.com
    REPORT ZFTPSAP LINE-SIZE 132.
    DATA: BEGIN OF MTAB_DATA OCCURS 0,
    LINE(132) TYPE C,
    END OF MTAB_DATA.
    DATA: MC_PASSWORD(20) TYPE C,
    MI_KEY TYPE I VALUE 26101957,
    MI_PWD_LEN TYPE I,
    MI_HANDLE TYPE I.
    START-OF-SELECTION.
    *-- Your SAP-UNIX FTP password (case sensitive)
    MC_PASSWORD = 'password'.
    DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.
    *-- FTP_CONNECT requires an encrypted password to work
    CALL 'AB_RFC_X_SCRAMBLE_STRING'
    ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
    ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
    ID 'DSTLEN' FIELD MI_PWD_LEN.
    CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
    *-- Your SAP-UNIX FTP user name (case sensitive)
    USER = 'userid'
    PASSWORD = MC_PASSWORD
    *-- Your SAP-UNIX server host name (case sensitive)
    HOST = 'unix-host'
    RFC_DESTINATION = 'SAPFTP'
    IMPORTING
    HANDLE = MI_HANDLE
    EXCEPTIONS
    NOT_CONNECTED = 1
    OTHERS = 2.
    CHECK SY-SUBRC = 0.
    CALL FUNCTION 'FTP_COMMAND'
    EXPORTING
    HANDLE = MI_HANDLE
    COMMAND = 'dir'
    TABLES
    DATA = MTAB_DATA
    EXCEPTIONS
    TCPIP_ERROR = 1
    COMMAND_ERROR = 2
    DATA_ERROR = 3
    OTHERS = 4.
    IF SY-SUBRC = 0.
    LOOP AT MTAB_DATA.
    WRITE: / MTAB_DATA.
    ENDLOOP.
    ELSE.
    do some error checking.
    WRITE: / 'Error in FTP Command'.
    ENDIF.
    CALL FUNCTION 'FTP_DISCONNECT'
    EXPORTING
    HANDLE = MI_HANDLE
    EXCEPTIONS
    OTHERS = 1.
    Hope this helps
    gabriel

  • Bapi issue with BAPI_EXCINV_CREATE_FROMDATA

    Hi Friends,
    I am using BAPI_EXCINV_CREATE_FROMDATA BAPI for excise posting of material documents.But while doing it, i am not able to post the excise as bapi is not reflecting the data into the respective tables J_1IEXCHDR and J_1IEXCDTL.
    In OBJHEADER,i am passing values of following fields:
    comp code
    plant
    excgrp
    excise year
    vendor
    ref doc 1
    year
    rtype
    PROCESS_FLAG - 'I'
    In OBJ_ITEM,i am passing following fields:
    excise date
    excise year
    excise grp
    document item
    storage loc
    material no
    chapterid
    ref doc1(po)
    ritem1
    ref doc2(po)
    rdoc year
    ritem2
    Still i am not able to post the excise.Please tell me the mistake done with this process or any alternatives.
    Thanks,
    Gaurav

    Hi,
    You can use the option Function Module -> Test-> Test Sequences option form SE37 menu. Call  BAPI_EXCINV_CREATE_FROMDATA and then BAPI_TRANSACTION_COMMIT.
    As per the FM apporach, if it meets your requirements, it is fine
    Regards,
    Sachin

  • BAPI Issues

    Hi i am using a BAPI : BAPI_SALESORDER_CHANGE.
    My requirement is:
      i have a report which displays sales order, material no and rejection code in a row.
    Now if i select a row and click on the user button (which i created it) the rejection should be empty ( get modified as blank in the database tables ) that is the material for that sales order should get unrejected.
    Could anyone pls help me how to achieve the same thru this BAPI.
    the internal table from which i display this report is itab.
    thanks
    John

    Hi,
    Change in the status of an item of a sales order implies that the sales order is changed. Hence Use the BAPI 'BAPI_SALESORDER_CHANGE', to change the Sales Order.
    In the items table structure 'ORDER_ITEM_IN'(Structure 'BAPISDITM')mark the field 'REASON_REJ' with the reason for rejection passed to the VA02 BDC.
    Point to note here is if a sales order is to be changed, then the structure 'ORDER_ITEM_INX'(Structure 'BAPISDITM') should also be populated (this is mandatory). Mark the field 'REASON_REJ' of this structure with 'X'(this means that the reason for rejection is to be updated).
    The mandatory field to be populated in both tables structures 'ORDER_ITEM_IN' and 'ORDER_ITEM_INX' is 'ITM_NUMBER', which is the item number.
    This would work.... Dont forget my points ;-).
    Regards
    Sudheer

  • BAPI_SalesOrder_CreateFromDat2 fails for items with free goods

    Hi all, I have a very weird problem when I am trying to create a sales order using SAP .net connector with the BAPI function BAPI_SalesOrder_CreateFromDat2().  The problem happens through the following scenario:
    1 - Item X has a free good rule on it that states "If user buys 5 Cartoons of Item X he will take 1 pack of Item Y free of charge" while Item Z has no rules like this
    2 - using BAPI and .net connector, an order is needed to be created with following details:
            a - Item X with quantity 6 Cartoons.
            b- Item Z with quantity 3 Cartoons
    3 - If BAPI_SalesOrder_CreateFromDat2() assigns these details to Order_Items_In with the same order (a then b),  SAP will return an error for Item z that states "No item category available (Table T184 ZKE NORM  KEN)."; while if the function tries to create the order with details in reverse order (b then a ), the order will be created successfully.
    I have done the following steps:
    1 - Tried the same order in SAP GUI but it succeeded. (So no problem in Item Category Determination)
    2 - Tries the same order with the suspicious order in the BAPI function Test inside SAP GUI (using tcode BAPI or SE37) but the function had not return any errors also.
    3 - Tried to send Item Category in code when calling the bapi function (Forced the code to KEN), but the same message appeared as SAP insist on redetermining the Item Category and return this meaningless message.
    thanks

    Hi Mohamed Abd Elbaset,
    I am facing the same issue while creating the Sales order through "BAPI_SALESORDER_CREATEFROMDAT2" All is going well in normal cases but when I process the contract with FREE GOODS line items for which free goods condition record is maintained it fails
    to create the Sales order. Is there any special treatment for this Free goods case..
    Regards,

  • Problem with the bapi.

    hi ,
    i transfered legacy data to sap system using bapi.
    for that i used salesorder creation bapi.
    'BAPI_SALESORDER_CREATEFROMDAT2'.
    it is uploading my header data and item data .
    even it set the values correctly.
    but the above rfc not creating saledocument.
    where i did mistake pls rectify my problem.

    hi michel i agree with u. i called 'bapi_transction_commit' first
    after than i called bapi_saleorder_createformdat2.
    i checked in debugging modein that function module.
    it gives sy-subrc 4 for the below statement
    fbgenmac 'BAPI_SALESORDER_CREATEFROMDAT2'.
    how i will rectify this problem.
    do u want the code.
    i will send my code.
    Edited by: kartik p on Sep 22, 2008 5:00 PM

  • Regarding BAPI_SALESORDER_CREATEFROMDAT2

    Hey guys,
    <b>Regarding BAPI "BAPI_SALESORDER_CREATEFROMDAT2"</b>
    I have developed a program for creating SALES ORDER using BAPI.(BAPI_SALESORDER_CREATEFROMDAT2)
    I want to know how to check the confirmation of values stored in sales order tables..is there any specific table
    i have to check for the datas stored or not?
    or otherwise how can i know the correct input format to fields and store the values to BAPI..
    Please guide me.
    ambichan.

    Hi,
    Check the documentation.You can get the following details.
    Short text
    Sales order: Create Sales Order
    Functionality
    You can use this method to create sales orders.
    You must enter at least sales order header data (via ORDER_HEADER_IN structure) and partner data (via the ORDER_PARTNERS table) as input parameters.
    Enter the item data via the ORDER_ITEMS_IN table. You can allocate item numbers manually, by filling in the relevant fields, or the system does it, according to the settings for Customizing, by leaving the relevant fields blank.
    If you have configurable items, you must enter the configuration data in the ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF and ORDER_CFGS_VALUE tables.
    Credit cards can be transferred via the BAPICCARD structure, on the one hand, data for card identification, on the other, data for a transaction which has taken place in an external system.
    Once you have created the sales order successfully, you will receive the document number (SALESDOCUMENT field). Any errors that may occur will be announced via the RETURN parameter.
    If no sales area has been created in the sales order header, then the system creates the sales area from the sold-to party or ship-to party, who has been entered in the partner table. If a clear sales area cannot be created, you will receive a system message, and the sales order will not be created.
    Notes
    1. Mandatory entries:
    ORDER_HEADER_IN : DOC_TYPE Sales document type
    SALES_ORG Sales organization
    DISTR_CHAN Distribution channel
    DIVISION Division
    ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
    PARTN_NUMB Customer number
    ORDER_ITEMS_IN..: MATERIAL Material number
    2. Ship-to party:
    If no ship-to party is entered, use the following: Ship-to party =
    sold-to party.
    3. Commit control:
    The BAPI does not have a database commit. This means that the relevant application must leave the commit, in order that can be carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is available for this.
    4. German key words:
    The following key words must be entered in German, independantly of
    the logon language:
    DOC_TYPE Sales document type, for example: TA for standard order
    PARTN_ROLE Partner role, for example: WE for ship-to party
    Further Information
    You can find further information in the OSS. The note 93091 contains general information on the BAPIs in SD.

  • Usage of ALE - idocs generated for BAPIs

    Hi
      I need to use - the std idocs generated for BUS2032 object - CREATEFROMDAT2 method to store the BAPI call  ( BAPI_SALESORDER_CREATEFROMDAT2 )data for those sales orders that could not be created.
    If I want to use the SAP delivered BAPI ( BAPI_SALESORDER_CREATEFROMDAT2 ) to call as it within an ABAP program - and then if the call did not go through - then log the data for BAPI into the corresponding idoc with the message type SALESORDER_CREATEFROMDAT2 ( idoc type SALESORDER_CREATEFROMDAT202 )  do I need to move the values from the BAPI structures to the idoc segments programatically ?  Or since the idoc is linked to the BAPI - by definition, is there an implicit way to move data to the corresponding idoc segments and save the idoc .
    Can anyone out there give me a code sample to do - what I have asked above ?

    Hi,
    I guess you can use function module ALE_SALESORDER_CREATEFROMDAT2 to create idoc from bapi data. You can pass the entire data in internal tables that you are passing to BAPI into above mentioned function module and then it will create an Idoc for the same. Also populate the receivers in the internal table receiver.
    KR Jaideep,

Maybe you are looking for

  • AIR Runtime Distribution License

    Should I need to sign the Adobe AIR Runtime Distribution License Agreement application with Adobe to distribute only the *.air to others. AIR runtime can be downloaded from the Adobe site. Should I need to sign the Adobe AIR Runtime Distribution Lice

  • JTextField.focusLost is called multiple times. Why?

    I have a JTextField component called projectNum. On focusLost I'm trying to prevent user to leave an empty field. But I have a problem, because focusLost is called two times. Here is a code snippet: projectNum.addFocusListener(new FocusAdapter() {   

  • Can a new calendar created in OBEE 11g ?

    We have a specific requirement to schedule reports based on the client's fiscal year. There will be certain reports that follow the fiscal year calendar and the rest follows the default Gregorian calendar. One option is to schedule the reports based

  • Location Services and battery explanation!

    Ok, so many of us are uncertain regarding leaving Location Services ON because of the battery life problem. I will explain the issue here so there will be no more questions about this: When enabling Location Services you authorize the usage of the GP

  • In QuickTime 10 is there a way to hide the movie controls when paused?

    Is there anyway to hide the movie controls in quicktime when pausing movies? It's quite irritating when trying to analyse video, especially when resolution is low, and can't move the controls out of the video window to see whole picture. There should