How to Count schedule lines in IDoc ORDERS05 using XSLT Mapping

Hi Experts,
In a Scenario where we are sending Purchase order (ORDERS05) to SAP SNC using XSLT Mapping,
where in we need to count the no. of schedule lines against the Purchase Order line.
As in Schedule line segment there is no such provision, so it needs to be handle in XSLT mapping to count the schedule lines.
Can you all please guide me how to go about the same.
Regards,
Nitin P

Hi Satish,
Thank you very much for the reply,
as there is only Quantity and other information is maintained against schedule lines how we can count the schedule line repeatation against PO line ? Is that very simple as you suggested or some other consideration also needs to be taken.
Please clarify the same and let me also know if there are some standard documents also for the same.
Regards,
Nitin P

Similar Messages

  • How to skip first TWO Lines of   .txt  file    using XSLT Mapping

    Hi Friends  ,
                              I have an .txt file in has the format as
                               <TEST>
                                4564564545
                                56456444566
                                56465
                                    How can i skip the first two Lines when i am writing the XSLT Mapping ?
                              That <TEST> and empty line shouldn't go the rfc  .
                             How can i skip and sent to rfc  using XSLT Mapping ?
    Best Regards .,
    V.Rangarajan

    you can avoid the empty lines in your File Content Conversion by defining offset.
    <i>Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.
    This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines.</i>
    ref: http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    then the generated XML after FCC will not have the empty lines.

  • IDOC Generation Using XSLT Mapping[Query]

    Hi,
    I am working on File to IDOC scenario. I have used XSLT mapping. It is necessary to generate EDI_DC40 segment for IDOC in XSLT?
    -Kavita

    Hi Kavita,
    please take a look at note: 728792
    (Fields of the IDoc control record )
    it describes your scenario
    Regards,
    michal

  • Issue in tranforming Idoc structure using XSLT mapping

    Hi,
    I am working on the XSLT Mapping to transform the IDoc xml to the desired format.
    Source structure single Idoc:
    EDI_DC40 record
    E1EDKxx records
    E1EDPxx records
    E1EDSxx records
    suppose I have 4 E1EDP01 records, of which 2 are Original and next two are corresponding Correction E1EDP01 records.
    I want the target Idoc to be:
    EDI_DC40 record
    E1EDKxx records and for (E1EDK14/ORGID = G2O)
    E1EDPxx records  (1st Original E1EDP01 segment)
    E1EDSxx records
    E1EDKxx records for (E1EDK14/ORGID = G2)
    E1EDPxx records  (1st corresponding correction E1EDP01 segment)
    E1EDSxx records
    E1EDKxx records for (E1EDK14/ORGID = G2O)
    E1EDPxx records  (2nd Original E1EDP01 segment)
    E1EDSxx records
    E1EDKxx records for (E1EDK14/ORGID = G2)
    E1EDPxx records  (2nd Corresponding correction E1EDP01segment)
    E1EDSxx records
    so correction segments follows original segments.
    All the E1EDSxx records are identical. remaining all the other segments are Idential except the above changes.
    correlate original and correction E1EDP01 segments is through POSEX of Original = HIPOS of Correction..
    bold segments represents Original records
    Italic segments represents correction records
    How to achieve the above scenario. I am finding issue in generating and correlating the E1EDP01 segments using <key> element. and changing the vales in E1EDK14
    Also does XSLT supports Dynamic Configuration for File Name ?
    Regards
    Edited by: Varun Reddy on Jul 7, 2011 12:44 PM

    Also does XSLT supports Dynamic Configuration for File Name ?=   Yes.
    refer - http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm

  • How to insert multiple line items in fv60 using bdc.

    Hi all,
          How to insert multiple line items in fv60 using bdcs

    hi
    chk this
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    DATA : IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : V_EBELP(30) , V_MENGE(30) , V_WERKS(30), V_EMATN(30) ,
    V_PEINH(30).
    DATA : FILE TYPE STRING, V_MSG(100) , V_IND(2) TYPE N , FLAG VALUE 'X'.
    PARAMETERS: P_FILE(50) TYPE C DEFAULT 'C:\ME21_TEST'.
    DATA : BEGIN OF ITAB OCCURS 0,
            IND(02),
            LIFNR_001(010),
    data element: BSART
            BSART_002(004),
    data element: BEDAT
    data element: EKORG
            EKORG_004(004),
            EKGRP_006(003),
    data element: LPEIN
            LPEIN_005(001),
    data element: EMATNR
            EMATN_01_007(018),
    data element: EWERK
            WERKS_01_008(004),
    data element: EPEIN
            PEINH_01_009(006),
    data element: EWERK
           MENGE_01_013(017),
    data element: AUFEP
            EBELP_014(005),
    data element: AUFEP
         END OF ITAB.
    START-OF-SELECTION.
    FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FILE
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = ITAB
    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.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    SORT ITAB BY IND.
    START-OF-SELECTION.
    LOOP AT ITAB.
    REFRESH IT_MESSAGES.
    <b>V_IND = V_IND + 1.</b>
    <b>AT NEW IND.</b>
    <b>READ TABLE ITAB INDEX SY-TABIX.</b>
    PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0100'.
    PERFORM BDC_FIELD       USING 'EKKO-LIFNR'
                                  ITAB-LIFNR_001.
    PERFORM BDC_FIELD       USING 'RM06E-BSART'
                                  ITAB-BSART_002.
    *perform bdc_field       using 'RM06E-BEDAT'
                                 ITAB-BEDAT_003.
    PERFORM BDC_FIELD       USING 'EKKO-EKORG'
                                  ITAB-EKORG_004.
    PERFORM BDC_FIELD       USING 'RM06E-LPEIN'
                                  ITAB-LPEIN_005.
    PERFORM BDC_FIELD       USING 'EKKO-EKGRP'
                                  ITAB-EKGRP_006.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    ENDAT.
    <b>PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
    CONCATENATE 'EKPO-EMATN(' V_IND ')' INTO V_EMATN.
    PERFORM BDC_FIELD       USING  V_EMATN
                                   ITAB-EMATN_01_007.
    CONCATENATE 'EKPO-WERKS(' V_IND ')' INTO V_WERKS.
    PERFORM BDC_FIELD       USING  V_WERKS
                                   ITAB-WERKS_01_008.
    CONCATENATE 'EKPO-PEINH(' V_IND ')' INTO V_PEINH.
    PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
    PERFORM BDC_FIELD       USING  V_PEINH
                                   ITAB-PEINH_01_009.
    *CONCATENATE 'EKPO-MENGE(' V_IND ')' INTO V_MENGE.
    *perform bdc_dynpro      using 'SAPMM06E' '0120'.
    *perform bdc_field       using  V_MENGE
                                  ITAB-MENGE_01_013.
    *CONCATENATE 'EKPO-EBELP(' V_IND ')' INTO V_EBELP.
    PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
    PERFORM BDC_FIELD       USING  'RM06E-EBELP'
                                   ITAB-EBELP_014.</b>PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    AT END OF IND.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=BU'.
    ENDAT.
    CALL TRANSACTION 'ME21' USING IT_BDCDATA MODE 'A'
                                             UPDATE 'S'
                                        MESSAGES INTO IT_MESSAGES.
       LOOP AT IT_MESSAGES WHERE MSGTYP = 'E' OR MSGTYP = 'A'.
         IF FLAG = 'X'.
         CALL FUNCTION 'BDC_OPEN_GROUP'
         EXPORTING
            CLIENT                    = SY-MANDT
           DEST                      = FILLER8
            GROUP                     = 'GAMY_FAILURE'
           HOLDDATE                  = FILLER8
            KEEP                      = 'X'
            USER                      = SY-UNAME
           RECORD                    = FILLER1
           PROG                      = SY-CPROG
         IMPORTING
           QID                       =
          EXCEPTIONS
            CLIENT_INVALID            = 1
            DESTINATION_INVALID       = 2
            GROUP_INVALID             = 3
            GROUP_IS_LOCKED           = 4
            HOLDDATE_INVALID          = 5
            INTERNAL_ERROR            = 6
            QUEUE_ERROR               = 7
            RUNNING                   = 8
            SYSTEM_LOCK_ERROR         = 9
            USER_INVALID              = 10
            OTHERS                    = 11
         IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         CLEAR FLAG.
         ENDIF.
         CALL FUNCTION 'BDC_INSERT'
          EXPORTING
            TCODE                  = 'ME21'
           POST_LOCAL             = NOVBLOCAL
           PRINTING               = NOPRINT
           SIMUBATCH              = ' '
           CTUPARAMS              = ' '
           TABLES
             DYNPROTAB              = IT_BDCDATA
          EXCEPTIONS
            INTERNAL_ERROR         = 1
            NOT_OPEN               = 2
            QUEUE_ERROR            = 3
            TCODE_INVALID          = 4
            PRINTING_INVALID       = 5
            POSTING_INVALID        = 6
            OTHERS                 = 7
         IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
        ENDIF.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        ID              = IT_MESSAGES-MSGID
        LANG            = 'EN'
        NO              = IT_MESSAGES-MSGNR
        V1              = IT_MESSAGES-MSGV1
        V2              = IT_MESSAGES-MSGV2
        V3              = IT_MESSAGES-MSGV3
        V4              = IT_MESSAGES-MSGV4
      IMPORTING
        MSG             = V_MSG
      EXCEPTIONS
        NOT_FOUND       = 1
        OTHERS          = 2
       WRITE : / V_MSG.
    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.
       ENDLOOP.
    IF FLAG NE 'X'.
      CALL FUNCTION 'BDC_CLOSE_GROUP'
       EXCEPTIONS
         NOT_OPEN          = 1
         QUEUE_ERROR       = 2
         OTHERS            = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ENDIF.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM  = PROGRAM.
      IT_BDCDATA-DYNPRO   = DYNPRO.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND IT_BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
        CLEAR IT_BDCDATA.
        IT_BDCDATA-FNAM = FNAM.
        IT_BDCDATA-FVAL = FVAL.
        APPEND IT_BDCDATA.

  • How do i remove this feature? where using google maps the input box has this in it( Enter your address line 2 here)/In hotmailmail new email it reads (Enter your email here) e

    how do i remove this feature? where using google maps the input box has this in it( Enter your address line 2 here)/In hotmail new email on the enter page it reads (Enter your email here) .
    You have the remove these statements before entering an address , and before sending an email or with the email it will stay on the email , google maps will not work.

    Try this -
    <img src="assets/jpgs/Prodigy Logo Large 2014.jpg" width="180" height="180" alt="" style="display:block;">
    What you are seeing as whitespace is the space reserved for glyph descenders on any element that is rendered within a text box (i.e., an inline element). By making the image "display:block" you eliminate that space because a block element doesn't have descenders. If that works to your satisfaction then you can give the logo an id, and create a CSS selector containing that block style.

  • How to put schedule lines for one year  in a schedule line agreement

    dear all
    thanks for the support till now from the forum
    now i need some seetings by which the scheduling agreement will autoumatically take the schedule line for one year automatically
    in my client we are getting open PO so
    we have to make one agreement acording to that PO and thats for one year
    and this one yr will have same quantity to be produced everyday
    means 12nos of material every day for 12 month and this will be for every day
    and as per that it should generate a sales order.i need to put schedule line automatically not mannually one by one for each date.so wat is the settingand how to reffer this scheduling agreement we can produce sales order.
    please help
    subrat
    Message was edited by:
            subrat panda

    Dear Subrat,
    you cannot create a yearly schedule line in the scheduling agreement. It is not possible due to format restrictions of the date field. But what you can do is the follows (it is the modification, but it should work with the help of user-exits):
    1. You can split the year schedule line to the monthly schedule lines. There are two ways to do it. If you apply the DELINS IDOC, then you can do it already during transfer of the data to the application (itr is the best way). Here you can use, for example, user-exit USEREXIT_ZUORDNEN_IDOCS (include LVED4FZZ) or customer function EXIT_SAPLVED4_002, called from the subroutine USEREXIT_DYNPRO (Include LVED4F0U). Alternatively, you can use the user-exit USEREXIT_MOVE_FIELD_TO_VBEP (Include MV45AFZZ) within the call transaction, then it will work also in the dialog case.
    2. After getting the monthly schedule lines, you can create a planning delivery schedule, where you can split mothly schedule lines automatically to daily schedule lines according to the customer factory calender.The settings for generation of planning delivery schedules can be found under:
    Customizing SPRO: Sales and Distribution => Sales => Sales Documents => Scheduling Agreements with Delivery schedules => Maintain Planning Delivery Sched. Instruct./Splitting Rules
    It is the only ways, how you can reach your aim. I hope, this information will help you further.
    Kind Regards,
    Akmal Vakhidov
    Development Support SD, SAP, Walldorf/Germany

  • How to upload  schedule line from flat files to sap file

    dear all,
    i want to upload the schedule lines from flat files to sap schedulle lines
    but the flat files have 15 schedule lines and the data is as per date
    so how to upload that and the fields available in flat files are more than the sap screen
    we are having more than 6 items
    and 15scedule lines its abt 90data to be upload
    for one customer in every 15 day
    so how to do this
    is there any direct use in functional side
    with out the help of any abap
    but my user will do it
    so he need a permanent solution
    with regards
    subrat

    Hi Subrat ,
    u can upload the data either ( Master /Transaction) data with the help of lsmw. for that all u need to do is go through the lsmw and do it. in that u can go Batch input recording/ BAPI/ IDOC any of that. here i am sending the LSMW Notes go through it and do the work.
    once u create the LSMW project then u can ask the data from user or u can explain the user about the program and can run the flat file to upload the data.
    if u require LSMW material Just send me blank mail from u. my mail id is [email protected]
    Reward if Helpful.
    Regards,
    Praveen Kumar.D

  • How to insert new schedule line in Sales order using BAPI

    Hi All,
    I am using the below code to add a new line in the schedules line of a existing sales order.But i am not getting the extra line after running the report.
    Kindly guide me in how to achieve this.
    thanks and regards
    shilpa
    REPORT  Z_VA32_EDI1.
    data: v_vbeln type BAPIVBELN-VBELN,
          wa_order_header type BAPISDH1X,
          i_sch_line type standard table of BAPISCHDL with header line,
          i_sch  type standard table of BAPISCHDLX with header line,
          i_return type standard table of BAPIRET2 with header line.
    v_vbeln = '0030001227'.
    wa_order_header-UPDATEFLAG = 'U'.
    i_sch-ITM_NUMBER = '000010'.
    i_sch-UPDATEFLAG  = 'I'.
    i_sch-REQ_DATE  = 'X'.
    i_sch-REL_TYPE = 'X'.
    i_sch-PLAN_SCHED_TYPE = 'X'.
    i_sch-REQ_QTY     = 'X'.
    append i_Sch.
    i_sch_line-ITM_NUMBER = '000010'.
    i_sch_line-REQ_DATE  = '20080127'.
    i_sch_line-REL_TYPE = '2'.
    i_sch_line-PLAN_SCHED_TYPE = '2'.
    i_sch_line-REQ_QTY     = '65'.
    append i_Sch_line.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument               = v_vbeln
      ORDER_HEADER_IN             =
        order_header_inx            = wa_order_header
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
      NO_STATUS_BUF_INIT          = ' '
      tables
        return                      = i_Return
      ORDER_ITEM_IN               =
      ORDER_ITEM_INX              =
      PARTNERS                    =
      PARTNERCHANGES              =
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
       SCHEDULE_LINES              = i_sch_line[]
       SCHEDULE_LINESX             = i_sch[]
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
      NFMETALLITMS                =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    write: 'Done'.

    hi,
    pass the values 'x' to the bellow structure for all the fields that u want use and provide the item no ,schedule line no.
    SCHEDULE_LINESX

  • How to deactivate schedule line in sales order

    hi friends,
    how can i deactivate the schedule line in sales order so that we can deliver the sales order after the schedule date. i can uderstand that system is not allowing before schedule date. but what if i want to deliver after that.
    Thanks in advance.
    Regards,
    Solomon

    hi,
    this is to inform you that,
    here you need to switch off:
    schedule lines allowed
    in schedule lines control data - remove or un check - availability/TOR
    In SPRO - Availability Check settings.
    but i have a question here:
    what is the business logic.
    do you want to do the same with all the sales orders or not.
    please update the forum
    then answer will be different
    balajia

  • How to Change Schedule line Quantity in BADI 'ORDER_SAVE'

    Hi,
    I need to change the Schedule line quantity While Order saving. I am writing the code in ORDER_SAVE BADI. Using the Header guid i am reading the details and changing the quantity in Schedule line structure. How can i pass those values in to Memory so that order quantity will change. I try to Use CRM_ORDER_MAINTAIN but not able to change the quantity. Can an

    Hi,
    You need the One Order Function Module - CRM_ORDER_MAINTAIN to update the Schedule line value. So, you need to have a look at all the fields that are necessary to fill using the Tables and Structures. If you have the header guid, then you can probably pass the guid to CRM_ORDER_READ to read the values and then fill in the entries necessary to make the changes.
    You can also debug the order code to get a feel of the necessary changes.
    Hope this helps.
    Thanks,
    Samantak.

  • How to check schedule line PO text before PO saving.

    How can i check the schedule line PO text before po saving. My idea is add a trigger in user exits. but i don't know how to check this data. I can't check the table stxh or stxl because those data are stored after PO saved. I think before that the data is stored in memory or somewhere. Could you give me some advise? thanks

    Hi
    Search for a correct user exit or BADI and you can check the text of the PO schedule line
    Use the READ_TEXT fun module to fetch the text by passing the parameters OBJECT,OBJECTNAME,ID and LANGUAGE and fetch it and check it
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to delete schedule line item

    Hi All,
    I want to delete schedule line entry for an item in R/3.
    How can i do this?
    Thanks,
    Nabha

    Hi,
    For some of the business documents schedule line item deletion would be partially which means mark for deletion-specially when the case of POs and so on
    other in general you need to goto the change document t-code and select the line item and you find the delete row mark in the same screen and select..
    Hope this helps..
    assign points if useful.
    cheers
    Pattan.

  • How to count Command-Line Arguments ?

    How do you count Command-Line Arguments ?
    For example,
    java program argument1 arguement2
    I would like to be able to count how many arguements the user inputed
    It should result as 2 for the bold line above
    Thank you for your help

    public static void main(String[] args) {
        int numArgs = args.length; // args holds argument1 and argument2
    }

  • How to pass Schedule lines of an item Line to 'BAPI_QUOTATION_CREATEFROMDAT

    Hi Friends,
    I am trying to create Sales Quotation using the  'BAPI_QUOTATION_CREATEFROMDATA2'  from Webdynpro Application.
    I am able to create the quotation with Line items, but I am not able to pass the multiple schedul line for an Item line.
    it takes,but it checks the item availabilty and propses the delivery propsal dates.
    but my requirement is It should take only the schedule line items which I am passing to BAPI,because I do the availability check in my application and pass those schdule line items to BAPI.
    If I pass only one schedule line item then should create only with one schdule line item,If I pass Muliple then it should create schedul lines for item line.
    Please help me in solving the issue.
    Regards,
    Xavier.P

    Hi max,
    loop at lt_nd_quote_items into ls_nd_quote_items.
        lv_item = lv_item + 10.
    *Check weather Availablity check is done or not.
        read table lt_nd_schedule_lines into ls_nd_schedule_lines
                           with key matnr = ls_nd_quote_items-matnr.
        if sy-subrc = 0.
          loop at lt_nd_schedule_lines into ls_nd_schedule_lines
                            where matnr = ls_nd_quote_items-matnr
                            and   kwmeng = ls_nd_quote_items-kwmeng.
            lv_sch_line = lv_sch_line + '0001'.
            wa_order_schedule-itm_number         = lv_item.
            wa_order_schedule_inx-itm_number     = lv_item.
            wa_order_schedule-sched_line         = lv_sch_line.
            wa_order_schedule_inx-sched_line     = lv_sch_line.
            wa_order_schedule-req_date           = ls_nd_schedule_lines-delv_date.
            wa_order_schedule_inx-req_date       = c_abap_true.
            wa_order_schedule-req_qty            = ls_nd_schedule_lines-kwmeng.
            wa_order_schedule_inx-req_qty        = c_abap_true.
            wa_order_schedule-SCHED_TYPE         = 'BP'.
            wa_order_schedule_inx-SCHED_TYPE     = 'X'.
            wa_order_schedule-MS_DATE = ls_nd_schedule_lines-delv_date.
            wa_order_schedule_inx-MS_DATE = 'X'.
            wa_order_schedule_inx-updateflag     = 'I'.
            append:wa_order_schedule to  it_order_schedule,
                   wa_order_schedule_inx to it_order_schedule_inx.
            clear:ls_nd_schedule_lines.
          endloop.
        else.
    *If no Availablity check is done,pass the item details to schedule lines.
          lv_sch_line = lv_sch_line + sy-tabix.
          wa_order_schedule-itm_number         = lv_item.
          wa_order_schedule_inx-itm_number     = lv_item.
          wa_order_schedule-sched_line         = lv_sch_line.
          wa_order_schedule_inx-sched_line     = lv_sch_line.
          wa_order_schedule-req_date           = ls_nd_quote_items-delivery_on.
          wa_order_schedule_inx-req_date       = c_abap_true.
          wa_order_schedule-req_qty            = ls_nd_quote_items-kwmeng.
          wa_order_schedule_inx-req_qty        = c_abap_true.
          wa_order_schedule_inx-updateflag     = 'I'.
          append:wa_order_schedule to  it_order_schedule,
                 wa_order_schedule_inx to it_order_schedule_inx.
        endif.
        clear:ls_nd_quote_items,lv_sch_line.
      endloop.
    Max,  the internal table lt_nd_schedule_lines  is containg my schedule lines,if there are no lines in that table i am just passing the default line item details so that the BAPI take care of schdule line for that Line item.
    Could you please help me in figuring the issue?
    Regards,
    Xavier.P

Maybe you are looking for