How to create IDOC for customer defined table

hi,
How to create IDOC for customer defined table Records and how to send this IDOC to target system.
  what message type will be used and on receiving system how to post these records.
  thankx.
  pillac.

Hi,
You need to create a custom message type and custom IDOC type for this with whatever fields you want send. You need to create segments (WE30), IDOC type (WE30), Message types (WE81) and assign the message type to the IDOC type (WE82).
You will have trigger the IDOC using a Report or something after doing the partner profile settings.
Similary in the target system also, you will have do all the settings.
Take a look the links to find out what settings needs to be done.
http://help.sap.com//saphelp_470/helpdata/EN/0b/2a611c507d11d18ee90000e8366fc2/frameset.htm
http://www.sappro.com/downloads/OneClientDistribution.pdf
Regards,
Ravi
Note : Please mark the helpful answers and close the thread if the issue is resolved.

Similar Messages

  • How to create iView for customized master head war ?

    Hi,
    I deployed customized masterhead war file. But i cant see deployed war in portal application location.
    Anyone help me for customizing and masterhead page and how to create iView for customized master head...

    Hi,
    1. You can see the deployed application under the "Portal Applications"
    2. If you want to create an iView out of it. right click on the application -> copy. than press right click in the folder you want the iView will be created and paste ad pcd object.
    Hope I helped you.
    Ronny.

  • How to Create Correspondance for Customer Statement

    Hi Gurus,
    my client is asking for customer statement.How to create correspondance for that.i dont want to use standard one.initially i tried with standard one,but it is giving the heading as open items instead of customer statement.
    what should i do.Kindly help me
    Thanks
    Prathima

    Prathima,
    While we all agree that SAP's in-app help could do with a lot of improvement, however there's no shortage in terms of volume and coverage. Have you cared to perhaps look at [SAP Online Help|http://help.sap.com]?
    Here's a little something to get you started. Have a look [here|http://help.sap.com/saphelp_erp60_sp/helpdata/en/01/a9cf0d455711d182b40000e829fbfe/frameset.htm] and [here|http://help.sap.com/saphelp_erp60_sp/helpdata/en/01/a9cf0d455711d182b40000e829fbfe/frameset.htm].
    Under IMG, the path is Financial Accounting --> Financial Accounting Global Settings --> Correspondence.
    This should be enough to get you started to forage on your own.
    Happy Learning!
    Regards
    Gulshan

  • How to Create IDOCs for a Custom Basic IDOC Type

    Hi friends,
    I Have a Custom Basic IDOC Type.
    For that IDOC Type i need to Create an IDOC for every Header Item.
    The Header Item may have variation (Different) number of Line Items.
    in this case can i Use
    MASTER_IDOC_DISTRIBUTE and create the Idoc for each Header Item.
    or is there any way to create the IDOCs
    Thanks in Advance.
    Ganesh.

    Hi ,
    If I am not wrong you need to pass data via fm "MASTER_IDOC_DISTRIBUTE".
    So you can transfer row by row data into SDATA filed of structure type :EDID ,
    by concatenating the data into one field of type sdata. and passing it into the fm.
    I.e defining a internal table of type EDIDD.
    Try this :
    DATA : itab TYPE TABLE OF edid,
           itab1 TYPE TABLE OF edidc.
    LOOP AT itab2 INTO wa_itab2.
    CONCATENATE wa_itab2-t1 wa_itab2-t2 wa_itab2-t3 wa_itab2-t4 wa_itab2-t5
      INTO result.
      itab-sdata = result.
      APPEND itab.
      all function 'MASTER_IDOC_DISTRIBUTE'
       exporting
         master_idoc_control                  =itab1
      OBJ_TYPE                             = ''
      CHNUM                                = ''
       tables
         communication_idoc_control           =
         master_idoc_data                     =itab.
    EXCEPTIONS
      ERROR_IN_IDOC_CONTROL                = 1
      ERROR_WRITING_IDOC_STATUS            = 2
      ERROR_IN_IDOC_DATA                   = 3
      SENDING_LOGICAL_SYSTEM_UNKNOWN       = 4
      OTHERS                               = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • How to Create CFL to user defined table

    Hi all,
    I have a user table with four fields. How to create a CFL for these fields?
    Regards,
    Fabio Ferreira.

    this is sub fn required for registration
    Here i mentioned heder level table and child table
    Fields are mentioned will be displayed on CFL
    If u want assign this CFL to any text field assign normal way but object id is:VEDA_PRN_WR_DOC
    Public Function UDOExists(ByVal code As String) As Boolean
            GC.Collect()
            Dim v_UDOMD As SAPbobsCOM.UserObjectsMD
            Dim v_ReturnCode As Boolean
            v_UDOMD = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
            v_ReturnCode = v_UDOMD.GetByKey(code)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(v_UDOMD)
            v_UDOMD = Nothing
            Return v_ReturnCode
        End Function
    'Second fn
    Function registerUDO(ByVal UDOCode As String, ByVal UDOName As String, ByVal UDOType As SAPbobsCOM.BoUDOObjType, ByVal findAliasNDescription As String(,), ByVal parentTableName As String, Optional ByVal childTable1 As String = "", Optional ByVal childTable2 As String = "", Optional ByVal childTable3 As String = "", Optional ByVal LogOption As SAPbobsCOM.BoYesNoEnum = SAPbobsCOM.BoYesNoEnum.tNO) As Boolean
            Dim actionSuccess As Boolean = False
            Try
                registerUDO = False
                Dim v_udoMD As SAPbobsCOM.UserObjectsMD
                v_udoMD = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
                v_udoMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tNO
                v_udoMD.CanClose = SAPbobsCOM.BoYesNoEnum.tNO
                v_udoMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO
                v_udoMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.CanLog = LogOption
                v_udoMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.Code = UDOCode
                v_udoMD.Name = UDOName
                v_udoMD.TableName = parentTableName
                If LogOption = SAPbobsCOM.BoYesNoEnum.tYES Then
                    v_udoMD.LogTableName = "A" & parentTableName
                End If
                v_udoMD.ObjectType = UDOType
                For i As Int16 = 0 To findAliasNDescription.GetLength(0) - 1
                    If i > 0 Then v_udoMD.FindColumns.Add()
                    v_udoMD.FindColumns.ColumnAlias = findAliasNDescription(i, 0)
                    v_udoMD.FindColumns.ColumnDescription = findAliasNDescription(i, 1)
                Next
                If childTable1 <> "" Then
                    v_udoMD.ChildTables.TableName = childTable1
                    v_udoMD.ChildTables.Add()
                End If
                If childTable2 <> "" Then
                    v_udoMD.ChildTables.TableName = childTable2
                    v_udoMD.ChildTables.Add()
                End If
                If childTable3 <> "" Then
                    v_udoMD.ChildTables.TableName = childTable3
                    v_udoMD.ChildTables.Add()
                End If
                If v_udoMD.Add() = 0 Then
                    registerUDO = True
                    objMain.objApplication.StatusBar.SetText("Successfully Registered UDO >" & UDOCode & ">" & UDOName & " >" & objMain.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
                Else
                    objMain.objApplication.StatusBar.SetText("Failed to Register UDO >" & UDOCode & ">" & UDOName & " >" & objMain.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                    registerUDO = False
                End If
                System.Runtime.InteropServices.Marshal.ReleaseComObject(v_udoMD)
                v_udoMD = Nothing
                GC.Collect()
            Catch ex As Exception
            End Try
        End Function
    This is a code for registration of table that will create CFL with mentioned fields.
    Hope help this
    By
    firos.C
    Edited by: firoz101 on Aug 18, 2009 6:07 AM
    Edited by: firoz101 on Aug 18, 2009 6:08 AM
    Edited by: firoz101 on Aug 18, 2009 6:08 AM

  • How to create idocs  for  existing records

    Hi
    are there any standard program by which i could create and send the existing customer invoice (VF01) data thru EDI idoc to a 3rd party system even if the output type is not defined during the creation of the invoices?
    Regards
    Sujai

    I am supposed to send all customer invoice data to an external system. I have been able to configure the system to trigger an idoc when an invoice is saved. That takes care of my delta transfer. But i would like to know if there is a way by which i can send all the existing customer invoice data to the 3rd party system that were already created in the SAP system. Something like an initial download of all the existing records.
    I am asked to keep the abap development to Zero as far as possible, hence i am exploring the idea of finding any standard program that could do this for me.
    just like Tx: BD10 for the material master data.
    I tried VF31 but the problem is that the invoice that would have been created might not contain the output type as EDI. So is there a way by which i can achieve this task with any standard program?
    I also have another question:
    how do i do the configuration to send all the SD invoices to a specific partner all the time thru EDI by default?
    Sujai

  • How to create index for Telecom large table

    Hi ,
    I'm working on DB 10G on REHL 5 for telecom company with more than 1 million recorded per day , we need to speed the query result ,
    we know there are many types of the INDEX and I'm need a professional advice to create a suitable one ,
    many of our queries depend on the MSID ( the MAC address of the Modem ) column ,
    Name           Null Type        
    STREAMNUMBER        NUMBER(9)   
    MSID                VARCHAR2(20)
    USERNAME            VARCHAR2(20)
    DOMAIN              VARCHAR2(20)
    USERIP              VARCHAR2(16)
    CORRELATION_ID      VARCHAR2(64)
    ACCOUNTREASON       NUMBER(3)   
    STARTTIME           VARCHAR2(14)
    PRIORTIME           VARCHAR2(14)
    CURTIME             VARCHAR2(14)
    SESSIONTIME         NUMBER(9)   
    SESSIONVOLUME       NUMBER(9)   
    .please any help ,

    really i have 3 queries for the subscriber activity like (usage details , the date of bundle start the the total of the download , he's working out of bundle or not )
    and any of the subscribers can check those queries at any time thorw web ,
    select nvl(min(substr(a.starttime,1,8)),0) Service_Start_Time, nvl(sum(a.sessionvolume),0) Total_Traffic_KB
    FROM aaa_bill a
    where msid='84A8E46E929D'
    and starttime >=(select  max(fee) FROM aaa_bill
    where msid='84A8E46E929D' and accountreason=5);and the expected result is
    service_start_date  totoal_traffic_KB
    20120225                   440554the MSIDs examples
    (84A8E46E7F43,
    84A8E46E7A82,
    84A8E46E7C84,
    84A8E46E7CBF,
    also i have this query ,
    select
    substr(nvl(
    (select nvl(starttime,'0') as starttime
    from (
    select nvl(starttime,0) starttime,sum(sessionvolume) over(partition by msid order by starttime) sum1
    from aaa_bill
    where msid='84A8E46E90BC' and starttime >=(select  max(fee) FROM aaa_bill
    where msid='84A8E46E90BC' and accountreason=5))
    where sum1>=44987000
    and rownum<2)
    ,0),1,8) Reached_45GB
    from dual;and this one ,
    select min(to_char(to_date(starttime,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss')) "Accounting Start Time",
    max(to_char(to_date(curtime,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss')) "Accounting Stop Time",sum(sessiontime) Duration1,
    TO_CHAR (TRUNC (SYSDATE) + NUMTODSINTERVAL (sum(sessiontime), 'second'),'hh24:mi:ss') hr,
    sum(sessionvolume) Traffic
    from aaa_bill
    where msid='84A8E46E78EF'
    and starttime >=(select  max(fee) FROM aaa_bill
    where msid='84A8E46E78EF' and accountreason=5)
    group by correlation_id
    order by min(starttime);

  • How can create IDOC for Purchase Requisition

    Hi all,
    whenever I change the Purchase requisition(Tcode-ME22N),IDOC has to be generated automatically.Please help me out.

    Hi ravi,
    It seems you are talking about the purchase order change.
    because ME22N is a transaction for editing the purchase order.Purchase req. is a internal document which we dont send out to any one.
    Anyway what is the output type you are using?.
    If you use NEU then no need for any changes.
    otherwise use NACE transaction and select your output type then mark the 'multiple issuing ' flag.
    So whenever there is a change system senses that and proposes the output.
    After that you got to make the settings at the partner profile using WE20 transaction.There at the message control parameters level mention the output type and set the change flag.
    Entry could be EF ( App.id) NEU (output type) and X (Change flag).
    So system generates the IDOC whenever you do the change using ME22n transaction.
    Please let me know if you have any issues.
    Thank you.
    Regards,
    karun.M

  • How to create wizard for a custom mainenance view/view cluster

    Hi Experts,
    I have created 5 custom maintenance view and have maintained all the views sequencially and have made the first mainenance view as the start view & header entry and all other views are child or subview of the header view in a custom view cluster. But I want a wizard to help the user / end user successfully enter all the required values for all child views, it will help  the user to navigate  from the start view to all the child views where the fields of the wizard will be associated to the child maintenance views.
    Please suggest how to create wizard for view cluster.
    I'll give max reward point for the helpful answer.
    Thanks in advance
    koustav

    Hello Pasapula
    When you are in the View Cluster maintenance dialog (SE54) click on dialog "Events".
    Below the field for the view cluster you have an additional field <b>FORM routines main program</b>. There you have to add the main program containing the FORM routines called by the VC events.
    For example: I had defined a normal report containing an include with all the FORM routines. The report contains only the following lines of coding:
    report zus_0120_u1.
    * Common Data und access routines for user exits in VC maintenance
    include LSVCMCOD.
    include  zus_0120_f1. "FORM routines for VC events
    Now in the "Events" dialog of the view cluster maintenance you assign your FORM routines to the events.
    Regards
      Uwe

  • How to create variant for table/view ?

    Hi,
    When I go through SM30, I find a radio button called variant. I don't know the effect.
    Can anyone tell me how to create variant for table / view ?
    I want to know when we need to create variant for table/view.
    Best regards,
    Chris Gu

    hi ,
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, refer to Selection Screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant
    Procedure
    To create a new variant:
           1.      On the ABAP Editor initial screen, enter the name of the program for which you want to create a variant, select Variants, and choose Change.
           2.      On the variant maintenance initial screen, enter the name of the variant to be created.
    Note the naming convention for variants (see below).
           3.      Choose Create.
    If the program has more than one selection screen, a dialog box for screen assignment appears. The dialog box does not appear if the program only has one selection screen. The selection screen appears in this case.
           4.      If there is more than one selection screen, select the screens for which you want to create the variant
    5.      Choose Continue.
    The (first) selection screen for the report appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them and to fill the fields with values. If you keep scrolling forwards, the Continue button appears on the last selection screen.
           6.      Enter the desired selection values, including multiple selection and dynamic selection.
           7.      Choose Continue.

  • How to create an Internal Customer  for Ineterplant stock Transfer

    Daer Gurus,
    Please tell me how to create an Internal Customer for Interplant stock transfer.
    Actually I have three plants out of them two plants are providing goods to third plant. Also both the plants do the stock transfer in eachother.
    How to maintain the Two plants as supplier and third one as a receiver plant. 
    which account group I should use and what details I have to use for it ?  Do I need to maintain all three plants under same account group? I know the theoratical process only for stock transfer please guide me on this Internal customer issue.
    thanks in advance
    regards,
    Sanjay

    Hi,
    Take your three plants as AAAA, BBBB and CCCC.... and these 3 plants may be assigned to the Sales Area of AAA 10 10, BBB 10 10 and CCC 10 10.
    Your STO will have following 4 flows.
    1. AAAA - CCCC
    2. AAAA - BBBB
    3. BBBB- CCCC
    4. BBBB- AAAA
    you need to do the following settings...
    1. Assign the Sales Area for the Shipping Plants... for ex (AAAA - AAA 10 10 and BBBB - BBB 10 10)
    2. You need to Create a Internal Customer for every Rec. Plant and need to assign the same to the Rec Plant. And Also note that this customer needs to be created in the Sales Area which is assigned in the Shipping Plant.
    (Note that CCCC will be Rec Plant from Both AAAA and BBBB... So you need to extend that customer for both the Sales Area of the plants AAAA and BBBB)
    Following is the example settings required for our scenario 1.
    AAAA will be a supplying plant and CCCC will be rec. plant....  for this you need to create a internal Customer (for ex C1000) in Sales area AAA 10 10 (which is assigned to the plant AAAA) and assign the Customer number (C1000) to Plant CCCC.
    Now you created a plant CCCC as a customer in Sales Area AAA 10 10 (which is nothing but plant AAAA)...
    Also here you need assign the Sales Area AAA 10 10 to the Plant AAAA.
    Hope this will be useful to you.
    Thanks,
    Muthu

  • How to create Criterian For more than one table

    Hi,
    I have one problem how to create criteria for more than one table in that using one criteria hot to get the values from database in that more than onetable for getting these values .Please send me the exampke code.
    reagrds,
    raghu

    Hi,
    I don't think its possible to create fieldcatalog for different tables,
    but if you want to do so create a dummy table which has all the fields which you want in fieldcatalog.
    populate the data from different table to that dummy table
    then create fieldcatalog for that table and pass it in the function module...
    Regards,
    Siddarth

  • What is authorization object and how to create it for a table

    Hi All,
    What is authorization object and how to create it for a table?
    Thanks

    Hi
    Authorization
    For authorization checks, there are many ways of linking authorization objects with user actions in an SAP system. The following discusses three possibilities in the context of ABAP programming.
    Authorization Check for Transactions
    You can directly link authorization objects with transaction codes. You can enter values for the fields of an authorization object in the transaction maintenance. Before the transaction is executed, the system compares these values with the values in the user master record and only starts the transaction if the appropriate authorization exists.
    Authorization Check for ABAP Programs
    For ABAP programs, the two objects S_DEVELOP (program development and program execution) and S_PROGRAM (program maintenance) exist. They contains a field P_GROUP that is connected with the program attribute authorization group. Thus, you can assign users program-specific authorizations for individual ABAP programs.
    Authorization Check in ABAP Programs
    A more sophisticated, user-programmed authorization check is possible using the Authority-Check statement. It allows you to check the entries in the user master record for specific authorization objects against any other values. Therefore, if a transaction or program is not sufficiently protected or not every user that is authorized to use the program can also execute all the actions, this statement must be used.
    AUTHORITY-CHECK OBJECT object
                            ID name1 FIELD f1
                            ID name2 FIELD f2
                            ID namen FIELD fn.
    object is the name of an authorization object. With name1, name2 ... , and so on, you must list all fields of the authorization object object. With  f1, f2 ... , and so on, you must specify the values that the system is to check against the entries in the relevant authorization of the user master record. The AUTHORITY-CHECK statement searches for the specified object in the user profile and checks the useru2019s authorizations for all values of f1, f2 ... . You can avoid checking a field name1, name2 ... by replacing FIELD f1  FIELD f2 with DUMMY.
    After the FIELD addition, you can only specify an elementary field, not a selection table. However, there are function modules available that execute the AUTHORITY-CHECK statement for all values of selection tables. The AUTHORITY-CHECK statement is supported by a statement pattern.
    Only if the user has all authorizations, is the return value sy-subrc of the AUTHORITY-CHECK statement set to 0. The most important return values are:
    ·        0: The user has an authorization for all specified values.
    ·        4: The user does not have the authorization.
    ·        8: The number of specified fields is incorrect.
    ·        12: The specified authorization object does not exist.
    A list of all possible return values is available in the ABAP keyword documentation. The content of sy-subrc has to be closely examined to ascertain the result of the authorization check and react accordingly.
    REPORT demo_authorithy_check.
    PARAMETERS pa_carr LIKE sflight-carrid.
    DATA wa_flights LIKE demo_focc.
    AT SELECTION-SCREEN.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                      ID 'CARRID' FIELD pa_carr
                      ID 'ACTVT' FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE e045(sabapdocu) WITH pa_carr.
      ELSEIF sy-subrc <> 0.
        MESSAGE e184(sabapdocu) WITH text-010.
      ENDIF.
    START-OF-SELECTION.
      SELECT  carrid connid fldate seatsmax seatsocc
        FROM  sflight
        INTO  CORRESPONDING FIELDS OF wa_flights
        WHERE carrid = pa_carr.
        WRITE: / wa_flights-carrid,
                 wa_flights-connid,
                 wa_flights-fldate,
                 wa_flights-seatsmax,
                 wa_flights-seatsocc.
      ENDSELECT.
    Regards
    Hitesh

  • How to create view for xmltype table in oracle

    hi:
    Can some one help me how to create view for xmltype table in oracle?
    XMLType do not have column
    Sem

    Thank you !!
    I read it and become very hard to implement what I want to do.
    Can you give me example please?
    My main goal to create view for xmltype table is to XQuery the XML data?
    Do you have any other suggestion?
    Please help
    Ali_2

  • How 2 creat report for displaying the details of a Delivery Document using

    how to create report for displaying the details of a Delivery Document using the tables LIKP, LIPS
    thank you
    regards,
    jagrut bharatkumar shukla
    points will be rewarded

    HI
    I AM GIVING YOU MY DELIVERY DOCUMENT CODE...MODIFY IT ACCORDING TO YOUR REQUIREMENT
    *& Report  ZDELIVERY                                *
    report  zdelivery  message-id z9bhu          .
    types: begin of t_likp,
               vbeln type likp-vbeln,      "Delivery
               erdat type likp-erdat,      "Date for rec creation
    *           LFDAT TYPE LIKP-LFDAT,      "Delevery Date
    *           WAERK TYPE LIKP-WAERK,      "Currency
               kunnr type likp-kunnr,      "Ship-To Party
               kunag type likp-kunag,      "Sold-to party
               traty type likp-traty,      "Means-of-Transport
           end of t_likp.
    types: begin of t_lips,
               vbeln type lips-vbeln,      "Delivery
               posnr type lips-posnr,      "Delivery item
               matnr type lips-matnr,      "Material Number
               arktx type lips-arktx,      "Short Text for Sales Order Item
               lfimg type lips-lfimg,      "Actual quantity delivered
               netpr type lips-netpr,
    *           MEINS TYPE LIPS-MEINS,      "Base Unit of Measure
               vgbel type lips-vgbel,      "Doc no of the reference document
            end of t_lips.
    types: begin of t_vbpa,
               vbeln type vbpa-vbeln,      "SD DocumenT Number
               posnr type vbpa-posnr,      "Item number
               parvw type vbpa-parvw,      "Partner function
               kunnrb type vbpa-kunnr,      "Customer Number 1
           end of t_vbpa.
    types: begin of t_kna1,
               kunnr type kna1-kunnr,      "Customer Number 1
               name1 type kna1-name1,      "Name 1
               ort01 type kna1-ort01,      "City
               adrnr type kna1-adrnr,      "Address
           end of t_kna1.
    types: begin of t_li_vbpa,
               vbeln type likp-vbeln,      "Delivery
               erdat type likp-erdat,      "Date for rec creation
    *           LFDAT TYPE LIKP-LFDAT,      "Delevery Date
    *           WAERK TYPE LIKP-WAERK,      "Currency
               kunnr type likp-kunnr,      "Ship-To Party
               kunag type likp-kunag,      "Sold-to party
               traty type likp-traty,      "Means-of-Transport
               vbeln1 type lips-vbeln,      "Delivery
               posnr type lips-posnr,      "Delivery item
               matnr type lips-matnr,      "Material Number
               arktx type lips-arktx,      "Short Text for Sales Order Item
               lfimg type lips-lfimg,      "Actual quantity delivered
               netpr type lips-netpr,      "Net Price
    *           MEINS TYPE LIPS-MEINS,      "Base Unit of Measure
               vgbel type lips-vgbel,      "Doc no of the reference document
               vbeln3 type vbpa-vbeln,     "SD DocumenT Number
               parvw type vbpa-parvw,      "Partner function
               kunnrb type vbpa-kunnr,      "Customer Number 1
           end of t_li_vbpa.
    types: begin of t_final,
               vbeln type likp-vbeln,      "Delivery
               erdat type likp-erdat,      "Date for rec creation
               kunnr type likp-kunnr,      "Ship-To Party
               kunag type likp-kunag,      "Sold-to party
               traty type likp-traty,      "Means-of-Transport
               vbeln1 type lips-vbeln,      "Delivery
               posnr type lips-posnr,      "Delivery item
               matnr type lips-matnr,      "Material Number
               arktx type lips-arktx,      "Short Text for Sales Order Item
               lfimg type lips-lfimg,      "Actual quantity delivered
               netpr type lips-netpr,      "Net Price
               vgbel type lips-vgbel,      "Doc no of the reference document
               vbeln3 type vbpa-vbeln,     "SD DocumenT Number
               parvw type vbpa-parvw,      "Partner function
               kunnrb type vbpa-kunnr,     "Customer Number 1
               name1 type kna1-name1,      "Name 1
               ort01 type kna1-ort01,      "City
               adrnr1 type kna1-adrnr,     "Address
               name2 type kna1-name1,      "Name 1
               ort02 type kna1-ort01,      "City
               adrnr2 type kna1-adrnr,     "Address
               name3 type kna1-name1,      "Name 1
               ort03 type kna1-ort01,      "City
               adrnr3 type kna1-adrnr,     "Address
           end of t_final.
    *            D A T A  D E C L A R A T I O N
    *&*********Internal Table Declaration****************&*
    data: it_likp type standard table of t_likp.
    data: it_lips type standard table of t_lips.
    data: it_vbpa type standard table of t_vbpa.
    data: it_kna1 type standard table of t_kna1.
    data: it_li_vbpa type standard table of t_li_vbpa.
    data: it_li_vbpa_temp type standard table of t_li_vbpa.
    data: it_final type standard table of t_final.
    *&*********Work Area Declaration********************&*
    data: wa_likp type t_likp.
    data: wa_lips type t_lips.
    data: wa_vbpa type t_vbpa.
    data: wa_kna1 type t_kna1.
    data: wa_li_vbpa type t_li_vbpa.
    data: wa_li_vbpa_temp type t_li_vbpa.
    data: wa_final type t_final.
    *&*********Data Declaration************************&*
    data: d_vbeln type likp-vbeln.
    data: flag type i value 0.
    *           S E L E C T I O N  S C R E E N   D E C L A R A T I O N
    selection-screen begin of block block2 with frame title text-001.
    select-options: s_vbeln for d_vbeln obligatory.    "Delivery no
    selection-screen end of block block2.
    *            A T  S E L E C T I O N - S C R E E N   E V E N T S
    *AT SELECTION-SCREEN.
    *PERFORM VALIDATE_DATA.
    *            S T A R T   O F  S E L E C T I O N     E V E N T S
    start-of-selection.
    perform fetch_data.
    perform merge_data_kna1.
    *INCLUDE Z9BT_SH_***4_FORMS.
    call function 'OPEN_FORM'
    exporting
    *   APPLICATION                       = 'TX'
    *   ARCHIVE_INDEX                     =
    *   ARCHIVE_PARAMS                    =
        device                            = 'PRINTER'
    *   DIALOG                            = 'X'
    *   FORM                              = ' '
       language                          = sy-langu
    *   OPTIONS                           =
    *   MAIL_SENDER                       =
    *   MAIL_RECIPIENT                    =
    *   MAIL_APPL_OBJECT                  =
    *   RAW_DATA_INTERFACE                = '*'
    *   SPONUMIV                          =
    * IMPORTING
    *   LANGUAGE                          =
    *   NEW_ARCHIVE_PARAMS                =
    *   RESULT                            =
    exceptions
       canceled                          = 1
       device                            = 2
       form                              = 3
       options                           = 4
       unclosed                          = 5
       mail_options                      = 6
       archive_error                     = 7
       invalid_fax_number                = 8
       more_params_needed_in_batch       = 9
       spool_error                       = 10
       codepage                          = 11
       others                            = 12
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    sort it_final by vbeln.
    loop at it_final into wa_final.
    call function 'START_FORM'
    exporting
    *   ARCHIVE_INDEX          =
       form                   = 'Z9BT_DELIVERY'
       language               = sy-langu
    *   STARTPAGE              = ' '
    *   PROGRAM                = ' '
    *   MAIL_APPL_OBJECT       =
    * IMPORTING
    *   LANGUAGE               =
    exceptions
       form                   = 1
       format                 = 2
       unended                = 3
       unopened               = 4
       unused                 = 5
       spool_error            = 6
       codepage               = 7
       others                 = 8
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function 'WRITE_FORM'
    exporting
       element                        = 'ITEM_LIST'
       function                       = 'SET'
       type                           = 'BODY'
       window                         = 'MAIN'
    * IMPORTING
    *   PENDING_LINES                  =
    * EXCEPTIONS
    *   ELEMENT                        = 1
    *   FUNCTION                       = 2
    *   TYPE                           = 3
    *   UNOPENED                       = 4
    *   UNSTARTED                      = 5
    *   WINDOW                         = 6
    *   BAD_PAGEFORMAT_FOR_PRINT       = 7
    *   SPOOL_ERROR                    = 8
    *   CODEPAGE                       = 9
    *   OTHERS                         = 10
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function 'END_FORM'
    * IMPORTING
    *   RESULT                         =
    exceptions
       unopened                       = 1
       bad_pageformat_for_print       = 2
       spool_error                    = 3
       codepage                       = 4
       others                         = 5
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endloop.
    call function 'CLOSE_FORM'
    * IMPORTING
    *   RESULT                         =
    *   RDI_RESULT                     =
    * TABLES
    *   OTFDATA                        =
    exceptions
       unopened                       = 1
       bad_pageformat_for_print       = 2
       send_error                     = 3
       spool_error                    = 4
       codepage                       = 5
       others                         = 6
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    *&      Form  VALIDATE_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form validate_data .
    select single vbeln into wa_likp-vbeln
                        from likp where vbeln in s_vbeln.
    append wa_likp to it_likp.
    if sy-subrc <> 0.
    flag = 1.
    endif.
    endform.                    " VALIDATE_DATA
    *&      Form  FETCH_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form fetch_data .
    select a~vbeln
           a~erdat
           a~kunnr
           a~kunag
           a~traty
           b~vbeln
           b~posnr
           b~matnr
           b~arktx
           b~lfimg
           b~netpr
           b~vgbel
           c~vbeln
           c~parvw
           c~kunnr
             into table it_li_vbpa
                    from likp as a
                    left outer join lips as b on a~vbeln = b~vbeln
                    inner join vbpa as c on b~vgbel = c~vbeln
                    where a~vbeln in s_vbeln and
                    c~parvw = 'RE'.
    endform.                    " FETCH_DATA
    *&      Form  MERGE_DATA_KNA1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form merge_data_kna1 .
    if it_li_vbpa[] is not initial.
    it_li_vbpa_temp[] = it_li_vbpa[].
    sort it_li_vbpa_temp by kunnr.
    delete adjacent duplicates from it_li_vbpa_temp comparing kunnr.
    loop at it_li_vbpa into wa_li_vbpa.
    read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
    wa_li_vbpa-kunag.
    if sy-subrc <> 0.
    wa_li_vbpa_temp = wa_li_vbpa.
    append wa_li_vbpa_temp to it_li_vbpa_temp.
    endif.
    read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
    wa_li_vbpa-kunnrb.
    if sy-subrc <> 0.
    wa_li_vbpa_temp = wa_li_vbpa.
    append wa_li_vbpa_temp to it_li_vbpa_temp.
    endif.
    endloop.
    endif.
    if it_li_vbpa_temp[] is not initial.
    select  kunnr
            name1
            ort01
            adrnr into table it_kna1 from kna1
                        for all entries in it_li_vbpa_temp
                        where kunnr = it_li_vbpa_temp-kunnr.
    endif.
    loop at it_li_vbpa into wa_li_vbpa .
    wa_final-vbeln = wa_li_vbpa-vbeln.
    wa_final-erdat = wa_li_vbpa-erdat.
    *it_final-LFART = it_li_vbpa-LFART.
    wa_final-kunnr = wa_li_vbpa-kunnr.
    wa_final-kunag = wa_li_vbpa-kunag.
    *it_final-VSTEL = it_li_vbpa-VSTEL.
    wa_final-traty = wa_li_vbpa-traty.
    wa_final-vbeln1 = wa_li_vbpa-vbeln.
    wa_final-posnr = wa_li_vbpa-posnr.
    wa_final-matnr = wa_li_vbpa-matnr.
    wa_final-arktx = wa_li_vbpa-arktx.
    wa_final-lfimg = wa_li_vbpa-lfimg.
    wa_final-netpr = wa_li_vbpa-netpr.
    *wa_final-GEWEI = it_li_vbpa-GEWEI.
    *it_final-VOLUM = it_li_vbpa-VOLUM.
    *it_final-VOLEH = it_li_vbpa-VOLEH.
    wa_final-vgbel = wa_li_vbpa-vgbel.
    wa_final-vbeln3 = wa_li_vbpa-vbeln.
    *wa_final-PARVW = wa_li_vbpa-PARVW.
    wa_final-kunnrb = wa_li_vbpa-kunnrb.
    read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnr.
    if sy-subrc = 0.
    wa_final-name1 = wa_kna1-name1.
    wa_final-ort01 = wa_kna1-ort01.
    wa_final-adrnr1 = wa_kna1-adrnr.
    endif.
    read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunag.
    if sy-subrc = 0.
    wa_final-name2 = wa_kna1-name1.
    wa_final-ort02 = wa_kna1-ort01.
    wa_final-adrnr2 = wa_kna1-adrnr.
    endif.
    read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnrb.
    if sy-subrc = 0.
    wa_final-name3 = wa_kna1-name1.
    wa_final-ort03 = wa_kna1-ort01.
    wa_final-adrnr3 = wa_kna1-adrnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    endform.

Maybe you are looking for

  • What is the recommended way to truncate tables in ODI?

    I want to create a separate step to truncate the result tables, before the start of the actual job. What is the recommended way of doing this? I am currently putting the truncate statements in the ODI procedure, but that has a lot of typing. Is there

  • Sync-to-Async process

    Hi, I'm trying to call an asynchronous process from a synchronous one following the Sync-to-Async instructions available in the documentation ("Building Synchronous and Asynchronous business processes"). I can generate the Sync-to-Async WSDL file wit

  • What challenges do you face?

    Hi All, As I read through the postings here regarding document management, packaging up files to move them around, user rights problems etc, I wonder if the stuff the company I work for creates might be able to help with some of these challenges... I

  • MBP slow speeds to Netgear DG834GT

    Hey, I'm having a small issue regarding the transfer speeds of files across a network I have set up. As it stands copying stuff from my brothers laptop to my MBP seems to be capped at around 160k/sec (courtesy of the activity monitor), wheras another

  • How to change contrast and/or brightness?

    i hope to know how can i change the contrast and/or the brightness of an image i have imported in my application. thanks (sorry for my english!)