Create a purchase order using transaction ME21

Hello Abappers,
I want to create a STO( purchase order using the sales order data) using transcation ME21.
Kindly provide step wise details as i am a technical person adn dont have to functional knowledge to create it.Also mention where the pricing conditions, the delivery address of the receiving plant. etc will have to be mentioned.
Thanks a lot in advance.
Appropriate points wil be rewarded to.

check this link::
http://web.mit.edu/sapr3/windocs/bpors03m.htm
from Purchase Requisition
http://web.mit.edu/sapr3/windocs/bpors03n.htm

Similar Messages

  • Create a Purchase order using the BAPI using the data in the XML file.

    Hello Gurus,
    here is the scenario can anyone help me how to proceed explaining the procedure?
    Create a Purchase order using the BAPI using the data in the XML file.
    comprehensive explanations are appreciated.
    thanks in advance.

    hi,
      first use fm "bapi_po_create".
      then use fm "BAPI_ACC_GL_POSTING_POST"
    The demo environment was made with real business scenario in mind, but following subjects need to be addressed in a live implementation:
    •     No exceptions and error handling is implemented, except the order rejection (e.g. partly delivery);
    •     In Navision both XML Ports and the XML DOM has been used to integrate with SAP XI, because XML ports has some drawbacks regarding to Namespaces in XML Documents (mandatory in SAP XI);
    •     A minimum of SAP and Navision customization is required to implement this solution. (e.g. user exit in SAP, Navision XML DOM).

  • Creating a Purchase Order using ORDERS05 Idoc

    Hi Experts,
    I need to create a purchase order using ORDERS05 Idoc, with the data I am using a sales order is gettig created but I need to create a PO insted of SO.
    Please let me know what is difference between a PO and SO while using ORDERS05. Also please let me know what are all the fields that needs to chaged in the Idoc.
    Thanks,
    Suma

    Hi,
       I'm looking at a similar problem, can we use ORDERS05 IDOC basic type to create a Purchase Order?
       What is the inbound processing FM?  I tried IDOC_INPUT_ORDRSP, but it seem to only allow changes to a PO, and not creation of a PO.
       For IDOC_INPUT_ORDERS FM this one seem to only create Sales Orders?
       Which inbound FM should i be using?
    Regards.

  • How to create multiple Purchase Order  using the same document number?

    HI Friends,
    I m in a product which extracts data from SAP and stored in Access database.
    For that,while i extracting Purchase Order from the Demo Database (SBODemo_US)for OEC Computers,the same DocNum is used for several Purchase Order using Index Line numbers.
    eg:
    DocNum for Purchase Order1 -->3000   0 (Index)
      DocNum for Purchase Order2 -->3000   1 (Index)
        But i can't create multiple Purchase Order using same DocNum manually in SAP B1,Could anybody please help me <b>to create a Purchase Order using same DocumentNumber?</b>
    Thanks in Advance
    SooriyaKala.P

    Hi,
    The problem statement is not quite clear to me.
    As far as I understand your statement, I think you want to club multiple orders into one purchase order using the index incrementally.
    For this I think once you have created the first purchase order, open the purchase order in edit mode the second time and append the new line items.
    If I am getting you wrong please explain the problem statement in more detail.
    Regards,
    Rara.

  • Create a purchase order  using an existing PO

    I want to create a purchase order (ME21N) using an existing PO.
    Please help. how can i do that.
    Best regards,
    Satish

    Hi,
    In the item overview of the purchase order creation screen (ME21N), you have a column Purchasing Doc and next it item no.  You can give the existing purchase order number here with item no which will create a purchase order, and changes can be made wherever you require.
    Hope this helps.
    Thanks
    Krishna.

  • Error release purchase order using transaction code me29n

    i have warning error this purchasing document number cannot be released.
    while i enter me29n t code.why?
    then how to release purchase order using me29n t code?
    can anyone answer this two questions.

    hi
    i have warning error this purchasing document number cannot be released. while i enter me29n t code.why?
    is the release strategy is triggred for the po ?? check thisin  P order in me23n ,in header level check release strategy tab ,
    then how to release purchase order using me29n t code? can anyone answer this two questions.
    just go to me29n >release strategy tab here just click on the release button in front of the release code

  • Problem in creating Purchase order Using BAPI

    Dear ABAPers,
             I am creating the Purchase order Using BAPI_PO_CREATE1. In that the Purchase order Line item i am giving the Net Price for the Material.But While creating the purchase order the system creates the puchase order with the net price which is already available in the memory.So how to solve this problem.
    Thanks & Regards,
    Ashok.

    Hi,
        Try to pass the value NO_PRICE_FROM_PO in the BAPI and see
    NO_PRICE_FROM_PO = 'X'
    Regards
    Bala Krishna

  • Create Purchase Order using B1ws SAP 8.81

    Hi Experts I am creating a Purchase Order using the Web Services SAP 8.81 PL7 SQL 2008, the problem is when i create the PO in business one it comes without the deatails on the lines like Price and Line total what am i doing wrong this is the code for the lines
    Dim docLine As PurchaseOrdersService.DocumentDocumentLine = New   PurchaseOrdersService.DocumentDocumentLine With
                                        .ItemCode = gvItems.Rows(i).Cells(1).Value, .ItemDescription = gvItems.Rows(i).Cells(2).Value,  .Quantity = gvItems.Rows(i).Cells(5).Value, .UnitPrice = Double.Parse(gvItems.Rows(i).Cells(6).Value) _
    , .Price = Double.Parse(gvItems.Rows(i).Cells(6).Value), .LineTotal =  
    Double.Parse(gvItems.Rows(i).Cells(9).Value)}                                 If i = 0 Then 
                                         poDoc.DocumentLines = Array.CreateInstance(docLine.GetType(), Me.gvItems.RowCount - 1)
                                  End If 
                                  poDoc.DocumentLines.SetValue(docLine, i)
    Regards Ben

    Hi Benedict,
    Please review B1WS samples and documentation, it is stated there the following sentence:
    Per each object property with a type different of string an associated Boolean property with the same
    name but finishing with u201CSpecifiedu201D is automatically created by .NET environment. You are forced to set
    this property value to u201Ctrueu201D if you want the associated property to be correctly set in the DI Server SOAP
    message automatically formatted.
    Hope it helps,
    Trinidad.

  • How to create a Purchase order from XI Using ORDERS05

    Hello Experts,
    I need to create a purchase order using OREDRS05 from XI. I was not able to create and I am having these quires.
    1. What are all the mandatory fields that I need to fill in to create a purchase order?
    2. Which part of the SAP will take care of the control record? Is this done by SAP or Integration Tool?
    3. When I have tryed with an existing Inbound Idoc(On R/3 Side) its showing Satus 51 what should I do?(Error: There is no article description for item 000010)
    If Possible give me the step by step procedure to reslove..
    Thanks in Advance,
    Sai Suma

    Hi Suma,
    Check this link
    Creating Purchase Order IDOC through XI
    /people/ravikumar.allampallam/blog/2005/03/03/creating-purchase-order-idoc-through-xi
    Sachin

  • Allow to create a purchase order with purchase requisiton item deleted

    Dear all,
    I have a question about creation purchase order process.
    Firstly, I have a purchase requisition with 2 items, first of them is deleted.
    If I try to create a purchase order thru transaction ME57N with the previous purchase requisition, I can only create it with one item (the one wich is not deleted)
    However, if I try to create the purchase order thru transaction ME21N, with purchase requisition as reference, I can create the PO with item that was deleted in PR.
    I don't understand why system allows to create a purchase order with an item that previously was deleted in PR.
    Does anyone have a explanation about this issue?
    Many thanks in advance
    Best Regards.

    Hi,
    In the document overview of ME21N you get all the items of the purchase
    requisitions, no matter if they are deleted or not.
    When you convert the deleted item into a Purchase Order you get message
    06 050 stating that this item is deleted in the purchase requisition.
    This message can be defined as an error message in the customizing
    transaction OME0. This way, it will not be possible to order an item
    which is deleted in the referenced purchase requisition.
    BR
    Nadia Orlandi

  • How create a purchase order without imputation using bapi: BAPI_PO_CREATE1

    Hello Forum
    I have an request for purchase order with imputation K (cost center, EBAN-KNTTP). During the liberation of the request for purchase order, and using the Bapi: BAPI_PO_CREATE1, I want to create a Purchase Order without imputation (imputation empty or charge empty).
    The system displays the following error: The request for purchase order, item (position) 10, is attributed to another order...
    I imagine that is because the request for purchase order has imputation (charged) K and the purchase order will have no type of imputation (imputation empty).
    However, manually, Yes, I can create the purchase order. That is, I first release, the request for purchase order. Then I create the order of purchase using ME21 and with reference to request for purchase order, and when SAP returns the items of the request for purchase order, I manually remove the imputation K, and these items to become the purchase order.
    Please support me want to know how to resolve this case, why can not I create a purchase order without imputation to from the request for purchase order with imputation K, using Bapi
    Thank you.
    Greetings,

    Hi,
    In the item overview of the purchase order creation screen (ME21N), you have a column Purchasing Doc and next it item no.  You can give the existing purchase order number here with item no which will create a purchase order, and changes can be made wherever you require.
    Hope this helps.
    Thanks
    Krishna.

  • Want to create a multiple Purchase Order using one file source

    I'm want to create a multiple purchase order using one source file. I want to read the file source create LINES in a purchase order and when the Vendor code changes I want to Add the purchase order and then create a new purchase order and Add LINES and so on.
    Right now I get  Item.no is missing [POR1.ItemCode][Line 2]

    Here is a code sample
        Private Sub testcode()
            Dim strOrdplanFile As String
            Dim oLineRec As SAPbobsCOM.Recordset
            Dim strLine As String = ""
            Dim ItemName As String
            Dim Quantity As String
            Dim RequiredDate As String
            Dim SupplierType As String
            Dim ShipTo As String
            Dim Vendor As String
            Dim oPurchaseOrder As SAPbobsCOM.Documents
            Dim bAddPOrder As Boolean = True
            Dim bPurchase As Boolean = False
            Dim sSQL As String
            Dim iReads As Integer = 1
            Dim iCurrentPurchaseNumber As Integer = 0
            Dim bErrors As Boolean = False
            Dim retCode As Double
            oPurchaseOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
            strOrdplanFile = strFolderLocation & "ORDPLAN.TXT"
            If File.Exists(strOrdplanFile) And FileLen(strOrdplanFile) > 0 Then
                Dim sr As New StreamReader(strOrdplanFile)
                strLine = sr.ReadLine()
                txtPurRec.String = "0"
                oFormStatus.Update()
                Try
                    Do
                        Vendor = strLine.Substring(0, 8).Trim()
                        ShipTo = strLine.Substring(12, 8).Trim()
                        SupplierType = strLine.Substring(26, 1)
                        ItemName = strLine.Substring(27, 20).Trim()
                        Quantity = strLine.Substring(94, 8)
                        RequiredDate = strLine.Substring(206, 9)
                        oLineRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                        sSQL = "SELECT PrcrmntMtd, CardCode FROM OITM WHERE ItemCode = '" & ItemName & "'"
                        oLineRec.DoQuery(sSQL)
                        If oLineRec.RecordCount() > 0 Then ' if it exists add the record
                            If oLineRec.Fields.Item(0).Value.ToString = "B" Then
                                If (bAddPOrder) Then
                                    oPurchaseOrder.CardCode = Vendor
                                    oPurchaseOrder.DocDueDate = RequiredDate
                                    'Add first item to the purchase order
                                    oPurchaseOrder.Lines.ItemCode = ItemName
                                    oPurchaseOrder.Lines.WarehouseCode = ShipTo
                                    oPurchaseOrder.Lines.Quantity = CDbl(Quantity)
                                    oPurchaseOrder.Lines.Add()
                                    bAddPOrder = False
                                    bPurchase = True
                                    iCurrentPurchaseNumber = iCurrentPurchaseNumber + 1
                                    txtPurRec.String = "R: " & iReads & " W: " & iCurrentPurchaseNumber.ToString
                                    oFormStatus.Update()
                                Else
                                    'compare CardCode to make sure Vendor hasn't change
                                    If (oPurchaseOrder.CardCode.CompareTo(Vendor) = 0) Then
                                        'Add item to the purchase order
                                        oPurchaseOrder.Lines.ItemCode = ItemName
                                        oPurchaseOrder.Lines.WarehouseCode = ShipTo
                                        oPurchaseOrder.Lines.Quantity = CDbl(Quantity)
                                        oPurchaseOrder.Lines.Add()
                                    Else
                                        'vender code changed
                                        retCode = oPurchaseOrder.Add()
                                        If (retCode <> 0) Then
                                            SBO_Application.MessageBox(oCompany.GetLastErrorDescription(), 1, "OK", "", "")
                                        End If
                                        oPurchaseOrder.CardCode = Vendor
                                        oPurchaseOrder.DocDueDate = RequiredDate
                                        'Add first item to the purchase order
                                        oPurchaseOrder.Lines.ItemCode = ItemName
                                        oPurchaseOrder.Lines.WarehouseCode = ShipTo
                                        oPurchaseOrder.Lines.Quantity = CDbl(Quantity)
                                        oPurchaseOrder.Lines.Add()
                                        bAddPOrder = False
                                        bPurchase = True
                                        iCurrentPurchaseNumber = iCurrentPurchaseNumber + 1
                                        txtPurRec.String = "R: " & iReads & " W: " & iCurrentPurchaseNumber.ToString
                                        oFormStatus.Update()
                                    End If
                                    iReads = iReads + 1
                                End If 'new
                                strLine = sr.ReadLine()
                            End If
                        End If
                    Loop Until sr.EndOfStream
                Catch ex As Exception
                    MsgBox(ex.Message, MsgBoxStyle.Information)
                End Try
                If (bPurchase) Then
                    lRetCode = oPurchaseOrder.Add()
                End If
                sr.Close()
                swLogFile.WriteLine("Purchase orders stored : " & iCurrentPurchaseNumber)
                oPurchaseOrder = Nothing
            End If
        End Sub

  • HOW TO CREATE PURCHASE ORDER USING BAPI

    HI FRIENDS,
    I HAVE URGENT REQUIREMNT ,TO CREATE PURCHASE ORDER USING BAPI.PLS HELP ON THIS.
    UR'S
    RAVI

    Hi
    See the sample code and do accordingly
    REPORT zpo_bapi_purchord_tej.
    DATA DECLARATIONS *
    TYPE-POOLS slis.
    TYPES: BEGIN OF ty_table,
    v_legacy(8),
    vendor TYPE bapimepoheader-vendor,
    purch_org TYPE bapimepoheader-purch_org,
    pur_group TYPE bapimepoheader-pur_group,
    material TYPE bapimepoitem-material,
    quantity(13),
    delivery_date TYPE bapimeposchedule-delivery_date,
    net_price(23),
    plant TYPE bapimepoitem-plant,
    END OF ty_table.
    TYPES: BEGIN OF ty_alv,
    v_legs(8),
    success(10),
    v_legf(8),
    END OF ty_alv.
    TYPES: BEGIN OF ty_alv1,
    v_legf1(8),
    v_msg(500),
    END OF ty_alv1.
    *-----Work area declarations.
    DATA: x_table TYPE ty_table,
    x_header TYPE bapimepoheader,
    x_headerx TYPE bapimepoheaderx,
    x_item TYPE bapimepoitem,
    x_itemx TYPE bapimepoitemx,
    x_sched TYPE bapimeposchedule,
    x_schedx TYPE bapimeposchedulx,
    x_commatable(255),
    x_alv TYPE ty_alv,
    x_alv1 TYPE ty_alv1,
    x_alv2 TYPE ty_alv1.
    *-----Internal table declarations.
    DATA: it_table TYPE TABLE OF ty_table,
    it_commatable LIKE TABLE OF x_commatable,
    it_item TYPE TABLE OF bapimepoitem,
    it_itemx TYPE TABLE OF bapimepoitemx,
    it_sched TYPE TABLE OF bapimeposchedule,
    it_schedx TYPE TABLE OF bapimeposchedulx,
    it_alv TYPE TABLE OF ty_alv,
    it_alv1 TYPE TABLE OF ty_alv1,
    it_alv2 TYPE TABLE OF ty_alv1.
    DATA: po_number TYPE bapimepoheader-po_number,
    x_return TYPE bapiret2,
    it_return TYPE TABLE OF bapiret2,
    v_file TYPE string,
    v_temp(8),
    v_succsount TYPE i VALUE 0,
    v_failcount TYPE i VALUE 0,
    v_total TYPE i.
    DATA: v_temp1(5) TYPE n VALUE 0.
    DATA: x_event TYPE slis_t_event,
    x_fieldcat TYPE slis_t_fieldcat_alv,
    x_list_header TYPE slis_t_listheader,
    x_event1 LIKE LINE OF x_event,
    x_layout1 TYPE slis_layout_alv,
    x_variant1 TYPE disvariant,
    x_repid2 LIKE sy-repid.
    DATA : it_fieldcat TYPE TABLE OF slis_t_fieldcat_alv.
    SELECTION-SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK v_b1 WITH FRAME.
    *-----To fetch the flat file.
    PARAMETERS: p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK v_b1.
    AT SELECTION-SCREEN *
    AT SELECTION-SCREEN.
    IF p_file IS INITIAL.
    MESSAGE text-001 TYPE 'E'.
    ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    *-----To use F4 help to find file path.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    IMPORTING
    file_name = p_file.
    v_file = p_file.
    START-OF-SELECTION *
    START-OF-SELECTION.
    PERFORM gui_upload.
    LOOP AT it_table INTO x_table.
    PERFORM header_details.
    v_temp = x_table-v_legacy.
    LOOP AT it_table INTO x_table WHERE v_legacy = v_temp.
    PERFORM lineitem.
    PERFORM schedule.
    ENDLOOP.
    DELETE it_table WHERE v_legacy = v_temp.
    PERFORM bapicall.
    MOVE po_number TO x_alv-success.
    APPEND x_alv TO it_alv.
    CLEAR x_alv.
    *-----To clear the item details in internal table after the operation for a header.
    REFRESH: it_item,
    it_itemx,
    it_sched,
    it_schedx.
    CLEAR: v_temp1.
    ENDLOOP.
    v_total = v_succsount + v_failcount.
    PERFORM display_alv.
    FORM GUI_UPLOAD *
    FORM gui_upload .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = v_file
    filetype = 'ASC'
    TABLES
    data_tab = it_commatable
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17
    IF sy-subrc = 0.
    *-----To fetch the comma seperated flat file into an internal table.
    LOOP AT it_commatable INTO x_commatable.
    IF x_commatable IS NOT INITIAL.
    SPLIT x_commatable AT ',' INTO
    x_table-v_legacy
    x_table-vendor
    x_table-purch_org
    x_table-pur_group
    x_table-material
    x_table-quantity
    x_table-delivery_date
    x_table-net_price
    x_table-plant.
    APPEND x_table TO it_table.
    ENDIF.
    CLEAR x_table.
    ENDLOOP.
    ENDIF.
    ENDFORM. " gui_upload
    FORM HEADER_DETAILS *
    FORM header_details .
    MOVE 'NB' TO x_header-doc_type.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = x_table-vendor
    IMPORTING
    output = x_table-vendor
    MOVE x_table-vendor TO x_header-vendor.
    MOVE x_table-purch_org TO x_header-purch_org.
    MOVE x_table-pur_group TO x_header-pur_group.
    x_headerx-doc_type = 'X'.
    x_headerx-vendor = 'X'.
    x_headerx-purch_org = 'X'.
    x_headerx-pur_group = 'X'.
    ENDFORM. " header_details
    FORM LINEITEM *
    FORM lineitem .
    v_temp1 = v_temp1 + 10.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = v_temp1
    IMPORTING
    output = v_temp1.
    MOVE v_temp1 TO x_item-po_item.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = x_table-material
    IMPORTING
    output = x_table-material.
    MOVE x_table-material TO x_item-material.
    MOVE x_table-quantity TO x_item-quantity.
    MOVE x_table-net_price TO x_item-net_price.
    MOVE x_table-plant TO x_item-plant.
    x_itemx-po_item = v_temp1.
    x_itemx-material = 'X'.
    x_itemx-quantity = 'X'.
    x_itemx-net_price = 'X'.
    x_itemx-plant = 'X'.
    APPEND x_item TO it_item.
    APPEND x_itemx TO it_itemx.
    CLEAR: x_item, x_itemx.
    ENDFORM. " lineitem1
    FORM SCHEDULE *
    FORM schedule .
    MOVE x_table-delivery_date TO x_sched-delivery_date.
    MOVE v_temp1 TO x_sched-po_item.
    x_schedx-delivery_date = 'X'.
    x_schedx-po_item = v_temp1.
    APPEND x_sched TO it_sched.
    APPEND x_schedx TO it_schedx.
    CLEAR: x_sched, x_schedx.
    ENDFORM. " schedule
    FORM BAPICALL *
    FORM bapicall .
    CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
    poheader = x_header
    poheaderx = x_headerx
    IMPORTING
    exppurchaseorder = po_number
    TABLES
    return = it_return
    poitem = it_item
    poitemx = it_itemx
    poschedule = it_sched
    poschedulex = it_schedx.
    IF po_number IS NOT INITIAL.
    v_succsount = v_succsount + 1.
    MOVE x_table-v_legacy TO x_alv-v_legs.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ELSE.
    v_failcount = v_failcount + 1.
    MOVE x_table-v_legacy TO x_alv-v_legf.
    MOVE x_table-v_legacy TO x_alv1-v_legf1.
    LOOP AT it_return INTO x_return.
    IF x_alv1-v_msg IS INITIAL.
    MOVE x_return-message TO x_alv1-v_msg.
    ELSE.
    CONCATENATE x_alv1-v_msg x_return-message INTO x_alv1-v_msg SEPARATED BY space.
    ENDIF.
    ENDLOOP.
    APPEND x_alv1 TO it_alv1.
    CLEAR x_alv1.
    ENDIF.
    ENDFORM. " bapicall
    FORM DISPLAY_ALV *
    FORM display_alv .
    PERFORM x_list_header.
    PERFORM build_fieldcat CHANGING x_fieldcat.
    x_repid2 = sy-repid.
    x_event1-name = 'TOP_OF_PAGE'.
    x_event1-form = 'TOP_OF_PAGE'.
    APPEND x_event1 TO x_event.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = x_repid2
    is_layout = x_layout1
    it_fieldcat = x_fieldcat
    i_callback_user_command = 'USER_COMMAND'
    i_callback_top_of_page = 'TOP_OF_PAGE'
    i_save = 'A'
    is_variant = x_variant1
    it_events = x_event
    TABLES
    t_outtab = it_alv
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " display_master_data
    FORM USER_COMMAND *
    FORM user_command USING ucomm LIKE sy-ucomm selfield
    TYPE slis_selfield.
    READ TABLE it_alv INTO x_alv INDEX selfield-tabindex.
    CLEAR : x_alv2,it_alv2[].
    LOOP AT it_alv1 INTO x_alv1 WHERE v_legf1 = x_alv-v_legf.
    x_alv2 = x_alv1.
    APPEND x_alv2 TO it_alv2 .
    ENDLOOP.
    DATA : it_fieldcat TYPE slis_t_fieldcat_alv.
    DATA : x3_fieldcat LIKE LINE OF it_fieldcat.
    CLEAR : x3_fieldcat,it_fieldcat[].
    CLEAR x3_fieldcat.
    x3_fieldcat-col_pos = '1'.
    x3_fieldcat-fieldname = 'V_LEGF1'.
    x3_fieldcat-reptext_ddic = text-111.
    x3_fieldcat-ref_tabname = 'IT_ALV2'.
    APPEND x3_fieldcat TO it_fieldcat.
    CLEAR x3_fieldcat.
    CLEAR x3_fieldcat.
    x3_fieldcat-col_pos = '1'.
    x3_fieldcat-fieldname = 'V_MSG'.
    x3_fieldcat-reptext_ddic = text-112.
    x3_fieldcat-ref_tabname = 'IT_ALV2'.
    APPEND x3_fieldcat TO it_fieldcat.
    CLEAR x3_fieldcat.
    x_layout1-colwidth_optimize = 'X'.
    x_layout1-zebra = 'X'.
    IF it_alv2[] IS NOT INITIAL.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = x_repid2
    is_layout = x_layout1
    it_fieldcat = it_fieldcat
    i_save = 'A'
    i_callback_top_of_page = 'TOP'
    is_variant = x_variant1
    it_events = x_event
    TABLES
    t_outtab = it_alv2
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDIF.
    ENDFORM.
    FORM USER_COMMAND *
    FORM top.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = 'Commentry'.
    ENDFORM.
    FORM BUILD_FIELDCAT *
    FORM build_fieldcat CHANGING et_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: x1_fieldcat TYPE slis_fieldcat_alv.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '1'.
    x1_fieldcat-fieldname = 'V_LEGS'.
    x1_fieldcat-reptext_ddic = text-108.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '2'.
    x1_fieldcat-fieldname = 'SUCCESS'.
    x1_fieldcat-key = 'X'.
    x1_fieldcat-reptext_ddic = text-109.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '3'.
    x1_fieldcat-fieldname = 'V_LEGF'.
    x1_fieldcat-key = 'X'.
    x1_fieldcat-reptext_ddic = text-110.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    ENDFORM. " build_fieldcat
    FORM BUILD_LIST_HEADER *
    FORM x_list_header.
    DATA: x_list_header1 TYPE slis_listheader.
    *-----List Header: type H
    CLEAR x_list_header1 .
    x_list_header1-typ = 'H'.
    x_list_header1-info = text-105.
    APPEND x_list_header1 TO x_list_header.
    *-----List Key: type S
    x_list_header1-typ = 'S'.
    x_list_header1-key = text-106.
    x_list_header1-info = v_total.
    APPEND x_list_header1 TO x_list_header.
    *-----List Key: Type S
    CLEAR x_list_header1 .
    x_list_header1-typ = 'S'.
    x_list_header1-key = text-107.
    x_list_header1-info = v_succsount.
    APPEND x_list_header1 TO x_list_header.
    ENDFORM. " build_list_header
    FORM TOP_OF_PAGE *
    FORM top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = x_list_header.
    ENDFORM. " TOP_OF_PAGE
    Reward points if useful
    Anji

  • Create an AP Invoice based on a Purchase Order using SDK

    Hi,
    What are the steps to create an AP Invoice based on a Purchase Order using DI API?
    Which methods of which objects to use and what parameters to pass?
    Thanks.

    Hi Rajesh,
    Here is a sample to create an Invoice based on a Sales Order. The same way you can change as per your requirement:
    SAPbobsCOM.Documents oInvoice = default(SAPbobsCOM.Documents);
                oInvoice = (SAPbobsCOM.Documents)SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
                oInvoice.CardCode = "C000003";
                oInvoice.DocDueDate = DateAndTime.Now;
                oInvoice.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oOrders);
               oInvoice.Lines.BaseEntry = Convert.ToInt32(3616);
               oInvoice.Lines.BaseLine = 1;
                oInvoice.Lines.Quantity = 3;
                oInvoice.Lines.Add();
                oInvoice.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oOrders);
                oInvoice.Lines.BaseEntry = Convert.ToInt32(3616);
                oInvoice.Lines.BaseLine = 2;
                int kth = 0;
                kth = oInvoice.Add();
                if (kth != 0)
                    int irrcode;
                    string errmsg;
                    SBO_Company.GetLastError(out irrcode, out errmsg);
                    Program.oMainSAPDI.ShowMessage(errmsg, BoStatusBarMessageType.smt_Error);
    The main thing to remember is Base Type, Based Entry and Base Line.
    Hope it helps.
    Thanks & Regards
    Ankit Chauhan

  • Create Sales order from Internal Purchase Order using IDOC

    Hello Friends,
    I have requirement to create Sales Order from Internal Purchase Order Using IDOC.
    Backgorund, we have already configured IDOC orders05 to create Sales Order from external Purchase order from Inbound IDOC, and it is working fine.
    Now we have new requirement to create Sales Order from our own Purchase order, i.e. When PO is created in one plant corresponidng sales order automatically must needs to create in another Plant with respect PO.
    I m trying to design a solution for above problem as follows,
    1.create an Inbound Idoc from PO, by creatiing one new message type on PO save.
    2.Process that Inbound  IDOC same as it is from external PO.
    3.Once processed Sales order will create.
    Please help me in step 1. to create Inbound IDOC from PO.
    If you want any further clarification please write me.
    Thanks,
    Mahesh

    I had done a similar scenario before and we achieved it through SAP XI. The problem is with the control record. When we create a ORDERS IDOC from a PO the control record will be for outbound transmission. We sent the file to XI and XI resent it back with some data parsing and a new inbound control record. This way it went neat outbound and inbound.
    I'm not sure what kind of architecture you have. If you have to do it within your ECC/R/3, then you could create the outbound IDOC to a new port and write a fresh RFC to pick it up from the same folder and create a new control record for inbound processing.
    I haven't tried this; but there is a "processing w. trigger (inbound)" option on the outbound process code. May be you can explore into that a bit more.
    I'm sure there could be better approaches to handle this within ECC so if you stumble on any, do write back. I would like to know to update my knowledge .

Maybe you are looking for

  • Problem with QofQ and Null Values

    Just converted from CF5 to CF7. Finally figured out what was causing the error message : "The value "" cannot be converted to a number" when running a QofQ. It happens whenever there is a NULL (and I think a ZERO) value in the QofQ. I'm using the Qof

  • USB PS2 Keyboard converter adapter worked fine in 10.5, issues in 10.6

    I'm a mac user with a fetish for old IBM Model M clicky keyboards. After some sniffing around and buying a few cheap adapters that didn't work, I found this product on www.clickykeyboards.com : http://www.clickykeyboards.com/index.cfm/fa/items.main/p

  • How to get the name, version and path of the oracle suite(s) installed

    Hi, I am trying to gather information regarding the Name, Version and Path of Oracle installation(s) on a computer. E.g. Name = Oracle Database 9i Enterprise Edition Version = 9.0.00 Path = C:\Oracle I don't want to do it by querying the system table

  • Direction of Sync?? What Overwrites What?

    Sorry for the newbi question. I searched for an answer but didn't find it. Each time I go to sync my phone (for the first time) I get a warning that "Syncing with this phone will change more than 5% of your contacts on this computer". In that the ind

  • Cannot view remote roles while in consumer portal

    I have set up federated portal and tested the connection. I cannot view remote roles, I get the following error in the default trace SOAP Fault Exception [Actor [prmhpu46.ce.corp.com] com.sapportals.portal.prt.service.soap.exception.SoapFaultHandler]